Verify script command table sizes

This commit is contained in:
Rangi 2021-03-11 16:28:52 -05:00
parent dbabd8b4a9
commit d132a20b7a
9 changed files with 17 additions and 0 deletions

View File

@ -1365,6 +1365,7 @@ ParseMusicCommand:
MusicCommands:
; entries correspond to audio constants (see macros/scripts/audio.asm)
table_width 2, MusicCommands
dw Music_Octave8
dw Music_Octave7
dw Music_Octave6
@ -1413,6 +1414,7 @@ MusicCommands:
dw Music_Loop
dw Music_Call
dw Music_Ret
assert_table_length $100 - FIRST_MUSIC_CMD
MusicF1:
MusicF2:

View File

@ -329,6 +329,7 @@ RunBattleAnimCommand:
BattleAnimCommands::
; entries correspond to anim_* constants (see macros/scripts/battle_anims.asm)
table_width 2, BattleAnimCommands
dw BattleAnimCmd_Obj
dw BattleAnimCmd_1GFX
dw BattleAnimCmd_2GFX
@ -377,6 +378,7 @@ BattleAnimCommands::
dw BattleAnimCmd_Loop
dw BattleAnimCmd_Call
dw BattleAnimCmd_Ret
assert_table_length $100 - FIRST_BATTLE_ANIM_CMD
BattleAnimCmd_EA:
BattleAnimCmd_EB:

View File

@ -1,5 +1,6 @@
MovementPointers:
; entries correspond to movement_* constants (see macros/scripts/movement.asm)
table_width 2, MovementPointers
dw Movement_turn_head_down ; 00
dw Movement_turn_head_up ; 01
dw Movement_turn_head_left ; 02
@ -90,6 +91,7 @@ MovementPointers:
dw Movement_rock_smash ; 57
dw Movement_return_dig ; 58
dw Movement_skyfall_top ; 59
assert_table_length NUM_MOVEMENT_CMDS
Movement_teleport_from:
ld hl, OBJECT_STEP_TYPE

View File

@ -63,6 +63,7 @@ RunScriptCommand:
ScriptCommandTable:
; entries correspond to *_command constants (see macros/scripts/events.asm)
table_width 2, ScriptCommandTable
dw Script_scall ; 00
dw Script_farscall ; 01
dw Script_memcall ; 02
@ -233,6 +234,7 @@ ScriptCommandTable:
dw Script_getname ; a7
dw Script_wait ; a8
dw Script_checksave ; a9
assert_table_length NUM_EVENT_COMMANDS
StartScript:
ld hl, wScriptFlags

View File

@ -699,6 +699,7 @@ DoTextUntilTerminator::
TextCommands::
; entries correspond to TX_* constants (see macros/scripts/text.asm)
table_width 2, TextCommands
dw TextCommand_START ; TX_START
dw TextCommand_RAM ; TX_RAM
dw TextCommand_BCD ; TX_BCD
@ -722,6 +723,7 @@ TextCommands::
dw TextCommand_STRINGBUFFER ; TX_STRINGBUFFER
dw TextCommand_DAY ; TX_DAY
dw TextCommand_FAR ; TX_FAR
assert_table_length NUM_TEXT_CMDS
TextCommand_START::
; write text until "@"

View File

@ -5,6 +5,7 @@ ENDM
; BattleAnimCommands indexes (see engine/battle_anims/anim_commands.asm)
const_def $d0
FIRST_BATTLE_ANIM_CMD EQU const_value
const anim_obj_command ; $d0
anim_obj: MACRO

View File

@ -1062,3 +1062,5 @@ ENDM
checksave: MACRO
db checksave_command
ENDM
NUM_EVENT_COMMANDS EQU const_value

View File

@ -218,3 +218,5 @@ ENDM
skyfall_top: MACRO
db movement_skyfall_top
ENDM
NUM_MOVEMENT_CMDS EQU const_value

View File

@ -137,6 +137,8 @@ text_far: MACRO
db BANK(\1)
ENDM
NUM_TEXT_CMDS EQU const_value
const_next $50
const TX_END ; $50