summaryrefslogtreecommitdiff
path: root/engine/gfx
diff options
context:
space:
mode:
Diffstat (limited to 'engine/gfx')
-rw-r--r--engine/gfx/cgb_layouts.asm168
-rw-r--r--engine/gfx/color.asm38
-rw-r--r--engine/gfx/crystal_layouts.asm69
-rw-r--r--engine/gfx/dma_transfer.asm68
-rw-r--r--engine/gfx/load_font.asm31
-rw-r--r--engine/gfx/load_overworld_font.asm3
-rw-r--r--engine/gfx/load_pics.asm101
-rw-r--r--engine/gfx/load_push_oam.asm4
-rw-r--r--engine/gfx/mon_icons.asm77
-rw-r--r--engine/gfx/pic_animation.asm196
-rw-r--r--engine/gfx/place_graphic.asm2
-rw-r--r--engine/gfx/player_gfx.asm38
-rw-r--r--engine/gfx/sgb_layouts.asm110
-rw-r--r--engine/gfx/sprite_anims.asm111
-rw-r--r--engine/gfx/sprites.asm80
-rw-r--r--engine/gfx/trademon_frontpic.asm4
16 files changed, 418 insertions, 682 deletions
diff --git a/engine/gfx/cgb_layouts.asm b/engine/gfx/cgb_layouts.asm
index b36dceeb6..d8f53d7fc 100644
--- a/engine/gfx/cgb_layouts.asm
+++ b/engine/gfx/cgb_layouts.asm
@@ -1,12 +1,11 @@
; Replaces the functionality of sgb.asm to work with CGB hardware.
-CheckCGB: ; 8d55
+CheckCGB:
ld a, [hCGB]
and a
ret
-; 8d59
-LoadSGBLayoutCGB: ; 8d59
+LoadSGBLayoutCGB:
ld a, b
cp SCGB_RAM
jr nz, .not_ram
@@ -26,13 +25,11 @@ LoadSGBLayoutCGB: ; 8d59
ld de, .ReturnFromJumpTable
push de
jp hl
-; 8d79
-.ReturnFromJumpTable: ; 8d79
+.ReturnFromJumpTable:
ret
-; 8d7a
-.dw ; 8d7a
+.dw
dw _CGB_BattleGrayscale
dw _CGB_BattleColors
dw _CGB_PokegearPals
@@ -48,7 +45,7 @@ LoadSGBLayoutCGB: ; 8d59
dw _CGB_GSTitleScreen
dw _CGB0d
dw _CGB_MoveList
- dw _CGB0f
+ dw _CGB_BetaPikachuMinigame
dw _CGB_PokedexSearchOption
dw _CGB11
dw _CGB_Pokepic
@@ -64,9 +61,8 @@ LoadSGBLayoutCGB: ; 8d59
dw _CGB_TrainerOrMonFrontpicPals
dw _CGB_MysteryGift
dw _CGB1e
-; 8db8
-_CGB_BattleGrayscale: ; 8db8
+_CGB_BattleGrayscale:
ld hl, PalPacket_BattleGrayscale + 1
ld de, wBGPals1
ld c, 4
@@ -81,7 +77,7 @@ _CGB_BattleGrayscale: ; 8db8
call CopyPalettes
jr _CGB_FinishBattleScreenLayout
-_CGB_BattleColors: ; 8ddb
+_CGB_BattleColors:
ld de, wBGPals1
call GetBattlemonBackpicPalettePointer
push hl
@@ -115,7 +111,7 @@ _CGB_BattleColors: ; 8ddb
ld a, SCGB_BATTLE_COLORS
ld [wSGBPredef], a
call ApplyPals
-_CGB_FinishBattleScreenLayout: ; 8e23
+_CGB_FinishBattleScreenLayout:
call InitPartyMenuBGPal7
hlcoord 0, 0, wAttrMap
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
@@ -152,12 +148,10 @@ _CGB_FinishBattleScreenLayout: ; 8e23
call FarCopyWRAM
call ApplyAttrMap
ret
-; 8e85
-
-InitPartyMenuBGPal7: ; 8e85
+InitPartyMenuBGPal7:
farcall Function100dc0
-Mobile_InitPartyMenuBGPal7: ; 8e8b
+Mobile_InitPartyMenuBGPal7:
ld hl, PartyMenuBGPalette
jr nc, .not_mobile
ld hl, PartyMenuBGMobilePalette
@@ -167,9 +161,8 @@ Mobile_InitPartyMenuBGPal7: ; 8e8b
ld a, BANK(wBGPals1)
call FarCopyWRAM
ret
-; 8e9f
-InitPartyMenuBGPal0: ; 8e9f
+InitPartyMenuBGPal0:
farcall Function100dc0
ld hl, PartyMenuBGPalette
jr nc, .not_mobile
@@ -180,9 +173,8 @@ InitPartyMenuBGPal0: ; 8e9f
ld a, BANK(wBGPals1)
call FarCopyWRAM
ret
-; 8eb9
-_CGB_PokegearPals: ; 8eb9
+_CGB_PokegearPals:
ld a, [wPlayerGender]
bit PLAYERGENDER_FEMALE_F, a
jr z, .male
@@ -200,9 +192,8 @@ _CGB_PokegearPals: ; 8eb9
ld a, $1
ld [hCGBPalUpdate], a
ret
-; 8edb
-_CGB_StatsScreenHPPals: ; 8edb
+_CGB_StatsScreenHPPals:
ld de, wBGPals1
ld a, [wCurHPPal]
ld l, a
@@ -255,17 +246,14 @@ _CGB_StatsScreenHPPals: ; 8edb
ld a, $1
ld [hCGBPalUpdate], a
ret
-; 8f52
-StatsScreenPagePals: ; 8f52
+StatsScreenPagePals:
INCLUDE "gfx/stats/pages.pal"
-; 8f6a
-StatsScreenPals: ; 8f6a
+StatsScreenPals:
INCLUDE "gfx/stats/stats.pal"
-; 8f70
-_CGB_Pokedex: ; 8f70
+_CGB_Pokedex:
ld de, wBGPals1
ld a, PREDEFPAL_POKEDEX
call GetPredefPal
@@ -297,17 +285,14 @@ _CGB_Pokedex: ; 8f70
ld a, $1
ld [hCGBPalUpdate], a
ret
-; 8fba
-.PokedexQuestionMarkPalette: ; 8fba
+.PokedexQuestionMarkPalette:
INCLUDE "gfx/pokedex/question_mark.pal"
-; 8fc2
-.PokedexCursorPalette: ; 8fc2
+.PokedexCursorPalette:
INCLUDE "gfx/pokedex/cursor.pal"
-; 8fca
-_CGB_BillsPC: ; 8fca
+_CGB_BillsPC:
ld de, wBGPals1
ld a, PREDEFPAL_POKEDEX
call GetPredefPal
@@ -335,9 +320,8 @@ _CGB_BillsPC: ; 8fca
ld a, $1
ld [hCGBPalUpdate], a
ret
-; 9009
-.Function9009: ; 9009
+.Function9009:
ld hl, .BillsPCOrangePalette
call LoadHLPaletteIntoDE
jr .asm_901a
@@ -358,13 +342,11 @@ _CGB_BillsPC: ; 8fca
ld a, $1
ld [hCGBPalUpdate], a
ret
-; 9036
-.BillsPCOrangePalette: ; 9036
+.BillsPCOrangePalette:
INCLUDE "gfx/pc/orange.pal"
-; 903e
-_CGB_PokedexUnownMode: ; 903e
+_CGB_PokedexUnownMode:
ld de, wBGPals1
ld a, PREDEFPAL_POKEDEX
call GetPredefPal
@@ -383,9 +365,8 @@ _CGB_PokedexUnownMode: ; 903e
ld a, $1
ld [hCGBPalUpdate], a
ret
-; 906e
-_CGB_SlotMachine: ; 906e
+_CGB_SlotMachine:
ld hl, SlotMachinePals
ld de, wBGPals1
ld bc, 16 palettes
@@ -437,9 +418,8 @@ _CGB_SlotMachine: ; 906e
ld a, $1
ld [hCGBPalUpdate], a
ret
-; 90f8
-_CGB06: ; 90f8
+_CGB06:
ld hl, PalPacket_SCGB_06 + 1
call CopyFourPalettes
call WipeAttrMap
@@ -456,9 +436,8 @@ _CGB06: ; 90f8
ld a, $1
ld [hCGBPalUpdate], a
ret
-; 9122
-_CGB_GSIntro: ; 9122
+_CGB_GSIntro:
ld b, 0
ld hl, .Jumptable
add hl, bc
@@ -467,15 +446,13 @@ _CGB_GSIntro: ; 9122
ld h, [hl]
ld l, a
jp hl
-; 912d
-.Jumptable: ; 912d
+.Jumptable:
dw .ShellderLaprasScene
dw .JigglypuffPikachuScene
dw .StartersCharizardScene
-; 9133
-.ShellderLaprasScene: ; 9133
+.ShellderLaprasScene:
ld hl, .ShellderLaprasBGPalette
ld de, wBGPals1
call LoadHLPaletteIntoDE
@@ -486,15 +463,14 @@ _CGB_GSIntro: ; 9122
call FarCopyWRAM
call WipeAttrMap
ret
-; 914e
-.ShellderLaprasBGPalette: ; 914e
+.ShellderLaprasBGPalette:
RGB 19, 31, 19
RGB 18, 23, 31
RGB 11, 21, 28
RGB 04, 16, 24
-.ShellderLaprasOBPals: ; 9156
+.ShellderLaprasOBPals:
RGB 29, 29, 29
RGB 20, 19, 20
RGB 19, 06, 04
@@ -504,9 +480,8 @@ _CGB_GSIntro: ; 9122
RGB 31, 31, 31
RGB 31, 00, 00
RGB 03, 04, 06
-; 9166
-.JigglypuffPikachuScene: ; 9166
+.JigglypuffPikachuScene:
ld de, wBGPals1
ld a, PREDEFPAL_GS_INTRO_JIGGLYPUFF_PIKACHU_BG
call GetPredefPal
@@ -518,9 +493,8 @@ _CGB_GSIntro: ; 9122
call LoadHLPaletteIntoDE
call WipeAttrMap
ret
-; 9180
-.StartersCharizardScene: ; 9180
+.StartersCharizardScene:
ld hl, PalPacket_Pack + 1
call CopyFourPalettes
ld de, wOBPals1
@@ -529,10 +503,9 @@ _CGB_GSIntro: ; 9122
call LoadHLPaletteIntoDE
call WipeAttrMap
ret
-; 9195
-_CGB11: ; 9195
- ld hl, Palettes_SCGB_11
+_CGB11:
+ ld hl, BetaPokerPals
ld de, wBGPals1
ld bc, 5 palettes
ld a, BANK(wBGPals1)
@@ -541,9 +514,8 @@ _CGB11: ; 9195
call WipeAttrMap
call ApplyAttrMap
ret
-; 91ad
-_CGB_Diploma: ; 91ad
+_CGB_Diploma:
ld hl, DiplomaPalettes
ld de, wBGPals1
ld bc, 16 palettes
@@ -555,16 +527,14 @@ _CGB_Diploma: ; 91ad
call WipeAttrMap
call ApplyAttrMap
ret
-; 91c8
-_CGB_MapPals: ; 91c8
+_CGB_MapPals:
call LoadMapPals
ld a, SCGB_MAPPALS
ld [wSGBPredef], a
ret
-; 91d1
-_CGB_PartyMenu: ; 91d1
+_CGB_PartyMenu:
ld hl, PalPacket_PartyMenu + 1
call CopyFourPalettes
call InitPartyMenuBGPal0
@@ -572,9 +542,8 @@ _CGB_PartyMenu: ; 91d1
call InitPartyMenuOBPals
call ApplyAttrMap
ret
-; 91e4
-_CGB_Evolution: ; 91e4
+_CGB_Evolution:
ld de, wBGPals1
ld a, c
and a
@@ -607,9 +576,8 @@ _CGB_Evolution: ; 91e4
ld a, $1
ld [hCGBPalUpdate], a
ret
-; 9228
-_CGB_GSTitleScreen: ; 9228
+_CGB_GSTitleScreen:
ld hl, UnusedGSTitleBGPals
ld de, wBGPals1
ld bc, 5 palettes
@@ -626,17 +594,15 @@ _CGB_GSTitleScreen: ; 9228
ld a, $1
ld [hCGBPalUpdate], a
ret
-; 9251
-_CGB0d: ; 9251
+_CGB0d:
ld hl, PalPacket_Diploma + 1
call CopyFourPalettes
call WipeAttrMap
call ApplyAttrMap
ret
-; 925e
-_CGB_UnownPuzzle: ; 925e
+_CGB_UnownPuzzle:
ld hl, PalPacket_UnownPuzzle + 1
call CopyFourPalettes
ld de, wOBPals1
@@ -657,9 +623,8 @@ _CGB_UnownPuzzle: ; 925e
call WipeAttrMap
call ApplyAttrMap
ret
-; 9289
-_CGB_TrainerCard: ; 9289
+_CGB_TrainerCard:
ld de, wBGPals1
xor a ; CHRIS
call GetTrainerPalettePointer
@@ -763,9 +728,8 @@ _CGB_TrainerCard: ; 9289
ld a, $1
ld [hCGBPalUpdate], a
ret
-; 9373
-_CGB_MoveList: ; 9373
+_CGB_MoveList:
ld de, wBGPals1
ld a, PREDEFPAL_GOLDENROD
call GetPredefPal
@@ -788,10 +752,9 @@ _CGB_MoveList: ; 9373
ld a, $1
ld [hCGBPalUpdate], a
ret
-; 93a6
-_CGB0f: ; 93a6
- ld hl, PalPacket_SCGB_0F + 1
+_CGB_BetaPikachuMinigame:
+ ld hl, PalPacket_BetaPikachuMinigame + 1
call CopyFourPalettes
call WipeAttrMap
call ApplyAttrMap
@@ -799,9 +762,8 @@ _CGB0f: ; 93a6
ld a, $1
ld [hCGBPalUpdate], a
ret
-; 93ba
-_CGB_PokedexSearchOption: ; 93ba
+_CGB_PokedexSearchOption:
ld de, wBGPals1
ld a, PREDEFPAL_POKEDEX
call GetPredefPal
@@ -812,9 +774,8 @@ _CGB_PokedexSearchOption: ; 93ba
ld a, $1
ld [hCGBPalUpdate], a
ret
-; 93d3
-_CGB_PackPals: ; 93d3
+_CGB_PackPals:
; pack pals
ld a, [wBattleType]
cp BATTLETYPE_TUTORIAL
@@ -861,17 +822,14 @@ _CGB_PackPals: ; 93d3
ld a, $1
ld [hCGBPalUpdate], a
ret
-; 9439
-.ChrisPackPals: ; 9439
+.ChrisPackPals:
INCLUDE "gfx/pack/pack.pal"
-; 9469
-.KrisPackPals: ; 9469
+.KrisPackPals:
INCLUDE "gfx/pack/pack_f.pal"
-; 9499
-_CGB_Pokepic: ; 9499
+_CGB_Pokepic:
call _CGB_MapPals
ld de, SCREEN_WIDTH
hlcoord 0, 0, wAttrMap
@@ -904,9 +862,8 @@ _CGB_Pokepic: ; 9499
call FillBoxCGB
call ApplyAttrMap
ret
-; 94d0
-_CGB13: ; 94d0
+_CGB13:
ld hl, PalPacket_SCGB_13 + 1
call CopyFourPalettes
call WipeAttrMap
@@ -923,9 +880,8 @@ _CGB13: ; 94d0
ld a, $1
ld [hCGBPalUpdate], a
ret
-; 94fa
-_CGB_GamefreakLogo: ; 94fa
+_CGB_GamefreakLogo:
ld de, wBGPals1
ld a, PREDEFPAL_GAMEFREAK_LOGO
call GetPredefPal
@@ -940,13 +896,11 @@ _CGB_GamefreakLogo: ; 94fa
call ApplyAttrMap
call ApplyPals
ret
-; 9521
-.Palette: ; 9521
+.Palette:
INCLUDE "gfx/splash/logo.pal"
-; 9529
-_CGB_PlayerOrMonFrontpicPals: ; 9529
+_CGB_PlayerOrMonFrontpicPals:
ld de, wBGPals1
ld a, [wCurPartySpecies]
ld bc, wTempMonDVs
@@ -956,9 +910,8 @@ _CGB_PlayerOrMonFrontpicPals: ; 9529
call ApplyAttrMap
call ApplyPals
ret
-; 9542
-_CGB1e: ; 9542
+_CGB1e:
ld de, wBGPals1
ld a, [wCurPartySpecies]
call GetMonPalettePointer_
@@ -966,9 +919,8 @@ _CGB1e: ; 9542
call WipeAttrMap
call ApplyAttrMap
ret
-; 9555
-_CGB_TradeTube: ; 9555
+_CGB_TradeTube:
ld hl, PalPacket_TradeTube + 1
call CopyFourPalettes
ld hl, PartyMenuOBPals
@@ -982,9 +934,8 @@ _CGB_TradeTube: ; 9555
call LoadHLPaletteIntoDE
call WipeAttrMap
ret
-; 9578
-_CGB_TrainerOrMonFrontpicPals: ; 9578
+_CGB_TrainerOrMonFrontpicPals:
ld de, wBGPals1
ld a, [wCurPartySpecies]
ld bc, wTempMonDVs
@@ -994,9 +945,8 @@ _CGB_TrainerOrMonFrontpicPals: ; 9578
call ApplyAttrMap
call ApplyPals
ret
-; 9591
-_CGB_MysteryGift: ; 9591
+_CGB_MysteryGift:
ld hl, .Palettes
ld de, wBGPals1
ld bc, 2 palettes
@@ -1026,8 +976,6 @@ _CGB_MysteryGift: ; 9591
call FillBoxCGB
call ApplyAttrMap
ret
-; 95e0
-.Palettes: ; 95e0
+.Palettes:
INCLUDE "gfx/mystery_gift/mystery_gift.pal"
-; 95f0
diff --git a/engine/gfx/color.asm b/engine/gfx/color.asm
index 6cf896ff4..9a3b4f8ef 100644
--- a/engine/gfx/color.asm
+++ b/engine/gfx/color.asm
@@ -43,37 +43,36 @@ CheckShininess:
and a
ret
-Unused_CheckContestMon:
-; Check a mon's DVs at hl in the bug catching contest.
-; Return carry if its DVs are good enough to place in the contest.
+Unused_CheckShininess:
+; Return carry if the DVs at hl are all 10 or higher.
; Attack
ld a, [hl]
cp 10 << 4
- jr c, .Bad
+ jr c, .NotShiny
; Defense
ld a, [hli]
and $f
cp 10
- jr c, .Bad
+ jr c, .NotShiny
; Speed
ld a, [hl]
cp 10 << 4
- jr c, .Bad
+ jr c, .NotShiny
; Special
ld a, [hl]
and $f
cp 10
- jr c, .Bad
+ jr c, .NotShiny
-.Good:
+.Shiny:
scf
ret
-.Bad:
+.NotShiny:
and a
ret
@@ -108,7 +107,7 @@ InitPartyMenuPalettes:
ret
; SGB layout for SCGB_PARTY_MENU_HP_PALS
-SGB_ApplyPartyMenuHPPals: ; 8ade
+SGB_ApplyPartyMenuHPPals:
ld hl, wHPPals
ld a, [wSGBPals]
ld e, a
@@ -182,12 +181,12 @@ Unreferenced_Function8b4d:
ld a, [hSGB]
and a
ret z
- ld hl, PalPacket_Function8b4d
+ ld hl, PalPacket_BetaIntroVenusaur
jp PushSGBPals_
.cgb
ld de, wOBPals1
- ld a, PREDEFPAL_3B
+ ld a, PREDEFPAL_BETA_INTRO_VENUSAUR
call GetPredefPal
jp LoadHLPaletteIntoDE
@@ -649,7 +648,7 @@ ApplyAttrMap:
ret
; CGB layout for SCGB_PARTY_MENU_HP_PALS
-CGB_ApplyPartyMenuHPPals: ; 96f3
+CGB_ApplyPartyMenuHPPals:
ld hl, wHPPals
ld a, [wSGBPals]
ld e, a
@@ -1129,7 +1128,7 @@ SGBBorder_YetMorePalPushing:
ld [rBGP], a
ret
-CopyData: ; 0x9a52
+CopyData:
; copy bc bytes of data from hl to de
.loop
ld a, [hli]
@@ -1140,9 +1139,8 @@ CopyData: ; 0x9a52
or b
jr nz, .loop
ret
-; 0x9a5b
-ClearBytes: ; 0x9a5b
+ClearBytes:
; clear bc bytes of data starting from de
.loop
xor a
@@ -1153,9 +1151,8 @@ ClearBytes: ; 0x9a5b
or b
jr nz, .loop
ret
-; 0x9a64
-DrawDefaultTiles: ; 0x9a64
+DrawDefaultTiles:
; Draw 240 tiles (2/3 of the screen) from tiles in VRAM
hlbgcoord 0, 0 ; BG Map 0
ld de, BG_MAP_WIDTH - SCREEN_WIDTH
@@ -1173,7 +1170,6 @@ DrawDefaultTiles: ; 0x9a64
dec c
jr nz, .line
ret
-; 0x9a7a
SGBDelayCycles:
ld de, 7000
@@ -1349,8 +1345,8 @@ INCLUDE "gfx/pokegear/pokegear.pal"
FemalePokegearPals:
INCLUDE "gfx/pokegear/pokegear_f.pal"
-Palettes_SCGB_11:
-INCLUDE "gfx/unknown/b789.pal"
+BetaPokerPals:
+INCLUDE "gfx/beta_poker/beta_poker.pal"
SlotMachinePals:
INCLUDE "gfx/slots/slots.pal"
diff --git a/engine/gfx/crystal_layouts.asm b/engine/gfx/crystal_layouts.asm
index 71e2e4f56..b9686701c 100644
--- a/engine/gfx/crystal_layouts.asm
+++ b/engine/gfx/crystal_layouts.asm
@@ -1,4 +1,4 @@
-GetMysteryGift_MobileAdapterLayout: ; 4930f (mobile)
+GetMysteryGift_MobileAdapterLayout:
ld a, b
cp SCGB_RAM
jr nz, .not_ram
@@ -20,15 +20,13 @@ GetMysteryGift_MobileAdapterLayout: ; 4930f (mobile)
jp hl
.done
ret
-; 49330 (12:5330)
-.dw ; 49330
+.dw
dw MG_Mobile_Layout00
dw MG_Mobile_Layout01
dw MG_Mobile_Layout02
-; 49336
-MG_Mobile_Layout_FillBox: ; 49336
+MG_Mobile_Layout_FillBox:
.row
push bc
push hl
@@ -43,16 +41,15 @@ MG_Mobile_Layout_FillBox: ; 49336
dec b
jr nz, .row
ret
-; 49346
-MG_Mobile_Layout_WipeAttrMap: ; 49346 (12:5346)
+MG_Mobile_Layout_WipeAttrMap:
hlcoord 0, 0, wAttrMap
ld bc, SCREEN_HEIGHT * SCREEN_WIDTH
xor a
call ByteFill
ret
-MG_Mobile_Layout_LoadPals: ; 49351 (12:5351)
+MG_Mobile_Layout_LoadPals:
ld de, wBGPals1
ld hl, Palette_MysteryGiftMobile
ld bc, 5 palettes
@@ -65,7 +62,7 @@ MG_Mobile_Layout_LoadPals: ; 49351 (12:5351)
call FarCopyWRAM
ret
-MG_Mobile_Layout00: ; 4936e (12:536e)
+MG_Mobile_Layout00:
call MG_Mobile_Layout_LoadPals
call MG_Mobile_Layout_WipeAttrMap
call MG_Mobile_Layout_CreatePalBoxes
@@ -73,7 +70,7 @@ MG_Mobile_Layout00: ; 4936e (12:536e)
farcall ApplyPals
ret
-MG_Mobile_Layout_CreatePalBoxes: ; 49384 (12:5384)
+MG_Mobile_Layout_CreatePalBoxes:
hlcoord 0, 0, wAttrMap
lb bc, 4, 1
ld a, $1
@@ -109,35 +106,30 @@ MG_Mobile_Layout_CreatePalBoxes: ; 49384 (12:5384)
ld a, $7
call ByteFill
ret
-; 493e1 (12:53e1)
-Palette_MysteryGiftMobile: ; 493e1
+Palette_MysteryGiftMobile:
INCLUDE "gfx/mystery_gift/mg_mobile.pal"
-; 49409
-LoadOW_BGPal7:: ; 49409
+LoadOW_BGPal7::
ld hl, Palette_TextBG7
ld de, wBGPals1 palette PAL_BG_TEXT
ld bc, 1 palettes
ld a, BANK(wBGPals1)
call FarCopyWRAM
ret
-; 49418
-Palette_TextBG7: ; 49418
+Palette_TextBG7:
INCLUDE "gfx/font/bg_text.pal"
-; 49420
-Function49420:: ; 49420 (12:5420)
+Function49420::
ld hl, MansionPalette1 + 8 palettes
ld de, wBGPals1 palette PAL_BG_ROOF
ld bc, 1 palettes
ld a, BANK(wBGPals1)
call FarCopyWRAM
ret
-; 4942f (12:542f)
-MG_Mobile_Layout01: ; 4942f
+MG_Mobile_Layout01:
call MG_Mobile_Layout_LoadPals
ld de, wBGPals1 palette PAL_BG_TEXT
ld hl, .Palette_49478
@@ -168,16 +160,14 @@ MG_Mobile_Layout01: ; 4942f
ld a, $1
ld [hCGBPalUpdate], a
ret
-; 49478
-.Palette_49478: ; 49478
+.Palette_49478:
RGB 31, 31, 31
RGB 26, 31, 00
RGB 20, 16, 03
RGB 00, 00, 00
-; 49480
-Function49480: ; 49480
+Function49480:
hlcoord 0, 0, wAttrMap
lb bc, 4, SCREEN_WIDTH
ld a, $7
@@ -188,9 +178,8 @@ Function49480: ; 49480
hlcoord 19, 2, wAttrMap
ld [hl], a
ret
-; 49496
-Function49496: ; 49496
+Function49496:
hlcoord 0, 0, wAttrMap
lb bc, 2, SCREEN_WIDTH
ld a, $7
@@ -201,11 +190,10 @@ Function49496: ; 49496
hlcoord 19, 1, wAttrMap
ld [hl], a
ret
-; 494ac
INCLUDE "engine/tilesets/tileset_palettes.asm"
-MG_Mobile_Layout02: ; 49706
+MG_Mobile_Layout02:
ld hl, .Palette_49732
ld de, wBGPals1
ld bc, 1 palettes
@@ -220,23 +208,20 @@ MG_Mobile_Layout02: ; 49706
ld a, BANK(wOBPals1)
call FarCopyWRAM
ret
-; 49732
-.Palette_49732: ; 49732
+.Palette_49732:
RGB 31, 31, 31
RGB 23, 16, 07
RGB 23, 07, 07
RGB 03, 07, 20
-; 4973a
-.Palette_4973a: ; 4973a
+.Palette_4973a:
RGB 00, 00, 00
RGB 07, 05, 31
RGB 14, 18, 31
RGB 31, 31, 31
-; 49742
-Function49742: ; 49742
+Function49742:
ld hl, .Palette_49757
ld de, wBGPals1
ld bc, 8 palettes
@@ -244,13 +229,11 @@ Function49742: ; 49742
call FarCopyWRAM
farcall ApplyPals
ret
-; 49757
-.Palette_49757: ; 49757
+.Palette_49757:
INCLUDE "gfx/unknown/49757.pal"
-; 49797
-_InitMG_Mobile_LinkTradePalMap: ; 49797
+_InitMG_Mobile_LinkTradePalMap:
hlcoord 0, 0, wAttrMap
lb bc, 16, 2
ld a, $4
@@ -300,9 +283,8 @@ _InitMG_Mobile_LinkTradePalMap: ; 49797
ld bc, 6
call ByteFill
ret
-; 49811
-LoadTradeRoomBGPals: ; 49811
+LoadTradeRoomBGPals:
ld hl, TradeRoomPalette
ld de, wBGPals1 palette PAL_BG_GREEN
ld bc, 6 palettes
@@ -310,16 +292,13 @@ LoadTradeRoomBGPals: ; 49811
call FarCopyWRAM
farcall ApplyPals
ret
-; 49826
-TradeRoomPalette: ; 49826
+TradeRoomPalette:
INCLUDE "gfx/trade/border.pal"
-; 49856
-InitMG_Mobile_LinkTradePalMap: ; 49856
+InitMG_Mobile_LinkTradePalMap:
call _InitMG_Mobile_LinkTradePalMap
ret
-; 4985a
; unused
INCLUDE "gfx/unknown/4985a.asm"
diff --git a/engine/gfx/dma_transfer.asm b/engine/gfx/dma_transfer.asm
index e22adf69a..241649dc5 100644
--- a/engine/gfx/dma_transfer.asm
+++ b/engine/gfx/dma_transfer.asm
@@ -1,4 +1,4 @@
-HDMATransferAttrMapAndTileMapToWRAMBank3:: ; 104000
+HDMATransferAttrMapAndTileMapToWRAMBank3::
ld hl, .Function
jp CallInSafeGFXMode
@@ -18,9 +18,8 @@ HDMATransferAttrMapAndTileMapToWRAMBank3:: ; 104000
ld hl, wScratchAttrMap
call HDMATransferToWRAMBank3
ret
-; 10402d
-HDMATransferTileMapToWRAMBank3:: ; 10402d
+HDMATransferTileMapToWRAMBank3::
ld hl, .Function
jp CallInSafeGFXMode
@@ -33,9 +32,8 @@ HDMATransferTileMapToWRAMBank3:: ; 10402d
ld hl, wScratchTileMap
call HDMATransferToWRAMBank3
ret
-; 104047
-HDMATransferAttrMapToWRAMBank3: ; 104047
+HDMATransferAttrMapToWRAMBank3:
ld hl, .Function
jp CallInSafeGFXMode
@@ -48,9 +46,8 @@ HDMATransferAttrMapToWRAMBank3: ; 104047
ld hl, wScratchAttrMap
call HDMATransferToWRAMBank3
ret
-; 104061
-ReloadMapPart:: ; 104061
+ReloadMapPart::
ld hl, .Function
jp CallInSafeGFXMode
@@ -80,7 +77,7 @@ ReloadMapPart:: ; 104061
ret
-Mobile_ReloadMapPart: ; 104099
+Mobile_ReloadMapPart:
ld hl, ReloadMapPart ; useless
ld hl, .Function
jp CallInSafeGFXMode
@@ -110,7 +107,6 @@ Mobile_ReloadMapPart: ; 104099
ei
ret
-; 1040d4
; unused
ld hl, .unreferenced_1040da
@@ -134,7 +130,6 @@ Mobile_ReloadMapPart: ; 104099
ld [hDMATransfer], a
call WaitDMATransfer
ret
-; 1040fb
; unused
ld hl, .unreferenced_104101
@@ -148,9 +143,8 @@ Mobile_ReloadMapPart: ; 104099
ld hl, w3_d800
call HDMATransferToWRAMBank3
ret
-; 104110
-OpenAndCloseMenu_HDMATransferTileMapAndAttrMap:: ; 104110
+OpenAndCloseMenu_HDMATransferTileMapAndAttrMap::
; OpenText
ld hl, .Function
jp CallInSafeGFXMode
@@ -182,9 +176,8 @@ OpenAndCloseMenu_HDMATransferTileMapAndAttrMap:: ; 104110
ld [rVBK], a
ei
ret
-; 104148
-Mobile_OpenAndCloseMenu_HDMATransferTileMapAndAttrMap: ; 104148 (41:4148)
+Mobile_OpenAndCloseMenu_HDMATransferTileMapAndAttrMap:
ld hl, .Function
jp CallInSafeGFXMode
@@ -209,9 +202,8 @@ Mobile_OpenAndCloseMenu_HDMATransferTileMapAndAttrMap: ; 104148 (41:4148)
ld hl, wScratchTileMap
call HDMATransfer_Wait127Scanlines_toBGMap
ret
-; 104177
-CallInSafeGFXMode: ; 104177
+CallInSafeGFXMode:
ld a, [hBGMapMode]
push af
ld a, [hMapAnims]
@@ -237,19 +229,16 @@ CallInSafeGFXMode: ; 104177
pop af
ld [hBGMapMode], a
ret
-; 10419c
-._hl_ ; 10419c
+._hl_
jp hl
-; 10419d
-
-HDMATransferToWRAMBank3: ; 10419d (41:419d)
+HDMATransferToWRAMBank3:
call _LoadHDMAParameters
ld a, $23
ld [hDMATransfer], a
-WaitDMATransfer: ; 104a14
+WaitDMATransfer:
.loop
call DelayFrame
ld a, [hDMATransfer]
@@ -257,7 +246,7 @@ WaitDMATransfer: ; 104a14
jr nz, .loop
ret
-HDMATransfer_Wait127Scanlines_toBGMap: ; 1041ad (41:41ad)
+HDMATransfer_Wait127Scanlines_toBGMap:
; HDMA transfer from hl to [hBGMapAddress]
; hBGMapAddress -> de
; 2 * SCREEN_HEIGHT -> c
@@ -268,7 +257,7 @@ HDMATransfer_Wait127Scanlines_toBGMap: ; 1041ad (41:41ad)
ld c, 2 * SCREEN_HEIGHT
jr HDMATransfer_Wait127Scanlines
-HDMATransfer_Wait123Scanlines_toBGMap: ; 1041b7 (41:41b7)
+HDMATransfer_Wait123Scanlines_toBGMap:
; HDMA transfer from hl to [hBGMapAddress]
; hBGMapAddress -> de
; 2 * SCREEN_HEIGHT -> c
@@ -279,9 +268,8 @@ HDMATransfer_Wait123Scanlines_toBGMap: ; 1041b7 (41:41b7)
ld e, a
ld c, 2 * SCREEN_HEIGHT
jr HDMATransfer_Wait123Scanlines
-; 1041c1 (41:41c1)
-HDMATransfer_NoDI: ; 1041c1
+HDMATransfer_NoDI:
; HDMA transfer from hl to [hBGMapAddress]
; [hBGMapAddress] --> de
; 2 * SCREEN_HEIGHT --> c
@@ -339,13 +327,11 @@ HDMATransfer_NoDI: ; 1041c1
ld hl, rHDMA5
res 7, [hl]
ret
-; 104205
HDMATransfer_Wait123Scanlines:
ld b, $7b
jr _continue_HDMATransfer
-
HDMATransfer_Wait127Scanlines:
ld b, $7f
_continue_HDMATransfer:
@@ -407,10 +393,8 @@ _continue_HDMATransfer:
ei
ret
-; 10424e
-
-_LoadHDMAParameters: ; 10424e (41:424e)
+_LoadHDMAParameters:
ld a, h
ld [rHDMA1], a
ld a, l
@@ -422,14 +406,14 @@ _LoadHDMAParameters: ; 10424e (41:424e)
ld [rHDMA4], a
ret
-PadTilemapForHDMATransfer: ; 10425f (41:425f)
+PadTilemapForHDMATransfer:
ld c, " "
jr PadMapForHDMATransfer
-PadAttrMapForHDMATransfer: ; 104263 (41:4263)
+PadAttrMapForHDMATransfer:
ld c, $0
-PadMapForHDMATransfer: ; 104265 (41:4265)
+PadMapForHDMATransfer:
; pad a 20x18 map to 32x18 for HDMA transfer
; back up the padding value in c to hMapObjectIndexBuffer
ld a, [hMapObjectIndexBuffer]
@@ -466,8 +450,7 @@ PadMapForHDMATransfer: ; 104265 (41:4265)
ld [hMapObjectIndexBuffer], a
ret
-
-_Get2bpp:: ; 104284
+_Get2bpp::
; 2bpp when [rLCDC] & $80
; switch to WRAM bank 6
ld a, [rSVBK]
@@ -510,9 +493,8 @@ _Get2bpp:: ; 104284
pop af
ld [rSVBK], a
ret
-; 1042b2
-_Get1bpp:: ; 1042b2
+_Get1bpp::
; 1bpp when [rLCDC] & $80
.loop
ld a, c
@@ -537,9 +519,8 @@ _Get1bpp:: ; 1042b2
sub $10
ld c, a
jr .loop
-; 1042d6
-.bankswitch ; 1042d6
+.bankswitch
ld a, [rSVBK]
push af
ld a, BANK(wScratchTileMap)
@@ -576,12 +557,10 @@ _Get1bpp:: ; 1042b2
pop af
ld [rSVBK], a
ret
-; 104303
-HDMATransfer_OnlyTopFourRows: ; 104303
+HDMATransfer_OnlyTopFourRows:
ld hl, .Function
jp CallInSafeGFXMode
-; 104309
.Function:
ld hl, wScratchTileMap
@@ -604,7 +583,7 @@ HDMATransfer_OnlyTopFourRows: ; 104303
call HDMATransfer_Wait127Scanlines
ret
-.Copy: ; 10433a (41:433a)
+.Copy:
ld b, 4
.outer_loop
ld c, SCREEN_WIDTH
@@ -623,4 +602,3 @@ HDMATransfer_OnlyTopFourRows: ; 104303
dec b
jr nz, .outer_loop
ret
-; 104350
diff --git a/engine/gfx/load_font.asm b/engine/gfx/load_font.asm
index 40dbb9c10..41c0721d6 100644
--- a/engine/gfx/load_font.asm
+++ b/engine/gfx/load_font.asm
@@ -5,22 +5,20 @@ INCLUDE "gfx/font.asm"
Unreferenced_fb434:
db 0
-Unreferenced_Functionfb435: ; 4b435
+Unreferenced_Functionfb435:
ld a, [Unreferenced_fb434]
and a
jp nz, Get1bpp_2
jp Get1bpp
-; fb43f
-Unreferenced_Functionfb43f: ; fb43f
+Unreferenced_Functionfb43f:
ld a, [Unreferenced_fb434]
and a
jp nz, Get2bpp_2
jp Get2bpp
; End unreferenced block
-; fb449
-_LoadStandardFont:: ; fb449
+_LoadStandardFont::
ld de, Font
ld hl, vTiles1
lb bc, BANK(Font), 128 ; "A" to "9"
@@ -45,9 +43,8 @@ _LoadStandardFont:: ; fb449
lb bc, BANK(Font), 32 ; "'" to "9"
call Get1bpp_2
ret
-; fb48a
-_LoadFontsExtra1:: ; fb48a
+_LoadFontsExtra1::
ld de, FontsExtra_SolidBlackGFX
ld hl, vTiles2 tile "■" ; $60
lb bc, BANK(FontsExtra_SolidBlackGFX), 1
@@ -61,26 +58,23 @@ _LoadFontsExtra1:: ; fb48a
lb bc, BANK(FontExtra), 22 ; "<BOLD_D>" to "ぉ"
call Get2bpp_2
jr LoadFrame
-; fb4b0
-_LoadFontsExtra2:: ; fb4b0
+_LoadFontsExtra2::
ld de, FontsExtra2_UpArrowGFX
ld hl, vTiles2 tile "▲" ; $61
ld b, BANK(FontsExtra2_UpArrowGFX)
ld c, 1
call Get2bpp_2
ret
-; fb4be
-_LoadFontsBattleExtra:: ; fb4be
+_LoadFontsBattleExtra::
ld de, FontBattleExtra
ld hl, vTiles2 tile $60
lb bc, BANK(FontBattleExtra), 25
call Get2bpp_2
jr LoadFrame
-; fb4cc
-LoadFrame: ; fb4cc
+LoadFrame:
ld a, [wTextBoxFrame]
maskbits NUM_FRAMES
ld bc, 6 * LEN_1BPP_TILE
@@ -96,9 +90,8 @@ LoadFrame: ; fb4cc
lb bc, BANK(TextBoxSpaceGFX), 1
call Get1bpp_2
ret
-; fb4f2
-LoadBattleFontsHPBar: ; fb4f2
+LoadBattleFontsHPBar:
ld de, FontBattleExtra
ld hl, vTiles2 tile $60
lb bc, BANK(FontBattleExtra), 12
@@ -109,7 +102,7 @@ LoadBattleFontsHPBar: ; fb4f2
call Get2bpp_2
call LoadFrame
-LoadHPBar: ; fb50d
+LoadHPBar:
ld de, EnemyHPBarBorderGFX
ld hl, vTiles2 tile $6c
lb bc, BANK(EnemyHPBarBorderGFX), 4
@@ -127,9 +120,8 @@ LoadHPBar: ; fb50d
lb bc, BANK(MobilePhoneTilesGFX), 2
call Get2bpp_2
ret
-; fb53e
-StatsScreen_LoadFont: ; fb53e
+StatsScreen_LoadFont:
call _LoadFontsBattleExtra
ld de, EnemyHPBarBorderGFX
ld hl, vTiles2 tile $6c
@@ -147,10 +139,9 @@ StatsScreen_LoadFont: ; fb53e
ld hl, vTiles2 tile $55
lb bc, BANK(ExpBarGFX), 8
call Get2bpp_2
-LoadStatsScreenPageTilesGFX: ; fb571
+LoadStatsScreenPageTilesGFX:
ld de, StatsScreenPageTilesGFX
ld hl, vTiles2 tile $31
lb bc, BANK(StatsScreenPageTilesGFX), 17
call Get2bpp_2
ret
-; fb57e
diff --git a/engine/gfx/load_overworld_font.asm b/engine/gfx/load_overworld_font.asm
index f23f01c4e..f4ef84619 100644
--- a/engine/gfx/load_overworld_font.asm
+++ b/engine/gfx/load_overworld_font.asm
@@ -1,4 +1,4 @@
-LoadOverworldFont:: ; 106594
+LoadOverworldFont::
ld de, .OverworldFontGFX
ld hl, vTiles1
lb bc, BANK(.OverworldFontGFX), $80
@@ -8,7 +8,6 @@ LoadOverworldFont:: ; 106594
lb bc, BANK(.OverworldFontSpaceGFX), 1
call Get2bpp
ret
-; 1065ad
.OverworldFontGFX:
INCBIN "gfx/font/overworld.2bpp"
diff --git a/engine/gfx/load_pics.asm b/engine/gfx/load_pics.asm
index b533ee56b..64190083d 100644
--- a/engine/gfx/load_pics.asm
+++ b/engine/gfx/load_pics.asm
@@ -1,4 +1,4 @@
-GetUnownLetter: ; 51040
+GetUnownLetter:
; Return Unown letter in wUnownLetter based on DVs at hl
; Take the middle 2 bits of each DV and place them in order:
@@ -48,7 +48,7 @@ GetUnownLetter: ; 51040
ld [wUnownLetter], a
ret
-GetMonFrontpic: ; 51077
+GetMonFrontpic:
ld a, [wCurPartySpecies]
ld [wCurSpecies], a
call IsAPokemon
@@ -60,7 +60,7 @@ GetMonFrontpic: ; 51077
ld [rSVBK], a
ret
-GetAnimatedFrontpic: ; 5108b
+GetAnimatedFrontpic:
ld a, [wCurPartySpecies]
ld [wCurSpecies], a
call IsAPokemon
@@ -75,7 +75,7 @@ GetAnimatedFrontpic: ; 5108b
ld [rSVBK], a
ret
-_GetFrontpic: ; 510a5
+_GetFrontpic:
push de
call GetBaseData
ld a, [wBasePicSize]
@@ -102,7 +102,7 @@ _GetFrontpic: ; 510a5
pop hl
ret
-GetFrontpicPointer: ; 510d7
+GetFrontpicPointer:
ld a, [wCurPartySpecies]
cp UNOWN
jr z, .unown
@@ -129,7 +129,7 @@ GetFrontpicPointer: ; 510d7
pop bc
ret
-GetAnimatedEnemyFrontpic: ; 51103
+GetAnimatedEnemyFrontpic:
ld a, BANK(vTiles3)
ld [rVBK], a
push hl
@@ -158,7 +158,6 @@ GetAnimatedEnemyFrontpic: ; 51103
ld de, wDecompressEnemyFrontpic + 7 * 7 tiles
ld c, 7 * 7
.got_dims
-
push hl
push bc
call LoadFrontpicTiles
@@ -172,7 +171,7 @@ GetAnimatedEnemyFrontpic: ; 51103
ld [rVBK], a
ret
-LoadFrontpicTiles: ; 5114f
+LoadFrontpicTiles:
ld hl, wDecompressScratch
swap c
ld a, c
@@ -193,7 +192,7 @@ LoadFrontpicTiles: ; 5114f
jr nz, .loop
ret
-GetMonBackpic: ; 5116c
+GetMonBackpic:
ld a, [wCurPartySpecies]
call IsAPokemon
ret c
@@ -244,7 +243,7 @@ GetMonBackpic: ; 5116c
ld [rSVBK], a
ret
-FixPicBank: ; 511c5
+FixPicBank:
; This is a thing for some reason.
PICS_FIX EQU $36
@@ -252,7 +251,7 @@ GLOBAL PICS_FIX
push hl
push bc
- sub BANK(Pics_1) - PICS_FIX
+ sub BANK("Pics 1") - PICS_FIX
ld c, a
ld b, 0
ld hl, .PicsBanks
@@ -262,33 +261,33 @@ GLOBAL PICS_FIX
pop hl
ret
-.PicsBanks: ; 511d4
- db BANK(Pics_1) + 0
- db BANK(Pics_1) + 1
- db BANK(Pics_1) + 2
- db BANK(Pics_1) + 3
- db BANK(Pics_1) + 4
- db BANK(Pics_1) + 5
- db BANK(Pics_1) + 6
- db BANK(Pics_1) + 7
- db BANK(Pics_1) + 8
- db BANK(Pics_1) + 9
- db BANK(Pics_1) + 10
- db BANK(Pics_1) + 11
- db BANK(Pics_1) + 12
- db BANK(Pics_1) + 13
- db BANK(Pics_1) + 14
- db BANK(Pics_1) + 15
- db BANK(Pics_1) + 16
- db BANK(Pics_1) + 17
- db BANK(Pics_1) + 18
- db BANK(Pics_1) + 19
- db BANK(Pics_1) + 20
- db BANK(Pics_1) + 21
- db BANK(Pics_1) + 22
- db BANK(Pics_1) + 23
-
-Function511ec: ; 511ec
+.PicsBanks:
+ db BANK("Pics 1") ; BANK("Pics 1") + 0
+ db BANK("Pics 2") ; BANK("Pics 1") + 1
+ db BANK("Pics 3") ; BANK("Pics 1") + 2
+ db BANK("Pics 4") ; BANK("Pics 1") + 3
+ db BANK("Pics 5") ; BANK("Pics 1") + 4
+ db BANK("Pics 6") ; BANK("Pics 1") + 5
+ db BANK("Pics 7") ; BANK("Pics 1") + 6
+ db BANK("Pics 8") ; BANK("Pics 1") + 7
+ db BANK("Pics 9") ; BANK("Pics 1") + 8
+ db BANK("Pics 10") ; BANK("Pics 1") + 9
+ db BANK("Pics 11") ; BANK("Pics 1") + 10
+ db BANK("Pics 12") ; BANK("Pics 1") + 11
+ db BANK("Pics 13") ; BANK("Pics 1") + 12
+ db BANK("Pics 14") ; BANK("Pics 1") + 13
+ db BANK("Pics 15") ; BANK("Pics 1") + 14
+ db BANK("Pics 16") ; BANK("Pics 1") + 15
+ db BANK("Pics 17") ; BANK("Pics 1") + 16
+ db BANK("Pics 18") ; BANK("Pics 1") + 17
+ db BANK("Pics 19") ; BANK("Pics 1") + 18
+ db BANK("Pics 20") ; BANK("Pics 1") + 19
+ db BANK("Pics 21") ; BANK("Pics 1") + 20
+ db BANK("Pics 22") ; BANK("Pics 1") + 21
+ db BANK("Pics 23") ; BANK("Pics 1") + 22
+ db BANK("Pics 24") ; BANK("Pics 1") + 23
+
+Function511ec:
ld a, c
push de
ld hl, PokemonPicPointers
@@ -307,7 +306,7 @@ Function511ec: ; 511ec
call FarDecompress
ret
-GetTrainerPic: ; 5120d
+GetTrainerPic:
ld a, [wTrainerClass]
and a
ret z
@@ -349,7 +348,7 @@ GetTrainerPic: ; 5120d
ld [hBGMapMode], a
ret
-DecompressGet2bpp: ; 5125d
+DecompressGet2bpp:
; Decompress lz data from b:hl to scratch space at 6:d000, then copy it to address de.
ld a, [rSVBK]
@@ -373,7 +372,7 @@ DecompressGet2bpp: ; 5125d
ld [rSVBK], a
ret
-FixBackpicAlignment: ; 5127c
+FixBackpicAlignment:
push de
push bc
ld a, [wBoxAlignment]
@@ -409,7 +408,7 @@ FixBackpicAlignment: ; 5127c
pop de
ret
-PadFrontpic: ; 512ab
+PadFrontpic:
; pads frontpic to fill 7x7 box
ld a, b
cp 6
@@ -418,39 +417,39 @@ PadFrontpic: ; 512ab
jr z, .five
.seven_loop
- ld c, $70
+ ld c, 7 << 4
call LoadOrientedFrontpic
dec b
jr nz, .seven_loop
ret
.six
- ld c, $70
+ ld c, 7 << 4
xor a
call .Fill
.six_loop
- ld c, $10
+ ld c, (7 - 6) << 4
xor a
call .Fill
- ld c, $60
+ ld c, 6 << 4
call LoadOrientedFrontpic
dec b
jr nz, .six_loop
ret
.five
- ld c, $70
+ ld c, 7 << 4
xor a
call .Fill
.five_loop
- ld c, $20
+ ld c, (7 - 5) << 4
xor a
call .Fill
- ld c, $50
+ ld c, 5 << 4
call LoadOrientedFrontpic
dec b
jr nz, .five_loop
- ld c, $70
+ ld c, 7 << 4
xor a
call .Fill
ret
@@ -461,7 +460,7 @@ PadFrontpic: ; 512ab
jr nz, .Fill
ret
-LoadOrientedFrontpic: ; 512f2
+LoadOrientedFrontpic:
ld a, [wBoxAlignment]
and a
jr nz, .x_flip
diff --git a/engine/gfx/load_push_oam.asm b/engine/gfx/load_push_oam.asm
index 95f67ff73..11045bb9d 100644
--- a/engine/gfx/load_push_oam.asm
+++ b/engine/gfx/load_push_oam.asm
@@ -1,4 +1,4 @@
-WriteOAMDMACodeToHRAM:: ; 4031
+WriteOAMDMACodeToHRAM::
ld c, hTransferVirtualOAM - $ff00
ld b, .PushOAMEnd - .PushOAM
ld hl, .PushOAM
@@ -10,7 +10,7 @@ WriteOAMDMACodeToHRAM:: ; 4031
jr nz, .loop
ret
-.PushOAM: ; 403f
+.PushOAM:
ld a, HIGH(wVirtualOAM)
ld [rDMA], a
ld a, NUM_SPRITE_OAM_STRUCTS
diff --git a/engine/gfx/mon_icons.asm b/engine/gfx/mon_icons.asm
index 5a26d2d7c..5ae2fbf8b 100644
--- a/engine/gfx/mon_icons.asm
+++ b/engine/gfx/mon_icons.asm
@@ -1,4 +1,4 @@
-LoadOverworldMonIcon: ; 8e82b
+LoadOverworldMonIcon:
ld a, e
call ReadMonMenuIcon
ld l, a
@@ -12,9 +12,8 @@ LoadOverworldMonIcon: ; 8e82b
ld b, BANK(Icons)
ld c, 8
ret
-; 8e83f
-LoadMenuMonIcon: ; 8e83f
+LoadMenuMonIcon:
push hl
push de
push bc
@@ -23,9 +22,8 @@ LoadMenuMonIcon: ; 8e83f
pop de
pop hl
ret
-; 8e849
-.LoadIcon: ; 8e849
+.LoadIcon:
ld d, 0
ld hl, .Jumptable
add hl, de
@@ -34,10 +32,8 @@ LoadMenuMonIcon: ; 8e83f
ld h, [hl]
ld l, a
jp hl
-; 8e854
-
-.Jumptable: ; 8e854 (23:6854)
+.Jumptable:
dw PartyMenu_InitAnimatedMonIcon ; party menu
dw NamingScreen_InitAnimatedMonIcon ; naming screen
dw MoveList_InitAnimatedMonIcon ; moves (?)
@@ -46,13 +42,13 @@ LoadMenuMonIcon: ; 8e83f
dw Mobile_InitPartyMenuBGPal71 ; mobile
dw .GetPartyMenuMonIcon ; unused
-.GetPartyMenuMonIcon: ; 8e862 (23:6862)
+.GetPartyMenuMonIcon:
call InitPartyMenuIcon
call .GetPartyMonItemGFX
call SetPartyMonIconAnimSpeed
ret
-.GetPartyMonItemGFX: ; 8e86c (23:686c)
+.GetPartyMonItemGFX:
push bc
ld a, [hObjectStructIndexBuffer]
ld hl, wPartyMon1Item
@@ -83,7 +79,7 @@ LoadMenuMonIcon: ; 8e83f
ld [hl], a
ret
-Mobile_InitAnimatedMonIcon: ; 8e898 (23:6898)
+Mobile_InitAnimatedMonIcon:
call PartyMenu_InitAnimatedMonIcon
ld hl, SPRITEANIMSTRUCT_ANIM_SEQ_ID
add hl, bc
@@ -99,7 +95,7 @@ Mobile_InitAnimatedMonIcon: ; 8e898 (23:6898)
ld [hl], a
ret
-Mobile_InitPartyMenuBGPal71: ; 8e8b1 (23:68b1)
+Mobile_InitPartyMenuBGPal71:
call InitPartyMenuIcon
call SetPartyMonIconAnimSpeed
ld hl, SPRITEANIMSTRUCT_ANIM_SEQ_ID
@@ -120,13 +116,13 @@ Mobile_InitPartyMenuBGPal71: ; 8e8b1 (23:68b1)
ld [wc608 + 1], a
ret
-PartyMenu_InitAnimatedMonIcon: ; 8e8d5 (23:68d5)
+PartyMenu_InitAnimatedMonIcon:
call InitPartyMenuIcon
call .SpawnItemIcon
call SetPartyMonIconAnimSpeed
ret
-.SpawnItemIcon: ; 8e8df (23:68df)
+.SpawnItemIcon:
push bc
ld a, [hObjectStructIndexBuffer]
ld hl, wPartyMon1Item
@@ -154,7 +150,7 @@ PartyMenu_InitAnimatedMonIcon: ; 8e8d5 (23:68d5)
ld [hl], a
ret
-InitPartyMenuIcon: ; 8e908 (23:6908)
+InitPartyMenuIcon:
ld a, [wCurIconTile]
push af
ld a, [hObjectStructIndexBuffer]
@@ -185,7 +181,7 @@ InitPartyMenuIcon: ; 8e908 (23:6908)
ld [hl], a
ret
-SetPartyMonIconAnimSpeed: ; 8e936 (23:6936)
+SetPartyMonIconAnimSpeed:
push bc
ld a, [hObjectStructIndexBuffer]
ld b, a
@@ -202,7 +198,7 @@ SetPartyMonIconAnimSpeed: ; 8e936 (23:6936)
ld [hl], a
ret
-.getspeed ; 8e94c (23:694c)
+.getspeed
farcall PlacePartymonHPBar
call GetHPPal
ld e, d
@@ -211,15 +207,13 @@ SetPartyMonIconAnimSpeed: ; 8e936 (23:6936)
add hl, de
ld b, [hl]
ret
-; 8e95e (23:695e)
-.speeds ; 8e95e
+.speeds
db $00 ; HP_GREEN
db $40 ; HP_YELLOW
db $80 ; HP_RED
-; 8e961
-NamingScreen_InitAnimatedMonIcon: ; 8e961 (23:6961)
+NamingScreen_InitAnimatedMonIcon:
ld a, [wd265]
call ReadMonMenuIcon
ld [wCurIcon], a
@@ -233,7 +227,7 @@ NamingScreen_InitAnimatedMonIcon: ; 8e961 (23:6961)
ld [hl], SPRITE_ANIM_SEQ_NULL
ret
-MoveList_InitAnimatedMonIcon: ; 8e97d (23:697d)
+MoveList_InitAnimatedMonIcon:
ld a, [wd265]
call ReadMonMenuIcon
ld [wCurIcon], a
@@ -248,7 +242,7 @@ MoveList_InitAnimatedMonIcon: ; 8e97d (23:697d)
ld [hl], SPRITE_ANIM_SEQ_NULL
ret
-Trade_LoadMonIconGFX: ; 8e99a (23:699a)
+Trade_LoadMonIconGFX:
ld a, [wd265]
call ReadMonMenuIcon
ld [wCurIcon], a
@@ -257,7 +251,7 @@ Trade_LoadMonIconGFX: ; 8e99a (23:699a)
call GetMemIconGFX
ret
-GetSpeciesIcon: ; 8e9ac
+GetSpeciesIcon:
; Load species icon into VRAM at tile a
push de
ld a, [wd265]
@@ -267,10 +261,8 @@ GetSpeciesIcon: ; 8e9ac
ld a, e
call GetIconGFX
ret
-; 8e9bc
-
-FlyFunction_GetMonIcon: ; 8e9bc (23:69bc)
+FlyFunction_GetMonIcon:
push de
ld a, [wd265]
call ReadMonMenuIcon
@@ -279,9 +271,8 @@ FlyFunction_GetMonIcon: ; 8e9bc (23:69bc)
ld a, e
call GetIcon_a
ret
-; 8e9cc (23:69cc)
-Unreferenced_GetMonIcon2: ; 8e9cc
+Unreferenced_GetMonIcon2:
push de
ld a, [wd265]
call ReadMonMenuIcon
@@ -289,11 +280,10 @@ Unreferenced_GetMonIcon2: ; 8e9cc
pop de
call GetIcon_de
ret
-; 8e9db
-GetMemIconGFX: ; 8e9db (23:69db)
+GetMemIconGFX:
ld a, [wCurIconTile]
-GetIconGFX: ; 8e9de
+GetIconGFX:
call GetIcon_a
ld de, 8 tiles
add hl, de
@@ -308,20 +298,19 @@ GetIconGFX: ; 8e9de
HeldItemIcons:
INCBIN "gfx/icons/mail.2bpp"
INCBIN "gfx/icons/item.2bpp"
-; 8ea17
-GetIcon_de: ; 8ea17
+GetIcon_de:
; Load icon graphics into VRAM starting from tile de.
ld l, e
ld h, d
jr GetIcon
-GetIcon_a: ; 8ea1b
+GetIcon_a:
; Load icon graphics into VRAM starting from tile a.
ld l, a
ld h, 0
-GetIcon: ; 8ea1e
+GetIcon:
; Load icon graphics into VRAM starting from tile hl.
; One tile is 16 bytes long.
@@ -352,16 +341,14 @@ endr
pop hl
ret
-; 8ea3f
-GetGFXUnlessMobile: ; 8ea3f
+GetGFXUnlessMobile:
ld a, [wLinkMode]
cp LINK_MOBILE
jp nz, Request2bpp
jp Get2bpp_2
-; 8ea4a
-FreezeMonIcons: ; 8ea4a
+FreezeMonIcons:
ld hl, wSpriteAnimationStructs
ld e, PARTY_LENGTH
ld a, [wMenuCursorY]
@@ -393,9 +380,8 @@ FreezeMonIcons: ; 8ea4a
dec e
jr nz, .loop
ret
-; 8ea71
-UnfreezeMonIcons: ; 8ea71
+UnfreezeMonIcons:
ld hl, wSpriteAnimationStructs
ld e, PARTY_LENGTH
.loop
@@ -415,9 +401,8 @@ UnfreezeMonIcons: ; 8ea71
dec e
jr nz, .loop
ret
-; 8ea8c (23:6a8c)
-HoldSwitchmonIcon: ; 8ea8c
+HoldSwitchmonIcon:
ld hl, wSpriteAnimationStructs
ld e, PARTY_LENGTH
ld a, [wSwitchMon]
@@ -448,7 +433,7 @@ HoldSwitchmonIcon: ; 8ea8c
jr nz, .loop
ret
-ReadMonMenuIcon: ; 8eab3
+ReadMonMenuIcon:
cp EGG
jr z, .egg
dec a
@@ -461,8 +446,6 @@ ReadMonMenuIcon: ; 8eab3
.egg
ld a, ICON_EGG
ret
-; 8eac4
-
INCLUDE "data/pokemon/menu_icons.asm"
diff --git a/engine/gfx/pic_animation.asm b/engine/gfx/pic_animation.asm
index 54999a6bb..843e5cba4 100644
--- a/engine/gfx/pic_animation.asm
+++ b/engine/gfx/pic_animation.asm
@@ -1,6 +1,6 @@
; Pic animation arrangement.
-Unused_AnimateMon_Slow_Normal: ; d0000
+Unused_AnimateMon_Slow_Normal:
hlcoord 12, 0
ld a, [wBattleMode]
cp WILD_BATTLE
@@ -15,42 +15,36 @@ Unused_AnimateMon_Slow_Normal: ; d0000
ld d, $0
call AnimateFrontpic
ret
-; d001a
-AnimateMon_Menu: ; d001a
+AnimateMon_Menu:
ld e, ANIM_MON_MENU
ld d, $0
call AnimateFrontpic
ret
-; d0022
-AnimateMon_Trade: ; d0022
+AnimateMon_Trade:
ld e, ANIM_MON_TRADE
ld d, $0
call AnimateFrontpic
ret
-; d002a
-AnimateMon_Evolve: ; d002a
+AnimateMon_Evolve:
ld e, ANIM_MON_EVOLVE
ld d, $0
call AnimateFrontpic
ret
-; d0032
-AnimateMon_Hatch: ; d0032
+AnimateMon_Hatch:
ld e, ANIM_MON_HATCH
ld d, $0
call AnimateFrontpic
ret
-; d003a
-AnimateMon_Unused: ; d003a
+AnimateMon_Unused:
ld e, ANIM_MON_UNUSED
ld d, $0
call AnimateFrontpic
ret
-; d0042
pokeanim: MACRO
rept _NARG
@@ -64,7 +58,7 @@ endr
db (PokeAnim_Finish_ - PokeAnim_SetupCommands) / 2
ENDM
-PokeAnims: ; d0042
+PokeAnims:
dw .Slow
dw .Normal
dw .Menu
@@ -85,8 +79,7 @@ PokeAnims: ; d0042
.Egg1: pokeanim Setup, Play
.Egg2: pokeanim Idle, Play
-
-AnimateFrontpic: ; d008e
+AnimateFrontpic:
call AnimateMon_CheckIfPokemon
ret c
call LoadMonAnimation
@@ -97,9 +90,8 @@ AnimateFrontpic: ; d008e
pop af
jr nc, .loop
ret
-; d00a3
-LoadMonAnimation: ; d00a3
+LoadMonAnimation:
push hl
ld c, e
ld b, 0
@@ -112,9 +104,8 @@ LoadMonAnimation: ; d00a3
pop hl
call PokeAnim_InitPicAttributes
ret
-; d00b4
-SetUpPokeAnim: ; d00b4
+SetUpPokeAnim:
ld a, [rSVBK]
push af
ld a, BANK(wPokeAnimSceneIndex)
@@ -139,9 +130,8 @@ SetUpPokeAnim: ; d00b4
ret z
scf
ret
-; d00da
-PokeAnim_SetupCommands: ; d00da
+PokeAnim_SetupCommands:
setup_command: MACRO
\1_: dw \1
ENDM
@@ -157,16 +147,15 @@ ENDM
setup_command PokeAnim_Cry
setup_command PokeAnim_CryNoWait
setup_command PokeAnim_StereoCry
-; d00f2
-PokeAnim_SetWait: ; d00f2
+PokeAnim_SetWait:
ld a, 18
ld [wPokeAnimWaitCounter], a
ld a, [wPokeAnimSceneIndex]
inc a
ld [wPokeAnimSceneIndex], a
-PokeAnim_Wait: ; d00fe
+PokeAnim_Wait:
ld hl, wPokeAnimWaitCounter
dec [hl]
ret nz
@@ -174,9 +163,8 @@ PokeAnim_Wait: ; d00fe
inc a
ld [wPokeAnimSceneIndex], a
ret
-; d010b
-PokeAnim_Setup: ; d010b
+PokeAnim_Setup:
ld c, FALSE
ld b, 0
call PokeAnim_InitAnim
@@ -185,9 +173,8 @@ PokeAnim_Setup: ; d010b
inc a
ld [wPokeAnimSceneIndex], a
ret
-; d011d
-PokeAnim_Setup2: ; d011d
+PokeAnim_Setup2:
ld c, FALSE
ld b, 4
call PokeAnim_InitAnim
@@ -196,9 +183,8 @@ PokeAnim_Setup2: ; d011d
inc a
ld [wPokeAnimSceneIndex], a
ret
-; d012f
-PokeAnim_Idle: ; d012f
+PokeAnim_Idle:
ld c, TRUE
ld b, 0
call PokeAnim_InitAnim
@@ -207,9 +193,8 @@ PokeAnim_Idle: ; d012f
inc a
ld [wPokeAnimSceneIndex], a
ret
-; d0141
-PokeAnim_Play: ; d0141
+PokeAnim_Play:
call PokeAnim_DoAnimScript
ld a, [wPokeAnimJumptableIndex]
bit 7, a
@@ -219,9 +204,8 @@ PokeAnim_Play: ; d0141
inc a
ld [wPokeAnimSceneIndex], a
ret
-; d0155
-PokeAnim_Play2: ; d0155
+PokeAnim_Play2:
call PokeAnim_DoAnimScript
ld a, [wPokeAnimJumptableIndex]
bit 7, a
@@ -230,42 +214,37 @@ PokeAnim_Play2: ; d0155
inc a
ld [wPokeAnimSceneIndex], a
ret
-; d0166
-PokeAnim_BasePic: ; d0166
+PokeAnim_BasePic:
call PokeAnim_DeinitFrames
ld a, [wPokeAnimSceneIndex]
inc a
ld [wPokeAnimSceneIndex], a
ret
-; d0171
-PokeAnim_Finish: ; d0171
+PokeAnim_Finish:
call PokeAnim_DeinitFrames
ld hl, wPokeAnimSceneIndex
set 7, [hl]
ret
-; d017a
-PokeAnim_Cry: ; d017a
+PokeAnim_Cry:
ld a, [wPokeAnimSpecies]
call _PlayMonCry
ld a, [wPokeAnimSceneIndex]
inc a
ld [wPokeAnimSceneIndex], a
ret
-; d0188
-PokeAnim_CryNoWait: ; d0188
+PokeAnim_CryNoWait:
ld a, [wPokeAnimSpecies]
call PlayMonCry2
ld a, [wPokeAnimSceneIndex]
inc a
ld [wPokeAnimSceneIndex], a
ret
-; d0196
-PokeAnim_StereoCry: ; d0196
+PokeAnim_StereoCry:
ld a, $f
ld [wCryTracks], a
ld a, [wPokeAnimSpecies]
@@ -274,9 +253,8 @@ PokeAnim_StereoCry: ; d0196
inc a
ld [wPokeAnimSceneIndex], a
ret
-; d01a9
-PokeAnim_DeinitFrames: ; d01a9
+PokeAnim_DeinitFrames:
ld a, [rSVBK]
push af
ld a, BANK(wPokeAnimCoord)
@@ -288,9 +266,8 @@ PokeAnim_DeinitFrames: ; d01a9
pop af
ld [rSVBK], a
ret
-; d01c6
-AnimateMon_CheckIfPokemon: ; d01c6
+AnimateMon_CheckIfPokemon:
ld a, [wCurPartySpecies]
cp EGG
jr z, .fail
@@ -302,9 +279,8 @@ AnimateMon_CheckIfPokemon: ; d01c6
.fail
scf
ret
-; d01d6
-PokeAnim_InitPicAttributes: ; d01d6
+PokeAnim_InitPicAttributes:
ld a, [rSVBK]
push af
ld a, BANK(wPokeAnimSceneIndex)
@@ -355,9 +331,8 @@ PokeAnim_InitPicAttributes: ; d01d6
pop af
ld [rSVBK], a
ret
-; d0228
-PokeAnim_InitAnim: ; d0228
+PokeAnim_InitAnim:
ld a, [rSVBK]
push af
ld a, BANK(wPokeAnimIdleFlag)
@@ -378,9 +353,8 @@ PokeAnim_InitAnim: ; d0228
pop af
ld [rSVBK], a
ret
-; d0250
-PokeAnim_DoAnimScript: ; d0250
+PokeAnim_DoAnimScript:
xor a
ld [hBGMapMode], a
.loop
@@ -389,43 +363,39 @@ PokeAnim_DoAnimScript: ; d0250
ld hl, .Jumptable
rst JumpTable
ret
-; d025d
-.Jumptable: ; d025d
+.Jumptable:
dw .RunAnim
dw .WaitAnim
-; d0261
-.RunAnim: ; d0261
+.RunAnim:
call PokeAnim_GetPointer
ld a, [wPokeAnimCommand]
- cp -1
+ cp endanim_command
jr z, PokeAnim_End
- cp -2
+ cp setrepeat_command
jr z, .SetRepeat
- cp -3
+ cp dorepeat_command
jr z, .DoRepeat
call PokeAnim_GetFrame
ld a, [wPokeAnimParameter]
call PokeAnim_GetDuration
ld [wPokeAnimWaitCounter], a
call PokeAnim_StartWaitAnim
-.WaitAnim: ; d0282
+.WaitAnim:
ld a, [wPokeAnimWaitCounter]
dec a
ld [wPokeAnimWaitCounter], a
ret nz
call PokeAnim_StopWaitAnim
ret
-; d028e
-.SetRepeat: ; d028e
+.SetRepeat:
ld a, [wPokeAnimParameter]
ld [wPokeAnimRepeatTimer], a
jr .loop
-; d0296
-.DoRepeat: ; d0296
+.DoRepeat:
ld a, [wPokeAnimRepeatTimer]
and a
ret z
@@ -435,15 +405,13 @@ PokeAnim_DoAnimScript: ; d0250
ld a, [wPokeAnimParameter]
ld [wPokeAnimFrame], a
jr .loop
-; d02a8
-PokeAnim_End: ; d02a8
+PokeAnim_End:
ld hl, wPokeAnimJumptableIndex
set 7, [hl]
ret
-; d02ae
-PokeAnim_GetDuration: ; d02ae
+PokeAnim_GetDuration:
; a * (1 + [wPokeAnimSpeed] / 16)
ld c, a
ld b, $0
@@ -460,9 +428,8 @@ PokeAnim_GetDuration: ; d02ae
or h
add c
ret
-; d02c8
-PokeAnim_GetFrame: ; d02c8
+PokeAnim_GetFrame:
call PokeAnim_PlaceGraphic
ld a, [wPokeAnimCommand]
and a
@@ -473,35 +440,30 @@ PokeAnim_GetFrame: ; d02c8
pop hl
call PokeAnim_ConvertAndApplyBitmask
ret
-; d02dc
-PokeAnim_StartWaitAnim: ; d02dc
+PokeAnim_StartWaitAnim:
ld a, [wPokeAnimJumptableIndex]
inc a
ld [wPokeAnimJumptableIndex], a
ret
-; d02e4
-PokeAnim_StopWaitAnim: ; d02e4
+PokeAnim_StopWaitAnim:
ld a, [wPokeAnimJumptableIndex]
dec a
ld [wPokeAnimJumptableIndex], a
ret
-; d02ec
-PokeAnim_IsUnown: ; d02ec
+PokeAnim_IsUnown:
ld a, [wPokeAnimSpecies]
cp UNOWN
ret
-; d02f2
-PokeAnim_IsEgg: ; d02f2
+PokeAnim_IsEgg:
ld a, [wPokeAnimSpecies]
cp EGG
ret
-; d02f8
-PokeAnim_GetPointer: ; d02f8
+PokeAnim_GetPointer:
push hl
ld a, [wPokeAnimFrame]
ld e, a
@@ -522,9 +484,8 @@ PokeAnim_GetPointer: ; d02f8
inc [hl]
pop hl
ret
-; d031b
-PokeAnim_GetBitmaskIndex: ; d031b
+PokeAnim_GetBitmaskIndex:
ld a, [wPokeAnimCommand]
dec a
ld c, a
@@ -542,9 +503,8 @@ PokeAnim_GetBitmaskIndex: ; d031b
ld [wPokeAnimCurBitmask], a
inc hl
ret
-; d033b
-PokeAnim_CopyBitmaskToBuffer: ; d033b
+PokeAnim_CopyBitmaskToBuffer:
call .GetSize
push bc
ld hl, wPokeAnimBitmaskAddr
@@ -558,9 +518,8 @@ PokeAnim_CopyBitmaskToBuffer: ; d033b
ld a, [wPokeAnimBitmaskBank]
call FarCopyBytes
ret
-; d0356
-.GetSize: ; d0356
+.GetSize:
push hl
ld a, [wPokeAnimFrontpicHeight]
sub 5 ; to get a number 0, 1, or 2
@@ -572,7 +531,6 @@ PokeAnim_CopyBitmaskToBuffer: ; d033b
ld b, 0
pop hl
ret
-; d0368
.Sizes: db 4, 5, 7
@@ -588,7 +546,7 @@ y = y + 7
endr
ENDM
-PokeAnim_ConvertAndApplyBitmask: ; d036b
+PokeAnim_ConvertAndApplyBitmask:
xor a
ld [wPokeAnimBitmaskCurBit], a
ld [wPokeAnimBitmaskCurRow], a
@@ -614,9 +572,8 @@ PokeAnim_ConvertAndApplyBitmask: ; d036b
pop hl
jr nc, .loop
ret
-; d0392
-.IsCurBitSet: ; d0392
+.IsCurBitSet:
; which byte
ld a, [wPokeAnimBitmaskCurBit]
and $f8
@@ -652,9 +609,8 @@ PokeAnim_ConvertAndApplyBitmask: ; d036b
ld hl, wPokeAnimBitmaskCurBit
inc [hl]
ret
-; d03bd
-.ApplyFrame: ; d03bd
+.ApplyFrame:
push af
call .GetCoord
pop af
@@ -665,9 +621,8 @@ PokeAnim_ConvertAndApplyBitmask: ; d036b
pop hl
ld [hl], a
ret
-; d03cd
-.GetCoord: ; d03cd
+.GetCoord:
call .GetStartCoord
ld a, [wPokeAnimBitmaskCurRow]
ld bc, SCREEN_WIDTH
@@ -693,12 +648,11 @@ PokeAnim_ConvertAndApplyBitmask: ; d036b
.skip2
ret
-; d03f4
; unused
db 6, 5, 4
-.GetTilemap: ; d03f7
+.GetTilemap:
push af
ld a, [wPokeAnimFrontpicHeight]
cp 5
@@ -745,7 +699,6 @@ PokeAnim_ConvertAndApplyBitmask: ; d036b
.add_13
add 13
ret
-; d042f
._5by5:
poke_anim_box 5
@@ -764,8 +717,7 @@ PokeAnim_ConvertAndApplyBitmask: ; d036b
; db 36, 37, 38, 39, 40, 41
; db 43, 44, 45, 46, 47, 48
-
-.GetStartCoord: ; d046c
+.GetStartCoord:
ld hl, wPokeAnimCoord
ld a, [hli]
ld h, [hl]
@@ -793,9 +745,8 @@ PokeAnim_ConvertAndApplyBitmask: ; d036b
.add_bc
add hl, bc
ret
-; d0499
-.NextBit: ; d0499
+.NextBit:
ld a, [wPokeAnimBitmaskCurRow]
inc a
ld [wPokeAnimBitmaskCurRow], a
@@ -818,9 +769,8 @@ PokeAnim_ConvertAndApplyBitmask: ; d036b
.no_carry
xor a
ret
-; d04bd
-PokeAnim_PlaceGraphic: ; d04bd
+PokeAnim_PlaceGraphic:
call .ClearBox
ld a, [wBoxAlignment]
and a
@@ -860,9 +810,8 @@ PokeAnim_PlaceGraphic: ; d04bd
dec c
jr nz, .loop
ret
-; d04f6
-.ClearBox: ; d04f6
+.ClearBox:
ld hl, wPokeAnimCoord
ld a, [hli]
ld h, [hl]
@@ -871,9 +820,8 @@ PokeAnim_PlaceGraphic: ; d04bd
ld c, 7
call ClearBox
ret
-; d0504
-PokeAnim_SetVBank1: ; d0504
+PokeAnim_SetVBank1:
ld a, [rSVBK]
push af
ld a, BANK(wPokeAnimCoord)
@@ -885,9 +833,8 @@ PokeAnim_SetVBank1: ; d0504
pop af
ld [rSVBK], a
ret
-; d051b
-.SetFlag: ; d051b
+.SetFlag:
call PokeAnim_GetAttrMapCoord
ld b, 7
ld c, 7
@@ -908,9 +855,8 @@ PokeAnim_SetVBank1: ; d0504
dec b
jr nz, .row
ret
-; d0536
-PokeAnim_SetVBank0: ; d0536
+PokeAnim_SetVBank0:
call PokeAnim_GetAttrMapCoord
ld b, 7
ld c, 7
@@ -931,9 +877,8 @@ PokeAnim_SetVBank0: ; d0536
dec b
jr nz, .row
ret
-; d0551
-PokeAnim_GetAttrMapCoord: ; d0551
+PokeAnim_GetAttrMapCoord:
ld hl, wPokeAnimCoord
ld a, [hli]
ld h, [hl]
@@ -941,9 +886,8 @@ PokeAnim_GetAttrMapCoord: ; d0551
ld de, wAttrMap - wTileMap
add hl, de
ret
-; d055c
-GetMonAnimPointer: ; d055c
+GetMonAnimPointer:
call PokeAnim_IsEgg
jr z, .egg
@@ -996,9 +940,8 @@ GetMonAnimPointer: ; d055c
ld a, h
ld [wPokeAnimPointerAddr + 1], a
ret
-; d05b4
-PokeAnim_GetFrontpicDims: ; d05b4
+PokeAnim_GetFrontpicDims:
ld a, [rSVBK]
push af
ld a, BANK(wCurPartySpecies)
@@ -1012,9 +955,8 @@ PokeAnim_GetFrontpicDims: ; d05b4
pop af
ld [rSVBK], a
ret
-; d05ce
-GetMonFramesPointer: ; d05ce
+GetMonFramesPointer:
call PokeAnim_IsEgg
jr z, .egg
@@ -1058,9 +1000,8 @@ GetMonFramesPointer: ; d05ce
ld a, h
ld [wPokeAnimFramesAddr + 1], a
ret
-; d061b
-GetMonBitmaskPointer: ; d061b
+GetMonBitmaskPointer:
call PokeAnim_IsEgg
jr z, .egg
@@ -1097,9 +1038,8 @@ GetMonBitmaskPointer: ; d061b
ld a, h
ld [wPokeAnimBitmaskAddr + 1], a
ret
-; d065c
-PokeAnim_GetSpeciesOrUnown: ; d065c
+PokeAnim_GetSpeciesOrUnown:
call PokeAnim_IsUnown
jr z, .unown
ld a, [wPokeAnimSpecies]
@@ -1108,13 +1048,12 @@ PokeAnim_GetSpeciesOrUnown: ; d065c
.unown
ld a, [wPokeAnimUnownLetter]
ret
-; d0669
-Unused_HOF_AnimateAlignedFrontpic: ; d0669
+Unused_HOF_AnimateAlignedFrontpic:
ld a, $1
ld [wBoxAlignment], a
-HOF_AnimateFrontpic: ; d066e
+HOF_AnimateFrontpic:
call AnimateMon_CheckIfPokemon
jr c, .fail
ld h, d
@@ -1138,4 +1077,3 @@ HOF_AnimateFrontpic: ; d066e
inc a
ld [wCurPartySpecies], a
ret
-; d0695
diff --git a/engine/gfx/place_graphic.asm b/engine/gfx/place_graphic.asm
index 21b914950..628c72413 100644
--- a/engine/gfx/place_graphic.asm
+++ b/engine/gfx/place_graphic.asm
@@ -1,4 +1,4 @@
-PlaceGraphic: ; 2ef6e
+PlaceGraphic:
; Fill wBoxAlignment-aligned box width b height c
; with iterating tile starting from hGraphicStartTile at hl.
diff --git a/engine/gfx/player_gfx.asm b/engine/gfx/player_gfx.asm
index deb16ad3a..9954143a8 100644
--- a/engine/gfx/player_gfx.asm
+++ b/engine/gfx/player_gfx.asm
@@ -1,4 +1,4 @@
-Unreferenced_Function88248: ; 88248
+Unreferenced_Function88248:
ld c, CAL
ld a, [wPlayerGender]
bit PLAYERGENDER_FEMALE_F, a
@@ -10,17 +10,17 @@ Unreferenced_Function88248: ; 88248
ld [wTrainerClass], a
ret
-MovePlayerPicRight: ; 88258
+MovePlayerPicRight:
hlcoord 6, 4
ld de, 1
jr MovePlayerPic
-MovePlayerPicLeft: ; 88260
+MovePlayerPicLeft:
hlcoord 13, 4
ld de, -1
; fallthrough
-MovePlayerPic: ; 88266
+MovePlayerPic:
; Move player pic at hl by de * 7 tiles.
ld c, $8
.loop
@@ -55,7 +55,7 @@ MovePlayerPic: ; 88266
pop hl
jr .loop
-ShowPlayerNamingChoices: ; 88297
+ShowPlayerNamingChoices:
ld hl, ChrisNameMenuHeader
ld a, [wPlayerGender]
bit PLAYERGENDER_FEMALE_F, a
@@ -72,7 +72,7 @@ ShowPlayerNamingChoices: ; 88297
INCLUDE "data/player_names.asm"
-GetPlayerNameArray: ; 88318 This Function is never called
+Unreferenced_GetPlayerNameArray:
ld hl, wPlayerName
ld de, MalePlayerNameArray
ld a, [wPlayerGender]
@@ -84,7 +84,7 @@ GetPlayerNameArray: ; 88318 This Function is never called
call InitName
ret
-GetPlayerIcon: ; 8832c
+GetPlayerIcon:
; Get the player icon corresponding to gender
; Male
@@ -102,7 +102,7 @@ GetPlayerIcon: ; 8832c
.done
ret
-GetCardPic: ; 8833e
+GetCardPic:
ld hl, ChrisCardPic
ld a, [wPlayerGender]
bit PLAYERGENDER_FEMALE_F, a
@@ -120,23 +120,23 @@ GetCardPic: ; 8833e
call FarCopyBytes
ret
-ChrisCardPic: ; 88365
+ChrisCardPic:
INCBIN "gfx/trainer_card/chris_card.2bpp"
-KrisCardPic: ; 88595
+KrisCardPic:
INCBIN "gfx/trainer_card/kris_card.2bpp"
-CardGFX: ; 887c5
+CardGFX:
INCBIN "gfx/trainer_card/trainer_card.2bpp"
-GetPlayerBackpic: ; 88825
+GetPlayerBackpic:
ld a, [wPlayerGender]
bit PLAYERGENDER_FEMALE_F, a
jr z, GetChrisBackpic
call GetKrisBackpic
ret
-GetChrisBackpic: ; 88830
+GetChrisBackpic:
ld hl, ChrisBackpic
ld b, BANK(ChrisBackpic)
ld de, vTiles2 tile $31
@@ -144,7 +144,7 @@ GetChrisBackpic: ; 88830
predef DecompressGet2bpp
ret
-HOF_LoadTrainerFrontpic: ; 88840
+HOF_LoadTrainerFrontpic:
call WaitBGMap
xor a
ld [hBGMapMode], a
@@ -173,7 +173,7 @@ HOF_LoadTrainerFrontpic: ; 88840
ld [hBGMapMode], a
ret
-DrawIntroPlayerPic: ; 88874
+DrawIntroPlayerPic:
; Draw the player pic at (6,4).
; Get class
@@ -206,13 +206,13 @@ DrawIntroPlayerPic: ; 88874
predef PlaceGraphic
ret
-ChrisPic: ; 888a9
+ChrisPic:
INCBIN "gfx/player/chris.2bpp"
-KrisPic: ; 88bb9
+KrisPic:
INCBIN "gfx/player/kris.2bpp"
-GetKrisBackpic: ; 88ec9
+GetKrisBackpic:
; Kris's backpic is uncompressed.
ld de, KrisBackpic
ld hl, vTiles2 tile $31
@@ -220,5 +220,5 @@ GetKrisBackpic: ; 88ec9
call Get2bpp
ret
-KrisBackpic: ; 88ed6
+KrisBackpic:
INCBIN "gfx/player/kris_back.2bpp"
diff --git a/engine/gfx/sgb_layouts.asm b/engine/gfx/sgb_layouts.asm
index 24bdc952e..538132ce2 100644
--- a/engine/gfx/sgb_layouts.asm
+++ b/engine/gfx/sgb_layouts.asm
@@ -1,4 +1,4 @@
-LoadSGBLayout: ; 864c
+LoadSGBLayout:
call CheckCGB
jp nz, LoadSGBLayoutCGB
@@ -20,9 +20,8 @@ LoadSGBLayout: ; 864c
ld de, _LoadSGBLayout_ReturnFromJumpTable
push de
jp hl
-; 866f
-.Jumptable: ; 866f
+.Jumptable:
dw .SGB_BattleGrayscale
dw .SGB_BattleColors
dw .SGB_PokegearPals
@@ -38,9 +37,9 @@ LoadSGBLayout: ; 864c
dw .SGB_GSTitleScreen
dw .SGB0d
dw .SGB_MoveList
- dw .SGB0f
+ dw .SGB_BetaPikachuMinigame
dw .SGB_PokedexSearchOption
- dw .SGB11
+ dw .SGB_BetaPoker
dw .SGB12
dw .SGB13
dw .SGB_PackPals
@@ -54,15 +53,13 @@ LoadSGBLayout: ; 864c
dw .SGB_TrainerOrMonFrontpicPals
dw .SGB_MysteryGift
dw .SGB1e
-; 86ad
-.SGB_BattleGrayscale: ; 86ad
+.SGB_BattleGrayscale:
ld hl, PalPacket_BattleGrayscale
ld de, BlkPacket_Battle
ret
-; 86b4
-.SGB_BattleColors: ; 86b4
+.SGB_BattleColors:
ld hl, BlkPacket_Battle
call PushSGBPals_
@@ -135,9 +132,8 @@ LoadSGBLayout: ; 864c
ld a, SCGB_BATTLE_COLORS
ld [wSGBPredef], a
ret
-; 873c
-.SGB_MoveList: ; 873c
+.SGB_MoveList:
ld hl, PalPacket_9bd6
ld de, wSGBPals
ld bc, PALPACKET_LENGTH
@@ -154,15 +150,13 @@ LoadSGBLayout: ; 864c
ld hl, wSGBPals
ld de, BlkPacket_MoveList
ret
-; 875c
-.SGB_PokegearPals: ; 875c
+.SGB_PokegearPals:
ld hl, PalPacket_Pokegear
ld de, BlkPacket_9a86
ret
-; 8763
-.SGB_StatsScreenHPPals: ; 8763
+.SGB_StatsScreenHPPals:
ld hl, PalPacket_9ce6
ld de, wSGBPals
ld bc, PALPACKET_LENGTH
@@ -196,15 +190,13 @@ LoadSGBLayout: ; 864c
ld hl, wSGBPals
ld de, BlkPacket_StatsScreen
ret
-; 87ab
-.SGB_PartyMenu: ; 87ab
+.SGB_PartyMenu:
ld hl, PalPacket_PartyMenu
ld de, wSGBPals + 1
ret
-; 87b2
-.SGB_Pokedex: ; 87b2
+.SGB_Pokedex:
ld hl, PalPacket_9ce6
ld de, wSGBPals
ld bc, PALPACKET_LENGTH
@@ -230,9 +222,8 @@ LoadSGBLayout: ; 864c
ld hl, wSGBPals
ld de, BlkPacket_Pokedex_PC
ret
-; 87e9
-.SGB_BillsPC: ; 87e9
+.SGB_BillsPC:
ld hl, PalPacket_9ce6
ld de, wSGBPals
ld bc, PALPACKET_LENGTH
@@ -259,15 +250,13 @@ LoadSGBLayout: ; 864c
ld hl, wSGBPals
ld de, BlkPacket_Pokedex_PC
ret
-; 8823
-.SGB_PokedexUnownMode: ; 8823
+.SGB_PokedexUnownMode:
call .SGB_Pokedex
ld de, BlkPacket_PokedexUnownMode
ret
-; 882a
-.SGB_PokedexSearchOption: ; 882a
+.SGB_PokedexSearchOption:
ld hl, PalPacket_9ce6
ld de, wSGBPals
ld bc, PALPACKET_LENGTH
@@ -283,34 +272,29 @@ LoadSGBLayout: ; 864c
ld hl, wSGBPals
ld de, BlkPacket_9a86
ret
-; 884b
-.SGB_PackPals: ; 884b
+.SGB_PackPals:
ld hl, PalPacket_Pack
ld de, BlkPacket_9a86
ret
-; 8852
-.SGB_SlotMachine: ; 8852
+.SGB_SlotMachine:
ld hl, PalPacket_SlotMachine
ld de, BlkPacket_SlotMachine
ret
-; 8859
-.SGB06: ; 8859
+.SGB06:
ld hl, PalPacket_SCGB_06
ld de, BlkPacket_SCGB_06
ret
-; 8860
.SGB_Diploma:
-.SGB_MysteryGift: ; 8860
+.SGB_MysteryGift:
ld hl, PalPacket_Diploma
ld de, BlkPacket_9a86
ret
-; 8867
-.SGB_GSIntro: ; 8867
+.SGB_GSIntro:
ld b, 0
ld hl, .BlkPacketTable_GSIntro
rept 4
@@ -324,45 +308,39 @@ endr
ld h, [hl]
ld l, a
ret
-; 8878
-.BlkPacketTable_GSIntro: ; 8878
+.BlkPacketTable_GSIntro:
dw BlkPacket_9a86, PalPacket_GSIntroShellderLapras
dw BlkPacket_GSIntroJigglypuffPikachu, PalPacket_GSIntroJigglypuffPikachu
dw BlkPacket_9a86, PalPacket_GSIntroStartersTransition
-; 8884
-.SGB_GSTitleScreen: ; 8884
+.SGB_GSTitleScreen:
ld hl, PalPacket_GSTitleScreen
ld de, BlkPacket_GSTitleScreen
ld a, SCGB_DIPLOMA
ld [wSGBPredef], a
ret
-; 8890
-.SGB13: ; 8890
+.SGB13:
ld hl, PalPacket_SCGB_13
ld de, BlkPacket_SCGB_13
ret
-; 8897
-.SGB0f: ; 8897
- ld hl, PalPacket_SCGB_0F
+.SGB_BetaPikachuMinigame:
+ ld hl, PalPacket_BetaPikachuMinigame
ld de, BlkPacket_9a86
ret
-; 889e
-.SGB11: ; 889e
+.SGB_BetaPoker:
ld hl, BlkPacket_9a86
ld de, wPlayerLightScreenCount ; ???
ld bc, PALPACKET_LENGTH
call CopyBytes
- ld hl, PalPacket_SCGB_11
+ ld hl, PalPacket_BetaPoker
ld de, BlkPacket_9a86
ret
-; 88b1
-.SGB_MapPals: ; 88b1
+.SGB_MapPals:
ld hl, PalPacket_9bd6
ld de, wSGBPals
ld bc, PALPACKET_LENGTH
@@ -374,9 +352,8 @@ endr
ld a, SCGB_MAPPALS
ld [wSGBPredef], a
ret
-; 88cd
-.SGB_Evolution: ; 88cd
+.SGB_Evolution:
push bc
ld hl, PalPacket_9ce6
ld de, wSGBPals
@@ -419,22 +396,19 @@ endr
ld hl, wSGBPals
ld de, BlkPacket_9a86
ret
-; 891a
.SGB0d:
-.SGB_TrainerCard: ; 891a
+.SGB_TrainerCard:
ld hl, PalPacket_Diploma
ld de, BlkPacket_9a86
ret
-; 8921
-.SGB_UnownPuzzle: ; 8921
+.SGB_UnownPuzzle:
ld hl, PalPacket_UnownPuzzle
ld de, BlkPacket_9a86
ret
-; 8928
-.SGB12: ; 8928
+.SGB12:
ld hl, PalPacket_9bd6
ld de, wSGBPals
ld bc, PALPACKET_LENGTH
@@ -462,9 +436,8 @@ endr
ld hl, wSGBPals
ld de, wSGBPals + PALPACKET_LENGTH
ret
-; 8969
-.SGB1e: ; 8969
+.SGB1e:
ld hl, PalPacket_9ce6
ld de, wSGBPals
ld bc, PALPACKET_LENGTH
@@ -495,15 +468,13 @@ endr
ld hl, wSGBPals
ld de, BlkPacket_9a86
ret
-; 89a6
-.SGB_GamefreakLogo: ; 89a6
+.SGB_GamefreakLogo:
ld hl, PalPacket_GamefreakLogo
ld de, BlkPacket_9a86
ret
-; 89ad
-.SGB_PlayerOrMonFrontpicPals: ; 89ad
+.SGB_PlayerOrMonFrontpicPals:
ld hl, PalPacket_9ce6
ld de, wSGBPals
ld bc, PALPACKET_LENGTH
@@ -522,15 +493,13 @@ endr
ld hl, wSGBPals
ld de, BlkPacket_9a86
ret
-; 89d9
-.SGB_TradeTube: ; 89d9
+.SGB_TradeTube:
ld hl, PalPacket_TradeTube
ld de, BlkPacket_9a86
ret
-; 89e0
-.SGB_TrainerOrMonFrontpicPals: ; 89e0
+.SGB_TrainerOrMonFrontpicPals:
ld hl, PalPacket_9ce6
ld de, wSGBPals
ld bc, PALPACKET_LENGTH
@@ -549,9 +518,8 @@ endr
ld hl, wSGBPals
ld de, BlkPacket_9a86
ret
-; 8a0c
-.GetMapPalsIndex: ; 8a0c
+.GetMapPalsIndex:
ld a, [wTimeOfDayPal]
cp NITE_F
jr c, .morn_day
@@ -593,13 +561,11 @@ endr
.gate
ld a, PREDEFPAL_PEWTER
ret
-; 8a45
INCLUDE "data/maps/sgb_roof_pal_inds.asm"
-_LoadSGBLayout_ReturnFromJumpTable: ; 8a60
+_LoadSGBLayout_ReturnFromJumpTable:
push de
call PushSGBPals_
pop hl
jp PushSGBPals_
-; 8a68
diff --git a/engine/gfx/sprite_anims.asm b/engine/gfx/sprite_anims.asm
index 9353b71c9..1d3aa6a8b 100644
--- a/engine/gfx/sprite_anims.asm
+++ b/engine/gfx/sprite_anims.asm
@@ -1,4 +1,4 @@
-DoAnimFrame: ; 8d24b
+DoAnimFrame:
ld hl, SPRITEANIMSTRUCT_ANIM_SEQ_ID
add hl, bc
ld e, [hl]
@@ -10,9 +10,8 @@ DoAnimFrame: ; 8d24b
ld h, [hl]
ld l, a
jp hl
-; 8d25b
-.Jumptable: ; 8d25b (23:525b)
+.Jumptable:
; entries correspond to SPRITE_ANIM_SEQ_* constants
dw .Null
dw .PartyMon
@@ -50,10 +49,10 @@ DoAnimFrame: ; 8d24b
dw .IntroUnownF
dw .IntroSuicuneAway
-.Null: ; 8d2a1 (23:52a1)
+.Null:
ret
-.PartyMon ; 8d2a2 (23:52a2)
+.PartyMon
ld a, [wMenuCursorY]
ld hl, SPRITEANIMSTRUCT_INDEX
@@ -70,7 +69,7 @@ DoAnimFrame: ; 8d24b
ld [hl], $0
ret
-.PartyMonSwitch ; 8d2b9 (23:52b9)
+.PartyMonSwitch
ld hl, SPRITEANIMSTRUCT_XCOORD
add hl, bc
ld [hl], 8 * 3
@@ -112,7 +111,7 @@ DoAnimFrame: ; 8d24b
ld [hl], a
ret
-.PartyMonSelected ; 8d2ea (23:52ea)
+.PartyMonSelected
ld a, [wMenuCursorY]
ld hl, SPRITEANIMSTRUCT_INDEX
@@ -131,17 +130,15 @@ DoAnimFrame: ; 8d24b
ld [hl], 8 * 3
ret
-.GSTitleTrail ; 8d302 (23:5302)
+.GSTitleTrail
call .AnonymousJumptable
jp hl
-; 8d306 (23:5306)
; Anonymous dw (see .AnonymousJumptable)
dw .four_zero
dw .four_one
-; 8d30a
-.four_zero ; 8d30a
+.four_zero
call .IncrementJumptableIndex
ld hl, SPRITEANIMSTRUCT_INDEX
@@ -159,7 +156,7 @@ DoAnimFrame: ; 8d24b
add hl, bc
ld [hl], a
-.four_one ; 8d321
+.four_one
ld hl, SPRITEANIMSTRUCT_XCOORD
add hl, bc
ld a, [hl]
@@ -200,9 +197,8 @@ DoAnimFrame: ; 8d24b
.asm_8d356
call DeinitializeSprite
ret
-; 8d35a
-.GSIntroHoOh ; 8d35a (23:535a)
+.GSIntroHoOh
ld hl, SPRITEANIMSTRUCT_0C
add hl, bc
ld a, [hl]
@@ -216,19 +212,19 @@ DoAnimFrame: ; 8d24b
ld [hl], a
ret
-.NamingScreenCursor ; 8d36c (23:536c)
+.NamingScreenCursor
callfar NamingScreen_AnimateCursor
ret
-.MailCursor ; 8d373 (23:5373)
+.MailCursor
callfar ComposeMail_AnimateCursor
ret
-.GameFreakLogo: ; 8d37a (23:537a)
+.GameFreakLogo:
callfar GameFreakLogoJumper
ret
-.GSIntroStar ; 8d381 (23:5381)
+.GSIntroStar
ld hl, SPRITEANIMSTRUCT_0C
add hl, bc
ld a, [hl]
@@ -278,7 +274,7 @@ DoAnimFrame: ; 8d24b
call DeinitializeSprite
ret
-.GSIntroSparkle ; 8d3c3 (23:53c3)
+.GSIntroSparkle
ld hl, SPRITEANIMSTRUCT_0C
add hl, bc
ld a, [hli]
@@ -355,11 +351,11 @@ DoAnimFrame: ; 8d24b
call DeinitializeSprite
ret
-.SlotsGolem: ; 8d422 (23:5422)
+.SlotsGolem:
callfar Slots_AnimateGolem
ret
-.SlotsChansey: ; 8d429 (23:5429)
+.SlotsChansey:
callfar Slots_AnimateChansey
ld hl, wcf64
ld a, [hl]
@@ -370,7 +366,7 @@ DoAnimFrame: ; 8d24b
call _ReinitSpriteAnimFrame
ret
-.SlotsChanseyEgg: ; 8d43e (23:543e)
+.SlotsChanseyEgg:
ld hl, SPRITEANIMSTRUCT_JUMPTABLE_INDEX
add hl, bc
ld a, [hl]
@@ -403,22 +399,21 @@ DoAnimFrame: ; 8d24b
ld [hl], a
ret
-.UnusedCursor ; 8d46e (23:546e)
+.UnusedCursor
callfar ret_e00ed
ret
-.PokegearArrow ; 8d475 (23:5475)
+.PokegearArrow
callfar AnimatePokegearModeIndicatorArrow
ret
-.DummyGameCursor ; 8d47c (23:547c)
+.DummyGameCursor
callfar DummyGame_InterpretJoypad_AnimateCursor
ret
-.TradePokeBall ; 8d483 (23:5483)
+.TradePokeBall
call .AnonymousJumptable
jp hl
-; 8d487 (23:5487)
; Anonymous dw (see .AnonymousJumptable)
dw .TradePokeBall_zero
@@ -427,9 +422,8 @@ DoAnimFrame: ; 8d24b
dw .TradePokeBall_three
dw .TradePokeBall_four
dw .TradePokeBall_five
-; 8d493
-.TradePokeBall_zero ; 8d493
+.TradePokeBall_zero
ld a, SPRITE_ANIM_FRAMESET_TRADE_POKE_BALL_WOBBLE
call _ReinitSpriteAnimFrame
@@ -441,9 +435,8 @@ DoAnimFrame: ; 8d24b
add hl, bc
ld [hl], $20
ret
-; 8d4a5
-.TradePokeBall_two ; 8d4a5
+.TradePokeBall_two
ld hl, SPRITEANIMSTRUCT_0C
add hl, bc
ld a, [hl]
@@ -459,7 +452,7 @@ DoAnimFrame: ; 8d24b
add hl, bc
ld [hl], $40
-.TradePokeBall_three ; 8d4b8
+.TradePokeBall_three
ld hl, SPRITEANIMSTRUCT_0C
add hl, bc
ld a, [hl]
@@ -478,9 +471,8 @@ DoAnimFrame: ; 8d24b
ld de, SFX_GOT_SAFARI_BALLS
call PlaySFX
jr .TradePokeBall_five
-; 8d4d5
-.TradePokeBall_one ; 8d4d5
+.TradePokeBall_one
ld hl, SPRITEANIMSTRUCT_JUMPTABLE_INDEX
add hl, bc
ld [hl], $4
@@ -493,9 +485,8 @@ DoAnimFrame: ; 8d24b
add hl, bc
ld [hl], $24
ret
-; 8d4e8
-.TradePokeBall_four ; 8d4e8
+.TradePokeBall_four
ld hl, SPRITEANIMSTRUCT_0D
add hl, bc
ld a, [hl]
@@ -541,12 +532,11 @@ DoAnimFrame: ; 8d24b
call .IncrementJumptableIndex
ret
-.TradePokeBall_five ; 8d526
+.TradePokeBall_five
call DeinitializeSprite
ret
-; 8d52a
-.TradeTubeBulge ; 8d52a (23:552a)
+.TradeTubeBulge
ld hl, SPRITEANIMSTRUCT_XCOORD
add hl, bc
ld a, [hl]
@@ -564,11 +554,11 @@ DoAnimFrame: ; 8d24b
call DeinitializeSprite
ret
-.TrademonInTube ; 8d543 (23:5543)
+.TrademonInTube
callfar TradeAnim_AnimateTrademonInTube
ret
-.RevealNewMon: ; 8d54a (23:554a)
+.RevealNewMon:
ld hl, SPRITEANIMSTRUCT_0C
add hl, bc
ld a, [hl]
@@ -605,11 +595,11 @@ DoAnimFrame: ; 8d24b
call DeinitializeSprite
ret
-.RadioTuningKnob: ; 8d578 (23:5578)
+.RadioTuningKnob:
callfar AnimateTuningKnob
ret
-.CutLeaves ; 8d57f (23:557f)
+.CutLeaves
ld hl, SPRITEANIMSTRUCT_0D
add hl, bc
ld e, [hl]
@@ -648,7 +638,7 @@ DoAnimFrame: ; 8d24b
ld [hl], a
ret
-.FlyFrom: ; 8d5b0 (23:55b0)
+.FlyFrom:
ld hl, SPRITEANIMSTRUCT_YCOORD
add hl, bc
ld a, [hl]
@@ -687,7 +677,7 @@ DoAnimFrame: ; 8d24b
ld [hl], a
ret
-.FlyLeaf: ; 8d5e2 (23:55e2)
+.FlyLeaf:
ld hl, SPRITEANIMSTRUCT_XCOORD
add hl, bc
ld a, [hl]
@@ -716,7 +706,7 @@ DoAnimFrame: ; 8d24b
call DeinitializeSprite
ret
-.FlyTo: ; 8d607 (23:5607)
+.FlyTo:
ld hl, SPRITEANIMSTRUCT_YCOORD
add hl, bc
ld a, [hl]
@@ -748,15 +738,15 @@ DoAnimFrame: ; 8d24b
ld [hl], a
ret
-.MobileTradeSentPulse ; 8d630 (23:5630)
+.MobileTradeSentPulse
farcall Function108bc7
ret
-.MobileTradeOTPulse ; 8d637 (23:5637)
+.MobileTradeOTPulse
farcall Function108be0
ret
-.IntroSuicune ; 8d63e (23:563e)
+.IntroSuicune
ld a, [wcf65]
and a
jr nz, .asm_8d645
@@ -783,7 +773,7 @@ DoAnimFrame: ; 8d24b
call _ReinitSpriteAnimFrame
ret
-.IntroPichuWooper ; 8d666 (23:5666)
+.IntroPichuWooper
ld hl, SPRITEANIMSTRUCT_0C
add hl, bc
ld a, [hl]
@@ -802,7 +792,7 @@ DoAnimFrame: ; 8d24b
.asm_8d67f
ret
-.IntroUnown ; 8d680 (23:5680)
+.IntroUnown
ld hl, SPRITEANIMSTRUCT_JUMPTABLE_INDEX
add hl, bc
ld d, [hl]
@@ -829,7 +819,7 @@ DoAnimFrame: ; 8d24b
ld [hl], a
ret
-.IntroUnownF ; 8d6a2 (23:56a2)
+.IntroUnownF
ld a, [wcf64]
cp $40
ret nz
@@ -837,7 +827,7 @@ DoAnimFrame: ; 8d24b
call _ReinitSpriteAnimFrame
ret
-.IntroSuicuneAway ; 8d6ae (23:56ae)
+.IntroSuicuneAway
ld hl, SPRITEANIMSTRUCT_YCOORD
add hl, bc
ld a, [hl]
@@ -845,15 +835,15 @@ DoAnimFrame: ; 8d24b
ld [hl], a
ret
-.EZChatCursor ; 8d6b7 (23:56b7)
+.EZChatCursor
farcall AnimateEZChatCursor
ret
-.Celebi ; 8d6be (23:56be)
+.Celebi
farcall UpdateCelebiPosition
ret
-.AnonymousJumptable: ; 8d6c5 (23:56c5)
+.AnonymousJumptable:
ld hl, sp+$0
ld e, [hl]
inc hl
@@ -870,20 +860,17 @@ DoAnimFrame: ; 8d24b
ld h, [hl]
ld l, a
ret
-; 8d6d8 (23:56d8)
-.IncrementJumptableIndex: ; 8d6d8
+.IncrementJumptableIndex:
ld hl, SPRITEANIMSTRUCT_JUMPTABLE_INDEX
add hl, bc
inc [hl]
ret
-; 8d6de
-.Sprites_Sine: ; 8d6de (23:56de)
+.Sprites_Sine:
call Sprites_Sine
ret
-.Sprites_Cosine: ; 8d6e2 (23:56e2)
+.Sprites_Cosine:
call Sprites_Cosine
ret
-; 8d6e6 (23:56e6)
diff --git a/engine/gfx/sprites.asm b/engine/gfx/sprites.asm
index 63666c624..1b22e5832 100644
--- a/engine/gfx/sprites.asm
+++ b/engine/gfx/sprites.asm
@@ -1,4 +1,4 @@
-ClearSpriteAnims: ; 8cf53
+ClearSpriteAnims:
ld hl, wSpriteAnimDict
ld bc, wSpriteAnimsEnd - wSpriteAnimDict
.loop
@@ -9,15 +9,13 @@ ClearSpriteAnims: ; 8cf53
or b
jr nz, .loop
ret
-; 8cf62
-PlaySpriteAnimationsAndDelayFrame: ; 8cf62
+PlaySpriteAnimationsAndDelayFrame:
call PlaySpriteAnimations
call DelayFrame
ret
-; 8cf69
-PlaySpriteAnimations: ; 8cf69
+PlaySpriteAnimations:
push hl
push de
push bc
@@ -32,9 +30,8 @@ PlaySpriteAnimations: ; 8cf69
pop de
pop hl
ret
-; 8cf7a
-DoNextFrameForAllSprites: ; 8cf7a
+DoNextFrameForAllSprites:
ld hl, wSpriteAnimationStructs
ld e, NUM_SPRITE_ANIM_STRUCTS
@@ -72,9 +69,8 @@ DoNextFrameForAllSprites: ; 8cf7a
.done
ret
-; 8cfa8
-DoNextFrameForFirst16Sprites: ; 8cfa8 (23:4fa8)
+DoNextFrameForFirst16Sprites:
ld hl, wSpriteAnimationStructs
ld e, NUM_SPRITE_ANIM_STRUCTS
@@ -113,7 +109,7 @@ DoNextFrameForFirst16Sprites: ; 8cfa8 (23:4fa8)
.done
ret
-InitSpriteAnimStruct:: ; 8cfd6
+InitSpriteAnimStruct::
; Initialize animation a at pixel x=e, y=d
; Find if there's any room in the wSpriteAnimationStructs array, which is 10x16
push de
@@ -208,18 +204,15 @@ endr
ld a, b
ld [wSpriteAnimAddrBackup + 1], a
ret
-; 8d036
-DeinitializeSprite: ; 8d036
+DeinitializeSprite:
; Clear the index field of the struct in bc.
ld hl, SPRITEANIMSTRUCT_INDEX
add hl, bc
ld [hl], $0
ret
-; 8d03d
-
-DeinitializeAllSprites: ; 8d03d (23:503d)
+DeinitializeAllSprites:
; Clear the index field of every struct in the wSpriteAnimationStructs array.
ld hl, wSpriteAnimationStructs
ld bc, SPRITEANIMSTRUCT_LENGTH
@@ -232,8 +225,7 @@ DeinitializeAllSprites: ; 8d03d (23:503d)
jr nz, .loop
ret
-
-UpdateAnimFrame: ; 8d04c
+UpdateAnimFrame:
call InitSpriteAnimBuffer ; init WRAM
call GetSpriteAnimFrame ; read from a memory array
cp -3
@@ -319,9 +311,8 @@ UpdateAnimFrame: ; 8d04c
pop bc
scf
ret
-; 8d0be
-AddOrSubtractY: ; 8d0be
+AddOrSubtractY:
push hl
ld a, [hl]
ld hl, wCurrSpriteAddSubFlags
@@ -335,9 +326,8 @@ AddOrSubtractY: ; 8d0be
.ok
pop hl
ret
-; 8d0ce
-AddOrSubtractX: ; 8d0ce
+AddOrSubtractX:
push hl
ld a, [hl]
ld hl, wCurrSpriteAddSubFlags
@@ -351,9 +341,8 @@ AddOrSubtractX: ; 8d0ce
.ok
pop hl
ret
-; 8d0de
-GetSpriteOAMAttr: ; 8d0de
+GetSpriteOAMAttr:
ld a, [wCurrSpriteAddSubFlags]
ld b, a
ld a, [hl]
@@ -364,9 +353,8 @@ GetSpriteOAMAttr: ; 8d0de
and $1f
or b
ret
-; 8d0ec
-InitSpriteAnimBuffer: ; 8d0ec
+InitSpriteAnimBuffer:
xor a
ld [wCurrSpriteAddSubFlags], a
ld hl, SPRITEANIMSTRUCT_TILE_ID
@@ -382,9 +370,8 @@ InitSpriteAnimBuffer: ; 8d0ec
ld a, [hli]
ld [wCurrAnimYOffset], a
ret
-; 8d109
-GetSpriteAnimVTile: ; 8d109
+GetSpriteAnimVTile:
; a = wSpriteAnimDict[a] if a in wSpriteAnimDict else 0
; vTiles offset
push hl
@@ -409,9 +396,8 @@ GetSpriteAnimVTile: ; 8d109
pop bc
pop hl
ret
-; 8d120
-_ReinitSpriteAnimFrame:: ; 8d120
+_ReinitSpriteAnimFrame::
ld hl, SPRITEANIMSTRUCT_FRAMESET_ID
add hl, bc
ld [hl], a
@@ -422,10 +408,8 @@ _ReinitSpriteAnimFrame:: ; 8d120
add hl, bc
ld [hl], -1
ret
-; 8d132
-
-GetSpriteAnimFrame: ; 8d132
+GetSpriteAnimFrame:
.loop
ld hl, SPRITEANIMSTRUCT_DURATION
add hl, bc
@@ -491,9 +475,8 @@ GetSpriteAnimFrame: ; 8d132
add hl, bc
ld [hl], a
jr .loop
-; 8d189
-.GetPointer: ; 8d189
+.GetPointer:
; Get the data for the current frame for the current animation sequence
; SpriteAnimFrameData[SpriteAnim[SPRITEANIMSTRUCT_FRAMESET_ID]][SpriteAnim[SPRITEANIMSTRUCT_FRAME]]
@@ -514,9 +497,8 @@ GetSpriteAnimFrame: ; 8d132
add hl, hl
add hl, de
ret
-; 8d1a2
-GetFrameOAMPointer: ; 8d1a2
+GetFrameOAMPointer:
; Load OAM data pointer
ld e, a
ld d, 0
@@ -525,9 +507,8 @@ GetFrameOAMPointer: ; 8d1a2
add hl, de
add hl, de
ret
-; 8d1ac
-Unreferenced_BrokenGetStdGraphics: ; 8d1ac
+Unreferenced_BrokenGetStdGraphics:
push hl
ld l, a
ld h, 0
@@ -547,8 +528,6 @@ Unreferenced_BrokenGetStdGraphics: ; 8d1ac
call Request2bpp
pop bc
ret
-; 8d1c4
-
INCLUDE "data/sprite_anims/sequences.asm"
@@ -558,7 +537,6 @@ INCLUDE "data/sprite_anims/framesets.asm"
INCLUDE "data/sprite_anims/oam.asm"
-
BrokenStdGFXPointers:
; tile count, bank, pointer
; (all pointers were dummied out to .deleted)
@@ -573,19 +551,16 @@ BrokenStdGFXPointers:
dbbw 16, $21, .deleted
.deleted
-; 8e72a (23:672a)
-
-Sprites_Cosine: ; 8e72a
+Sprites_Cosine:
; a = d * cos(a * pi/32)
add %010000 ; cos(x) = sin(x + pi/2)
; fallthrough
-Sprites_Sine: ; 8e72c
+Sprites_Sine:
; a = d * sin(a * pi/32)
calc_sine_wave
-
-AnimateEndOfExpBar: ; 8e79d
+AnimateEndOfExpBar:
ld a, [hSGB]
ld de, EndOfExpBarGFX
and a
@@ -609,9 +584,8 @@ AnimateEndOfExpBar: ; 8e79d
jr nz, .loop
call ClearSprites
ret
-; 8e7c6
-.AnimateFrame: ; 8e7c6
+.AnimateFrame:
ld hl, wVirtualOAMSprite00
ld c, 8 ; number of animated circles
.anim_loop
@@ -648,14 +622,13 @@ AnimateEndOfExpBar: ; 8e79d
ld a, PAL_BATTLE_OB_BLUE
ld [hli], a ; attributes
jr .anim_loop
-; 8e7f4
-EndOfExpBarGFX: ; 8e7f4
+EndOfExpBarGFX:
INCBIN "gfx/battle/expbarend.2bpp"
-SGBEndOfExpBarGFX: ; 8e804
+SGBEndOfExpBarGFX:
INCBIN "gfx/battle/expbarend_sgb.2bpp"
-ClearSpriteAnims2: ; 8e814
+ClearSpriteAnims2:
push hl
push de
push bc
@@ -674,4 +647,3 @@ ClearSpriteAnims2: ; 8e814
pop de
pop hl
ret
-; 8e82b
diff --git a/engine/gfx/trademon_frontpic.asm b/engine/gfx/trademon_frontpic.asm
index d5f7b55de..d557123e9 100644
--- a/engine/gfx/trademon_frontpic.asm
+++ b/engine/gfx/trademon_frontpic.asm
@@ -1,4 +1,4 @@
-GetTrademonFrontpic: ; 4d7fd
+GetTrademonFrontpic:
ld a, [wOTTrademonSpecies]
ld hl, wOTTrademonDVs
ld de, vTiles2
@@ -13,7 +13,7 @@ GetTrademonFrontpic: ; 4d7fd
predef GetAnimatedFrontpic
ret
-AnimateTrademonFrontpic: ; 4d81e
+AnimateTrademonFrontpic:
ld a, [wOTTrademonSpecies]
call IsAPokemon
ret c