Verify data table sizes with table_width and assert_table_length macros

This was discussed in #706

It also uncovered some off-by-one issues with defining some constants.

A few structs now use rsreset/_RS to define their offset constants, as discussed in #739
This commit is contained in:
Rangi
2021-03-03 22:22:41 -05:00
parent 9c17fb14c8
commit 40902ffe24
148 changed files with 608 additions and 237 deletions

View File

@@ -1,5 +1,6 @@
BattleAnimations::
; entries correspond to constants/move_constants.asm
table_width 2, BattleAnimations
dw BattleAnim_0
dw BattleAnim_Pound
dw BattleAnim_KarateChop
@@ -252,10 +253,12 @@ BattleAnimations::
dw BattleAnim_RockSmash
dw BattleAnim_Whirlpool
dw BattleAnim_BeatUp
assert_table_length NUM_ATTACKS + 1
dw BattleAnim_252
dw BattleAnim_253
dw BattleAnim_254
dw BattleAnim_SweetScent2
assert_table_length $100
; $100
dw BattleAnim_ThrowPokeBall
dw BattleAnim_SendOutMon
@@ -279,6 +282,7 @@ BattleAnimations::
dw BattleAnim_Wobble
dw BattleAnim_Shake
dw BattleAnim_HitConfusion
assert_table_length NUM_BATTLE_ANIMS + 1
BattleAnim_0:
BattleAnim_252: