summaryrefslogtreecommitdiff
path: root/data/pokemon
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2021-03-25 16:33:05 -0400
committerRangi <remy.oukaour+rangi42@gmail.com>2021-03-25 16:44:41 -0400
commit95ec2cf039f0efdc6dadfb6fe766ace231a1b6b1 (patch)
tree5a7b79846bd7f07e40310da46b21873774a08ef7 /data/pokemon
parente1f6bb53939be34f55e05cbbd19cd758936b3422 (diff)
Verify data table and name list sizes with assertion macros
Fixes #312
Diffstat (limited to 'data/pokemon')
-rw-r--r--data/pokemon/base_stats.asm6
-rw-r--r--data/pokemon/cries.asm2
-rw-r--r--data/pokemon/dex_entries.asm2
-rw-r--r--data/pokemon/dex_order.asm2
-rw-r--r--data/pokemon/evos_moves.asm2
-rw-r--r--data/pokemon/menu_icons.asm2
-rw-r--r--data/pokemon/names.asm2
-rw-r--r--data/pokemon/palettes.asm2
8 files changed, 16 insertions, 4 deletions
diff --git a/data/pokemon/base_stats.asm b/data/pokemon/base_stats.asm
index 91ccbe08..691e75b0 100644
--- a/data/pokemon/base_stats.asm
+++ b/data/pokemon/base_stats.asm
@@ -1,7 +1,6 @@
BaseStats::
-MonBaseStats::
+ table_width BASE_DATA_SIZE, BaseStats
INCLUDE "data/pokemon/base_stats/bulbasaur.asm"
-MonBaseStatsEnd::
INCLUDE "data/pokemon/base_stats/ivysaur.asm"
INCLUDE "data/pokemon/base_stats/venusaur.asm"
INCLUDE "data/pokemon/base_stats/charmander.asm"
@@ -151,5 +150,4 @@ INCLUDE "data/pokemon/base_stats/dratini.asm"
INCLUDE "data/pokemon/base_stats/dragonair.asm"
INCLUDE "data/pokemon/base_stats/dragonite.asm"
INCLUDE "data/pokemon/base_stats/mewtwo.asm"
-BaseStatsEnd::
- assert BaseStatsEnd - BaseStats == (wMonHeaderEnd - wMonHeader) * (NUM_POKEMON - 1) ; discount Mew
+ assert_table_length NUM_POKEMON - 1 ; discount Mew
diff --git a/data/pokemon/cries.asm b/data/pokemon/cries.asm
index e4bf07d9..f823cdef 100644
--- a/data/pokemon/cries.asm
+++ b/data/pokemon/cries.asm
@@ -4,6 +4,7 @@ mon_cry: MACRO
ENDM
CryData::
+ table_width 3, CryData
; base cry, pitch, length
mon_cry SFX_CRY_11, $00, $80 ; Rhydon
mon_cry SFX_CRY_03, $00, $80 ; Kangaskhan
@@ -195,3 +196,4 @@ CryData::
mon_cry SFX_CRY_21, $55, $01 ; Bellsprout
mon_cry SFX_CRY_25, $44, $20 ; Weepinbell
mon_cry SFX_CRY_25, $66, $CC ; Victreebel
+ assert_table_length NUM_POKEMON_INDEXES
diff --git a/data/pokemon/dex_entries.asm b/data/pokemon/dex_entries.asm
index 931793df..c99087e2 100644
--- a/data/pokemon/dex_entries.asm
+++ b/data/pokemon/dex_entries.asm
@@ -1,4 +1,5 @@
PokedexEntryPointers:
+ table_width 2, PokedexEntryPointers
dw RhydonDexEntry
dw KangaskhanDexEntry
dw NidoranMDexEntry
@@ -189,6 +190,7 @@ PokedexEntryPointers:
dw BellsproutDexEntry
dw WeepinbellDexEntry
dw VictreebelDexEntry
+ assert_table_length NUM_POKEMON_INDEXES
; string: species name
; height in feet, inches
diff --git a/data/pokemon/dex_order.asm b/data/pokemon/dex_order.asm
index 0e293946..32e7a79b 100644
--- a/data/pokemon/dex_order.asm
+++ b/data/pokemon/dex_order.asm
@@ -1,4 +1,5 @@
PokedexOrder:
+ table_width 1, PokedexOrder
db DEX_RHYDON
db DEX_KANGASKHAN
db DEX_NIDORAN_M
@@ -189,3 +190,4 @@ PokedexOrder:
db DEX_BELLSPROUT
db DEX_WEEPINBELL
db DEX_VICTREEBEL
+ assert_table_length NUM_POKEMON_INDEXES
diff --git a/data/pokemon/evos_moves.asm b/data/pokemon/evos_moves.asm
index 51f6b244..c5fcc292 100644
--- a/data/pokemon/evos_moves.asm
+++ b/data/pokemon/evos_moves.asm
@@ -2,6 +2,7 @@
; The max number of evolutions per monster is MAX_EVOLUTIONS
EvosMovesPointerTable:
+ table_width 2, EvosMovesPointerTable
dw RhydonEvosMoves
dw KangaskhanEvosMoves
dw NidoranMEvosMoves
@@ -192,6 +193,7 @@ EvosMovesPointerTable:
dw BellsproutEvosMoves
dw WeepinbellEvosMoves
dw VictreebelEvosMoves
+ assert_table_length NUM_POKEMON_INDEXES
RhydonEvosMoves:
; Evolutions
diff --git a/data/pokemon/menu_icons.asm b/data/pokemon/menu_icons.asm
index 471ee846..80a45e49 100644
--- a/data/pokemon/menu_icons.asm
+++ b/data/pokemon/menu_icons.asm
@@ -1,4 +1,5 @@
MonPartyData:
+ table_width 1, MonPartyData
dn ICON_GRASS, ICON_GRASS ; Bulbasaur / Ivysaur
dn ICON_GRASS, ICON_MON ; Venusaur / Charmander
dn ICON_MON, ICON_MON ; Charmeleon / Charizard
@@ -75,3 +76,4 @@ MonPartyData:
dn ICON_SNAKE, ICON_SNAKE ; Dratini / Dragonair
dn ICON_SNAKE, ICON_MON ; Dragonite / Mewtwo
dn ICON_MON, 0 ; Mew / padding
+ assert_table_length (NUM_POKEMON + 1) / 2
diff --git a/data/pokemon/names.asm b/data/pokemon/names.asm
index 83a45b77..56aa9f5d 100644
--- a/data/pokemon/names.asm
+++ b/data/pokemon/names.asm
@@ -1,4 +1,5 @@
MonsterNames::
+ table_width NAME_LENGTH - 1, MonsterNames
db "RHYDON@@@@"
db "KANGASKHAN"
db "NIDORAN♂@@"
@@ -189,3 +190,4 @@ MonsterNames::
db "BELLSPROUT"
db "WEEPINBELL"
db "VICTREEBEL"
+ assert_table_length NUM_POKEMON_INDEXES
diff --git a/data/pokemon/palettes.asm b/data/pokemon/palettes.asm
index 8c4d0bc0..2ce500aa 100644
--- a/data/pokemon/palettes.asm
+++ b/data/pokemon/palettes.asm
@@ -1,4 +1,5 @@
MonsterPalettes:
+ table_width 1, MonsterPalettes
db PAL_MEWMON ; MISSINGNO
db PAL_GREENMON ; BULBASAUR
db PAL_GREENMON ; IVYSAUR
@@ -151,3 +152,4 @@ MonsterPalettes:
db PAL_BROWNMON ; DRAGONITE
db PAL_MEWMON ; MEWTWO
db PAL_MEWMON ; MEW
+ assert_table_length NUM_POKEMON + 1