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

@@ -15,6 +15,7 @@
const POKE_FLUTE_RADIO ; 08
const UNOWN_RADIO ; 09
const EVOLUTION_RADIO ; 0a
NUM_RADIO_CHANNELS EQU const_value
; internal indexes for channel segments
const OAKS_POKEMON_TALK_2 ; 0b
const OAKS_POKEMON_TALK_3 ; 0c
@@ -93,6 +94,7 @@
const POKEDEX_SHOW_6 ; 55
const POKEDEX_SHOW_7 ; 56
const POKEDEX_SHOW_8 ; 57
NUM_RADIO_SEGMENTS EQU const_value
; PlayRadio.StationPointers indexes (see engine/pokegear/pokegear.asm)
const_def
@@ -106,9 +108,6 @@
const MAPRADIO_LETS_ALL_SING
const MAPRADIO_ROCKET
; OaksPKMNTalkRoutes size (see data/radio/oaks_pkmn_talk_routes.asm)
NUM_OAKS_POKEMON_TALK_ROUTES EQU 15
; These tables in engine/pokegear/radio.asm are all sized to a power of 2
; so there's no need for a rejection sampling loop
NUM_OAKS_POKEMON_TALK_ADVERBS EQU 16 ; OaksPKMNTalk8.Adverbs