From 57d4cb0edfd62ca403b1470c67ac4efbd761ec5a Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 28 Dec 2015 10:57:04 -0500 Subject: [PATCH] trainer card --- battle/anim_commands.asm | 2 +- battle/core.asm | 10 +- battle/effect_commands.asm | 2 +- constants/cgb_constants.asm | 10 +- engine/color.asm | 8 +- engine/mon_icons.asm | 4 +- engine/pokegear.asm | 8 +- engine/slot_machine.asm | 2 +- engine/stats_screen.asm | 2 +- engine/town_map.asm | 2 +- engine/trainer_card.asm | 293 +++++++++++++++---------------- event/whiteout.asm | 2 +- main.asm | 2 +- misc/fixed_words.asm | 340 ++++++++++++++++++++++++------------ misc/mobile_40.asm | 287 +++++++++++++++--------------- misc/mobile_46.asm | 23 +-- predef/cgb.asm | 91 +++++----- predef/sgb.asm | 34 ++-- 18 files changed, 616 insertions(+), 506 deletions(-) diff --git a/battle/anim_commands.asm b/battle/anim_commands.asm index 4596f19d4..266b76af2 100644 --- a/battle/anim_commands.asm +++ b/battle/anim_commands.asm @@ -1169,7 +1169,7 @@ BattleAnimCmd_BeatUp: ; cc776 (33:4776) .done pop af ld [CurPartySpecies], a ; CurPartySpecies - ld b, SCGB_01 + ld b, SCGB_BATTLE_COLORS call GetSGBLayout pop af ld [rSVBK], a diff --git a/battle/core.asm b/battle/core.asm index 3abf99872..3dc8a4dc0 100644 --- a/battle/core.asm +++ b/battle/core.asm @@ -2994,7 +2994,7 @@ SetUpBattlePartyMenu_NoLoop: ; 3d2f7 SetUpBattlePartyMenu: ; switch to fullscreen menu? callba LoadPartyMenuGFX callba InitPartyMenuWithCancel - callba InitBattlePartyMenuPals + callba InitPartyMenuBGPal7 callba InitPartyMenuGFX ret ; 3d313 @@ -3141,7 +3141,7 @@ LostBattle: ; 3d38e jr nz, .LostLinkBattle ; Greyscale - ld b, SCGB_00 + ld b, SCGB_BATTLE_GRAYSCALE call GetSGBLayout call SetPalettes jr .end @@ -7360,7 +7360,7 @@ FinishBattleAnim: ; 3ee27 push bc push de push hl - ld b, SCGB_01 + ld b, SCGB_BATTLE_COLORS call GetSGBLayout call SetPalettes call DelayFrame @@ -8495,7 +8495,7 @@ BattleIntro: ; 3f4dd callba ClearBattleRAM call InitEnemy call BackUpVBGMap2 - ld b, SCGB_00 + ld b, SCGB_BATTLE_GRAYSCALE call GetSGBLayout ld hl, rLCDC res 6, [hl] @@ -9418,7 +9418,7 @@ InitBattleDisplay: ; 3fb6c ld [rWY], a call WaitBGMap call HideSprites - ld b, SCGB_01 + ld b, SCGB_BATTLE_COLORS call GetSGBLayout call SetPalettes ld a, $90 diff --git a/battle/effect_commands.asm b/battle/effect_commands.asm index ad89448da..0c7eafbc5 100644 --- a/battle/effect_commands.asm +++ b/battle/effect_commands.asm @@ -9168,7 +9168,7 @@ BattleCommand_BatonPass: ; 379c9 hlcoord 1, 0 lb bc, 4, 10 call ClearBox - ld b, SCGB_01 + ld b, SCGB_BATTLE_COLORS call GetSGBLayout call SetPalettes call BatonPass_LinkPlayerSwitch diff --git a/constants/cgb_constants.asm b/constants/cgb_constants.asm index bb19ac0aa..028cc71d7 100755 --- a/constants/cgb_constants.asm +++ b/constants/cgb_constants.asm @@ -1,10 +1,10 @@ const_def - const SCGB_00 - const SCGB_01 - const SCGB_02 + const SCGB_BATTLE_GRAYSCALE + const SCGB_BATTLE_COLORS + const SCGB_POKEGEAR_PALS const SCGB_STATS_SCREEN_HP_PALS const SCGB_04 - const SCGB_05 + const SCGB_SLOT_MACHINE const SCGB_06 const SCGB_07 const SCGB_08 @@ -20,7 +20,7 @@ const SCGB_12 const SCGB_13 const SCGB_PACKPALS - const SCGB_15 + const SCGB_TRAINER_CARD const SCGB_16 const SCGB_17 const SCGB_18 diff --git a/engine/color.asm b/engine/color.asm index 627063c82..9ff761ffa 100644 --- a/engine/color.asm +++ b/engine/color.asm @@ -112,7 +112,7 @@ Function8aa4: ; 8aa4 Function8ad1: ; 8ad1 ld hl, PalPacket_9c56 + 1 call CopyFourPalettes - call Function971a + call InitPartyMenuOBPals call WipeAttrMap ret ; 8ade @@ -759,7 +759,7 @@ CGB_ApplyPartyMenuHPPals: ; 96f3 CGB layout $fc ; 971a -Function971a: ; 971a +InitPartyMenuOBPals: ; 971a ld hl, Palettes_b681 ld de, UnknOBPals ld bc, 2 palettes @@ -2262,7 +2262,7 @@ Palettes_b719: ; b719 ; b729 -Palettes_b729: ; b729 +MalePokegearPals: ; b729 RGB 28, 31, 20 RGB 21, 21, 21 RGB 13, 13, 13 @@ -2295,7 +2295,7 @@ Palettes_b729: ; b729 ; b759 -Palettes_b759: ; b759 +FemalePokegearPals: ; b759 RGB 28, 31, 20 RGB 21, 21, 21 RGB 13, 13, 13 diff --git a/engine/mon_icons.asm b/engine/mon_icons.asm index ea3614ae5..f579d0cd5 100755 --- a/engine/mon_icons.asm +++ b/engine/mon_icons.asm @@ -44,7 +44,7 @@ endr dw Function8e97d dw Function8e99a dw Function8e898 - dw Function8e8b1 + dw Mobile_InitPartyMenuBGPal71 dw Function8e862 @@ -100,7 +100,7 @@ Function8e898: ; 8e898 (23:6898) ld [hl], a ret -Function8e8b1: ; 8e8b1 (23:68b1) +Mobile_InitPartyMenuBGPal71: ; 8e8b1 (23:68b1) call InitPartyMenuIcon call SetPartyMonIconAnimSpeed ld hl, SPRITEANIMSTRUCT_ANIM_SEQ_ID diff --git a/engine/pokegear.asm b/engine/pokegear.asm index 449c6dc32..821a51f8a 100755 --- a/engine/pokegear.asm +++ b/engine/pokegear.asm @@ -79,7 +79,7 @@ Function90bea: ; 90bea (24:4bea) ld [wc6db], a call Function90d9e call Function90da8 - ld b, SCGB_02 + ld b, SCGB_POKEGEAR_PALS call GetSGBLayout call SetPalettes ld a, [hCGB] @@ -1955,7 +1955,7 @@ _FlyMap: ; 91af3 call Request1bpp call FlyMap call ret_91c8f - ld b, SCGB_02 + ld b, SCGB_POKEGEAR_PALS call GetSGBLayout call SetPalettes .loop @@ -2377,7 +2377,7 @@ _Area: ; 91d11 call TownMapPals hlbgcoord 0, 0 call TownMapBGUpdate - ld b, SCGB_02 + ld b, SCGB_POKEGEAR_PALS call GetSGBLayout call SetPalettes xor a @@ -2893,7 +2893,7 @@ Function92311: ; 92311 ld [wd003], a ld a, b ld [wd004], a - ld b, SCGB_02 + ld b, SCGB_POKEGEAR_PALS call GetSGBLayout call SetPalettes .loop diff --git a/engine/slot_machine.asm b/engine/slot_machine.asm index 6ca93fab6..abdf6cd53 100755 --- a/engine/slot_machine.asm +++ b/engine/slot_machine.asm @@ -39,7 +39,7 @@ _SlotMachine: ld bc, VBGMap1 - VBGMap0 ld a, " " call ByteFill - ld b, SCGB_05 + ld b, SCGB_SLOT_MACHINE call GetSGBLayout callab ClearSpriteAnims ld hl, wSlots diff --git a/engine/stats_screen.asm b/engine/stats_screen.asm index 7b61f0272..32b75069a 100755 --- a/engine/stats_screen.asm +++ b/engine/stats_screen.asm @@ -83,7 +83,7 @@ StatsScreenBattle: ; 4dcf7 or $1 ld [wcf64], a .loop - callba Function100dd2 + callba Mobile_SetOverworldDelay ld a, [wJumptableIndex] and $7f ld hl, StatsScreenPointerTable diff --git a/engine/town_map.asm b/engine/town_map.asm index 871d4bb89..2633b8385 100755 --- a/engine/town_map.asm +++ b/engine/town_map.asm @@ -40,7 +40,7 @@ _TownMap: ; 9191c ld [wd004], a ld a, b ld [wd005], a - ld b, SCGB_02 + ld b, SCGB_POKEGEAR_PALS call GetSGBLayout call SetPalettes ld a, [hCGB] diff --git a/engine/trainer_card.asm b/engine/trainer_card.asm index 076e13fec..ae8ad2aa5 100755 --- a/engine/trainer_card.asm +++ b/engine/trainer_card.asm @@ -7,33 +7,34 @@ TrainerCard: ; 25105 ld a, [hl] push af set 4, [hl] - call Function2513b -.asm_25117 + call .InitRAM +.loop call UpdateTime call JoyTextDelay ld a, [wJumptableIndex] bit 7, a - jr nz, .asm_25132 + jr nz, .quit ld a, [hJoyLast] and B_BUTTON - jr nz, .asm_25132 - call Function2518e + jr nz, .quit + call .RunJumptable call DelayFrame - jr .asm_25117 -.asm_25132 + jr .loop + +.quit pop af ld [Options], a pop af ld [VramState], a ret -Function2513b: ; 2513b (9:513b) +.InitRAM: ; 2513b (9:513b) call ClearBGPalettes call ClearSprites call ClearTileMap call DisableLCD - callba Function8833e + callba GetCardPic ld hl, CardRightCornerGFX ld de, VTiles2 tile $1c @@ -43,19 +44,19 @@ Function2513b: ; 2513b (9:513b) ld hl, CardStatusGFX ld de, VTiles2 tile $29 - ld bc, $56 tiles + ld bc, 86 tiles ld a, BANK(CardStatusGFX) call FarCopyBytes - call Function25299 + call TrainerCard_PrintTopHalfOfCard hlcoord 0, 8 - ld d, $6 - call Function253b0 + ld d, 6 + call TrainerCard_InitBorder call EnableLCD call WaitBGMap - ld b, SCGB_15 + ld b, SCGB_TRAINER_CARD call GetSGBLayout call SetPalettes call WaitBGMap @@ -67,55 +68,45 @@ endr ld [hl], a ret -Function2518e: ; 2518e (9:518e) - ld a, [wJumptableIndex] - ld e, a - ld d, $0 - ld hl, Jumptable_2519d -rept 2 - add hl, de -endr - ld a, [hli] - ld h, [hl] - ld l, a - jp [hl] +.RunJumptable: ; 2518e (9:518e) + jumptable .Jumptable, wJumptableIndex -Jumptable_2519d: ; 2519d (9:519d) - dw Function251b6 - dw Function251d7 - dw Function251f4 - dw Function25221 - dw Function2524c - dw Function25279 - dw Function251b0 +.Jumptable: ; 2519d (9:519d) + dw TrainerCard_Page1_LoadGFX + dw TrainerCard_Page1_Joypad + dw TrainerCard_Page2_LoadGFX + dw TrainerCard_Page2_Joypad + dw TrainerCard_Page3_LoadGFX + dw TrainerCard_Page3_Joypad + dw TrainerCard_Quit -Function251ab: ; 251ab (9:51ab) +TrainerCard_IncrementJumptable: ; 251ab (9:51ab) ld hl, wJumptableIndex inc [hl] ret -Function251b0: ; 251b0 (9:51b0) +TrainerCard_Quit: ; 251b0 (9:51b0) ld hl, wJumptableIndex set 7, [hl] ret -Function251b6: ; 251b6 (9:51b6) +TrainerCard_Page1_LoadGFX: ; 251b6 (9:51b6) call ClearSprites hlcoord 0, 8 - ld d, $6 - call Function253b0 + ld d, 6 + call TrainerCard_InitBorder call WaitBGMap ld de, CardStatusGFX ld hl, VTiles2 tile $29 - lb bc, BANK(CardStatusGFX), $56 + lb bc, BANK(CardStatusGFX), 86 call Request2bpp - call Function2530a - call Function251ab + call TrainerCard_Page1_PrintDexCaught_GameTime + call TrainerCard_IncrementJumptable ret -Function251d7: ; 251d7 (9:51d7) - call Function25415 +TrainerCard_Page1_Joypad: ; 251d7 (9:51d7) + call TrainerCard_Page1_PrintGameTime ld hl, hJoyLast ld a, [hl] and D_RIGHT | A_BUTTON @@ -126,23 +117,23 @@ Function251d7: ; 251d7 (9:51d7) ld a, $2 ld [wJumptableIndex], a ret -; 251e9 (9:51e9) -Function251e9: ; 251e9 +.KantoCheck +; unreferenced ld a, [KantoBadges] and a ret z - ld a, $4 ld [wJumptableIndex], a ret + ; 251f4 -Function251f4: ; 251f4 (9:51f4) +TrainerCard_Page2_LoadGFX: ; 251f4 (9:51f4) call ClearSprites hlcoord 0, 8 - ld d, $6 - call Function253b0 + ld d, 6 + call TrainerCard_InitBorder call WaitBGMap ld de, LeaderGFX ld hl, VTiles2 tile $29 @@ -152,46 +143,46 @@ Function251f4: ; 251f4 (9:51f4) ld hl, VTiles0 tile $00 lb bc, BANK(BadgeGFX), $2c call Request2bpp - call Function2536c - call Function251ab + call TrainerCard_Page2_3_InitObjectsAndStrings + call TrainerCard_IncrementJumptable ret -Function25221: ; 25221 (9:5221) - ld hl, Unknown_254c9 - call Function25438 +TrainerCard_Page2_Joypad: ; 25221 (9:5221) + ld hl, TrainerCard_JohtoBadgesOAM + call TrainerCard_Page2_3_AnimateBadges ld hl, hJoyLast ld a, [hl] and A_BUTTON - jr nz, Function25246 + jr nz, .Quit ld a, [hl] and D_LEFT - jr nz, .asm_25235 + jr nz, .d_left ret -.asm_25235 + +.d_left ld a, $0 ld [wJumptableIndex], a ret -; 2523b (9:523b) -Function2523b: ; 2523b +.KantoCheck +; unreferenced ld a, [KantoBadges] and a ret z ld a, $4 ld [wJumptableIndex], a ret -; 25246 -Function25246: ; 25246 +.Quit ld a, $6 ld [wJumptableIndex], a ret -Function2524c: ; 2524c (9:524c) +TrainerCard_Page3_LoadGFX: ; 2524c (9:524c) call ClearSprites hlcoord 0, 8 - ld d, $6 - call Function253b0 + ld d, 6 + call TrainerCard_InitBorder call WaitBGMap ld de, LeaderGFX2 ld hl, VTiles2 tile $29 @@ -201,13 +192,13 @@ Function2524c: ; 2524c (9:524c) ld hl, VTiles0 tile $00 lb bc, BANK(BadgeGFX2), $2c call Request2bpp - call Function2536c - call Function251ab + call TrainerCard_Page2_3_InitObjectsAndStrings + call TrainerCard_IncrementJumptable ret -Function25279: ; 25279 (9:5279) - ld hl, Unknown_254c9 - call Function25438 +TrainerCard_Page3_Joypad: ; 25279 (9:5279) + ld hl, TrainerCard_JohtoBadgesOAM + call TrainerCard_Page2_3_AnimateBadges ld hl, hJoyLast ld a, [hl] and D_LEFT @@ -227,16 +218,16 @@ Function25279: ; 25279 (9:5279) ld [wJumptableIndex], a ret -Function25299: ; 25299 (9:5299) +TrainerCard_PrintTopHalfOfCard: ; 25299 (9:5299) hlcoord 0, 0 - ld d, $5 - call Function253b0 + ld d, 5 + call TrainerCard_InitBorder hlcoord 2, 2 - ld de, String_252ec + ld de, .Name_Money call PlaceString hlcoord 2, 4 - ld de, Tilemap_252f9 - call Function253a8 + ld de, .ID_No + call TrainerCardSetup_PlaceTilemapString hlcoord 7, 2 ld de, PlayerName call PlaceString @@ -249,46 +240,47 @@ Function25299: ; 25299 (9:5299) lb bc, PRINTNUM_MONEY | 3, 6 call PrintNum hlcoord 1, 3 - ld de, Tilemap_252fc - call Function253a8 + ld de, .HorizontalDivider + call TrainerCardSetup_PlaceTilemapString hlcoord 14, 1 lb bc, 5, 7 xor a ld [hFillBox], a predef FillBox ret + ; 252ec (9:52ec) -String_252ec: ; 252ec +.Name_Money: ; 252ec db "NAME/" next "" next "MONEY@" -Tilemap_252f9: ; 252f9 +.ID_No: ; 252f9 db $27, $28, $ff ; ID NO -Tilemap_252fc: ; 252fc +.HorizontalDivider: ; 252fc db $25, $25, $25, $25, $25, $25, $25, $25, $25, $25, $25, $25, $26, $ff ; ____________> ; 2530a -Function2530a: ; 2530a (9:530a) +TrainerCard_Page1_PrintDexCaught_GameTime: ; 2530a (9:530a) hlcoord 2, 10 - ld de, String_2534c + ld de, .Dex_PlayTime call PlaceString hlcoord 10, 15 - ld de, String_2535c + ld de, .Badges call PlaceString ld hl, PokedexCaught - ld b, $20 + ld b, EndPokedexCaught - PokedexCaught call CountSetBits ld de, wd265 hlcoord 15, 10 lb bc, 1, 3 call PrintNum - call Function25415 + call TrainerCard_Page1_PrintGameTime hlcoord 2, 8 - ld de, Tilemap_25366 - call Function253a8 + ld de, .StatusTilemap + call TrainerCardSetup_PlaceTilemapString ld a, [StatusFlags] ; pokedex bit 0, a ret nz @@ -296,119 +288,122 @@ Function2530a: ; 2530a (9:530a) lb bc, 2, 17 call ClearBox ret -; 2534c (9:534c) -String_2534c: ; 2534c +.Dex_PlayTime db "#DEX" - next "PLAY TIME" - db "@" + next "PLAY TIME@@" -String_2535b: ; 2535b - db "@" - -String_2535c: ; 2535c +.Badges db " BADGES▶@" -Tilemap_25366: ; 25366 +.StatusTilemap: ; 25366 db $29, $2a, $2b, $2c, $2d, $ff ; 2536c -Function2536c: ; 2536c (9:536c) +TrainerCard_Page2_3_InitObjectsAndStrings: ; 2536c (9:536c) hlcoord 2, 8 - ld de, Tilemap_253a2 - call Function253a8 + ld de, .BadgesTilemap + call TrainerCardSetup_PlaceTilemapString hlcoord 2, 10 ld a, $29 - ld c, $4 -.asm_2537c - call Function253f4 + ld c, 4 +.loop + call TrainerCard_Page2_3_PlaceLeadersFaces rept 4 inc hl endr dec c - jr nz, .asm_2537c + jr nz, .loop hlcoord 2, 13 ld a, $51 - ld c, $4 -.asm_2538d - call Function253f4 + ld c, 4 +.loop2 + call TrainerCard_Page2_3_PlaceLeadersFaces rept 4 inc hl endr dec c - jr nz, .asm_2538d + jr nz, .loop2 xor a ld [wcf64], a - ld hl, Unknown_254c9 - call Function25448 + ld hl, TrainerCard_JohtoBadgesOAM + call TrainerCard_Page2_3_OAMUpdate ret + ; 253a2 (9:53a2) -Tilemap_253a2: ; 253a2 +.BadgesTilemap: ; 253a2 db $79, $7a, $7b, $7c, $7d, $ff ; "BADGES" ; 253a8 -Function253a8: ; 253a8 (9:53a8) +TrainerCardSetup_PlaceTilemapString: ; 253a8 (9:53a8) +.loop ld a, [de] cp $ff ret z ld [hli], a inc de - jr Function253a8 + jr .loop -Function253b0: ; 253b0 (9:53b0) - ld e, $14 -.asm_253b2 +TrainerCard_InitBorder: ; 253b0 (9:53b0) + ld e, 20 +.loop1 ld a, $23 ld [hli], a dec e - jr nz, .asm_253b2 + jr nz, .loop1 + ld a, $23 ld [hli], a - ld e, $11 - ld a, $7f -.asm_253bf + ld e, 17 + ld a, " " +.loop2 ld [hli], a dec e - jr nz, .asm_253bf + jr nz, .loop2 + ld a, $1c ld [hli], a ld a, $23 ld [hli], a -.asm_253c9 +.loop3 ld a, $23 ld [hli], a - ld e, $12 - ld a, $7f -.asm_253d0 + + ld e, 18 + ld a, " " +.loop4 ld [hli], a dec e - jr nz, .asm_253d0 + jr nz, .loop4 + ld a, $23 ld [hli], a dec d - jr nz, .asm_253c9 + jr nz, .loop3 + ld a, $23 ld [hli], a ld a, $24 ld [hli], a - ld e, $11 - ld a, $7f -.asm_253e4 + + ld e, 17 + ld a, " " +.loop5 ld [hli], a dec e - jr nz, .asm_253e4 + jr nz, .loop5 ld a, $23 ld [hli], a - ld e, $14 -.asm_253ed + ld e, 20 +.loop6 ld a, $23 ld [hli], a dec e - jr nz, .asm_253ed + jr nz, .loop6 ret -Function253f4: ; 253f4 (9:53f4) +TrainerCard_Page2_3_PlaceLeadersFaces: ; 253f4 (9:53f4) push de push hl ld [hli], a @@ -419,7 +414,7 @@ Function253f4: ; 253f4 (9:53f4) inc a ld [hli], a inc a - ld de, $11 + ld de, SCREEN_WIDTH - 3 add hl, de ld [hli], a inc a @@ -427,7 +422,7 @@ Function253f4: ; 253f4 (9:53f4) inc a ld [hli], a inc a - ld de, $11 + ld de, SCREEN_WIDTH - 3 add hl, de ld [hli], a inc a @@ -439,7 +434,7 @@ Function253f4: ; 253f4 (9:53f4) pop de ret -Function25415: ; 25415 (9:5415) +TrainerCard_Page1_PrintGameTime: ; 25415 (9:5415) hlcoord 11, 12 ld de, GameTimeHours lb bc, 2, 4 @@ -453,11 +448,11 @@ Function25415: ; 25415 (9:5415) ret nz hlcoord 15, 12 ld a, [hl] - xor $51 + xor %01010001 ; $7F <--> $2E ld [hl], a ret -Function25438: ; 25438 (9:5438) +TrainerCard_Page2_3_AnimateBadges: ; 25438 (9:5438) ld a, [hVBlankCounter] and $7 ret nz @@ -465,9 +460,9 @@ Function25438: ; 25438 (9:5438) inc a and $7 ld [wcf64], a - jr Function25448 + jr TrainerCard_Page2_3_OAMUpdate -Function25448: ; 25448 (9:5448) +TrainerCard_Page2_3_OAMUpdate: ; 25448 (9:5448) ; copy flag array pointer ld a, [hli] ld e, a @@ -497,7 +492,7 @@ Function25448: ; 25448 (9:5448) ld h, a ld a, [hl] ld [wcf65], a - call Function2547b + call .PrepOAM pop hl .skip_badge ld bc, $b ; 3 + 2 * 4 @@ -507,15 +502,16 @@ Function25448: ; 25448 (9:5448) jr nz, .loop ret -Function2547b: ; 2547b (9:547b) +.PrepOAM: ; 2547b (9:547b) ld a, [wcf65] and $80 jr nz, .xflip ld hl, .facing1 - jr .loop + jr .loop2 + .xflip ld hl, .facing2 -.loop +.loop2 ld a, [hli] cp $ff ret z @@ -540,7 +536,8 @@ Function2547b: ; 2547b (9:547b) ld [de], a inc hl inc de - jr .loop + jr .loop2 + ; 254a7 (9:54a7) .facing1: ; 254a7 @@ -558,7 +555,7 @@ Function2547b: ; 2547b (9:547b) db 8, 8, 2, X_FLIP db -1 -Unknown_254c9: ; 254c9 +TrainerCard_JohtoBadgesOAM: ; 254c9 ; Template OAM data for each badge on the trainer card. ; Format: ; y, x, palette diff --git a/event/whiteout.asm b/event/whiteout.asm index 9bce90e17..a076bdcb6 100755 --- a/event/whiteout.asm +++ b/event/whiteout.asm @@ -42,7 +42,7 @@ OverworldBGMap: ; 124fa ; 1250a BattleBGMap: ; 1250a - ld b, SCGB_00 + ld b, SCGB_BATTLE_GRAYSCALE call GetSGBLayout call SetPalettes ret diff --git a/main.asm b/main.asm index d7c88db4d..c1a1568f1 100644 --- a/main.asm +++ b/main.asm @@ -12543,7 +12543,7 @@ GetPlayerIcon: ; 8832c ret ; 8833e -Function8833e: ; 8833e +GetCardPic: ; 8833e ld hl, ChrisCardPic ld a, [PlayerGender] bit 0, a diff --git a/misc/fixed_words.asm b/misc/fixed_words.asm index c82c0d3e3..c7f1390e5 100755 --- a/misc/fixed_words.asm +++ b/misc/fixed_words.asm @@ -21,6 +21,7 @@ Function11c05d: ; 11c05d ld b, h scf ret + ; 11c075 Function11c075: ; 11c075 @@ -31,6 +32,7 @@ Function11c075: ; 11c075 ld bc, wcd36 call Function11c08f ret + ; 11c082 Function11c082: ; 11c082 @@ -41,6 +43,7 @@ Function11c082: ; 11c082 ld bc, wcd36 call Function11c0c6 ret + ; 11c08f Function11c08f: ; 11c08f @@ -93,6 +96,7 @@ Function11c08f: ; 11c08f dec a jr nz, .asm_11c0b0 ret + ; 11c0c6 @@ -187,6 +191,7 @@ Function11c0c6: ; 11c0c6 ld a, h ld [wcf64], a ret + ; 11c14a Function11c14a: ; 11c14a @@ -211,8 +216,8 @@ Function11c156: ; 11c156 call ByteFill ld a, d and a - jr z, .asm_11c19c - ld hl, Unknown_11daac + jr z, .get_name + ld hl, MobileFixedWordCategoryPointers dec d sla d ld c, d @@ -233,8 +238,8 @@ Function11c156: ; 11c156 sla c rl b add hl, bc - ld bc, $0005 -.asm_11c18f + ld bc, 5 ; length of a string +.loop ld de, $c608 call CopyBytes ld de, $c608 @@ -242,13 +247,13 @@ Function11c156: ; 11c156 ld [rSVBK], a ret -.asm_11c19c +.get_name ld a, e ld [wd265], a call GetPokemonName ld hl, StringBuffer1 - ld bc, $000a - jr .asm_11c18f + ld bc, PKMN_NAME_LENGTH - 1 + jr .loop ; 11c1ab Function11c1ab: ; 11c1ab @@ -260,6 +265,7 @@ Function11c1ab: ; 11c1ab pop af ld [hInMenu], a ret + ; 11c1b9 Function11c1b9: ; 11c1b9 @@ -272,6 +278,7 @@ Function11c1b9: ; 11c1b9 pop af ld [rSVBK], a ret + ; 11c1ca Function11c1ca: ; 11c1ca @@ -322,6 +329,7 @@ Function11c1ca: ; 11c1ca call Function11d4aa call Function11d3ba ret + ; 11c254 Function11c254: ; 11c254 @@ -343,6 +351,7 @@ Function11c254: ; 11c254 call CopyBytes call CloseSRAM ret + ; 11c277 @@ -370,6 +379,7 @@ Function11c283: ; 11c283 callba ClearSpriteAnims call ClearSprites ret + ; 11c2ac .DoJumptableFunction: ; 11c2ac @@ -525,6 +535,7 @@ Function11c38a: ; 11c38a (47:438a) dec a jr nz, .asm_11c392 ret + ; 11c3bc (47:43bc) String_11c3bc: ; 11c3bc @@ -574,6 +585,7 @@ Function11c3ed: ; 11c3ed (47:43ed) and $10 jr nz, .asm_11c498 ret + .asm_11c41a call PlayClickSFX .asm_11c41d @@ -585,6 +597,7 @@ Function11c3ed: ; 11c3ed (47:43ed) ld a, $8 ld [wcd20], a ; wcd20 (aliases: CreditsPos) ret + .asm_11c42c ld a, [wcd20] ; wcd20 (aliases: CreditsPos) cp $6 @@ -628,6 +641,7 @@ Function11c3ed: ; 11c3ed (47:43ed) ld [wJumptableIndex], a call PlayClickSFX ret + .asm_11c47c ld a, [hl] cp $3 @@ -673,6 +687,7 @@ Function11c4a5: ; 11c4a5 (47:44a5) ld [wcd21], a ld a, $6 ret + .asm_11c4b7 xor a ld [wcd22], a @@ -690,6 +705,7 @@ Function11c4be: ; 11c4be (47:44be) call ByteFill callba ReloadMapPart ret + ; 11c4db (47:44db) String_11c4db: ; 11c4db @@ -849,10 +865,11 @@ Function11c53d: ; 11c53d (47:453d) .asm_11c5ee ld [hl], a ret + ; 11c5f0 Function11c5f0: ; 11c5f0 (47:45f0) - ld de, Strings_11da52 + ld de, MobileFixedWordCategoryNames ld bc, Unknown_11c63a ld a, $f .asm_11c5f8 @@ -886,6 +903,7 @@ Function11c618: ; 11c618 (47:4618) call ByteFill callba ReloadMapPart ret + ; 11c62a (47:462a) String_11c62a: ; 11c62a @@ -1010,6 +1028,7 @@ Function11c675: ; 11c675 (47:4675) set 3, [hl] call PlayClickSFX ret + .asm_11c708 ld a, [hl] cp $3 @@ -1103,6 +1122,7 @@ Function11c770: ; 11c770 (47:4770) .asm_11c795 ld [wcd29], a ret + .asm_11c799 ld a, [wc7d2] ld [wcd28], a @@ -1157,6 +1177,7 @@ Function11c7bc: ; 11c7bc (47:47bc) cp e jr nz, .asm_11c7d0 ret + .asm_11c7e9 ld hl, wd100 ld a, [wcd26] @@ -1187,10 +1208,12 @@ Function11c7bc: ; 11c7bc (47:47bc) cp e jr nz, .asm_11c7f1 ret + .asm_11c811 pop hl pop de ret + .asm_11c814 ld hl, $c648 ld a, [wcd22] @@ -1237,10 +1260,12 @@ Function11c7bc: ; 11c7bc (47:47bc) cp e jr nz, .asm_11c831 ret + .asm_11c851 pop hl pop de ret + ; 11c854 (47:4854) Unknown_11c854: ; 11c854 @@ -1302,6 +1327,7 @@ Function11c86e: ; 11c86e (47:486e) dec c jr nz, .asm_11c8b1 ret + .asm_11c8b7 hlcoord 17, 16 ld a, $7f @@ -1313,6 +1339,7 @@ Function11c86e: ; 11c86e (47:486e) dec c jr nz, .asm_11c8c2 ret + ; 11c8c7 (47:48c7) BCD2String: ; 11c8c7 @@ -1336,6 +1363,7 @@ BCD2String: ; 11c8c7 add "0" ld [hli], a ret + ; 11c8ec MobileString_Page: ; 11c8ec @@ -1381,6 +1409,7 @@ Function11c8f6: ; 11c8f6 (47:48f6) inc hl ld [hl], d ret + .asm_11c927 ld hl, wcd26 ld a, [wcd25] @@ -1451,6 +1480,7 @@ Function11c95d: ; 11c95d (47:495d) jr nz, .asm_11c980 pop hl ret + ; 11c986 (47:4986) Unknown_11c986: @@ -1507,6 +1537,7 @@ Function11c9c3: ; 11c9c3 (47:49c3) and $80 jr nz, .asm_11c9fc ret + .asm_11c9de ld a, [hl] and a @@ -1521,12 +1552,14 @@ Function11c9c3: ; 11c9c3 (47:49c3) ld [wJumptableIndex], a call PlayClickSFX ret + .asm_11c9f7 ld a, [hl] and a ret z dec [hl] ret + .asm_11c9fc ld a, [hl] and a @@ -1573,6 +1606,7 @@ Function11ca19: ; 11ca19 (47:4a19) jr nz, .asm_11ca22 callba ReloadMapPart ret + ; 11ca38 (47:4a38) String_11ca38: ; 11ca38 @@ -1650,6 +1684,7 @@ Function11cab3: ; 11cab3 (47:4ab3) and $80 jr nz, .asm_11cb17 ret + .asm_11cace call PlayClickSFX ld a, [hl] @@ -1668,10 +1703,12 @@ Function11cab3: ; 11cab3 (47:4ab3) ld a, $1 ld [wcd2a], a ret + .asm_11caf3 ld hl, wJumptableIndex set 7, [hl] ret + .asm_11caf9 call PlayClickSFX .asm_11cafc @@ -1685,18 +1722,21 @@ Function11cab3: ; 11cab3 (47:4ab3) ld a, $1 ld [wcd35], a ret + .asm_11cb12 ld a, [hl] and a ret z dec [hl] ret + .asm_11cb17 ld a, [hl] and a ret nz inc [hl] ret + ; 11cb1c (47:4b1c) String_11cb1c: ; 11cb1c @@ -1741,6 +1781,7 @@ Function11cb66: ; 11cb66 (47:4b66) and $80 jr nz, .asm_11cbf0 ret + .asm_11cb81 ld a, [hl] and a @@ -1791,6 +1832,7 @@ Function11cb66: ; 11cb66 (47:4b66) ld a, $10 ld [hl], a ret + .asm_11cbd4 call PlayClickSFX .asm_11cbd7 @@ -1802,12 +1844,14 @@ Function11cb66: ; 11cb66 (47:4b66) ld a, $4 ld [wJumptableIndex], a ret + .asm_11cbeb ld a, [hl] and a ret z dec [hl] ret + .asm_11cbf0 ld a, [hl] and a @@ -1823,6 +1867,7 @@ Function11cbf5: ; 11cbf5 (47:4bf5) dec hl set 7, [hl] ret + ; 11cc01 (47:4c01) Unknown_11cc01: ; 11cc01 @@ -1888,6 +1933,7 @@ Function11cd04: ; 11cd04 (47:4d04) ld a, $4 ld [wJumptableIndex], a ret + ; 11cd10 (47:4d10) String_11cd10: ; 11cd10 @@ -1987,6 +2033,7 @@ Function11cdaa: ; 11cdaa (47:4daa) call ByteFill callba ReloadMapPart ret + ; 11cdc7 (47:4dc7) String_11cdc7: ; 11cdc7 @@ -2115,58 +2162,107 @@ Function11ce2b: ; 11ce2b (47:4e2b) ret z ld [wcd22], a ret + ; 11ceb9 (47:4eb9) Unknown_11ceb9: ; 11ceb9 ; up left down right - db $ff, $01, $05, $ff - db $ff, $02, $06, $00 - db $ff, $03, $07, $01 - db $ff, $04, $08, $02 - db $ff, $14, $09, $03 - db $00, $06, $0a, $ff - db $01, $07, $0b, $05 - db $02, $08, $0c, $06 - db $03, $09, $0d, $07 - db $04, $19, $0e, $08 - db $05, $0b, $0f, $ff - db $06, $0c, $10, $0a - db $07, $0d, $11, $0b - db $08, $0e, $12, $0c - db $09, $1e, $13, $0d - db $0a, $10, $2d, $ff - db $0b, $11, $2d, $0f - db $0c, $12, $2d, $10 - db $0d, $13, $2d, $11 - db $0e, $26, $2d, $12 - db $ff, $15, $19, $04 - db $ff, $16, $1a, $14 - db $ff, $17, $1b, $15 - db $ff, $18, $1c, $16 - db $ff, $23, $1d, $17 - db $14, $1a, $1e, $09 - db $15, $1b, $1f, $19 - db $16, $1c, $20, $1a - db $17, $1d, $21, $1b - db $18, $2b, $22, $1c - db $19, $1f, $26, $0e - db $1a, $20, $27, $1e - db $1b, $21, $28, $1f - db $1c, $22, $29, $20 - db $1d, $2c, $2a, $21 - db $ff, $24, $2b, $18 - db $ff, $25, $2b, $23 - db $ff, $ff, $2b, $24 - db $1e, $27, $2e, $13 - db $1f, $28, $2e, $26 - db $20, $29, $2e, $27 - db $21, $2a, $2e, $28 - db $22, $ff, $2e, $29 - db $23, $ff, $2c, $1d - db $2b, $ff, $2f, $22 - db $0f, $2e, $ff, $ff - db $26, $2f, $ff, $2d - db $2c, $ff, $ff, $2e + db $ff, $01 + db $05, $ff + db $ff, $02 + db $06, $00 + db $ff, $03 + db $07, $01 + db $ff, $04 + db $08, $02 + db $ff, $14 + db $09, $03 + db $00, $06 + db $0a, $ff + db $01, $07 + db $0b, $05 + db $02, $08 + db $0c, $06 + db $03, $09 + db $0d, $07 + db $04, $19 + db $0e, $08 + db $05, $0b + db $0f, $ff + db $06, $0c + db $10, $0a + db $07, $0d + db $11, $0b + db $08, $0e + db $12, $0c + db $09, $1e + db $13, $0d + db $0a, $10 + db $2d, $ff + db $0b, $11 + db $2d, $0f + db $0c, $12 + db $2d, $10 + db $0d, $13 + db $2d, $11 + db $0e, $26 + db $2d, $12 + db $ff, $15 + db $19, $04 + db $ff, $16 + db $1a, $14 + db $ff, $17 + db $1b, $15 + db $ff, $18 + db $1c, $16 + db $ff, $23 + db $1d, $17 + db $14, $1a + db $1e, $09 + db $15, $1b + db $1f, $19 + db $16, $1c + db $20, $1a + db $17, $1d + db $21, $1b + db $18, $2b + db $22, $1c + db $19, $1f + db $26, $0e + db $1a, $20 + db $27, $1e + db $1b, $21 + db $28, $1f + db $1c, $22 + db $29, $20 + db $1d, $2c + db $2a, $21 + db $ff, $24 + db $2b, $18 + db $ff, $25 + db $2b, $23 + db $ff, $ff + db $2b, $24 + db $1e, $27 + db $2e, $13 + db $1f, $28 + db $2e, $26 + db $20, $29 + db $2e, $27 + db $21, $2a + db $2e, $28 + db $22, $ff + db $2e, $29 + db $23, $ff + db $2c, $1d + db $2b, $ff + db $2f, $22 + db $0f, $2e + db $ff, $ff + db $26, $2f + db $ff, $2d + db $2c, $ff + db $ff, $2e ; 11cf79 String_11cf79: ; 11cf79 @@ -2182,6 +2278,7 @@ Function11cfb5: ; 11cfb5 (47:4fb5) ld hl, wJumptableIndex inc [hl] ret + ; 11cfba (47:4fba) Unknown_11cfba: @@ -2548,6 +2645,7 @@ Function11d0b6: ; 11d0b6 (47:50b6) ld e, a call Function11d2ee ret + .asm_11d1b1 ld a, [wcd4c] sla a @@ -2604,6 +2702,7 @@ Function11d0b6: ; 11d0b6 (47:50b6) ld e, a call Function11d2ee ret + ; 11d208 (47:5208) Unknown_11d208: ; 11d208 @@ -2738,38 +2837,40 @@ Unknown_11d2be: ; 11d2be Function11d2ee: ; 11d2ee (47:52ee) ld hl, wcd24 and [hl] - jr nz, .asm_11d316 + jr nz, .update_y_offset ld a, e ld hl, wcd23 and [hl] - jr z, .asm_11d30f - ld hl, $e + jr z, .reset_y_offset + ld hl, SPRITEANIMSTRUCT_0E add hl, bc ld a, [hl] and a - jr z, .asm_11d305 + jr z, .flip_bit_0 dec [hl] ret -.asm_11d305 + +.flip_bit_0 ld a, $0 ld [hld], a ld a, $1 xor [hl] ld [hl], a and a - jr nz, .asm_11d316 -.asm_11d30f - ld hl, $7 + jr nz, .update_y_offset +.reset_y_offset + ld hl, SPRITEANIMSTRUCT_YOFFSET add hl, bc xor a ld [hl], a ret -.asm_11d316 - ld hl, $5 + +.update_y_offset + ld hl, SPRITEANIMSTRUCT_YCOORD add hl, bc ld a, $b0 sub [hl] - ld hl, $7 + ld hl, SPRITEANIMSTRUCT_YOFFSET add hl, bc ld [hl], a ret @@ -2781,11 +2882,12 @@ Function11d323: ; 11d323 ld [rSVBK], a ld hl, Palette_11d33a ld de, UnknBGPals - ld bc, 16 * 8 + ld bc, 16 palettes call CopyBytes pop af ld [rSVBK], a ret + ; 11d33a Palette_11d33a: @@ -3044,6 +3146,7 @@ Function11d3ba: ; 11d3ba pop af ld [rSVBK], a ret + ; 11d493 .CheckSeenMon: ; 11d493 @@ -3062,6 +3165,7 @@ Function11d3ba: ; 11d3ba pop bc pop hl ret + ; 11d4aa Function11d4aa: ; 11d4aa @@ -3069,34 +3173,34 @@ Function11d4aa: ; 11d4aa push af ld a, $3 ld [rSVBK], a - ld hl, Unknown_11daac + ld hl, MobileFixedWordCategoryPointers ld bc, Unknown_11f220 xor a ld [wcd2d], a inc a ld [wcd2e], a ld a, $e -.asm_11d4c1 +.loop1 push af ld a, [hli] ld e, a ld a, [hli] ld d, a push hl - ld hl, $0005 + ld hl, 5 ; length of a string add hl, de ld a, [bc] inc bc inc bc push bc -.asm_11d4cf +.loop2 push af push hl ld a, [hli] ld e, a ld a, [hl] ld d, a - ld hl, wd000 + ld hl, w3_d000 add hl, de ld a, [wcd2d] ld [hli], a @@ -3105,11 +3209,11 @@ Function11d4aa: ; 11d4aa ld a, [wcd2e] ld [hl], a pop hl - ld de, $0008 + ld de, 8 add hl, de pop af dec a - jr nz, .asm_11d4cf + jr nz, .loop2 ld hl, wcd2d xor a ld [hli], a @@ -3118,10 +3222,11 @@ Function11d4aa: ; 11d4aa pop hl pop af dec a - jr nz, .asm_11d4c1 + jr nz, .loop1 pop af ld [rSVBK], a ret + ; 11d4fe @@ -3272,40 +3377,40 @@ LZ_11d6de: INCBIN "gfx/pokedex/slowpoke.2bpp.lz" ; 11da52 -Strings_11da52: ; 11da52 +MobileFixedWordCategoryNames: ; 11da52 ; Fixed message categories - db "ポケモン@@" - db "タイプ@@@" - db "あいさつ@@" - db "ひと@@@@" - db "バトル@@@" - db "こえ@@@@" - db "かいわ@@@" - db "きもち@@@" - db "じょうたい@" - db "せいかつ@@" - db "しゅみ@@@" - db "こうどう@@" - db "じかん@@@" - db "むすび@@@" - db "あれこれ@@" + db "ポケモン@@" ; 00 + db "タイプ@@@" ; 01 + db "あいさつ@@" ; 02 + db "ひと@@@@" ; 03 + db "バトル@@@" ; 04 + db "こえ@@@@" ; 05 + db "かいわ@@@" ; 06 + db "きもち@@@" ; 07 + db "じょうたい@" ; 08 + db "せいかつ@@" ; 09 + db "しゅみ@@@" ; 0a + db "こうどう@@" ; 0b + db "じかん@@@" ; 0c + db "むすび@@@" ; 0d + db "あれこれ@@" ; 0e ; 11daac -Unknown_11daac: ; 11daac - dw .Types - dw .Greetings - dw .People - dw .Battle - dw .Exclamations - dw .Conversation - dw .Feelings - dw .Conditions - dw .Life - dw .Hobbies - dw .Actions - dw .Time - dw .Farewells - dw .ThisAndThat +MobileFixedWordCategoryPointers: ; 11daac + dw .Types ; 01 + dw .Greetings ; 02 + dw .People ; 03 + dw .Battle ; 04 + dw .Exclamations ; 05 + dw .Conversation ; 06 + dw .Feelings ; 07 + dw .Conditions ; 08 + dw .Life ; 09 + dw .Hobbies ; 0a + dw .Actions ; 0b + dw .Time ; 0c + dw .Farewells ; 0d + dw .ThisAndThat ; 0e .Types: ; 11dac8 db "あく@@@", $26, $0, $0 @@ -4084,13 +4189,20 @@ Unknown_11daac: ; 11daac ; 11f220 Unknown_11f220: - db $12, $01, $24, $02 - db $45, $05, $45, $05 - db $42, $05, $42, $05 - db $45, $05, $42, $05 - db $27, $03, $27, $03 - db $45, $05, $27, $03 - db $42, $05, $24, $02 + db $12, $01 ; 01 + db $24, $02 ; 02 + db $45, $05 ; 03 + db $45, $05 ; 04 + db $42, $05 ; 05 + db $42, $05 ; 06 + db $45, $05 ; 07 + db $42, $05 ; 08 + db $27, $03 ; 09 + db $27, $03 ; 0a + db $45, $05 ; 0b + db $27, $03 ; 0c + db $42, $05 ; 0d + db $24, $02 ; 0e Unknown_11f23c: macro_11f23c: macro diff --git a/misc/mobile_40.asm b/misc/mobile_40.asm index 5e933b7fc..8c48b6546 100644 --- a/misc/mobile_40.asm +++ b/misc/mobile_40.asm @@ -1807,7 +1807,7 @@ Function100b12: ; 100b12 ld [wMenuCursorBuffer], a call Function100e72 call Function100b45 - callba InitBattlePartyMenuPals + callba InitPartyMenuBGPal7 call Function100ed4 ld a, [wMenuCursorBuffer] ld [wd0d2], a @@ -1817,8 +1817,8 @@ Function100b12: ; 100b12 Function100b45: ; 100b45 call Function100b7a -.asm_100b48 - call Function100dd2 +.loop + call Mobile_SetOverworldDelay callba MobileMenuJoypad push bc callba Function10402d @@ -1827,7 +1827,7 @@ Function100b45: ; 100b45 jr c, .asm_100b6b ld a, [wMenuJoypadFilter] and c - jr z, .asm_100b48 + jr z, .loop callba Mobile_GetMenuSelection ret @@ -1863,63 +1863,63 @@ MobileMoveSelectionScreen: ; 100b9f call Function100dd8 jp c, xor_a_dec_a call Function100e72 - call Function100bc2 + call .GetMoveSelection push af - callba InitBattlePartyMenuPals + callba InitPartyMenuBGPal7 call Function100ed4 pop af ret ; 100bc2 -Function100bc2: ; 100bc2 +.GetMoveSelection: ; 100bc2 xor a ld [hBGMapMode], a call Function100c74 call Function100c98 -.asm_100bcb +.master_loop callba MoveInfoBox -.asm_100bd1 - call Function100dd2 +.loop + call Mobile_SetOverworldDelay callba MobileMenuJoypad push bc callba Function10402d call Function100e2d pop bc - jr c, .asm_100c25 + jr c, .b_button ld a, [wMenuJoypadFilter] and c - bit 6, a - jp nz, .asm_100bff - bit 7, a - jp nz, .asm_100c10 - bit 0, a - jr nz, .asm_100c30 - bit 1, a - jr nz, .asm_100c25 - jr .asm_100bd1 + bit D_UP_F, a + jp nz, .d_up + bit D_DOWN_F, a + jp nz, .d_down + bit A_BUTTON_F, a + jr nz, .a_button + bit B_BUTTON_F, a + jr nz, .b_button + jr .loop -.asm_100bff +.d_up ld a, [wMenuCursorY] and a - jp nz, .asm_100bcb + jp nz, .master_loop ld a, [wNumMoves] inc a ld [wMenuCursorY], a - jp .asm_100bcb + jp .master_loop -.asm_100c10 +.d_down ld a, [wMenuCursorY] ld b, a ld a, [wNumMoves] inc a inc a cp b - jp nz, .asm_100bcb + jp nz, .master_loop ld a, $1 ld [wMenuCursorY], a - jp .asm_100bcb + jp .master_loop -.asm_100c25 +.b_button ld a, [wMenuCursorY] dec a ld [CurMoveNum], a @@ -1927,7 +1927,7 @@ Function100bc2: ; 100bc2 and a ret -.asm_100c30 +.a_button ld a, [wMenuCursorY] dec a ld [CurMoveNum], a @@ -1939,13 +1939,13 @@ Function100bc2: ; 100bc2 add hl, bc ld a, [hl] and $3f - jr z, .asm_100c68 + jr z, .no_pp_left ld a, [PlayerDisableCount] swap a and $f dec a cp c - jr z, .asm_100c63 + jr z, .move_disabled ld a, [wMenuCursorY] dec a ld c, a @@ -1957,17 +1957,17 @@ Function100bc2: ; 100bc2 xor a ret -.asm_100c63 +.move_disabled ld hl, BattleText_TheMoveIsDisabled - jr .asm_100c6b + jr .print_text -.asm_100c68 +.no_pp_left ld hl, BattleText_TheresNoPPLeftForThisMove -.asm_100c6b +.print_text call StdBattleTextBox call Call_LoadTempTileMapToTileMap - jp Function100bc2 + jp .GetMoveSelection ; 100c74 Function100c74: ; 100c74 @@ -2012,7 +2012,7 @@ Function100cb5: ; 100cb5 set 7, [hl] res 6, [hl] .loop - call Function100dd2 + call Mobile_SetOverworldDelay callba MobileMenuJoypad push bc callba PlaySpriteAnimations @@ -2066,7 +2066,7 @@ MobileBattleMonMenu: ; 100d22 set 7, [hl] res 6, [hl] .asm_100d30 - call Function100dd2 + call Mobile_SetOverworldDelay callba MobileMenuJoypad push bc callba PlaySpriteAnimations @@ -2169,7 +2169,7 @@ Function100dc0: ; 100dc0 ret ; 100dd2 -Function100dd2: ; 100dd2 +Mobile_SetOverworldDelay: ; 100dd2 ld a, 30 ld [OverworldDelay], a ret @@ -2337,7 +2337,7 @@ Function100ec5 ; 100eca Function100eca: ; 100eca - callba Function8e8b + callba Mobile_InitPartyMenuBGPal7 call Function100ed4 ret ; 100ed4 @@ -5120,13 +5120,13 @@ UnknownText_0x1021f4: Function1021f9: ; 1021f9 call Function102233 - ld a, 0 + ld a, $0 ; Function10234b ld [wcd49], a ld hl, wcd29 bit 3, [hl] res 3, [hl] jr z, .asm_10220f - ld a, $1 + ld a, $1 ; Function102361 ld [wcd49], a .asm_10220f @@ -5280,49 +5280,49 @@ Function1022d0: ; 1022d0 ; 1022f5 Jumptable_1022f5: ; 1022f5 - dw Function10234b - dw Function102361 - dw Function10236e - dw Function102387 - dw Function1023a1 - dw Function1025c7 - dw Function1025dc - dw Function1024f6 - dw Function10250c - dw Function1024a8 - dw Function102591 - dw Function1024a8 - dw Function1025b0 - dw Function1025bd - dw Function102814 - dw Function10283c - dw Function102862 - dw Function10286f - dw Function1024a8 - dw Function1028a5 - dw Function1028ab - dw Function1023b5 - dw Function1023c6 - dw Function1024af - dw Function102416 - dw Function102423 - dw Function10244b - dw Function1024af - dw Function10246a - dw Function102652 - dw Function10266b - dw Function1025e9 - dw Function1025ff - dw Function102738 - dw Function102754 - dw Function1026b7 - dw Function1026c8 - dw Function1028bf - dw Function1028c6 - dw Function1028d3 - dw Function1028da - dw Function1024a8 - dw Function10248d + dw Function10234b ; 00 + dw Function102361 ; 01 + dw Function10236e ; 02 + dw Function102387 ; 03 + dw Function1023a1 ; 04 + dw Function1025c7 ; 05 + dw Function1025dc ; 06 + dw Function1024f6 ; 07 + dw Function10250c ; 08 + dw Function1024a8 ; 09 + dw Function102591 ; 0a + dw Function1024a8 ; 0b + dw Function1025b0 ; 0c + dw Function1025bd ; 0d + dw Function102814 ; 0e + dw Function10283c ; 0f + dw Function102862 ; 10 + dw Function10286f ; 11 + dw Function1024a8 ; 12 + dw Function1028a5 ; 13 + dw Function1028ab ; 14 + dw Function1023b5 ; 15 + dw Function1023c6 ; 16 + dw Function1024af ; 17 + dw Function102416 ; 18 + dw Function102423 ; 19 + dw Function10244b ; 1a + dw Function1024af ; 1b + dw Function10246a ; 1c + dw Function102652 ; 1d + dw Function10266b ; 1e + dw Function1025e9 ; 1f + dw Function1025ff ; 20 + dw Function102738 ; 21 + dw Function102754 ; 22 + dw Function1026b7 ; 23 + dw Function1026c8 ; 24 + dw Function1028bf ; 25 + dw Function1028c6 ; 26 + dw Function1028d3 ; 27 + dw Function1028da ; 28 + dw Function1024a8 ; 29 + dw Function10248d ; 2a ; 10234b Function10234b: ; 10234b @@ -5723,22 +5723,22 @@ Function1025ff: ; 1025ff ld a, [wMenuJoypadFilter] and c ret z - bit 0, c - jr nz, .asm_102623 - bit 6, c - jr nz, .asm_10262e - bit 7, c - jr nz, .asm_102646 + bit A_BUTTON_F, c + jr nz, .a_button + bit D_UP_F, c + jr nz, .d_up + bit D_DOWN_F, c + jr nz, .d_down ret -.asm_102623 +.a_button ld hl, wcd4b set 3, [hl] - ld a, $27 + ld a, $27 ; Function1028d3 ld [wcd49], a ret -.asm_10262e +.d_up ld a, [wMenuCursorY] ld b, a ld a, [OTPartyCount] @@ -5747,15 +5747,15 @@ Function1025ff: ; 1025ff call HideCursor ld a, [PartyCount] ld [wMenuCursorY], a - ld a, $1d + ld a, $1d ; Function102652 ld [wcd49], a ret -.asm_102646 +.d_down ld a, [wMenuCursorY] cp $1 ret nz - ld a, $23 + ld a, $23 ; Function1026b7 ld [wcd49], a ret ; 102652 @@ -5785,37 +5785,37 @@ Function10266b: ; 10266b ld a, [wMenuJoypadFilter] and c ret z - bit 0, c - jr nz, .asm_10268f - bit 7, c - jr nz, .asm_10269a - bit 6, c - jr nz, .asm_1026a8 + bit A_BUTTON_F, c + jr nz, .a_button + bit D_DOWN_F, c + jr nz, .d_down + bit D_UP_F, c + jr nz, .d_up ret -.asm_10268f +.a_button ld hl, wcd4b set 3, [hl] - ld a, $21 + ld a, $21 ; Function102738 ld [wcd49], a ret -.asm_10269a +.d_down ld a, [wMenuCursorY] dec a ret nz call HideCursor - ld a, $1f + ld a, $1f ; Function1025e9 ld [wcd49], a ret -.asm_1026a8 +.d_up ld a, [wMenuCursorY] ld b, a ld a, [PartyCount] cp b ret nz - ld a, $23 + ld a, $23 ; Function1026b7 ld [wcd49], a ret ; 1026b7 @@ -5858,40 +5858,40 @@ Function1026de: ; 1026de Function1026f3: ; 1026f3 ld a, [hJoyPressed] - bit 0, a + bit A_BUTTON_F, a jr nz, .asm_102723 - bit 6, a + bit D_UP_F, a jr nz, .asm_102712 - bit 7, a + bit D_DOWN_F, a jr nz, .asm_102702 ret .asm_102702 hlcoord 9, 17 - ld [hl], $7f + ld [hl], " " ld a, $1 ld [wMenuCursorY], a - ld a, $1d + ld a, $1d ; Function102652 ld [wcd49], a ret .asm_102712 hlcoord 9, 17 - ld [hl], $7f + ld [hl], " " ld a, [OTPartyCount] ld [wMenuCursorY], a - ld a, $1f + ld a, $1f ; Function1025e9 ld [wcd49], a ret .asm_102723 hlcoord 9, 17 - ld [hl], $ec + ld [hl], "▷" ld hl, wcd4b set 3, [hl] ld hl, wcd4b set 2, [hl] - ld a, $5 + ld a, $5 ; Function1025c7 ld [wcd49], a ret ; 102738 @@ -5933,9 +5933,9 @@ Function102770: ; 102770 Function102775: ; 102775 hlcoord 1, 16 - ld [hl], $ed + ld [hl], "▶" hlcoord 11, 16 - ld [hl], $7f + ld [hl], " " ld hl, wcd4b set 2, [hl] ld a, [wcd4a] @@ -5946,23 +5946,22 @@ Function102775: ; 102775 Function10278c: ; 10278c ld a, [hJoyPressed] - bit 0, a + bit A_BUTTON_F, a jr nz, asm_1027c6 - bit 1, a + bit B_BUTTON_F, a jr nz, asm_1027e2 - bit 4, a + bit D_RIGHT_F, a jr nz, .asm_10279b ret .asm_10279b ld a, $3 ld [wcd4a], a - Function1027a0: ; 1027a0 hlcoord 1, 16 - ld [hl], $7f + ld [hl], " " hlcoord 11, 16 - ld [hl], $ed + ld [hl], "▶" ld hl, wcd4b set 2, [hl] ld a, [wcd4a] @@ -5972,18 +5971,18 @@ Function1027a0: ; 1027a0 Function1027b7: ; 1027b7 ld a, [hJoyPressed] - bit 0, a + bit A_BUTTON_F, a jr nz, asm_1027d1 - bit 1, a + bit B_BUTTON_F, a jr nz, asm_1027e2 - bit 5, a + bit D_LEFT_F, a jr nz, Function102770 ret asm_1027c6: ld hl, wcd4b set 3, [hl] - ld a, $25 + ld a, $25 ; Function1028bf ld [wcd49], a ret @@ -5992,31 +5991,31 @@ asm_1027d1: set 3, [hl] ld a, [wMenuCursorY] ld [wcd4c], a - ld a, $7 + ld a, $7 ; Function1024f6 ld [wcd49], a ret asm_1027e2: call Function102db7 - ld a, $1d + ld a, $1d ; Function102652 ld [wcd49], a ret ; 1027eb Function1027eb: ; 1027eb hlcoord 0, 14 - ld b, $2 - ld c, $12 + ld b, 2 + ld c, 18 ld d, h ld e, l callba _LinkTextbox - ld de, String_102804 + ld de, .Stats_Trade hlcoord 2, 16 call PlaceString ret ; 102804 -String_102804: ; 102804 +.Stats_Trade: ; 102804 db "STATS TRADE@" ; 102814 @@ -6044,14 +6043,14 @@ Function10283c: ; 10283c call Function1029c3 ret z jr c, .asm_102852 - ld a, $10 + ld a, $10 ; Function102862 ld [wcd49], a ld hl, wcd4b set 1, [hl] ret .asm_102852 - ld a, $14 + ld a, $14 ; Function1028ab ld [wcd49], a ld hl, wcd4b set 3, [hl] @@ -6077,7 +6076,7 @@ Function10286f: ; 10286f ld a, [wcd51] cp $8 jr nz, .asm_102886 - ld a, $15 + ld a, $15 ; Function1023b5 ld [wcd49], a ret @@ -6098,7 +6097,7 @@ Function10286f: ; 10286f ; 1028a5 Function1028a5: ; 1028a5 - ld a, $4 + ld a, $4 ; Function1023a1 ld [wcd49], a ret ; 1028ab @@ -6109,7 +6108,7 @@ Function1028ab: ; 1028ab call Function102f15 ld hl, wcd4b set 1, [hl] - ld a, $c + ld a, $c ; Function1025b0 ld [wcd49], a ret ; 1028bf @@ -6123,7 +6122,7 @@ Function1028c6: ; 1028c6 xor a ld [MonType], a call Function102bac - ld a, $1d + ld a, $1d ; Function102652 ld [wcd49], a ret ; 1028d3 @@ -6134,10 +6133,10 @@ Function1028d3: ; 1028d3 ld [wcd49], a Function1028da: ; 1028da - ld a, $1 + ld a, OTPARTYMON ld [MonType], a call Function102bac - ld a, $1f + ld a, $1f ; Function1025e9 ld [wcd49], a ret ; 1028e8 @@ -6485,7 +6484,7 @@ Function102b32: ; 102b32 ; 102b4e Function102b4e: ; 102b4e - ld a, $1 + ld a, OTPARTYMON ld [MonType], a ld a, [wMenuCursorY] push af diff --git a/misc/mobile_46.asm b/misc/mobile_46.asm index fd9b85e4f..de5539eaa 100755 --- a/misc/mobile_46.asm +++ b/misc/mobile_46.asm @@ -5491,9 +5491,9 @@ Function11a90f: ; 11a90f .asm_11a94f xor a ld [$c31f], a - ld a, $20 + ld a, $c320 % $100 ld [$c31b], a - ld a, $c3 + ld a, $c320 / $100 ld [$c31c], a hlcoord 1, 14 ld a, l @@ -7057,12 +7057,13 @@ Function11b3d9: ; 11b3d9 ; 11b444 Function11b444: ; 11b444 - call Function11b44b - call Function11b45c +; special + call Mobile46_InitJumptable + call Mobile46_RunJumptable ret ; 11b44b -Function11b44b: ; 11b44b +Mobile46_InitJumptable: ; 11b44b xor a ld [wJumptableIndex], a ld [wcf64], a @@ -7072,9 +7073,9 @@ Function11b44b: ; 11b44b ret ; 11b45c -Function11b45c: ; 11b45c +Mobile46_RunJumptable: ; 11b45c .loop - call Function11b46a + call .IterateJumptable call DelayFrame ld a, [wJumptableIndex] cp 4 @@ -7082,7 +7083,7 @@ Function11b45c: ; 11b45c ret ; 11b46a -Function11b46a: ; 11b46a +.IterateJumptable: ; 11b46a jumptable .Jumptable, wJumptableIndex .Jumptable @@ -7377,7 +7378,7 @@ Function11b5e8: ; 11b5e8 ld a, [$a826] ld [wcd31], a call CloseSRAM - call Function11b44b + call Mobile46_InitJumptable call .loop ret @@ -7732,11 +7733,11 @@ Function11b879: ; 11b879 ; 11b920 Function11b920: ; 11b920 - call Function11b44b + call Mobile46_InitJumptable ld a, $5 call GetSRAMBank ld hl, $a81f - ld de, BattleMonNick + 5 + ld de, wc626 ld bc, $0008 call CopyBytes call CloseSRAM diff --git a/predef/cgb.asm b/predef/cgb.asm index 61be93ad4..9a24dfce1 100644 --- a/predef/cgb.asm +++ b/predef/cgb.asm @@ -33,16 +33,16 @@ Predef_LoadSGBLayoutCGB: ; 8d59 ; 8d7a .dw: ; 8d7a - dw _CGB00 - dw _CGB01 - dw _CGB02 - dw _CGB03 + dw _CGB_BattleGrayscale + dw _CGB_BattleColors + dw _CGB_PokegearPals + dw _CGB_StatsScreenHPPals dw _CGB04 - dw _CGB05 + dw _CGB_SlotMachine dw _CGB06 dw _CGB07 dw _CGB08 - dw _CGB09 + dw _CGB_MapPals dw _CGB0a dw _CGB0b dw _CGB0c @@ -53,8 +53,8 @@ Predef_LoadSGBLayoutCGB: ; 8d59 dw _CGB11 dw _CGB12 dw _CGB13 - dw _CGB14 - dw _CGB15 + dw _CGB_PackPals + dw _CGB_TrainerCard dw _CGB16 dw _CGB17 dw _CGB18 @@ -66,22 +66,22 @@ Predef_LoadSGBLayoutCGB: ; 8d59 dw _CGB1e ; 8db8 -_CGB00: ; 8db8 +_CGB_BattleGrayscale: ; 8db8 ld hl, PalPacket_9c66 + 1 ld de, UnknBGPals ld c, $4 call CopyPalettes ld hl, PalPacket_9c66 + 1 - ld de, UnknBGPals + $20 + ld de, UnknBGPals + 4 palettes ld c, $4 call CopyPalettes ld hl, PalPacket_9c66 + 1 ld de, UnknOBPals ld c, $2 call CopyPalettes - jr Function8e23 + jr _CGB_FinishBattleScreenLayout -_CGB01: ; 8ddb +_CGB_BattleColors: ; 8ddb ld de, UnknBGPals call GetBattlemonBackpicPalettePointer push hl @@ -112,11 +112,11 @@ _CGB01: ; 8ddb call LoadPalette_White_Col1_Col2_Black pop hl call LoadPalette_White_Col1_Col2_Black - ld a, SCGB_01 + ld a, SCGB_BATTLE_COLORS ld [SGBPredef], a call ApplyPals -Function8e23: ; 8e23 - call InitBattlePartyMenuPals +_CGB_FinishBattleScreenLayout: ; 8e23 + call InitPartyMenuBGPal7 hlcoord 0, 0, AttrMap ld bc, SCREEN_WIDTH * SCREEN_HEIGHT ld a, $2 @@ -146,8 +146,8 @@ Function8e23: ; 8e23 ld a, $7 call ByteFill ld hl, Palettes_979c - ld de, UnknOBPals + $10 - ld bc, $30 + ld de, UnknOBPals + 2 palettes + ld bc, 6 palettes ld a, $5 call FarCopyWRAM call ApplyAttrMap @@ -155,9 +155,9 @@ Function8e23: ; 8e23 ; 8e85 -InitBattlePartyMenuPals: ; 8e85 +InitPartyMenuBGPal7: ; 8e85 callba Function100dc0 -Function8e8b: ; 8e8b +Mobile_InitPartyMenuBGPal7: ; 8e8b ld hl, Palette_b311 jr nc, .not_mobile ld hl, Palette_b309 @@ -169,7 +169,7 @@ Function8e8b: ; 8e8b ret ; 8e9f -Function8e9f: ; 8e9f +InitPartyMenuBGPal0: ; 8e9f callba Function100dc0 ld hl, Palette_b311 jr nc, .not_mobile @@ -182,16 +182,16 @@ Function8e9f: ; 8e9f ret ; 8eb9 -_CGB02: ; 8eb9 +_CGB_PokegearPals: ; 8eb9 ld a, [PlayerGender] bit 0, a - jr z, .asm_8ec5 - ld hl, Palettes_b759 - jr .asm_8ec8 + jr z, .male + ld hl, FemalePokegearPals + jr .got_pals -.asm_8ec5 - ld hl, Palettes_b729 -.asm_8ec8 +.male + ld hl, MalePokegearPals +.got_pals ld de, UnknBGPals ld bc, 6 palettes ld a, $5 @@ -202,7 +202,7 @@ _CGB02: ; 8eb9 ret ; 8edb -_CGB03: ; 8edb +_CGB_StatsScreenHPPals: ; 8edb ld de, UnknBGPals ld a, [wcda1] ld l, a @@ -289,23 +289,23 @@ _CGB04: ; 8f70 call LoadHLPaletteIntoDE ld a, [CurPartySpecies] cp $ff - jr nz, .asm_8f8a + jr nz, .is_pokemon ld hl, Palette8fba call LoadHLPaletteIntoDE - jr .asm_8f90 + jr .got_palette -.asm_8f8a +.is_pokemon call GetMonPalettePointer_ call LoadPalette_White_Col1_Col2_Black -.asm_8f90 +.got_palette call WipeAttrMap hlcoord 1, 1, AttrMap lb bc, 7, 7 ld a, $1 call FillBoxCGB - call Function971a + call InitPartyMenuOBPals ld hl, Palette8fc2 - ld de, UnknOBPals + $38 + ld de, UnknOBPals + 7 palettes ld bc, 1 palettes ld a, $5 call FarCopyWRAM @@ -351,7 +351,7 @@ _CGB17: ; 8fca lb bc, 7, 7 ld a, $1 call FillBoxCGB - call Function971a + call InitPartyMenuOBPals call ApplyAttrMap call ApplyPals ld a, $1 @@ -374,7 +374,7 @@ Function9009: ; 9009 lb bc, 7, 7 ld a, $1 call FillBoxCGB - call Function971a + call InitPartyMenuOBPals call ApplyAttrMap call ApplyPals ld a, $1 @@ -402,7 +402,7 @@ _CGB16: ; 903e lb bc, 7, 7 ld a, $1 call FillBoxCGB - call Function971a + call InitPartyMenuOBPals call ApplyAttrMap call ApplyPals ld a, $1 @@ -410,7 +410,7 @@ _CGB16: ; 903e ret ; 906e -_CGB05: ; 906e +_CGB_SlotMachine: ; 906e ld hl, Palettes_b7a9 ld de, UnknBGPals ld bc, $80 @@ -574,6 +574,7 @@ _CGB08: ; 91ad ld bc, 16 palettes ld a, $5 call FarCopyWRAM + ld hl, PalPacket_9cb6 + 1 call CopyFourPalettes call WipeAttrMap @@ -581,7 +582,7 @@ _CGB08: ; 91ad ret ; 91c8 -_CGB09: ; 91c8 +_CGB_MapPals: ; 91c8 call LoadMapPals ld a, SCGB_MAPPALS ld [SGBPredef], a @@ -591,9 +592,9 @@ _CGB09: ; 91c8 _CGB0a: ; 91d1 ld hl, PalPacket_9c56 + 1 call CopyFourPalettes - call Function8e9f - call InitBattlePartyMenuPals - call Function971a + call InitPartyMenuBGPal0 + call InitPartyMenuBGPal7 + call InitPartyMenuOBPals call ApplyAttrMap ret ; 91e4 @@ -683,7 +684,7 @@ _CGB18: ; 925e ret ; 9289 -_CGB15: ; 9289 +_CGB_TrainerCard: ; 9289 ld de, UnknBGPals xor a call GetTrainerPalettePointer @@ -834,7 +835,7 @@ _CGB10: ; 93ba ret ; 93d3 -_CGB14: ; 93d3 +_CGB_PackPals: ; 93d3 ; pack pals ld a, [BattleType] cp BATTLETYPE_TUTORIAL @@ -948,7 +949,7 @@ _CGB14: ; 93d3 ; 9499 _CGB12: ; 9499 - call _CGB09 + call _CGB_MapPals ld de, SCREEN_WIDTH hlcoord 0, 0, AttrMap ld a, [wMenuBorderTopCoord] diff --git a/predef/sgb.asm b/predef/sgb.asm index 2de9c9359..be44adc63 100644 --- a/predef/sgb.asm +++ b/predef/sgb.asm @@ -24,16 +24,16 @@ Predef_LoadSGBLayout: ; 864c ; 866f .Jumptable: ; 866f - dw .SGB00 - dw .SGB01 - dw .SGB02 - dw .SGB03 + dw .SGB_BattleGrayscale + dw .SGB_BattleColors + dw .SGB_PokegearPals + dw .SGB_StatsScreenHPPals dw .SGB04 - dw .SGB05 + dw .SGB_SlotMachine dw .SGB06 dw .SGB07 dw .SGB08 - dw .SGB09 + dw .SGB_MapPals dw .SGB0a dw .SGB0b dw .SGB0c @@ -44,8 +44,8 @@ Predef_LoadSGBLayout: ; 864c dw .SGB11 dw .SGB12 dw .SGB13 - dw .SGB14 - dw .SGB15 + dw .SGB_PackPals + dw .SGB_TrainerCard dw .SGB16 dw .SGB17 dw .SGB18 @@ -57,13 +57,13 @@ Predef_LoadSGBLayout: ; 864c dw .SGB1e ; 86ad -.SGB00: ; 86ad +.SGB_BattleGrayscale: ; 86ad ld hl, PalPacket_9c66 ld de, BlkPacket_9aa6 ret ; 86b4 -.SGB01: ; 86b4 +.SGB_BattleColors: ; 86b4 ld hl, BlkPacket_9aa6 call Function9809 @@ -135,7 +135,7 @@ endr ld hl, wSGBPals ld de, wSGBPals + $10 - ld a, SCGB_01 + ld a, SCGB_BATTLE_COLORS ld [SGBPredef], a ret ; 873c @@ -160,13 +160,13 @@ endr ret ; 875c -.SGB02: ; 875c +.SGB_PokegearPals: ; 875c ld hl, PalPacket_9c76 ld de, BlkPacket_9a86 ret ; 8763 -.SGB03: ; 8763 +.SGB_StatsScreenHPPals: ; 8763 ld hl, PalPacket_9ce6 ld de, wSGBPals ld bc, $10 @@ -290,13 +290,13 @@ endr ret ; 884b -.SGB14: ; 884b +.SGB_PackPals: ; 884b ld hl, PalPacket_9c36 ld de, BlkPacket_9a86 ret ; 8852 -.SGB05: ; 8852 +.SGB_SlotMachine: ; 8852 ld hl, PalPacket_9c96 ld de, BlkPacket_9b06 ret @@ -367,7 +367,7 @@ endr ret ; 88b1 -.SGB09: ; 88b1 +.SGB_MapPals: ; 88b1 ld hl, PalPacket_9bd6 ld de, wSGBPals ld bc, $10 @@ -426,7 +426,7 @@ endr ; 891a .SGB0d: -.SGB15: ; 891a +.SGB_TrainerCard: ; 891a ld hl, PalPacket_9cb6 ld de, BlkPacket_9a86 ret