summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--audio/engine.asm2
-rw-r--r--engine/battle_anims/anim_commands.asm2
-rw-r--r--engine/overworld/movement.asm2
-rw-r--r--engine/overworld/scripting.asm2
-rw-r--r--home/text.asm2
-rw-r--r--macros/scripts/battle_anims.asm1
-rw-r--r--macros/scripts/events.asm2
-rw-r--r--macros/scripts/movement.asm2
-rw-r--r--macros/scripts/text.asm2
9 files changed, 17 insertions, 0 deletions
diff --git a/audio/engine.asm b/audio/engine.asm
index 7a7d2f9aa..9149223eb 100644
--- a/audio/engine.asm
+++ b/audio/engine.asm
@@ -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:
diff --git a/engine/battle_anims/anim_commands.asm b/engine/battle_anims/anim_commands.asm
index 5f41d2314..a5ecdb393 100644
--- a/engine/battle_anims/anim_commands.asm
+++ b/engine/battle_anims/anim_commands.asm
@@ -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:
diff --git a/engine/overworld/movement.asm b/engine/overworld/movement.asm
index ec9d56288..6a8e242b0 100644
--- a/engine/overworld/movement.asm
+++ b/engine/overworld/movement.asm
@@ -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
diff --git a/engine/overworld/scripting.asm b/engine/overworld/scripting.asm
index 0470247d4..230ce4e53 100644
--- a/engine/overworld/scripting.asm
+++ b/engine/overworld/scripting.asm
@@ -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
diff --git a/home/text.asm b/home/text.asm
index 6b9960df5..a1b1f6dd0 100644
--- a/home/text.asm
+++ b/home/text.asm
@@ -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 "@"
diff --git a/macros/scripts/battle_anims.asm b/macros/scripts/battle_anims.asm
index a6ebe4310..6dc21e5fc 100644
--- a/macros/scripts/battle_anims.asm
+++ b/macros/scripts/battle_anims.asm
@@ -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
diff --git a/macros/scripts/events.asm b/macros/scripts/events.asm
index 4e71035b3..74de5419a 100644
--- a/macros/scripts/events.asm
+++ b/macros/scripts/events.asm
@@ -1062,3 +1062,5 @@ ENDM
checksave: MACRO
db checksave_command
ENDM
+
+NUM_EVENT_COMMANDS EQU const_value
diff --git a/macros/scripts/movement.asm b/macros/scripts/movement.asm
index 76e06b8e4..6501454c5 100644
--- a/macros/scripts/movement.asm
+++ b/macros/scripts/movement.asm
@@ -218,3 +218,5 @@ ENDM
skyfall_top: MACRO
db movement_skyfall_top
ENDM
+
+NUM_MOVEMENT_CMDS EQU const_value
diff --git a/macros/scripts/text.asm b/macros/scripts/text.asm
index f45b7fd14..252481ff4 100644
--- a/macros/scripts/text.asm
+++ b/macros/scripts/text.asm
@@ -137,6 +137,8 @@ text_far: MACRO
db BANK(\1)
ENDM
+NUM_TEXT_CMDS EQU const_value
+
const_next $50
const TX_END ; $50