summaryrefslogtreecommitdiff
path: root/audio
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2021-03-03 22:22:41 -0500
committerRangi <remy.oukaour+rangi42@gmail.com>2021-03-05 16:10:25 -0500
commit5454e1e0deefc6b4fc8c4de0e63314052fceebc0 (patch)
tree565805b252fa596aab3f80b3128ebc91b1fae540 /audio
parentb423e94be700cc6434465cf1dcccf0b677489192 (diff)
Verify data table sizes with table_width and assert_table_length macros
It also uncovered some off-by-one issues with defining some constants. A few structs now use rsreset/_RS to define their offset constants.
Diffstat (limited to 'audio')
-rw-r--r--audio/cry_pointers.asm3
-rw-r--r--audio/music_pointers.asm2
-rw-r--r--audio/sfx_pointers.asm2
3 files changed, 7 insertions, 0 deletions
diff --git a/audio/cry_pointers.asm b/audio/cry_pointers.asm
index ec6b17e0..58b948a0 100644
--- a/audio/cry_pointers.asm
+++ b/audio/cry_pointers.asm
@@ -1,4 +1,6 @@
Cries:
+; entries correspond to CRY_* constants (see constants/cry_constants.asm)
+ table_width 3, Cries
dba Cry_Nidoran_M
dba Cry_Nidoran_F
dba Cry_Slowpoke
@@ -67,3 +69,4 @@ Cries:
dba Cry_Aipom
dba Cry_Dunsparce
dba Cry_Donphan
+ assert_table_length NUM_CRIES
diff --git a/audio/music_pointers.asm b/audio/music_pointers.asm
index 2e467c0d..12dda56b 100644
--- a/audio/music_pointers.asm
+++ b/audio/music_pointers.asm
@@ -2,6 +2,7 @@
Music:
; entries correspond to MUSIC_* constants
+ table_width 3, Music
dba Music_Nothing
dba Music_TitleScreen
dba Music_Route1
@@ -95,3 +96,4 @@ Music:
dba Music_LakeOfRageRocketRadio
dba Music_Printer
dba Music_PostCredits
+ assert_table_length NUM_MUSIC_SONGS
diff --git a/audio/sfx_pointers.asm b/audio/sfx_pointers.asm
index 8c3420e5..9049b89e 100644
--- a/audio/sfx_pointers.asm
+++ b/audio/sfx_pointers.asm
@@ -1,5 +1,6 @@
SFX:
; entries correspond to SFX_* constants
+ table_width 3, SFX
dba Sfx_DexFanfare5079
dba Sfx_Item
dba Sfx_CaughtMon
@@ -188,3 +189,4 @@ SFX:
dba Sfx_TrainArrived
dba Sfx_StopSlot
dba Sfx_2Boops
+ assert_table_length NUM_SFX