mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2024-11-16 11:27:33 -08:00
Verify script command table sizes
This commit is contained in:
parent
dbabd8b4a9
commit
d132a20b7a
@ -1365,6 +1365,7 @@ ParseMusicCommand:
|
|||||||
|
|
||||||
MusicCommands:
|
MusicCommands:
|
||||||
; entries correspond to audio constants (see macros/scripts/audio.asm)
|
; entries correspond to audio constants (see macros/scripts/audio.asm)
|
||||||
|
table_width 2, MusicCommands
|
||||||
dw Music_Octave8
|
dw Music_Octave8
|
||||||
dw Music_Octave7
|
dw Music_Octave7
|
||||||
dw Music_Octave6
|
dw Music_Octave6
|
||||||
@ -1413,6 +1414,7 @@ MusicCommands:
|
|||||||
dw Music_Loop
|
dw Music_Loop
|
||||||
dw Music_Call
|
dw Music_Call
|
||||||
dw Music_Ret
|
dw Music_Ret
|
||||||
|
assert_table_length $100 - FIRST_MUSIC_CMD
|
||||||
|
|
||||||
MusicF1:
|
MusicF1:
|
||||||
MusicF2:
|
MusicF2:
|
||||||
|
@ -329,6 +329,7 @@ RunBattleAnimCommand:
|
|||||||
|
|
||||||
BattleAnimCommands::
|
BattleAnimCommands::
|
||||||
; entries correspond to anim_* constants (see macros/scripts/battle_anims.asm)
|
; entries correspond to anim_* constants (see macros/scripts/battle_anims.asm)
|
||||||
|
table_width 2, BattleAnimCommands
|
||||||
dw BattleAnimCmd_Obj
|
dw BattleAnimCmd_Obj
|
||||||
dw BattleAnimCmd_1GFX
|
dw BattleAnimCmd_1GFX
|
||||||
dw BattleAnimCmd_2GFX
|
dw BattleAnimCmd_2GFX
|
||||||
@ -377,6 +378,7 @@ BattleAnimCommands::
|
|||||||
dw BattleAnimCmd_Loop
|
dw BattleAnimCmd_Loop
|
||||||
dw BattleAnimCmd_Call
|
dw BattleAnimCmd_Call
|
||||||
dw BattleAnimCmd_Ret
|
dw BattleAnimCmd_Ret
|
||||||
|
assert_table_length $100 - FIRST_BATTLE_ANIM_CMD
|
||||||
|
|
||||||
BattleAnimCmd_EA:
|
BattleAnimCmd_EA:
|
||||||
BattleAnimCmd_EB:
|
BattleAnimCmd_EB:
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
MovementPointers:
|
MovementPointers:
|
||||||
; entries correspond to movement_* constants (see macros/scripts/movement.asm)
|
; entries correspond to movement_* constants (see macros/scripts/movement.asm)
|
||||||
|
table_width 2, MovementPointers
|
||||||
dw Movement_turn_head_down ; 00
|
dw Movement_turn_head_down ; 00
|
||||||
dw Movement_turn_head_up ; 01
|
dw Movement_turn_head_up ; 01
|
||||||
dw Movement_turn_head_left ; 02
|
dw Movement_turn_head_left ; 02
|
||||||
@ -90,6 +91,7 @@ MovementPointers:
|
|||||||
dw Movement_rock_smash ; 57
|
dw Movement_rock_smash ; 57
|
||||||
dw Movement_return_dig ; 58
|
dw Movement_return_dig ; 58
|
||||||
dw Movement_skyfall_top ; 59
|
dw Movement_skyfall_top ; 59
|
||||||
|
assert_table_length NUM_MOVEMENT_CMDS
|
||||||
|
|
||||||
Movement_teleport_from:
|
Movement_teleport_from:
|
||||||
ld hl, OBJECT_STEP_TYPE
|
ld hl, OBJECT_STEP_TYPE
|
||||||
|
@ -63,6 +63,7 @@ RunScriptCommand:
|
|||||||
|
|
||||||
ScriptCommandTable:
|
ScriptCommandTable:
|
||||||
; entries correspond to *_command constants (see macros/scripts/events.asm)
|
; entries correspond to *_command constants (see macros/scripts/events.asm)
|
||||||
|
table_width 2, ScriptCommandTable
|
||||||
dw Script_scall ; 00
|
dw Script_scall ; 00
|
||||||
dw Script_farscall ; 01
|
dw Script_farscall ; 01
|
||||||
dw Script_memcall ; 02
|
dw Script_memcall ; 02
|
||||||
@ -233,6 +234,7 @@ ScriptCommandTable:
|
|||||||
dw Script_getname ; a7
|
dw Script_getname ; a7
|
||||||
dw Script_wait ; a8
|
dw Script_wait ; a8
|
||||||
dw Script_checksave ; a9
|
dw Script_checksave ; a9
|
||||||
|
assert_table_length NUM_EVENT_COMMANDS
|
||||||
|
|
||||||
StartScript:
|
StartScript:
|
||||||
ld hl, wScriptFlags
|
ld hl, wScriptFlags
|
||||||
|
@ -699,6 +699,7 @@ DoTextUntilTerminator::
|
|||||||
|
|
||||||
TextCommands::
|
TextCommands::
|
||||||
; entries correspond to TX_* constants (see macros/scripts/text.asm)
|
; entries correspond to TX_* constants (see macros/scripts/text.asm)
|
||||||
|
table_width 2, TextCommands
|
||||||
dw TextCommand_START ; TX_START
|
dw TextCommand_START ; TX_START
|
||||||
dw TextCommand_RAM ; TX_RAM
|
dw TextCommand_RAM ; TX_RAM
|
||||||
dw TextCommand_BCD ; TX_BCD
|
dw TextCommand_BCD ; TX_BCD
|
||||||
@ -722,6 +723,7 @@ TextCommands::
|
|||||||
dw TextCommand_STRINGBUFFER ; TX_STRINGBUFFER
|
dw TextCommand_STRINGBUFFER ; TX_STRINGBUFFER
|
||||||
dw TextCommand_DAY ; TX_DAY
|
dw TextCommand_DAY ; TX_DAY
|
||||||
dw TextCommand_FAR ; TX_FAR
|
dw TextCommand_FAR ; TX_FAR
|
||||||
|
assert_table_length NUM_TEXT_CMDS
|
||||||
|
|
||||||
TextCommand_START::
|
TextCommand_START::
|
||||||
; write text until "@"
|
; write text until "@"
|
||||||
|
@ -5,6 +5,7 @@ ENDM
|
|||||||
|
|
||||||
; BattleAnimCommands indexes (see engine/battle_anims/anim_commands.asm)
|
; BattleAnimCommands indexes (see engine/battle_anims/anim_commands.asm)
|
||||||
const_def $d0
|
const_def $d0
|
||||||
|
FIRST_BATTLE_ANIM_CMD EQU const_value
|
||||||
|
|
||||||
const anim_obj_command ; $d0
|
const anim_obj_command ; $d0
|
||||||
anim_obj: MACRO
|
anim_obj: MACRO
|
||||||
|
@ -1062,3 +1062,5 @@ ENDM
|
|||||||
checksave: MACRO
|
checksave: MACRO
|
||||||
db checksave_command
|
db checksave_command
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
NUM_EVENT_COMMANDS EQU const_value
|
||||||
|
@ -218,3 +218,5 @@ ENDM
|
|||||||
skyfall_top: MACRO
|
skyfall_top: MACRO
|
||||||
db movement_skyfall_top
|
db movement_skyfall_top
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
NUM_MOVEMENT_CMDS EQU const_value
|
||||||
|
@ -137,6 +137,8 @@ text_far: MACRO
|
|||||||
db BANK(\1)
|
db BANK(\1)
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
NUM_TEXT_CMDS EQU const_value
|
||||||
|
|
||||||
const_next $50
|
const_next $50
|
||||||
|
|
||||||
const TX_END ; $50
|
const TX_END ; $50
|
||||||
|
Loading…
Reference in New Issue
Block a user