summaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
Diffstat (limited to 'engine')
-rw-r--r--engine/battle/move_effects/conversion2.asm2
-rw-r--r--engine/battle_anims/core.asm2
-rw-r--r--engine/debug/color_picker.asm4
-rw-r--r--engine/gfx/color.asm2
-rw-r--r--engine/gfx/load_pics.asm2
-rw-r--r--engine/gfx/sprite_anims.asm4
-rw-r--r--engine/items/item_effects.asm18
-rw-r--r--engine/overworld/decorations.asm116
-rw-r--r--engine/overworld/map_object_action.asm4
-rw-r--r--engine/overworld/map_objects.asm8
-rw-r--r--engine/overworld/overworld.asm2
-rw-r--r--engine/overworld/player_movement.asm6
-rw-r--r--engine/phone/phone.asm4
-rw-r--r--engine/pokedex/pokedex.asm8
-rw-r--r--engine/pokegear/radio.asm22
-rw-r--r--engine/tilesets/mapgroup_roofs.asm4
16 files changed, 125 insertions, 83 deletions
diff --git a/engine/battle/move_effects/conversion2.asm b/engine/battle/move_effects/conversion2.asm
index df6d91090..32d4502e3 100644
--- a/engine/battle/move_effects/conversion2.asm
+++ b/engine/battle/move_effects/conversion2.asm
@@ -27,7 +27,7 @@ BattleCommand_Conversion2:
.loop
call BattleRandom
- maskbits NUM_TYPES
+ maskbits TYPES_END
cp UNUSED_TYPES
jr c, .okay
cp UNUSED_TYPES_END
diff --git a/engine/battle_anims/core.asm b/engine/battle_anims/core.asm
index 51916ef42..64be8839d 100644
--- a/engine/battle_anims/core.asm
+++ b/engine/battle_anims/core.asm
@@ -31,7 +31,7 @@ InitBattleAnimation:
ld e, a
ld d, 0
ld hl, BattleAnimObjects
-rept 6
+rept BATTLEANIMOBJ_LENGTH
add hl, de
endr
ld e, l
diff --git a/engine/debug/color_picker.asm b/engine/debug/color_picker.asm
index 502620de5..75f5a22ae 100644
--- a/engine/debug/color_picker.asm
+++ b/engine/debug/color_picker.asm
@@ -99,7 +99,7 @@ DebugColor_InitMonColor:
DebugColor_InitTrainerColor:
ld hl, TrainerPalettes
ld de, wDebugOriginalColors
- ld c, NUM_TRAINER_CLASSES
+ ld c, NUM_TRAINER_CLASSES + 1
.loop
push bc
push hl
@@ -284,7 +284,7 @@ DebugColorMain:
ld a, NUM_POKEMON ; CELEBI
ret
.trainer
- ld a, NUM_TRAINER_CLASSES - 1 ; MYSTICALMAN
+ ld a, NUM_TRAINER_CLASSES ; MYSTICALMAN
ret
.Jumptable:
diff --git a/engine/gfx/color.asm b/engine/gfx/color.asm
index 7e7f075a0..b6d1a2b2e 100644
--- a/engine/gfx/color.asm
+++ b/engine/gfx/color.asm
@@ -1305,7 +1305,9 @@ MapObjectPals::
INCLUDE "gfx/overworld/npc_sprites.pal"
RoofPals:
+ table_width PAL_COLOR_SIZE * 2 * 2, RoofPals
INCLUDE "gfx/tilesets/roofs.pal"
+ assert_table_length NUM_MAP_GROUPS + 1
DiplomaPalettes:
INCLUDE "gfx/diploma/diploma.pal"
diff --git a/engine/gfx/load_pics.asm b/engine/gfx/load_pics.asm
index 9b540d86b..23b0f606d 100644
--- a/engine/gfx/load_pics.asm
+++ b/engine/gfx/load_pics.asm
@@ -311,7 +311,7 @@ GetTrainerPic:
ld a, [wTrainerClass]
and a
ret z
- cp NUM_TRAINER_CLASSES
+ cp NUM_TRAINER_CLASSES + 1
ret nc
call WaitBGMap
xor a
diff --git a/engine/gfx/sprite_anims.asm b/engine/gfx/sprite_anims.asm
index f9b1dc221..d74db175d 100644
--- a/engine/gfx/sprite_anims.asm
+++ b/engine/gfx/sprite_anims.asm
@@ -12,7 +12,8 @@ DoAnimFrame:
jp hl
.Jumptable:
-; entries correspond to SPRITE_ANIM_SEQ_* constants
+; entries correspond to SPRITE_ANIM_SEQ_* constants (see constants/sprite_anim_constants.asm)
+ table_width 2, DoAnimFrame.Jumptable
dw AnimSeq_Null
dw AnimSeq_PartyMon
dw AnimSeq_PartyMonSwitch
@@ -48,6 +49,7 @@ DoAnimFrame:
dw AnimSeq_IntroUnown
dw AnimSeq_IntroUnownF
dw AnimSeq_IntroSuicuneAway
+ assert_table_length NUM_SPRITE_ANIM_SEQS
AnimSeq_Null:
ret
diff --git a/engine/items/item_effects.asm b/engine/items/item_effects.asm
index d4a969c24..b7d979fd9 100644
--- a/engine/items/item_effects.asm
+++ b/engine/items/item_effects.asm
@@ -12,7 +12,8 @@ _DoItemEffect::
ret
ItemEffects:
-; entries correspond to item ids
+; entries correspond to item ids (see constants/item_constants.asm)
+ table_width 2, ItemEffects
dw PokeBallEffect ; MASTER_BALL
dw PokeBallEffect ; ULTRA_BALL
dw NoEffect ; BRIGHTPOWDER
@@ -192,6 +193,21 @@ ItemEffects:
dw PokeBallEffect ; PARK_BALL
dw NoEffect ; RAINBOW_WING
dw NoEffect ; ITEM_B3
+ assert_table_length ITEM_B3
+; The items past ITEM_B3 do not have effect entries:
+; BRICK_PIECE
+; SURF_MAIL
+; LITEBLUEMAIL
+; PORTRAITMAIL
+; LOVELY_MAIL
+; EON_MAIL
+; MORPH_MAIL
+; BLUESKY_MAIL
+; MUSIC_MAIL
+; MIRAGE_MAIL
+; ITEM_BE
+; They all have the ITEMMENU_NOUSE attribute so they can't be used anyway.
+; NoEffect would be appropriate, with the table then being NUM_ITEMS long.
PokeBallEffect:
ld a, [wBattleMode]
diff --git a/engine/overworld/decorations.asm b/engine/overworld/decorations.asm
index 288e60d4e..f9b235900 100644
--- a/engine/overworld/decorations.asm
+++ b/engine/overworld/decorations.asm
@@ -23,7 +23,7 @@ _PlayerDecorationMenu:
ld [wCurDecorationCategory], a
jr c, .exit_menu
ld a, [wMenuSelection]
- ld hl, .pointers
+ ld hl, .category_pointers
call MenuJumptable
jr nc, .top_loop
@@ -46,26 +46,28 @@ _PlayerDecorationMenu:
db 0 ; items
dw wNumOwnedDecoCategories
dw PlaceNthMenuStrings
- dw .pointers
-
-.pointers
- dw DecoBedMenu, .bed
- dw DecoCarpetMenu, .carpet
- dw DecoPlantMenu, .plant
- dw DecoPosterMenu, .poster
- dw DecoConsoleMenu, .game
+ dw .category_pointers
+
+.category_pointers:
+ table_width 2 + 2, _PlayerDecorationMenu.category_pointers
+ dw DecoBedMenu, .bed
+ dw DecoCarpetMenu, .carpet
+ dw DecoPlantMenu, .plant
+ dw DecoPosterMenu, .poster
+ dw DecoConsoleMenu, .game
dw DecoOrnamentMenu, .ornament
- dw DecoBigDollMenu, .big_doll
- dw DecoExitMenu, .exit
-
-.bed db "BED@"
-.carpet db "CARPET@"
-.plant db "PLANT@"
-.poster db "POSTER@"
-.game db "GAME CONSOLE@"
-.ornament db "ORNAMENT@"
-.big_doll db "BIG DOLL@"
-.exit db "EXIT@"
+ dw DecoBigDollMenu, .big_doll
+ dw DecoExitMenu, .exit
+ assert_table_length NUM_DECO_CATEGORIES + 1
+
+.bed: db "BED@"
+.carpet: db "CARPET@"
+.plant: db "PLANT@"
+.poster: db "POSTER@"
+.game: db "GAME CONSOLE@"
+.ornament: db "ORNAMENT@"
+.big_doll: db "BIG DOLL@"
+.exit: db "EXIT@"
.FindCategoriesWithOwnedDecos:
xor a
@@ -99,7 +101,7 @@ _PlayerDecorationMenu:
ret
.FindOwnedDecos:
- ld hl, .dw
+ ld hl, .owned_pointers
.loop
ld a, [hli]
ld e, a
@@ -121,14 +123,16 @@ _PlayerDecorationMenu:
.done
ret
-.dw
- dwb FindOwnedBeds, 0 ; bed
- dwb FindOwnedCarpets, 1 ; carpet
- dwb FindOwnedPlants, 2 ; plant
- dwb FindOwnedPosters, 3 ; poster
- dwb FindOwnedConsoles, 4 ; game console
+.owned_pointers:
+ table_width 3, _PlayerDecorationMenu.owned_pointers
+ dwb FindOwnedBeds, 0 ; bed
+ dwb FindOwnedCarpets, 1 ; carpet
+ dwb FindOwnedPlants, 2 ; plant
+ dwb FindOwnedPosters, 3 ; poster
+ dwb FindOwnedConsoles, 4 ; game console
dwb FindOwnedOrnaments, 5 ; ornament
- dwb FindOwnedBigDolls, 6 ; big doll
+ dwb FindOwnedBigDolls, 6 ; big doll
+ assert_table_length NUM_DECO_CATEGORIES
dw 0 ; end
Deco_FillTempWithMinusOne:
@@ -200,7 +204,7 @@ FindOwnedBeds:
ld c, BEDS
jp FindOwnedDecosInCategory
-.beds
+.beds:
db DECO_FEATHERY_BED ; 2
db DECO_PINK_BED ; 3
db DECO_POLKADOT_BED ; 4
@@ -218,7 +222,7 @@ FindOwnedCarpets:
ld c, CARPETS
jp FindOwnedDecosInCategory
-.carpets
+.carpets:
db DECO_RED_CARPET ; 7
db DECO_BLUE_CARPET ; 8
db DECO_YELLOW_CARPET ; 9
@@ -236,7 +240,7 @@ FindOwnedPlants:
ld c, PLANTS
jp FindOwnedDecosInCategory
-.plants
+.plants:
db DECO_MAGNAPLANT ; c
db DECO_TROPICPLANT ; d
db DECO_JUMBOPLANT ; e
@@ -253,7 +257,7 @@ FindOwnedPosters:
ld c, POSTERS
jp FindOwnedDecosInCategory
-.posters
+.posters:
db DECO_TOWN_MAP ; 10
db DECO_PIKACHU_POSTER ; 11
db DECO_CLEFAIRY_POSTER ; 12
@@ -271,7 +275,7 @@ FindOwnedConsoles:
ld c, CONSOLES
jp FindOwnedDecosInCategory
-.consoles
+.consoles:
db DECO_FAMICOM ; 15
db DECO_SNES ; 16
db DECO_N64 ; 17
@@ -289,7 +293,7 @@ FindOwnedOrnaments:
ld c, DOLLS
jp FindOwnedDecosInCategory
-.ornaments
+.ornaments:
db DECO_PIKACHU_DOLL ; 1e
db DECO_SURF_PIKACHU_DOLL ; 1f
db DECO_CLEFAIRY_DOLL ; 20
@@ -326,7 +330,7 @@ FindOwnedBigDolls:
ld c, BIG_DOLLS
jp FindOwnedDecosInCategory
-.big_dolls
+.big_dolls:
db DECO_BIG_SNORLAX_DOLL ; 1a
db DECO_BIG_ONIX_DOLL ; 1b
db DECO_BIG_LAPRAS_DOLL ; 1c
@@ -419,7 +423,7 @@ PopulateDecoCategoryMenu:
GetDecorationData:
ld hl, DecorationAttributes
- ld bc, 6
+ ld bc, DECOATTR_STRUCT_LENGTH
call AddNTimes
ret
@@ -443,7 +447,7 @@ DecorationMenuFunction:
DoDecorationAction2:
ld a, [wMenuSelection]
call GetDecorationData
- ld de, 2 ; function 2
+ ld de, DECOATTR_ACTION
add hl, de
ld a, [hl]
ld hl, .DecoActions
@@ -451,6 +455,7 @@ DoDecorationAction2:
ret
.DecoActions:
+ table_width 2, DoDecorationAction2.DecoActions
dw DecoAction_nothing
dw DecoAction_setupbed
dw DecoAction_putawaybed
@@ -466,10 +471,11 @@ DoDecorationAction2:
dw DecoAction_putawaybigdoll
dw DecoAction_setupornament
dw DecoAction_putawayornament
+ assert_table_length NUM_DECO_ACTIONS + 1
GetDecorationFlag:
call GetDecorationData
- ld de, 3 ; event flag
+ ld de, DECOATTR_EVENT_FLAG
add hl, de
ld a, [hli]
ld d, [hl]
@@ -486,7 +492,7 @@ DecorationFlagAction:
GetDecorationSprite:
ld a, c
call GetDecorationData
- ld de, 5 ; sprite
+ ld de, DECOATTR_SPRITE
add hl, de
ld a, [hl]
ld c, a
@@ -497,8 +503,8 @@ INCLUDE "data/decorations/attributes.asm"
INCLUDE "data/decorations/names.asm"
GetDecoName:
- ld a, [hli]
- ld e, [hl]
+ ld a, [hli] ; DECOATTR_TYPE
+ ld e, [hl] ; DECOATTR_NAME
ld bc, wStringBuffer2
push bc
ld hl, .NameFunctions
@@ -507,6 +513,7 @@ GetDecoName:
ret
.NameFunctions:
+ table_width 2, GetDecoName.NameFunctions
dw .invalid
dw .plant
dw .bed
@@ -514,37 +521,38 @@ GetDecoName:
dw .poster
dw .doll
dw .bigdoll
+ assert_table_length NUM_DECO_TYPES + 1
-.invalid
+.invalid:
ret
-.plant
+.plant:
ld a, e
jr .getdeconame
-.bed
+.bed:
call .plant
ld a, _BED
jr .getdeconame
-.carpet
+.carpet:
call .plant
ld a, _CARPET
jr .getdeconame
-.poster
+.poster:
ld a, e
call .getpokename
ld a, _POSTER
jr .getdeconame
-.doll
+.doll:
ld a, e
call .getpokename
ld a, _DOLL
jr .getdeconame
-.bigdoll
+.bigdoll:
push de
ld a, BIG_
call .getdeconame
@@ -552,25 +560,25 @@ GetDecoName:
ld a, e
jr .getpokename
-.unused ; unreferenced
+.unused: ; unreferenced
push de
call .getdeconame
pop de
ld a, e
jr .getdeconame
-.getpokename
+.getpokename:
push bc
ld [wNamedObjectIndex], a
call GetPokemonName
pop bc
jr .copy
-.getdeconame
+.getdeconame:
call ._getdeconame
jr .copy
-._getdeconame
+._getdeconame:
push bc
ld hl, DecorationNames
call GetNthString
@@ -579,7 +587,7 @@ GetDecoName:
pop bc
ret
-.copy
+.copy:
ld h, b
ld l, c
call CopyName2
@@ -968,11 +976,13 @@ DescribeDecoration::
.JumpTable:
; entries correspond to DECODESC_* constants
+ table_width 2, DescribeDecoration.JumpTable
dw DecorationDesc_Poster
dw DecorationDesc_LeftOrnament
dw DecorationDesc_RightOrnament
dw DecorationDesc_GiantOrnament
dw DecorationDesc_Console
+ assert_table_length NUM_DECODESCS
DecorationDesc_Poster:
ld a, [wDecoPoster]
diff --git a/engine/overworld/map_object_action.asm b/engine/overworld/map_object_action.asm
index 5c68f6b0f..e44fdfeb0 100644
--- a/engine/overworld/map_object_action.asm
+++ b/engine/overworld/map_object_action.asm
@@ -1,6 +1,7 @@
ObjectActionPairPointers:
-; entries correspond to OBJECT_ACTION_* constants
+; entries correspond to OBJECT_ACTION_* constants (see constants/map_object_constants.asm)
; normal action, frozen action
+ table_width 2 + 2, ObjectActionPairPointers
dw SetFacingStanding, SetFacingStanding
dw SetFacingStandAction, SetFacingCurrent
dw SetFacingStepAction, SetFacingCurrent
@@ -18,6 +19,7 @@ ObjectActionPairPointers:
dw SetFacingBoulderDust, SetFacingStanding
dw SetFacingGrassShake, SetFacingStanding
dw SetFacingSkyfall, SetFacingCurrent
+ assert_table_length NUM_OBJECT_ACTIONS
SetFacingStanding:
ld hl, OBJECT_FACING_STEP
diff --git a/engine/overworld/map_objects.asm b/engine/overworld/map_objects.asm
index 4d7139128..bf809a2e6 100644
--- a/engine/overworld/map_objects.asm
+++ b/engine/overworld/map_objects.asm
@@ -523,7 +523,8 @@ StepFunction_FromMovement:
ret
.Pointers:
-; entries correspond to SPRITEMOVEFN_* constants
+; entries correspond to SPRITEMOVEFN_* constants (see constants/map_object_constants.asm)
+ table_width 2, StepFunction_FromMovement.Pointers
dw MovementFunction_Null ; 00
dw MovementFunction_RandomWalkY ; 01
dw MovementFunction_RandomWalkX ; 02
@@ -552,6 +553,7 @@ StepFunction_FromMovement:
dw MovementFunction_SpinCounterclockwise ; 19
dw MovementFunction_BoulderDust ; 1a
dw MovementFunction_ShakingGrass ; 1b
+ assert_table_length NUM_SPRITEMOVEFN
MovementFunction_Null:
ret
@@ -1085,7 +1087,8 @@ _SetRandomStepDuration:
ret
StepTypesJumptable:
-; entries correspond to STEP_TYPE_* constants
+; entries correspond to STEP_TYPE_* constants (see constants/map_object_constants.asm)
+ table_width 2, StepTypesJumptable
dw StepFunction_Reset ; 00
dw StepFunction_FromMovement ; 01
dw StepFunction_NPCWalk ; 02
@@ -1112,6 +1115,7 @@ StepTypesJumptable:
dw StepFunction_17 ; 17
dw StepFunction_Delete ; 18
dw StepFunction_SkyfallTop ; 19
+ assert_table_length NUM_STEP_TYPES
WaitStep_InPlace:
ld hl, OBJECT_STEP_DURATION
diff --git a/engine/overworld/overworld.asm b/engine/overworld/overworld.asm
index f09159f37..e6c8319bf 100644
--- a/engine/overworld/overworld.asm
+++ b/engine/overworld/overworld.asm
@@ -636,7 +636,7 @@ endr
LoadEmote::
; Get the address of the pointer to emote c.
ld a, c
- ld bc, 6 ; sizeof(emote)
+ ld bc, EMOTE_LENGTH
ld hl, Emotes
call AddNTimes
; Load the emote address into de
diff --git a/engine/overworld/player_movement.asm b/engine/overworld/player_movement.asm
index a485cfa93..a5db49970 100644
--- a/engine/overworld/player_movement.asm
+++ b/engine/overworld/player_movement.asm
@@ -1,5 +1,4 @@
DoPlayerMovement::
-
call .GetDPad
ld a, movement_step_sleep
ld [wMovementAnimation], a
@@ -12,7 +11,6 @@ DoPlayerMovement::
ret
.GetDPad:
-
ldh a, [hJoyDown]
ld [wCurInput], a
@@ -469,7 +467,8 @@ DoPlayerMovement::
ret
.Steps:
-; entries correspond to STEP_* constants
+; entries correspond to STEP_* constants (see constants/map_object_constants.asm)
+ table_width 2, DoPlayerMovement.Steps
dw .SlowStep
dw .NormalStep
dw .FastStep
@@ -478,6 +477,7 @@ DoPlayerMovement::
dw .TurningStep
dw .BackJumpStep
dw .FinishFacing
+ assert_table_length NUM_STEPS
.SlowStep:
slow_step DOWN
diff --git a/engine/phone/phone.asm b/engine/phone/phone.asm
index c8c9744ed..3263f8b50 100644
--- a/engine/phone/phone.asm
+++ b/engine/phone/phone.asm
@@ -247,7 +247,7 @@ CheckSpecialPhoneCall::
ld c, a
ld b, 0
ld hl, SpecialPhoneCallList
- ld a, 6
+ ld a, SPECIALCALL_SIZE
call AddNTimes
ld a, [hli]
ld h, [hl]
@@ -291,7 +291,7 @@ CheckSpecialPhoneCall::
ld c, a
ld b, 0
ld hl, SpecialPhoneCallList
- ld a, 6
+ ld a, SPECIALCALL_SIZE
call AddNTimes
ret
diff --git a/engine/pokedex/pokedex.asm b/engine/pokedex/pokedex.asm
index 3cfd30104..1a52d750f 100644
--- a/engine/pokedex/pokedex.asm
+++ b/engine/pokedex/pokedex.asm
@@ -1805,7 +1805,7 @@ Pokedex_PrevSearchMonType:
jr .done
.wrap_around
- ld [hl], NUM_TYPES - 1
+ ld [hl], NUM_TYPES
.done
scf
@@ -1818,7 +1818,7 @@ Pokedex_NextSearchMonType:
ld hl, wDexSearchMonType1
ld a, [hl]
- cp NUM_TYPES - 1
+ cp NUM_TYPES
jr nc, .type1_wrap_around
inc [hl]
jr .done
@@ -1829,7 +1829,7 @@ Pokedex_NextSearchMonType:
.type2
ld hl, wDexSearchMonType2
ld a, [hl]
- cp NUM_TYPES - 1
+ cp NUM_TYPES
jr nc, .type2_wrap_around
inc [hl]
jr .done
@@ -1862,7 +1862,7 @@ Pokedex_PlaceTypeString:
ld e, a
ld d, 0
ld hl, PokedexTypeSearchStrings
-rept 9
+rept POKEDEX_TYPE_STRING_LENGTH
add hl, de
endr
ld e, l
diff --git a/engine/pokegear/radio.asm b/engine/pokegear/radio.asm
index 8257ff565..cc1b504d6 100644
--- a/engine/pokegear/radio.asm
+++ b/engine/pokegear/radio.asm
@@ -20,6 +20,7 @@ PlayRadioShow:
RadioJumptable:
; entries correspond to constants/radio_constants.asm
+ table_width 2, RadioJumptable
dw OaksPKMNTalk1 ; $00
dw PokedexShow1 ; $01
dw BenMonMusic1 ; $02
@@ -31,6 +32,7 @@ RadioJumptable:
dw PokeFluteRadio ; $08
dw UnownRadio ; $09
dw EvolutionRadio ; $0a
+ assert_table_length NUM_RADIO_CHANNELS
; OaksPKMNTalk
dw OaksPKMNTalk2 ; $0b
dw OaksPKMNTalk3 ; $0c
@@ -116,6 +118,7 @@ RadioJumptable:
dw PokedexShow6 ; $55
dw PokedexShow7 ; $56
dw PokedexShow8 ; $57
+ assert_table_length NUM_RADIO_SEGMENTS
PrintRadioLine:
ld [wNextRadioLine], a
@@ -193,10 +196,9 @@ OaksPKMNTalk4:
; Choose a random route, and a random Pokemon from that route.
.sample
call Random
- and %11111 ; maskbits NUM_OAKS_POKEMON_TALK_ROUTES would be more efficient
- cp NUM_OAKS_POKEMON_TALK_ROUTES
+ and %11111
+ cp (OaksPKMNTalkRoutes.End - OaksPKMNTalkRoutes) / 2
jr nc, .sample
- ; We now have a number between 0 and NUM_OAKS_POKEMON_TALK_ROUTES - 1.
ld hl, OaksPKMNTalkRoutes
ld c, a
ld b, 0
@@ -347,7 +349,7 @@ OaksPKMNTalk8:
jp NextRadioLine
.Adverbs:
-; there are NUM_OAKS_POKEMON_TALK_ADVERBS entries
+ table_width 2, OaksPKMNTalk8.Adverbs
dw .OPT_SweetAdorablyText
dw .OPT_WigglySlicklyText
dw .OPT_AptlyNamedText
@@ -364,6 +366,7 @@ OaksPKMNTalk8:
dw .OPT_ProvocativelyText
dw .OPT_FlippedOutText
dw .OPT_HeartMeltinglyText
+ assert_table_length NUM_OAKS_POKEMON_TALK_ADVERBS
.OPT_SweetAdorablyText:
text_far _OPT_SweetAdorablyText
@@ -455,7 +458,7 @@ OaksPKMNTalk9:
jp NextRadioLine
.Adjectives:
-; there are NUM_OAKS_POKEMON_TALK_ADJECTIVES entries
+ table_width 2, OaksPKMNTalk9.Adjectives
dw .OPT_CuteText
dw .OPT_WeirdText
dw .OPT_PleasantText
@@ -472,6 +475,7 @@ OaksPKMNTalk9:
dw .OPT_GuardedText
dw .OPT_LovelyText
dw .OPT_SpeedyText
+ assert_table_length NUM_OAKS_POKEMON_TALK_ADJECTIVES
.OPT_CuteText:
text_far _OPT_CuteText
@@ -1090,7 +1094,7 @@ PeoplePlaces4: ; People
call Random
maskbits NUM_TRAINER_CLASSES
inc a
- cp NUM_TRAINER_CLASSES - 1 ; omit MYSTICALMAN
+ cp NUM_TRAINER_CLASSES
jr nc, PeoplePlaces4
push af
ld hl, PnP_HiddenPeople
@@ -1154,7 +1158,7 @@ PeoplePlaces5:
jp NextRadioLine
.Adjectives:
-; there are NUM_PNP_PEOPLE_ADJECTIVES entries
+ table_width 2, PeoplePlaces5.Adjectives
dw PnP_CuteText
dw PnP_LazyText
dw PnP_HappyText
@@ -1171,6 +1175,7 @@ PeoplePlaces5:
dw PnP_WeirdText
dw PnP_RightForMeText
dw PnP_OddText
+ assert_table_length NUM_PNP_PEOPLE_ADJECTIVES
PnP_CuteText:
text_far _PnP_CuteText
@@ -1289,7 +1294,7 @@ PeoplePlaces7:
jp PrintRadioLine
.Adjectives:
-; there are NUM_PNP_PLACES_ADJECTIVES entries
+ table_width 2, PeoplePlaces7.Adjectives
dw PnP_CuteText
dw PnP_LazyText
dw PnP_HappyText
@@ -1306,6 +1311,7 @@ PeoplePlaces7:
dw PnP_WeirdText
dw PnP_RightForMeText
dw PnP_OddText
+ assert_table_length NUM_PNP_PLACES_ADJECTIVES
RocketRadio1:
call StartRadioStation
diff --git a/engine/tilesets/mapgroup_roofs.asm b/engine/tilesets/mapgroup_roofs.asm
index b269e5277..9db5d64d8 100644
--- a/engine/tilesets/mapgroup_roofs.asm
+++ b/engine/tilesets/mapgroup_roofs.asm
@@ -8,10 +8,10 @@ LoadMapGroupRoof::
cp -1
ret z
ld hl, Roofs
- ld bc, 9 tiles
+ ld bc, ROOF_LENGTH tiles
call AddNTimes
ld de, vTiles2 tile $0a
- ld bc, 9 tiles
+ ld bc, ROOF_LENGTH tiles
call CopyBytes
ret