summaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2021-03-16 18:08:25 -0400
committerRangi <remy.oukaour+rangi42@gmail.com>2021-03-16 18:08:25 -0400
commit2bc8cf5fc11d4ef84022840ad10cd05eaab12ae9 (patch)
treea51a504112ef948c1ddcb0b7e31c2f285f3b84a9 /engine
parent8b5dde16c3e7f7ad87a095f71cc6b61cf00b2bb8 (diff)
Revise some constant definitions
Diffstat (limited to 'engine')
-rw-r--r--engine/gfx/cgb_layouts.asm6
-rw-r--r--engine/gfx/load_font.asm4
-rw-r--r--engine/gfx/sgb_layouts.asm6
-rw-r--r--engine/pokegear/pokegear.asm12
4 files changed, 17 insertions, 11 deletions
diff --git a/engine/gfx/cgb_layouts.asm b/engine/gfx/cgb_layouts.asm
index a830e45a..c0f0dbf5 100644
--- a/engine/gfx/cgb_layouts.asm
+++ b/engine/gfx/cgb_layouts.asm
@@ -17,7 +17,7 @@ LoadSGBLayoutCGB:
ld l, a
ld h, 0
add hl, hl
- ld de, .Jumptable
+ ld de, CGBLayoutJumptable
add hl, de
ld a, [hli]
ld h, [hl]
@@ -28,7 +28,8 @@ LoadSGBLayoutCGB:
.done:
ret
-.Jumptable:
+CGBLayoutJumptable:
+ table_width 2, CGBLayoutJumptable
dw _CGB_BattleGrayscale
dw _CGB_BattleColors
dw _CGB_PokegearPals
@@ -61,6 +62,7 @@ LoadSGBLayoutCGB:
dw _CGB_MysteryGift
dw _CGB_Unused1E
dw _CGB_Pokedex_5x5
+ assert_table_length NUM_SCGB_LAYOUTS
_CGB_BattleGrayscale:
ld hl, PalPacket_BattleGrayscale + 1
diff --git a/engine/gfx/load_font.asm b/engine/gfx/load_font.asm
index b41badc2..d6658137 100644
--- a/engine/gfx/load_font.asm
+++ b/engine/gfx/load_font.asm
@@ -29,13 +29,13 @@ _LoadFontsBattleExtra::
LoadFrame:
ld a, [wTextboxFrame]
maskbits NUM_FRAMES
- ld bc, 6 * LEN_1BPP_TILE
+ ld bc, TEXTBOX_FRAME_TILES * LEN_1BPP_TILE
ld hl, Frames
call AddNTimes
ld d, h
ld e, l
ld hl, vTiles2 tile "┌" ; $79
- lb bc, BANK(Frames), 6 ; "┌" to "┘"
+ lb bc, BANK(Frames), TEXTBOX_FRAME_TILES ; "┌" to "┘"
call Get1bpp
ld hl, vTiles2 tile " " ; $7f
ld de, TextboxSpaceGFX
diff --git a/engine/gfx/sgb_layouts.asm b/engine/gfx/sgb_layouts.asm
index 1b2799bf..b7a6fc3f 100644
--- a/engine/gfx/sgb_layouts.asm
+++ b/engine/gfx/sgb_layouts.asm
@@ -12,7 +12,7 @@ LoadSGBLayout:
ld l, a
ld h, 0
add hl, hl
- ld de, .Jumptable
+ ld de, SGBLayoutJumptable
add hl, de
ld a, [hli]
ld h, [hl]
@@ -21,7 +21,8 @@ LoadSGBLayout:
push de
jp hl
-.Jumptable:
+SGBLayoutJumptable:
+ table_width 2, SGBLayoutJumptable
dw .SGB_BattleGrayscale
dw .SGB_BattleColors
dw .SGB_PokegearPals
@@ -54,6 +55,7 @@ LoadSGBLayout:
dw .SGB_MysteryGift
dw .SGB_Unused1E
dw .SGB_Pokedex_5x5
+ assert_table_length NUM_SCGB_LAYOUTS
.SGB_BattleGrayscale:
ld hl, PalPacket_BattleGrayscale
diff --git a/engine/pokegear/pokegear.asm b/engine/pokegear/pokegear.asm
index acef7b42..ee040de3 100644
--- a/engine/pokegear/pokegear.asm
+++ b/engine/pokegear/pokegear.asm
@@ -1907,7 +1907,7 @@ PlayRadio:
.PlayStation:
ld a, ENTER_MAP_MUSIC
ld [wPokegearRadioMusicPlaying], a
- ld hl, .StationPointers
+ ld hl, PlayRadioStationPointers
ld d, 0
add hl, de
add hl, de
@@ -1934,9 +1934,10 @@ PlayRadio:
call WaitBGMap
ret
-.StationPointers:
+PlayRadioStationPointers:
; entries correspond to MAPRADIO_* constants
- dw .OakOrPnP
+ table_width 2, PlayRadioStationPointers
+ dw LoadStation_PokemonChannel
dw LoadStation_OaksPokemonTalk
dw LoadStation_PokedexShow
dw LoadStation_PokemonMusic
@@ -1945,8 +1946,9 @@ PlayRadio:
dw LoadStation_PlacesAndPeople
dw LoadStation_LetsAllSing
dw LoadStation_RocketRadio
+ assert_table_length NUM_MAP_RADIO_STATIONS
-.OakOrPnP:
+LoadStation_PokemonChannel:
call IsInJohto
and a
jr nz, .kanto
@@ -1956,7 +1958,7 @@ PlayRadio:
jp z, LoadStation_PokedexShow
jp LoadStation_OaksPokemonTalk
-.kanto
+.kanto:
jp LoadStation_PlacesAndPeople
PokegearMap: