From 4c87426d43aacf1101ee59b02f0c4a35ce85e77c Mon Sep 17 00:00:00 2001 From: mid-kid Date: Sun, 28 Apr 2019 23:58:50 +0200 Subject: [PATCH] Do the obvious reorganizations Things like split some "generic" files into multiple specific files, or some big files into multiple, or join some sections. Thing is, splitting the sections like this gives us great insight into what goes where, and what is or isn't related. This commit doesn't yet throw away strict ROM order, however. --- engine/battle/menu.asm | 8 +- engine/events/bug_contest/abort.asm | 9 + engine/events/bug_contest/display_stats.asm | 2 +- .../{misc_scripts_2.asm => hidden_item.asm} | 20 +- .../{misc_scripts.asm => item_ball.asm} | 11 - engine/events/print_unown.asm | 8 +- engine/events/repel.asm | 13 + engine/events/std_collision.asm | 5 +- engine/gfx/player_gfx.asm | 5 +- engine/link/link_trade.asm | 5 +- engine/link/mystery_gift.asm | 5 +- engine/math/{math.asm => divide.asm} | 84 - engine/math/multiply.asm | 82 + engine/menus/trainer_card.asm | 5 +- engine/movie/crystal_intro.asm | 11 +- engine/movie/gbc_only.asm | 5 +- engine/phone/numbers.asm | 96 ++ engine/phone/phone.asm | 98 -- .../pokedex/{pokedex_2.asm => dex_entry.asm} | 81 - engine/pokedex/slowpoke_anim.asm | 79 + engine/pokegear/map.asm | 923 +++++++++++ engine/pokegear/pokegear.asm | 925 ----------- engine/pokemon/breeding.asm | 4 +- engine/printer/print_party.asm | 8 +- engine/tilesets/timeofday_pals.asm | 2 +- main.asm | 14 +- mobile/mobile_45.asm | 1453 +---------------- mobile/mobile_45_sprite_engine.asm | 1451 ++++++++++++++++ mobile/mobile_5c.asm | 5 +- pokecrystal.link | 131 +- 30 files changed, 2725 insertions(+), 2823 deletions(-) create mode 100644 engine/events/bug_contest/abort.asm rename engine/events/{misc_scripts_2.asm => hidden_item.asm} (69%) rename engine/events/{misc_scripts.asm => item_ball.asm} (81%) create mode 100644 engine/events/repel.asm rename engine/math/{math.asm => divide.asm} (54%) create mode 100644 engine/math/multiply.asm create mode 100644 engine/phone/numbers.asm rename engine/pokedex/{pokedex_2.asm => dex_entry.asm} (70%) create mode 100644 engine/pokedex/slowpoke_anim.asm create mode 100644 engine/pokegear/map.asm diff --git a/engine/battle/menu.asm b/engine/battle/menu.asm index d21df0ff1fd..50550f438f4 100644 --- a/engine/battle/menu.asm +++ b/engine/battle/menu.asm @@ -1,4 +1,4 @@ -SECTION "LoadBattleMenu - MenuData_0x24f91", ROMX +SECTION "LoadBattleMenu - Function24fb2", ROMX LoadBattleMenu: ld hl, BattleMenuHeader @@ -88,18 +88,12 @@ MenuData_0x24f91: dba Strings24f9a dba Function24fb2 - -SECTION "Strings24f9a", ROMX - Strings24f9a: db "FIGHT@" db "@" db "PARKBALL× @" db "RUN@" - -SECTION "Function24fb2", ROMX - Function24fb2: hlcoord 13, 16 ld de, wParkBallsRemaining diff --git a/engine/events/bug_contest/abort.asm b/engine/events/bug_contest/abort.asm new file mode 100644 index 00000000000..bbdf75711f8 --- /dev/null +++ b/engine/events/bug_contest/abort.asm @@ -0,0 +1,9 @@ +SECTION "Script_AbortBugContest", ROMX + +Script_AbortBugContest: + checkflag ENGINE_BUG_CONTEST_TIMER + iffalse .finish + setflag ENGINE_DAILY_BUG_CONTEST + special ContestReturnMons +.finish + end diff --git a/engine/events/bug_contest/display_stats.asm b/engine/events/bug_contest/display_stats.asm index 7ff85fb7c8b..a152ef11c1c 100644 --- a/engine/events/bug_contest/display_stats.asm +++ b/engine/events/bug_contest/display_stats.asm @@ -107,7 +107,7 @@ DisplayAlreadyCaughtText: text_end -SECTION "DummyPredef2F", ROMX +SECTION "DummyPredef2F - DummyPredef39", ROMX DummyPredef2F: DummyPredef38: diff --git a/engine/events/misc_scripts_2.asm b/engine/events/hidden_item.asm similarity index 69% rename from engine/events/misc_scripts_2.asm rename to engine/events/hidden_item.asm index cd53f7d6d65..5a126a0e0d8 100644 --- a/engine/events/misc_scripts_2.asm +++ b/engine/events/hidden_item.asm @@ -1,19 +1,4 @@ -SECTION "RepelWoreOffScript", ROMX - -RepelWoreOffScript:: - opentext - writetext .text - waitbutton - closetext - end - -.text - ; REPEL's effect wore off. - text_far _RepelWoreOffText - text_end - - -SECTION "HiddenItemScript", ROMX +SECTION "HiddenItemScript - SetMemEvent", ROMX HiddenItemScript:: opentext @@ -46,9 +31,6 @@ HiddenItemScript:: text_far _ButNoSpaceText text_end - -SECTION "SetMemEvent", ROMX - SetMemEvent: ld hl, wHiddenItemEvent ld a, [hli] diff --git a/engine/events/misc_scripts.asm b/engine/events/item_ball.asm similarity index 81% rename from engine/events/misc_scripts.asm rename to engine/events/item_ball.asm index 562b5ada633..63bfddf6e30 100644 --- a/engine/events/misc_scripts.asm +++ b/engine/events/item_ball.asm @@ -1,14 +1,3 @@ -SECTION "Script_AbortBugContest", ROMX - -Script_AbortBugContest: - checkflag ENGINE_BUG_CONTEST_TIMER - iffalse .finish - setflag ENGINE_DAILY_BUG_CONTEST - special ContestReturnMons -.finish - end - - SECTION "FindItemInBallScript", ROMX FindItemInBallScript:: diff --git a/engine/events/print_unown.asm b/engine/events/print_unown.asm index 6318e87cbe7..46bab50004d 100644 --- a/engine/events/print_unown.asm +++ b/engine/events/print_unown.asm @@ -2,7 +2,7 @@ UNOWNSTAMP_BOLD_A EQU "♂" ; $ef UNOWNSTAMP_BOLD_B EQU "♀" ; $f5 -SECTION "_UnownPrinter - UnownDexVacantString", ROMX +SECTION "_UnownPrinter - UnownDexBTile", ROMX _UnownPrinter: ld a, [wUnownDex] @@ -215,15 +215,9 @@ UnownDexMenuString: UnownDexVacantString: db "VACANT@" - -SECTION "UnownDexATile", ROMX - UnownDexATile: INCBIN "gfx/printer/bold_a.1bpp" - -SECTION "UnownDexBTile", ROMX - UnownDexBTile: INCBIN "gfx/printer/bold_b.1bpp" diff --git a/engine/events/repel.asm b/engine/events/repel.asm new file mode 100644 index 00000000000..77c6d2239d0 --- /dev/null +++ b/engine/events/repel.asm @@ -0,0 +1,13 @@ +SECTION "RepelWoreOffScript", ROMX + +RepelWoreOffScript:: + opentext + writetext .text + waitbutton + closetext + end + +.text + ; REPEL's effect wore off. + text_far _RepelWoreOffText + text_end diff --git a/engine/events/std_collision.asm b/engine/events/std_collision.asm index cd325996e67..31e9f1f03ed 100644 --- a/engine/events/std_collision.asm +++ b/engine/events/std_collision.asm @@ -1,4 +1,4 @@ -SECTION "CheckFacingTileForStdScript - TileCollisionStdScripts", ROMX +SECTION "CheckFacingTileForStdScript - Script_JumpStdFromRAM", ROMX CheckFacingTileForStdScript:: ; Checks to see if the tile you're facing has a std script associated with it. If so, executes the script and returns carry. @@ -27,8 +27,5 @@ CheckFacingTileForStdScript:: INCLUDE "data/events/collision_stdscripts.asm" - -SECTION "Script_JumpStdFromRAM", ROMX - Script_JumpStdFromRAM: sjump wJumpStdScriptBuffer diff --git a/engine/gfx/player_gfx.asm b/engine/gfx/player_gfx.asm index 518f50930fb..1351b689afc 100644 --- a/engine/gfx/player_gfx.asm +++ b/engine/gfx/player_gfx.asm @@ -114,7 +114,7 @@ GetPlayerIcon: ret -SECTION "GetCardPic - KrisCardPic", ROMX +SECTION "GetCardPic - CardGFX", ROMX GetCardPic: ld hl, ChrisCardPic @@ -140,9 +140,6 @@ INCBIN "gfx/trainer_card/chris_card.2bpp" KrisCardPic: INCBIN "gfx/trainer_card/kris_card.2bpp" - -SECTION "CardGFX", ROMX - CardGFX: INCBIN "gfx/trainer_card/trainer_card.2bpp" diff --git a/engine/link/link_trade.asm b/engine/link/link_trade.asm index 2c4cae81ec3..12df88d5e78 100644 --- a/engine/link/link_trade.asm +++ b/engine/link/link_trade.asm @@ -1,11 +1,8 @@ -SECTION "LinkCommsBorderGFX", ROMX +SECTION "LinkCommsBorderGFX - LinkTextbox", ROMX LinkCommsBorderGFX: INCBIN "gfx/trade/border_tiles.2bpp" - -SECTION "__LoadTradeScreenBorder - LinkTextbox", ROMX - __LoadTradeScreenBorder: ld de, LinkCommsBorderGFX ld hl, vTiles2 diff --git a/engine/link/mystery_gift.asm b/engine/link/mystery_gift.asm index 7f805734622..ab56aa31b1e 100644 --- a/engine/link/mystery_gift.asm +++ b/engine/link/mystery_gift.asm @@ -1,4 +1,4 @@ -SECTION "DoMysteryGift - Function1057d7", ROMX +SECTION "DoMysteryGift - MysteryGiftJP_GFX", ROMX DoMysteryGift: call ClearTileMap @@ -1708,9 +1708,6 @@ Function1057d7: dsprite 1, 1, 13, 4, $06, 0 dsprite 1, 1, 14, 4, $07, 0 - -SECTION "MysteryGiftJP_GFX", ROMX - ; japanese mystery gift gfx MysteryGiftJP_GFX: INCBIN "gfx/mystery_gift/mystery_gift_jp.2bpp" diff --git a/engine/math/math.asm b/engine/math/divide.asm similarity index 54% rename from engine/math/math.asm rename to engine/math/divide.asm index 1b4974853b0..2170ce4d451 100644 --- a/engine/math/math.asm +++ b/engine/math/divide.asm @@ -1,87 +1,3 @@ -SECTION "_Multiply", ROMX - -_Multiply:: -; hMultiplier is one byte. - ld a, 8 - ld b, a - - xor a - ldh [hMultiplicand - 1], a - ldh [hMathBuffer + 1], a - ldh [hMathBuffer + 2], a - ldh [hMathBuffer + 3], a - ldh [hMathBuffer + 4], a - -.loop - ldh a, [hMultiplier] - srl a - ldh [hMultiplier], a - jr nc, .next - - ldh a, [hMathBuffer + 4] - ld c, a - ldh a, [hMultiplicand + 2] - add c - ldh [hMathBuffer + 4], a - - ldh a, [hMathBuffer + 3] - ld c, a - ldh a, [hMultiplicand + 1] - adc c - ldh [hMathBuffer + 3], a - - ldh a, [hMathBuffer + 2] - ld c, a - ldh a, [hMultiplicand + 0] - adc c - ldh [hMathBuffer + 2], a - - ldh a, [hMathBuffer + 1] - ld c, a - ldh a, [hMultiplicand - 1] - adc c - ldh [hMathBuffer + 1], a - -.next - dec b - jr z, .done - -; hMultiplicand <<= 1 - - ldh a, [hMultiplicand + 2] - add a - ldh [hMultiplicand + 2], a - - ldh a, [hMultiplicand + 1] - rla - ldh [hMultiplicand + 1], a - - ldh a, [hMultiplicand + 0] - rla - ldh [hMultiplicand + 0], a - - ldh a, [hMultiplicand - 1] - rla - ldh [hMultiplicand - 1], a - - jr .loop - -.done - ldh a, [hMathBuffer + 4] - ldh [hProduct + 3], a - - ldh a, [hMathBuffer + 3] - ldh [hProduct + 2], a - - ldh a, [hMathBuffer + 2] - ldh [hProduct + 1], a - - ldh a, [hMathBuffer + 1] - ldh [hProduct + 0], a - - ret - - SECTION "_Divide", ROMX _Divide:: diff --git a/engine/math/multiply.asm b/engine/math/multiply.asm new file mode 100644 index 00000000000..499be2ad390 --- /dev/null +++ b/engine/math/multiply.asm @@ -0,0 +1,82 @@ +SECTION "_Multiply", ROMX + +_Multiply:: +; hMultiplier is one byte. + ld a, 8 + ld b, a + + xor a + ldh [hMultiplicand - 1], a + ldh [hMathBuffer + 1], a + ldh [hMathBuffer + 2], a + ldh [hMathBuffer + 3], a + ldh [hMathBuffer + 4], a + +.loop + ldh a, [hMultiplier] + srl a + ldh [hMultiplier], a + jr nc, .next + + ldh a, [hMathBuffer + 4] + ld c, a + ldh a, [hMultiplicand + 2] + add c + ldh [hMathBuffer + 4], a + + ldh a, [hMathBuffer + 3] + ld c, a + ldh a, [hMultiplicand + 1] + adc c + ldh [hMathBuffer + 3], a + + ldh a, [hMathBuffer + 2] + ld c, a + ldh a, [hMultiplicand + 0] + adc c + ldh [hMathBuffer + 2], a + + ldh a, [hMathBuffer + 1] + ld c, a + ldh a, [hMultiplicand - 1] + adc c + ldh [hMathBuffer + 1], a + +.next + dec b + jr z, .done + +; hMultiplicand <<= 1 + + ldh a, [hMultiplicand + 2] + add a + ldh [hMultiplicand + 2], a + + ldh a, [hMultiplicand + 1] + rla + ldh [hMultiplicand + 1], a + + ldh a, [hMultiplicand + 0] + rla + ldh [hMultiplicand + 0], a + + ldh a, [hMultiplicand - 1] + rla + ldh [hMultiplicand - 1], a + + jr .loop + +.done + ldh a, [hMathBuffer + 4] + ldh [hProduct + 3], a + + ldh a, [hMathBuffer + 3] + ldh [hProduct + 2], a + + ldh a, [hMathBuffer + 2] + ldh [hProduct + 1], a + + ldh a, [hMathBuffer + 1] + ldh [hProduct + 0], a + + ret diff --git a/engine/menus/trainer_card.asm b/engine/menus/trainer_card.asm index 8de4e27acdc..435ac7f5e02 100644 --- a/engine/menus/trainer_card.asm +++ b/engine/menus/trainer_card.asm @@ -9,7 +9,7 @@ const TRAINERCARDSTATE_QUIT ; 6 -SECTION "TrainerCard - TrainerCard_JohtoBadgesOAM", ROMX +SECTION "TrainerCard - CardRightCornerGFX", ROMX TrainerCard: ld a, [wVramState] @@ -606,9 +606,6 @@ TrainerCard_JohtoBadgesOAM: db $1c, $20, $24, $20 | (1 << 7) db $1c | (1 << 7), $20, $24, $20 | (1 << 7) - -SECTION "CardStatusGFX - CardRightCornerGFX", ROMX - CardStatusGFX: INCBIN "gfx/trainer_card/card_status.2bpp" LeaderGFX: INCBIN "gfx/trainer_card/leaders.2bpp" diff --git a/engine/movie/crystal_intro.asm b/engine/movie/crystal_intro.asm index 0e2477578df..48b57df8dae 100644 --- a/engine/movie/crystal_intro.asm +++ b/engine/movie/crystal_intro.asm @@ -1,4 +1,4 @@ -SECTION "Copyright_GFPresents - GameFreakLogoPalettes", ROMX +SECTION "Copyright_GFPresents - GameFreakLogo", ROMX Copyright_GFPresents: ld de, MUSIC_NONE @@ -331,15 +331,12 @@ GameFreakLogoScene5: GameFreakLogoPalettes: INCLUDE "gfx/intro/gamefreak_logo.pal" - -SECTION "GameFreakLogo", ROMX - GameFreakLogo: INCBIN "gfx/splash/logo1.1bpp" INCBIN "gfx/splash/logo2.1bpp" -SECTION "CrystalIntro - IntroGrass3GFX", ROMX +SECTION "CrystalIntro - IntroGrass4GFX", ROMX CrystalIntro: ldh a, [rSVBK] @@ -2136,9 +2133,5 @@ IntroGrass2GFX: INCBIN "gfx/intro/grass2.2bpp" IntroGrass3GFX: INCBIN "gfx/intro/grass3.2bpp" - - -SECTION "IntroGrass4GFX", ROMX - IntroGrass4GFX: INCBIN "gfx/intro/grass4.2bpp" diff --git a/engine/movie/gbc_only.asm b/engine/movie/gbc_only.asm index e25bc218b05..ae9642b6bd6 100644 --- a/engine/movie/gbc_only.asm +++ b/engine/movie/gbc_only.asm @@ -1,4 +1,4 @@ -SECTION "GBCOnlyScreen - GBCOnlyString", ROMX +SECTION "GBCOnlyScreen - GBCOnlyGFX", ROMX GBCOnlyScreen: ldh a, [hCGB] @@ -131,8 +131,5 @@ GBCOnlyString: next "use on the" next "Game Boy Color.@" - -SECTION "GBCOnlyGFX", ROMX - GBCOnlyGFX: INCBIN "gfx/sgb/gbc_only.2bpp.lz" diff --git a/engine/phone/numbers.asm b/engine/phone/numbers.asm new file mode 100644 index 00000000000..4f861e9fdf9 --- /dev/null +++ b/engine/phone/numbers.asm @@ -0,0 +1,96 @@ +SECTION "AddPhoneNumber - PermanentNumbers", ROMX + +AddPhoneNumber:: + call _CheckCellNum + jr c, .cant_add + call Phone_FindOpenSlot + jr nc, .cant_add + ld [hl], c + xor a + ret + +.cant_add + scf + ret + +DelCellNum:: + call _CheckCellNum + jr nc, .not_in_list + xor a + ld [hl], a + ret + +.not_in_list + scf + ret + +CheckCellNum:: + jp _CheckCellNum ; wtf + +_CheckCellNum: + ld hl, wPhoneList + ld b, CONTACT_LIST_SIZE +.loop + ld a, [hli] + cp c + jr z, .got_it + dec b + jr nz, .loop + xor a + ret + +.got_it + dec hl + scf + ret + +Phone_FindOpenSlot: + call GetRemainingSpaceInPhoneList + ld b, a + ld hl, wPhoneList +.loop + ld a, [hli] + and a + jr z, .FoundOpenSpace + dec b + jr nz, .loop + xor a + ret + +.FoundOpenSpace: + dec hl + scf + ret + +GetRemainingSpaceInPhoneList: + xor a + ld [wBuffer1], a + ld hl, PermanentNumbers +.loop + ld a, [hli] + cp -1 + jr z, .done + cp c + jr z, .continue + + push bc + push hl + ld c, a + call _CheckCellNum + jr c, .permanent + ld hl, wBuffer1 + inc [hl] +.permanent + pop hl + pop bc + +.continue + jr .loop + +.done + ld a, CONTACT_LIST_SIZE + ld hl, wBuffer1 + sub [hl] + ret + +INCLUDE "data/phone/permanent_numbers.asm" diff --git a/engine/phone/phone.asm b/engine/phone/phone.asm index fe8ccb96bd0..661e6ac3ea1 100644 --- a/engine/phone/phone.asm +++ b/engine/phone/phone.asm @@ -1,101 +1,3 @@ -SECTION "AddPhoneNumber - PermanentNumbers", ROMX - -AddPhoneNumber:: - call _CheckCellNum - jr c, .cant_add - call Phone_FindOpenSlot - jr nc, .cant_add - ld [hl], c - xor a - ret - -.cant_add - scf - ret - -DelCellNum:: - call _CheckCellNum - jr nc, .not_in_list - xor a - ld [hl], a - ret - -.not_in_list - scf - ret - -CheckCellNum:: - jp _CheckCellNum ; wtf - -_CheckCellNum: - ld hl, wPhoneList - ld b, CONTACT_LIST_SIZE -.loop - ld a, [hli] - cp c - jr z, .got_it - dec b - jr nz, .loop - xor a - ret - -.got_it - dec hl - scf - ret - -Phone_FindOpenSlot: - call GetRemainingSpaceInPhoneList - ld b, a - ld hl, wPhoneList -.loop - ld a, [hli] - and a - jr z, .FoundOpenSpace - dec b - jr nz, .loop - xor a - ret - -.FoundOpenSpace: - dec hl - scf - ret - -GetRemainingSpaceInPhoneList: - xor a - ld [wBuffer1], a - ld hl, PermanentNumbers -.loop - ld a, [hli] - cp -1 - jr z, .done - cp c - jr z, .continue - - push bc - push hl - ld c, a - call _CheckCellNum - jr c, .permanent - ld hl, wBuffer1 - inc [hl] -.permanent - pop hl - pop bc - -.continue - jr .loop - -.done - ld a, CONTACT_LIST_SIZE - ld hl, wBuffer1 - sub [hl] - ret - -INCLUDE "data/phone/permanent_numbers.asm" - - SECTION "FarPlaceString - UnknownText_0x9066d", ROMX, BANK[BANK_PHONE_CALL] FarPlaceString: diff --git a/engine/pokedex/pokedex_2.asm b/engine/pokedex/dex_entry.asm similarity index 70% rename from engine/pokedex/pokedex_2.asm rename to engine/pokedex/dex_entry.asm index 0b47682f81d..c2c86798ba6 100644 --- a/engine/pokedex/pokedex_2.asm +++ b/engine/pokedex/dex_entry.asm @@ -1,84 +1,3 @@ -SECTION "AnimateDexSearchSlowpoke - DoDexSearchSlowpokeFrame", ROMX - -AnimateDexSearchSlowpoke: - ld hl, .FrameIDs - ld b, 25 -.loop - ld a, [hli] - - ; Wrap around - cp $fe - jr nz, .ok - ld hl, .FrameIDs - ld a, [hli] -.ok - - ld [wDexSearchSlowpokeFrame], a - ld a, [hli] - ld c, a - push bc - push hl - call DoDexSearchSlowpokeFrame - pop hl - pop bc - call DelayFrames - dec b - jr nz, .loop - xor a - ld [wDexSearchSlowpokeFrame], a - call DoDexSearchSlowpokeFrame - ld c, 32 - call DelayFrames - ret - -.FrameIDs: - ; frame ID, duration - db 0, 7 - db 1, 7 - db 2, 7 - db 3, 7 - db 4, 7 - db -2 - -DoDexSearchSlowpokeFrame: - ld a, [wDexSearchSlowpokeFrame] - ld hl, .SlowpokeSpriteData - ld de, wVirtualOAMSprite00 -.loop - ld a, [hli] - cp -1 - ret z - ld [de], a ; y - inc de - ld a, [hli] - ld [de], a ; x - inc de - ld a, [wDexSearchSlowpokeFrame] - ld b, a - add a - add b - add [hl] - inc hl - ld [de], a ; tile id - inc de - ld a, [hli] - ld [de], a ; attributes - inc de - jr .loop - -.SlowpokeSpriteData: - dsprite 11, 0, 9, 0, $00, 0 - dsprite 11, 0, 10, 0, $01, 0 - dsprite 11, 0, 11, 0, $02, 0 - dsprite 12, 0, 9, 0, $10, 0 - dsprite 12, 0, 10, 0, $11, 0 - dsprite 12, 0, 11, 0, $12, 0 - dsprite 13, 0, 9, 0, $20, 0 - dsprite 13, 0, 10, 0, $21, 0 - dsprite 13, 0, 11, 0, $22, 0 - db -1 - - SECTION "DisplayDexEntry - PokedexDataPointerTable", ROMX DisplayDexEntry: diff --git a/engine/pokedex/slowpoke_anim.asm b/engine/pokedex/slowpoke_anim.asm new file mode 100644 index 00000000000..81f749b1ba2 --- /dev/null +++ b/engine/pokedex/slowpoke_anim.asm @@ -0,0 +1,79 @@ +SECTION "AnimateDexSearchSlowpoke - DoDexSearchSlowpokeFrame", ROMX + +AnimateDexSearchSlowpoke: + ld hl, .FrameIDs + ld b, 25 +.loop + ld a, [hli] + + ; Wrap around + cp $fe + jr nz, .ok + ld hl, .FrameIDs + ld a, [hli] +.ok + + ld [wDexSearchSlowpokeFrame], a + ld a, [hli] + ld c, a + push bc + push hl + call DoDexSearchSlowpokeFrame + pop hl + pop bc + call DelayFrames + dec b + jr nz, .loop + xor a + ld [wDexSearchSlowpokeFrame], a + call DoDexSearchSlowpokeFrame + ld c, 32 + call DelayFrames + ret + +.FrameIDs: + ; frame ID, duration + db 0, 7 + db 1, 7 + db 2, 7 + db 3, 7 + db 4, 7 + db -2 + +DoDexSearchSlowpokeFrame: + ld a, [wDexSearchSlowpokeFrame] + ld hl, .SlowpokeSpriteData + ld de, wVirtualOAMSprite00 +.loop + ld a, [hli] + cp -1 + ret z + ld [de], a ; y + inc de + ld a, [hli] + ld [de], a ; x + inc de + ld a, [wDexSearchSlowpokeFrame] + ld b, a + add a + add b + add [hl] + inc hl + ld [de], a ; tile id + inc de + ld a, [hli] + ld [de], a ; attributes + inc de + jr .loop + +.SlowpokeSpriteData: + dsprite 11, 0, 9, 0, $00, 0 + dsprite 11, 0, 10, 0, $01, 0 + dsprite 11, 0, 11, 0, $02, 0 + dsprite 12, 0, 9, 0, $10, 0 + dsprite 12, 0, 10, 0, $11, 0 + dsprite 12, 0, 11, 0, $12, 0 + dsprite 13, 0, 9, 0, $20, 0 + dsprite 13, 0, 10, 0, $21, 0 + dsprite 13, 0, 11, 0, $22, 0 + db -1 diff --git a/engine/pokegear/map.asm b/engine/pokegear/map.asm new file mode 100644 index 00000000000..6925383823b --- /dev/null +++ b/engine/pokegear/map.asm @@ -0,0 +1,923 @@ +SECTION "PokegearMap - Unreferenced_Function92311", ROMX + +PokegearMap: + ld a, e + and a + jr nz, .kanto + call LoadTownMapGFX + call FillJohtoMap + ret + +.kanto + call LoadTownMapGFX + call FillKantoMap + ret + +_FlyMap: + call ClearBGPalettes + call ClearTileMap + call ClearSprites + ld hl, hInMenu + ld a, [hl] + push af + ld [hl], $1 + xor a + ldh [hBGMapMode], a + farcall ClearSpriteAnims + call LoadTownMapGFX + ld de, FlyMapLabelBorderGFX + ld hl, vTiles2 tile $30 + lb bc, BANK(FlyMapLabelBorderGFX), 6 + call Request1bpp + call FlyMap + call ret_91c8f + ld b, SCGB_POKEGEAR_PALS + call GetSGBLayout + call SetPalettes +.loop + call JoyTextDelay + ld hl, hJoyPressed + ld a, [hl] + and B_BUTTON + jr nz, .pressedB + ld a, [hl] + and A_BUTTON + jr nz, .pressedA + call FlyMapScroll + call GetMapCursorCoordinates + farcall PlaySpriteAnimations + call DelayFrame + jr .loop + +.pressedB + ld a, -1 + jr .exit + +.pressedA + ld a, [wTownMapPlayerIconLandmark] + ld l, a + ld h, 0 + add hl, hl + ld de, Flypoints + 1 + add hl, de + ld a, [hl] +.exit + ld [wTownMapPlayerIconLandmark], a + pop af + ldh [hInMenu], a + call ClearBGPalettes + ld a, $90 + ldh [hWY], a + xor a ; LOW(vBGMap0) + ldh [hBGMapAddress], a + ld a, HIGH(vBGMap0) + ldh [hBGMapAddress + 1], a + ld a, [wTownMapPlayerIconLandmark] + ld e, a + ret + +FlyMapScroll: + ld a, [wStartFlypoint] + ld e, a + ld a, [wEndFlypoint] + ld d, a + ld hl, hJoyLast + ld a, [hl] + and D_UP + jr nz, .ScrollNext + ld a, [hl] + and D_DOWN + jr nz, .ScrollPrev + ret + +.ScrollNext: + ld hl, wTownMapPlayerIconLandmark + ld a, [hl] + cp d + jr nz, .NotAtEndYet + ld a, e + dec a + ld [hl], a +.NotAtEndYet: + inc [hl] + call CheckIfVisitedFlypoint + jr z, .ScrollNext + jr .Finally + +.ScrollPrev: + ld hl, wTownMapPlayerIconLandmark + ld a, [hl] + cp e + jr nz, .NotAtStartYet + ld a, d + inc a + ld [hl], a +.NotAtStartYet: + dec [hl] + call CheckIfVisitedFlypoint + jr z, .ScrollPrev +.Finally: + call TownMapBubble + call WaitBGMap + xor a + ldh [hBGMapMode], a + ret + +TownMapBubble: +; Draw the bubble containing the location text in the town map HUD + +; Top-left corner + hlcoord 1, 0 + ld a, $30 + ld [hli], a +; Top row + ld bc, 16 + ld a, " " + call ByteFill +; Top-right corner + ld a, $31 + ld [hl], a + hlcoord 1, 1 + +; Middle row + ld bc, 18 + ld a, " " + call ByteFill + +; Bottom-left corner + hlcoord 1, 2 + ld a, $32 + ld [hli], a +; Bottom row + ld bc, 16 + ld a, " " + call ByteFill +; Bottom-right corner + ld a, $33 + ld [hl], a + +; Print "Where?" + hlcoord 2, 0 + ld de, .Where + call PlaceString +; Print the name of the default flypoint + call .Name +; Up/down arrows + hlcoord 18, 1 + ld [hl], $34 + ret + +.Where: + db "Where?@" + +.Name: +; We need the map location of the default flypoint + ld a, [wTownMapPlayerIconLandmark] + ld l, a + ld h, 0 + add hl, hl ; two bytes per flypoint + ld de, Flypoints + add hl, de + ld e, [hl] + farcall GetLandmarkName + hlcoord 2, 1 + ld de, wStringBuffer1 + call PlaceString + ret + +GetMapCursorCoordinates: + ld a, [wTownMapPlayerIconLandmark] + ld l, a + ld h, 0 + add hl, hl + ld de, Flypoints + add hl, de + ld e, [hl] + farcall GetLandmarkCoords + ld a, [wTownMapCursorCoordinates] + ld c, a + ld a, [wTownMapCursorCoordinates + 1] + ld b, a + ld hl, 4 + add hl, bc + ld [hl], e + ld hl, 5 + add hl, bc + ld [hl], d + ret + +CheckIfVisitedFlypoint: +; Check if the flypoint loaded in [hl] has been visited yet. + push bc + push de + push hl + ld l, [hl] + ld h, 0 + add hl, hl + ld de, Flypoints + 1 + add hl, de + ld c, [hl] + call HasVisitedSpawn + pop hl + pop de + pop bc + and a + ret + +HasVisitedSpawn: +; Check if spawn point c has been visited. + ld hl, wVisitedSpawns + ld b, CHECK_FLAG + ld d, 0 + predef SmallFarFlagAction + ld a, c + ret + +INCLUDE "data/maps/flypoints.asm" + +ret_91c8f: + ret + +FlyMap: + ld a, [wMapGroup] + ld b, a + ld a, [wMapNumber] + ld c, a + call GetWorldMapLocation +; If we're not in a valid location, i.e. Pokecenter floor 2F, +; the backup map information is used. + cp SPECIAL_MAP + jr nz, .CheckRegion + ld a, [wBackupMapGroup] + ld b, a + ld a, [wBackupMapNumber] + ld c, a + call GetWorldMapLocation +.CheckRegion: +; The first 46 locations are part of Johto. The rest are in Kanto. + cp KANTO_LANDMARK + jr nc, .KantoFlyMap +.JohtoFlyMap: +; Note that .NoKanto should be modified in tandem with this branch + push af +; Start from New Bark Town + ld a, FLY_NEW_BARK + ld [wTownMapPlayerIconLandmark], a +; Flypoints begin at New Bark Town... + ld [wStartFlypoint], a +; ..and end at Silver Cave. + ld a, FLY_MT_SILVER + ld [wEndFlypoint], a +; Fill out the map + call FillJohtoMap + call .MapHud + pop af + call TownMapPlayerIcon + ret + +.KantoFlyMap: +; The event that there are no flypoints enabled in a map is not +; accounted for. As a result, if you attempt to select a flypoint +; when there are none enabled, the game will crash. Additionally, +; the flypoint selection has a default starting point that +; can be flown to even if none are enabled. +; To prevent both of these things from happening when the player +; enters Kanto, fly access is restricted until Indigo Plateau is +; visited and its flypoint enabled. + push af + ld c, SPAWN_INDIGO + call HasVisitedSpawn + and a + jr z, .NoKanto +; Kanto's map is only loaded if we've visited Indigo Plateau + +; Flypoints begin at Pallet Town... + ld a, FLY_PALLET + ld [wStartFlypoint], a +; ...and end at Indigo Plateau + ld a, FLY_INDIGO + ld [wEndFlypoint], a +; Because Indigo Plateau is the first flypoint the player +; visits, it's made the default flypoint. + ld [wTownMapPlayerIconLandmark], a +; Fill out the map + call FillKantoMap + call .MapHud + pop af + call TownMapPlayerIcon + ret + +.NoKanto: +; If Indigo Plateau hasn't been visited, we use Johto's map instead + +; Start from New Bark Town + ld a, FLY_NEW_BARK + ld [wTownMapPlayerIconLandmark], a +; Flypoints begin at New Bark Town... + ld [wStartFlypoint], a +; ..and end at Silver Cave + ld a, FLY_MT_SILVER + ld [wEndFlypoint], a + call FillJohtoMap + pop af +.MapHud: + call TownMapBubble + call TownMapPals + hlbgcoord 0, 0 ; BG Map 0 + call TownMapBGUpdate + call TownMapMon + ld a, c + ld [wTownMapCursorCoordinates], a + ld a, b + ld [wTownMapCursorCoordinates + 1], a + ret + +Pokedex_GetArea: +; e: Current landmark + ld a, [wTownMapPlayerIconLandmark] + push af + ld a, [wTownMapCursorLandmark] + push af + ld a, e + ld [wTownMapPlayerIconLandmark], a + call ClearSprites + xor a + ldh [hBGMapMode], a + ld a, $1 + ldh [hInMenu], a + ld de, PokedexNestIconGFX + ld hl, vTiles0 tile $7f + lb bc, BANK(PokedexNestIconGFX), 1 + call Request2bpp + call .GetPlayerOrFastShipIcon + ld hl, vTiles0 tile $78 + ld c, 4 + call Request2bpp + call LoadTownMapGFX + call FillKantoMap + call .PlaceString_MonsNest + call TownMapPals + hlbgcoord 0, 0, vBGMap1 + call TownMapBGUpdate + call FillJohtoMap + call .PlaceString_MonsNest + call TownMapPals + hlbgcoord 0, 0 + call TownMapBGUpdate + ld b, SCGB_POKEGEAR_PALS + call GetSGBLayout + call SetPalettes + xor a + ldh [hBGMapMode], a + xor a ; JOHTO_REGION + call .GetAndPlaceNest +.loop + call JoyTextDelay + ld hl, hJoyPressed + ld a, [hl] + and A_BUTTON | B_BUTTON + jr nz, .a_b + ldh a, [hJoypadDown] + and SELECT + jr nz, .select + call .LeftRightInput + call .BlinkNestIcons + jr .next + +.select + call .HideNestsShowPlayer +.next + call DelayFrame + jr .loop + +.a_b + call ClearSprites + pop af + ld [wTownMapCursorLandmark], a + pop af + ld [wTownMapPlayerIconLandmark], a + ret + +.LeftRightInput: + ld a, [hl] + and D_LEFT + jr nz, .left + ld a, [hl] + and D_RIGHT + jr nz, .right + ret + +.left + ldh a, [hWY] + cp $90 + ret z + call ClearSprites + ld a, $90 + ldh [hWY], a + xor a ; JOHTO_REGION + call .GetAndPlaceNest + ret + +.right + ld a, [wStatusFlags] + bit STATUSFLAGS_HALL_OF_FAME_F, a + ret z + ldh a, [hWY] + and a + ret z + call ClearSprites + xor a + ldh [hWY], a + ld a, KANTO_REGION + call .GetAndPlaceNest + ret + +.BlinkNestIcons: + ldh a, [hVBlankCounter] + ld e, a + and $f + ret nz + ld a, e + and $10 + jr nz, .copy_sprites + call ClearSprites + ret + +.copy_sprites + hlcoord 0, 0 + ld de, wVirtualOAM + ld bc, wVirtualOAMEnd - wVirtualOAM + call CopyBytes + ret + +.PlaceString_MonsNest: + hlcoord 0, 0 + ld bc, SCREEN_WIDTH + ld a, " " + call ByteFill + hlcoord 0, 1 + ld a, $6 + ld [hli], a + ld bc, SCREEN_WIDTH - 2 + ld a, $7 + call ByteFill + ld [hl], $17 + call GetPokemonName + hlcoord 2, 0 + call PlaceString + ld h, b + ld l, c + ld de, .String_SNest + call PlaceString + ret + +.String_SNest: + db "'S NEST@" + +.GetAndPlaceNest: + ld [wTownMapCursorLandmark], a + ld e, a + farcall FindNest ; load nest landmarks into wTileMap[0,0] + decoord 0, 0 + ld hl, wVirtualOAMSprite00 +.nestloop + ld a, [de] + and a + jr z, .done_nest + push de + ld e, a + push hl + farcall GetLandmarkCoords + pop hl + ; load into OAM + ld a, d + sub 4 + ld [hli], a ; y + ld a, e + sub 4 + ld [hli], a ; x + ld a, $7f ; nest icon + ld [hli], a ; tile id + xor a + ld [hli], a ; attributes + ; next + pop de + inc de + jr .nestloop + +.done_nest + ld hl, wVirtualOAM + decoord 0, 0 + ld bc, wVirtualOAMEnd - wVirtualOAM + call CopyBytes + ret + +.HideNestsShowPlayer: + call .CheckPlayerLocation + ret c + ld a, [wTownMapPlayerIconLandmark] + ld e, a + farcall GetLandmarkCoords + ld c, e + ld b, d + ld de, .PlayerOAM + ld hl, wVirtualOAMSprite00 +.ShowPlayerLoop: + ld a, [de] + cp $80 + jr z, .clear_oam + add b + ld [hli], a ; y + inc de + ld a, [de] + add c + ld [hli], a ; x + inc de + ld a, [de] + add $78 ; where the player's sprite is loaded + ld [hli], a ; tile id + inc de + push bc + ld c, PAL_OW_RED + ld a, [wPlayerGender] + bit PLAYERGENDER_FEMALE_F, a + jr z, .male + inc c ; PAL_OW_BLUE +.male + ld a, c + ld [hli], a ; attributes + pop bc + jr .ShowPlayerLoop + +.clear_oam + ld hl, wVirtualOAMSprite04 + ld bc, wVirtualOAMEnd - wVirtualOAMSprite04 + xor a + call ByteFill + ret + +.PlayerOAM: + ; y pxl, x pxl, tile offset + db -1 * 8, -1 * 8, 0 ; top left + db -1 * 8, 0 * 8, 1 ; top right + db 0 * 8, -1 * 8, 2 ; bottom left + db 0 * 8, 0 * 8, 3 ; bottom right + db $80 ; terminator + +.CheckPlayerLocation: +; Don't show the player's sprite if you're +; not in the same region as what's currently +; on the screen. + ld a, [wTownMapPlayerIconLandmark] + cp FAST_SHIP + jr z, .johto + cp KANTO_LANDMARK + jr c, .johto +.kanto + ld a, [wTownMapCursorLandmark] + and a + jr z, .clear + jr .ok + +.johto + ld a, [wTownMapCursorLandmark] + and a + jr nz, .clear +.ok + and a + ret + +.clear + ld hl, wVirtualOAM + ld bc, wVirtualOAMEnd - wVirtualOAM + xor a + call ByteFill + scf + ret + +.GetPlayerOrFastShipIcon: + ld a, [wTownMapPlayerIconLandmark] + cp FAST_SHIP + jr z, .FastShip + farcall GetPlayerIcon + ret + +.FastShip: + ld de, FastShipGFX + ld b, BANK(FastShipGFX) + ret + +TownMapBGUpdate: +; Update BG Map tiles and attributes + +; BG Map address + ld a, l + ldh [hBGMapAddress], a + ld a, h + ldh [hBGMapAddress + 1], a +; Only update palettes on CGB + ldh a, [hCGB] + and a + jr z, .tiles +; BG Map mode 2 (palettes) + ld a, 2 + ldh [hBGMapMode], a +; The BG Map is updated in thirds, so we wait + +; 3 frames to update the whole screen's palettes. + ld c, 3 + call DelayFrames +.tiles +; Update BG Map tiles + call WaitBGMap +; Turn off BG Map update + xor a + ldh [hBGMapMode], a + ret + +FillJohtoMap: + ld de, JohtoMap + jr FillTownMap + +FillKantoMap: + ld de, KantoMap +FillTownMap: + hlcoord 0, 0 +.loop + ld a, [de] + cp -1 + ret z + ld a, [de] + ld [hli], a + inc de + jr .loop + +TownMapPals: +; Assign palettes based on tile ids + hlcoord 0, 0 + decoord 0, 0, wAttrMap + ld bc, SCREEN_WIDTH * SCREEN_HEIGHT +.loop +; Current tile + ld a, [hli] + push hl +; The palette map covers tiles $00 to $5f; $60 and above use palette 0 + cp $60 + jr nc, .pal0 + +; The palette data is condensed to nybbles, least-significant first. + ld hl, .PalMap + srl a + jr c, .odd +; Even-numbered tile ids take the bottom nybble... + add l + ld l, a + ld a, h + adc 0 + ld h, a + ld a, [hl] + and PALETTE_MASK + jr .update + +.odd +; ...and odd ids take the top. + add l + ld l, a + ld a, h + adc 0 + ld h, a + ld a, [hl] + swap a + and PALETTE_MASK + jr .update + +.pal0 + xor a +.update + pop hl + ld [de], a + inc de + dec bc + ld a, b + or c + jr nz, .loop + ret + +.PalMap: +INCLUDE "gfx/pokegear/town_map_palette_map.asm" + +TownMapMon: +; Draw the FlyMon icon at town map location + +; Get FlyMon species + ld a, [wCurPartyMon] + ld hl, wPartySpecies + ld e, a + ld d, $0 + add hl, de + ld a, [hl] + ld [wTempIconSpecies], a +; Get FlyMon icon + ld e, $08 ; starting tile in VRAM + farcall GetSpeciesIcon +; Animation/palette + depixel 0, 0 + ld a, SPRITE_ANIM_INDEX_PARTY_MON + call _InitSpriteAnimStruct + ld hl, SPRITEANIMSTRUCT_TILE_ID + add hl, bc + ld [hl], $08 + ld hl, SPRITEANIMSTRUCT_ANIM_SEQ_ID + add hl, bc + ld [hl], SPRITE_ANIM_SEQ_NULL + ret + +TownMapPlayerIcon: +; Draw the player icon at town map location in a + push af + farcall GetPlayerIcon +; Standing icon + ld hl, vTiles0 tile $10 + ld c, 4 ; # tiles + call Request2bpp +; Walking icon + ld hl, $c0 + add hl, de + ld d, h + ld e, l + ld hl, vTiles0 tile $14 + ld c, 4 ; # tiles + ld a, BANK(ChrisSpriteGFX) ; does nothing + call Request2bpp +; Animation/palette + depixel 0, 0 + ld b, SPRITE_ANIM_INDEX_RED_WALK ; Male + ld a, [wPlayerGender] + bit PLAYERGENDER_FEMALE_F, a + jr z, .got_gender + ld b, SPRITE_ANIM_INDEX_BLUE_WALK ; Female +.got_gender + ld a, b + call _InitSpriteAnimStruct + ld hl, SPRITEANIMSTRUCT_TILE_ID + add hl, bc + ld [hl], $10 + pop af + ld e, a + push bc + farcall GetLandmarkCoords + pop bc + ld hl, SPRITEANIMSTRUCT_XCOORD + add hl, bc + ld [hl], e + ld hl, SPRITEANIMSTRUCT_YCOORD + add hl, bc + ld [hl], d + ret + +LoadTownMapGFX: + ld hl, TownMapGFX + ld de, vTiles2 + lb bc, BANK(TownMapGFX), 48 + call DecompressRequest2bpp + ret + +JohtoMap: +INCBIN "gfx/pokegear/johto.bin" + +KantoMap: +INCBIN "gfx/pokegear/kanto.bin" + +PokedexNestIconGFX: +INCBIN "gfx/pokegear/dexmap_nest_icon.2bpp" +FlyMapLabelBorderGFX: +INCBIN "gfx/pokegear/flymap_label_border.1bpp" + +Unreferenced_Function92311: + xor a + ld [wTownMapPlayerIconLandmark], a + call ClearBGPalettes + call ClearTileMap + call ClearSprites + ld hl, hInMenu + ld a, [hl] + push af + ld [hl], $1 + xor a + ldh [hBGMapMode], a + farcall ClearSpriteAnims + call LoadTownMapGFX + ld de, FlyMapLabelBorderGFX + ld hl, vTiles2 tile $30 + lb bc, BANK(FlyMapLabelBorderGFX), 6 + call Request1bpp + call FillKantoMap + call TownMapBubble + call TownMapPals + hlbgcoord 0, 0, vBGMap1 + call TownMapBGUpdate + call FillJohtoMap + call TownMapBubble + call TownMapPals + hlbgcoord 0, 0 + call TownMapBGUpdate + call TownMapMon + ld a, c + ld [wTownMapCursorCoordinates], a + ld a, b + ld [wTownMapCursorCoordinates + 1], a + ld b, SCGB_POKEGEAR_PALS + call GetSGBLayout + call SetPalettes +.loop + call JoyTextDelay + ld hl, hJoyPressed + ld a, [hl] + and B_BUTTON + jr nz, .pressedB + ld a, [hl] + and A_BUTTON + jr nz, .pressedA + call .HandleDPad + call GetMapCursorCoordinates + farcall PlaySpriteAnimations + call DelayFrame + jr .loop + +.pressedB + ld a, -1 + jr .finished_a_b + +.pressedA + ld a, [wTownMapPlayerIconLandmark] + ld l, a + ld h, 0 + add hl, hl + ld de, Flypoints + 1 + add hl, de + ld a, [hl] +.finished_a_b + ld [wTownMapPlayerIconLandmark], a + pop af + ldh [hInMenu], a + call ClearBGPalettes + ld a, $90 + ldh [hWY], a + xor a ; LOW(vBGMap0) + ldh [hBGMapAddress], a + ld a, HIGH(vBGMap0) + ldh [hBGMapAddress + 1], a + ld a, [wTownMapPlayerIconLandmark] + ld e, a + ret + +.HandleDPad: + ld hl, hJoyLast + ld a, [hl] + and D_DOWN | D_RIGHT + jr nz, .down_right + ld a, [hl] + and D_UP | D_LEFT + jr nz, .up_left + ret + +.down_right + ld hl, wTownMapPlayerIconLandmark + ld a, [hl] + cp FLY_INDIGO + jr c, .okay_dr + ld [hl], -1 +.okay_dr + inc [hl] + jr .continue + +.up_left + ld hl, wTownMapPlayerIconLandmark + ld a, [hl] + and a + jr nz, .okay_ul + ld [hl], FLY_INDIGO + 1 +.okay_ul + dec [hl] +.continue + ld a, [wTownMapPlayerIconLandmark] + cp KANTO_FLYPOINT + jr c, .johto + call FillKantoMap + xor a + ld b, $9c + jr .finish + +.johto + call FillJohtoMap + ld a, $90 + ld b, $98 +.finish + ldh [hWY], a + ld a, b + ldh [hBGMapAddress + 1], a + call TownMapBubble + call WaitBGMap + xor a + ldh [hBGMapMode], a + ret diff --git a/engine/pokegear/pokegear.asm b/engine/pokegear/pokegear.asm index 233492f0372..5d9dc49baa4 100644 --- a/engine/pokegear/pokegear.asm +++ b/engine/pokegear/pokegear.asm @@ -2027,928 +2027,3 @@ PlayRadio: .kanto jp LoadStation_PlacesAndPeople - - -SECTION "PokegearMap - Unreferenced_Function92311", ROMX - -PokegearMap: - ld a, e - and a - jr nz, .kanto - call LoadTownMapGFX - call FillJohtoMap - ret - -.kanto - call LoadTownMapGFX - call FillKantoMap - ret - -_FlyMap: - call ClearBGPalettes - call ClearTileMap - call ClearSprites - ld hl, hInMenu - ld a, [hl] - push af - ld [hl], $1 - xor a - ldh [hBGMapMode], a - farcall ClearSpriteAnims - call LoadTownMapGFX - ld de, FlyMapLabelBorderGFX - ld hl, vTiles2 tile $30 - lb bc, BANK(FlyMapLabelBorderGFX), 6 - call Request1bpp - call FlyMap - call ret_91c8f - ld b, SCGB_POKEGEAR_PALS - call GetSGBLayout - call SetPalettes -.loop - call JoyTextDelay - ld hl, hJoyPressed - ld a, [hl] - and B_BUTTON - jr nz, .pressedB - ld a, [hl] - and A_BUTTON - jr nz, .pressedA - call FlyMapScroll - call GetMapCursorCoordinates - farcall PlaySpriteAnimations - call DelayFrame - jr .loop - -.pressedB - ld a, -1 - jr .exit - -.pressedA - ld a, [wTownMapPlayerIconLandmark] - ld l, a - ld h, 0 - add hl, hl - ld de, Flypoints + 1 - add hl, de - ld a, [hl] -.exit - ld [wTownMapPlayerIconLandmark], a - pop af - ldh [hInMenu], a - call ClearBGPalettes - ld a, $90 - ldh [hWY], a - xor a ; LOW(vBGMap0) - ldh [hBGMapAddress], a - ld a, HIGH(vBGMap0) - ldh [hBGMapAddress + 1], a - ld a, [wTownMapPlayerIconLandmark] - ld e, a - ret - -FlyMapScroll: - ld a, [wStartFlypoint] - ld e, a - ld a, [wEndFlypoint] - ld d, a - ld hl, hJoyLast - ld a, [hl] - and D_UP - jr nz, .ScrollNext - ld a, [hl] - and D_DOWN - jr nz, .ScrollPrev - ret - -.ScrollNext: - ld hl, wTownMapPlayerIconLandmark - ld a, [hl] - cp d - jr nz, .NotAtEndYet - ld a, e - dec a - ld [hl], a -.NotAtEndYet: - inc [hl] - call CheckIfVisitedFlypoint - jr z, .ScrollNext - jr .Finally - -.ScrollPrev: - ld hl, wTownMapPlayerIconLandmark - ld a, [hl] - cp e - jr nz, .NotAtStartYet - ld a, d - inc a - ld [hl], a -.NotAtStartYet: - dec [hl] - call CheckIfVisitedFlypoint - jr z, .ScrollPrev -.Finally: - call TownMapBubble - call WaitBGMap - xor a - ldh [hBGMapMode], a - ret - -TownMapBubble: -; Draw the bubble containing the location text in the town map HUD - -; Top-left corner - hlcoord 1, 0 - ld a, $30 - ld [hli], a -; Top row - ld bc, 16 - ld a, " " - call ByteFill -; Top-right corner - ld a, $31 - ld [hl], a - hlcoord 1, 1 - -; Middle row - ld bc, 18 - ld a, " " - call ByteFill - -; Bottom-left corner - hlcoord 1, 2 - ld a, $32 - ld [hli], a -; Bottom row - ld bc, 16 - ld a, " " - call ByteFill -; Bottom-right corner - ld a, $33 - ld [hl], a - -; Print "Where?" - hlcoord 2, 0 - ld de, .Where - call PlaceString -; Print the name of the default flypoint - call .Name -; Up/down arrows - hlcoord 18, 1 - ld [hl], $34 - ret - -.Where: - db "Where?@" - -.Name: -; We need the map location of the default flypoint - ld a, [wTownMapPlayerIconLandmark] - ld l, a - ld h, 0 - add hl, hl ; two bytes per flypoint - ld de, Flypoints - add hl, de - ld e, [hl] - farcall GetLandmarkName - hlcoord 2, 1 - ld de, wStringBuffer1 - call PlaceString - ret - -GetMapCursorCoordinates: - ld a, [wTownMapPlayerIconLandmark] - ld l, a - ld h, 0 - add hl, hl - ld de, Flypoints - add hl, de - ld e, [hl] - farcall GetLandmarkCoords - ld a, [wTownMapCursorCoordinates] - ld c, a - ld a, [wTownMapCursorCoordinates + 1] - ld b, a - ld hl, 4 - add hl, bc - ld [hl], e - ld hl, 5 - add hl, bc - ld [hl], d - ret - -CheckIfVisitedFlypoint: -; Check if the flypoint loaded in [hl] has been visited yet. - push bc - push de - push hl - ld l, [hl] - ld h, 0 - add hl, hl - ld de, Flypoints + 1 - add hl, de - ld c, [hl] - call HasVisitedSpawn - pop hl - pop de - pop bc - and a - ret - -HasVisitedSpawn: -; Check if spawn point c has been visited. - ld hl, wVisitedSpawns - ld b, CHECK_FLAG - ld d, 0 - predef SmallFarFlagAction - ld a, c - ret - -INCLUDE "data/maps/flypoints.asm" - -ret_91c8f: - ret - -FlyMap: - ld a, [wMapGroup] - ld b, a - ld a, [wMapNumber] - ld c, a - call GetWorldMapLocation -; If we're not in a valid location, i.e. Pokecenter floor 2F, -; the backup map information is used. - cp SPECIAL_MAP - jr nz, .CheckRegion - ld a, [wBackupMapGroup] - ld b, a - ld a, [wBackupMapNumber] - ld c, a - call GetWorldMapLocation -.CheckRegion: -; The first 46 locations are part of Johto. The rest are in Kanto. - cp KANTO_LANDMARK - jr nc, .KantoFlyMap -.JohtoFlyMap: -; Note that .NoKanto should be modified in tandem with this branch - push af -; Start from New Bark Town - ld a, FLY_NEW_BARK - ld [wTownMapPlayerIconLandmark], a -; Flypoints begin at New Bark Town... - ld [wStartFlypoint], a -; ..and end at Silver Cave. - ld a, FLY_MT_SILVER - ld [wEndFlypoint], a -; Fill out the map - call FillJohtoMap - call .MapHud - pop af - call TownMapPlayerIcon - ret - -.KantoFlyMap: -; The event that there are no flypoints enabled in a map is not -; accounted for. As a result, if you attempt to select a flypoint -; when there are none enabled, the game will crash. Additionally, -; the flypoint selection has a default starting point that -; can be flown to even if none are enabled. -; To prevent both of these things from happening when the player -; enters Kanto, fly access is restricted until Indigo Plateau is -; visited and its flypoint enabled. - push af - ld c, SPAWN_INDIGO - call HasVisitedSpawn - and a - jr z, .NoKanto -; Kanto's map is only loaded if we've visited Indigo Plateau - -; Flypoints begin at Pallet Town... - ld a, FLY_PALLET - ld [wStartFlypoint], a -; ...and end at Indigo Plateau - ld a, FLY_INDIGO - ld [wEndFlypoint], a -; Because Indigo Plateau is the first flypoint the player -; visits, it's made the default flypoint. - ld [wTownMapPlayerIconLandmark], a -; Fill out the map - call FillKantoMap - call .MapHud - pop af - call TownMapPlayerIcon - ret - -.NoKanto: -; If Indigo Plateau hasn't been visited, we use Johto's map instead - -; Start from New Bark Town - ld a, FLY_NEW_BARK - ld [wTownMapPlayerIconLandmark], a -; Flypoints begin at New Bark Town... - ld [wStartFlypoint], a -; ..and end at Silver Cave - ld a, FLY_MT_SILVER - ld [wEndFlypoint], a - call FillJohtoMap - pop af -.MapHud: - call TownMapBubble - call TownMapPals - hlbgcoord 0, 0 ; BG Map 0 - call TownMapBGUpdate - call TownMapMon - ld a, c - ld [wTownMapCursorCoordinates], a - ld a, b - ld [wTownMapCursorCoordinates + 1], a - ret - -Pokedex_GetArea: -; e: Current landmark - ld a, [wTownMapPlayerIconLandmark] - push af - ld a, [wTownMapCursorLandmark] - push af - ld a, e - ld [wTownMapPlayerIconLandmark], a - call ClearSprites - xor a - ldh [hBGMapMode], a - ld a, $1 - ldh [hInMenu], a - ld de, PokedexNestIconGFX - ld hl, vTiles0 tile $7f - lb bc, BANK(PokedexNestIconGFX), 1 - call Request2bpp - call .GetPlayerOrFastShipIcon - ld hl, vTiles0 tile $78 - ld c, 4 - call Request2bpp - call LoadTownMapGFX - call FillKantoMap - call .PlaceString_MonsNest - call TownMapPals - hlbgcoord 0, 0, vBGMap1 - call TownMapBGUpdate - call FillJohtoMap - call .PlaceString_MonsNest - call TownMapPals - hlbgcoord 0, 0 - call TownMapBGUpdate - ld b, SCGB_POKEGEAR_PALS - call GetSGBLayout - call SetPalettes - xor a - ldh [hBGMapMode], a - xor a ; JOHTO_REGION - call .GetAndPlaceNest -.loop - call JoyTextDelay - ld hl, hJoyPressed - ld a, [hl] - and A_BUTTON | B_BUTTON - jr nz, .a_b - ldh a, [hJoypadDown] - and SELECT - jr nz, .select - call .LeftRightInput - call .BlinkNestIcons - jr .next - -.select - call .HideNestsShowPlayer -.next - call DelayFrame - jr .loop - -.a_b - call ClearSprites - pop af - ld [wTownMapCursorLandmark], a - pop af - ld [wTownMapPlayerIconLandmark], a - ret - -.LeftRightInput: - ld a, [hl] - and D_LEFT - jr nz, .left - ld a, [hl] - and D_RIGHT - jr nz, .right - ret - -.left - ldh a, [hWY] - cp $90 - ret z - call ClearSprites - ld a, $90 - ldh [hWY], a - xor a ; JOHTO_REGION - call .GetAndPlaceNest - ret - -.right - ld a, [wStatusFlags] - bit STATUSFLAGS_HALL_OF_FAME_F, a - ret z - ldh a, [hWY] - and a - ret z - call ClearSprites - xor a - ldh [hWY], a - ld a, KANTO_REGION - call .GetAndPlaceNest - ret - -.BlinkNestIcons: - ldh a, [hVBlankCounter] - ld e, a - and $f - ret nz - ld a, e - and $10 - jr nz, .copy_sprites - call ClearSprites - ret - -.copy_sprites - hlcoord 0, 0 - ld de, wVirtualOAM - ld bc, wVirtualOAMEnd - wVirtualOAM - call CopyBytes - ret - -.PlaceString_MonsNest: - hlcoord 0, 0 - ld bc, SCREEN_WIDTH - ld a, " " - call ByteFill - hlcoord 0, 1 - ld a, $6 - ld [hli], a - ld bc, SCREEN_WIDTH - 2 - ld a, $7 - call ByteFill - ld [hl], $17 - call GetPokemonName - hlcoord 2, 0 - call PlaceString - ld h, b - ld l, c - ld de, .String_SNest - call PlaceString - ret - -.String_SNest: - db "'S NEST@" - -.GetAndPlaceNest: - ld [wTownMapCursorLandmark], a - ld e, a - farcall FindNest ; load nest landmarks into wTileMap[0,0] - decoord 0, 0 - ld hl, wVirtualOAMSprite00 -.nestloop - ld a, [de] - and a - jr z, .done_nest - push de - ld e, a - push hl - farcall GetLandmarkCoords - pop hl - ; load into OAM - ld a, d - sub 4 - ld [hli], a ; y - ld a, e - sub 4 - ld [hli], a ; x - ld a, $7f ; nest icon - ld [hli], a ; tile id - xor a - ld [hli], a ; attributes - ; next - pop de - inc de - jr .nestloop - -.done_nest - ld hl, wVirtualOAM - decoord 0, 0 - ld bc, wVirtualOAMEnd - wVirtualOAM - call CopyBytes - ret - -.HideNestsShowPlayer: - call .CheckPlayerLocation - ret c - ld a, [wTownMapPlayerIconLandmark] - ld e, a - farcall GetLandmarkCoords - ld c, e - ld b, d - ld de, .PlayerOAM - ld hl, wVirtualOAMSprite00 -.ShowPlayerLoop: - ld a, [de] - cp $80 - jr z, .clear_oam - add b - ld [hli], a ; y - inc de - ld a, [de] - add c - ld [hli], a ; x - inc de - ld a, [de] - add $78 ; where the player's sprite is loaded - ld [hli], a ; tile id - inc de - push bc - ld c, PAL_OW_RED - ld a, [wPlayerGender] - bit PLAYERGENDER_FEMALE_F, a - jr z, .male - inc c ; PAL_OW_BLUE -.male - ld a, c - ld [hli], a ; attributes - pop bc - jr .ShowPlayerLoop - -.clear_oam - ld hl, wVirtualOAMSprite04 - ld bc, wVirtualOAMEnd - wVirtualOAMSprite04 - xor a - call ByteFill - ret - -.PlayerOAM: - ; y pxl, x pxl, tile offset - db -1 * 8, -1 * 8, 0 ; top left - db -1 * 8, 0 * 8, 1 ; top right - db 0 * 8, -1 * 8, 2 ; bottom left - db 0 * 8, 0 * 8, 3 ; bottom right - db $80 ; terminator - -.CheckPlayerLocation: -; Don't show the player's sprite if you're -; not in the same region as what's currently -; on the screen. - ld a, [wTownMapPlayerIconLandmark] - cp FAST_SHIP - jr z, .johto - cp KANTO_LANDMARK - jr c, .johto -.kanto - ld a, [wTownMapCursorLandmark] - and a - jr z, .clear - jr .ok - -.johto - ld a, [wTownMapCursorLandmark] - and a - jr nz, .clear -.ok - and a - ret - -.clear - ld hl, wVirtualOAM - ld bc, wVirtualOAMEnd - wVirtualOAM - xor a - call ByteFill - scf - ret - -.GetPlayerOrFastShipIcon: - ld a, [wTownMapPlayerIconLandmark] - cp FAST_SHIP - jr z, .FastShip - farcall GetPlayerIcon - ret - -.FastShip: - ld de, FastShipGFX - ld b, BANK(FastShipGFX) - ret - -TownMapBGUpdate: -; Update BG Map tiles and attributes - -; BG Map address - ld a, l - ldh [hBGMapAddress], a - ld a, h - ldh [hBGMapAddress + 1], a -; Only update palettes on CGB - ldh a, [hCGB] - and a - jr z, .tiles -; BG Map mode 2 (palettes) - ld a, 2 - ldh [hBGMapMode], a -; The BG Map is updated in thirds, so we wait - -; 3 frames to update the whole screen's palettes. - ld c, 3 - call DelayFrames -.tiles -; Update BG Map tiles - call WaitBGMap -; Turn off BG Map update - xor a - ldh [hBGMapMode], a - ret - -FillJohtoMap: - ld de, JohtoMap - jr FillTownMap - -FillKantoMap: - ld de, KantoMap -FillTownMap: - hlcoord 0, 0 -.loop - ld a, [de] - cp -1 - ret z - ld a, [de] - ld [hli], a - inc de - jr .loop - -TownMapPals: -; Assign palettes based on tile ids - hlcoord 0, 0 - decoord 0, 0, wAttrMap - ld bc, SCREEN_WIDTH * SCREEN_HEIGHT -.loop -; Current tile - ld a, [hli] - push hl -; The palette map covers tiles $00 to $5f; $60 and above use palette 0 - cp $60 - jr nc, .pal0 - -; The palette data is condensed to nybbles, least-significant first. - ld hl, .PalMap - srl a - jr c, .odd -; Even-numbered tile ids take the bottom nybble... - add l - ld l, a - ld a, h - adc 0 - ld h, a - ld a, [hl] - and PALETTE_MASK - jr .update - -.odd -; ...and odd ids take the top. - add l - ld l, a - ld a, h - adc 0 - ld h, a - ld a, [hl] - swap a - and PALETTE_MASK - jr .update - -.pal0 - xor a -.update - pop hl - ld [de], a - inc de - dec bc - ld a, b - or c - jr nz, .loop - ret - -.PalMap: -INCLUDE "gfx/pokegear/town_map_palette_map.asm" - -TownMapMon: -; Draw the FlyMon icon at town map location - -; Get FlyMon species - ld a, [wCurPartyMon] - ld hl, wPartySpecies - ld e, a - ld d, $0 - add hl, de - ld a, [hl] - ld [wTempIconSpecies], a -; Get FlyMon icon - ld e, $08 ; starting tile in VRAM - farcall GetSpeciesIcon -; Animation/palette - depixel 0, 0 - ld a, SPRITE_ANIM_INDEX_PARTY_MON - call _InitSpriteAnimStruct - ld hl, SPRITEANIMSTRUCT_TILE_ID - add hl, bc - ld [hl], $08 - ld hl, SPRITEANIMSTRUCT_ANIM_SEQ_ID - add hl, bc - ld [hl], SPRITE_ANIM_SEQ_NULL - ret - -TownMapPlayerIcon: -; Draw the player icon at town map location in a - push af - farcall GetPlayerIcon -; Standing icon - ld hl, vTiles0 tile $10 - ld c, 4 ; # tiles - call Request2bpp -; Walking icon - ld hl, $c0 - add hl, de - ld d, h - ld e, l - ld hl, vTiles0 tile $14 - ld c, 4 ; # tiles - ld a, BANK(ChrisSpriteGFX) ; does nothing - call Request2bpp -; Animation/palette - depixel 0, 0 - ld b, SPRITE_ANIM_INDEX_RED_WALK ; Male - ld a, [wPlayerGender] - bit PLAYERGENDER_FEMALE_F, a - jr z, .got_gender - ld b, SPRITE_ANIM_INDEX_BLUE_WALK ; Female -.got_gender - ld a, b - call _InitSpriteAnimStruct - ld hl, SPRITEANIMSTRUCT_TILE_ID - add hl, bc - ld [hl], $10 - pop af - ld e, a - push bc - farcall GetLandmarkCoords - pop bc - ld hl, SPRITEANIMSTRUCT_XCOORD - add hl, bc - ld [hl], e - ld hl, SPRITEANIMSTRUCT_YCOORD - add hl, bc - ld [hl], d - ret - -LoadTownMapGFX: - ld hl, TownMapGFX - ld de, vTiles2 - lb bc, BANK(TownMapGFX), 48 - call DecompressRequest2bpp - ret - -JohtoMap: -INCBIN "gfx/pokegear/johto.bin" - -KantoMap: -INCBIN "gfx/pokegear/kanto.bin" - -PokedexNestIconGFX: -INCBIN "gfx/pokegear/dexmap_nest_icon.2bpp" -FlyMapLabelBorderGFX: -INCBIN "gfx/pokegear/flymap_label_border.1bpp" - -Unreferenced_Function92311: - xor a - ld [wTownMapPlayerIconLandmark], a - call ClearBGPalettes - call ClearTileMap - call ClearSprites - ld hl, hInMenu - ld a, [hl] - push af - ld [hl], $1 - xor a - ldh [hBGMapMode], a - farcall ClearSpriteAnims - call LoadTownMapGFX - ld de, FlyMapLabelBorderGFX - ld hl, vTiles2 tile $30 - lb bc, BANK(FlyMapLabelBorderGFX), 6 - call Request1bpp - call FillKantoMap - call TownMapBubble - call TownMapPals - hlbgcoord 0, 0, vBGMap1 - call TownMapBGUpdate - call FillJohtoMap - call TownMapBubble - call TownMapPals - hlbgcoord 0, 0 - call TownMapBGUpdate - call TownMapMon - ld a, c - ld [wTownMapCursorCoordinates], a - ld a, b - ld [wTownMapCursorCoordinates + 1], a - ld b, SCGB_POKEGEAR_PALS - call GetSGBLayout - call SetPalettes -.loop - call JoyTextDelay - ld hl, hJoyPressed - ld a, [hl] - and B_BUTTON - jr nz, .pressedB - ld a, [hl] - and A_BUTTON - jr nz, .pressedA - call .HandleDPad - call GetMapCursorCoordinates - farcall PlaySpriteAnimations - call DelayFrame - jr .loop - -.pressedB - ld a, -1 - jr .finished_a_b - -.pressedA - ld a, [wTownMapPlayerIconLandmark] - ld l, a - ld h, 0 - add hl, hl - ld de, Flypoints + 1 - add hl, de - ld a, [hl] -.finished_a_b - ld [wTownMapPlayerIconLandmark], a - pop af - ldh [hInMenu], a - call ClearBGPalettes - ld a, $90 - ldh [hWY], a - xor a ; LOW(vBGMap0) - ldh [hBGMapAddress], a - ld a, HIGH(vBGMap0) - ldh [hBGMapAddress + 1], a - ld a, [wTownMapPlayerIconLandmark] - ld e, a - ret - -.HandleDPad: - ld hl, hJoyLast - ld a, [hl] - and D_DOWN | D_RIGHT - jr nz, .down_right - ld a, [hl] - and D_UP | D_LEFT - jr nz, .up_left - ret - -.down_right - ld hl, wTownMapPlayerIconLandmark - ld a, [hl] - cp FLY_INDIGO - jr c, .okay_dr - ld [hl], -1 -.okay_dr - inc [hl] - jr .continue - -.up_left - ld hl, wTownMapPlayerIconLandmark - ld a, [hl] - and a - jr nz, .okay_ul - ld [hl], FLY_INDIGO + 1 -.okay_ul - dec [hl] -.continue - ld a, [wTownMapPlayerIconLandmark] - cp KANTO_FLYPOINT - jr c, .johto - call FillKantoMap - xor a - ld b, $9c - jr .finish - -.johto - call FillJohtoMap - ld a, $90 - ld b, $98 -.finish - ldh [hWY], a - ld a, b - ldh [hBGMapAddress + 1], a - call TownMapBubble - call WaitBGMap - xor a - ldh [hBGMapMode], a - ret diff --git a/engine/pokemon/breeding.asm b/engine/pokemon/breeding.asm index ca1051330cb..ac6e0dd24cd 100644 --- a/engine/pokemon/breeding.asm +++ b/engine/pokemon/breeding.asm @@ -956,9 +956,9 @@ DayCareMonCompatibilityText: text_end -SECTION "Unreferenced_DayCareMonPrintEmptyString", ROMX +SECTION "Unreferenced_GetEmptyString", ROMX -Unreferenced_DayCareMonPrintEmptyString: +Unreferenced_GetEmptyString: ld hl, .string ret diff --git a/engine/printer/print_party.asm b/engine/printer/print_party.asm index 70c78577b13..0041b76d8c0 100644 --- a/engine/printer/print_party.asm +++ b/engine/printer/print_party.asm @@ -140,7 +140,7 @@ GBPrinterString_PrinterError4: db "@" -SECTION "PrintPartyMonPage1 - String1dc584", ROMX +SECTION "PrintPartyMonPage1 - GBPrinterLvIcon", ROMX PrintPartyMonPage1: call ClearBGPalettes @@ -358,14 +358,8 @@ String1dc55d: String1dc584: db "------------@" - -SECTION "GBPrinterHPIcon", ROMX - GBPrinterHPIcon: INCBIN "gfx/printer/hp.1bpp" - -SECTION "GBPrinterLvIcon", ROMX - GBPrinterLvIcon: INCBIN "gfx/printer/lv.1bpp" diff --git a/engine/tilesets/timeofday_pals.asm b/engine/tilesets/timeofday_pals.asm index d8f36124788..8bff9eb8879 100644 --- a/engine/tilesets/timeofday_pals.asm +++ b/engine/tilesets/timeofday_pals.asm @@ -1,4 +1,4 @@ -SECTION "DummyPredef35", ROMX +SECTION "DummyPredef35 - DummyPredef36", ROMX DummyPredef35: DummyPredef36: diff --git a/main.asm b/main.asm index 9daf0491d84..69f5947dc00 100644 --- a/main.asm +++ b/main.asm @@ -8,7 +8,8 @@ INCLUDE "engine/menus/intro_menu.asm" INCLUDE "engine/overworld/init_map.asm" INCLUDE "engine/pokemon/learn.asm" INCLUDE "engine/pokemon/correct_nick_errors.asm" -INCLUDE "engine/math/math.asm" +INCLUDE "engine/math/multiply.asm" +INCLUDE "engine/math/divide.asm" INCLUDE "data/items/attributes.asm" INCLUDE "engine/overworld/npc_movement.asm" INCLUDE "engine/events/happiness_egg.asm" @@ -38,7 +39,8 @@ INCLUDE "engine/items/pack.asm" INCLUDE "engine/overworld/time.asm" INCLUDE "engine/items/tmhm2.asm" INCLUDE "engine/menus/naming_screen.asm" -INCLUDE "engine/events/misc_scripts.asm" +INCLUDE "engine/events/bug_contest/abort.asm" +INCLUDE "engine/events/item_ball.asm" INCLUDE "engine/events/heal_machine_anim.asm" INCLUDE "engine/events/whiteout.asm" INCLUDE "engine/events/forced_movement.asm" @@ -46,7 +48,8 @@ INCLUDE "engine/events/itemfinder.asm" INCLUDE "engine/menus/start_menu.asm" INCLUDE "engine/events/elevator.asm" INCLUDE "engine/events/bug_contest/contest.asm" -INCLUDE "engine/events/misc_scripts_2.asm" +INCLUDE "engine/events/repel.asm" +INCLUDE "engine/events/hidden_item.asm" INCLUDE "engine/events/std_collision.asm" INCLUDE "engine/events/bug_contest/judging.asm" INCLUDE "engine/events/pokerus/apply_pokerus_tick.asm" @@ -124,7 +127,8 @@ INCLUDE "data/moves/moves.asm" INCLUDE "data/pokemon/evos_attacks.asm" INCLUDE "engine/events/fruit_trees.asm" INCLUDE "engine/battle/ai/move.asm" -INCLUDE "engine/pokedex/pokedex_2.asm" +INCLUDE "engine/pokedex/slowpoke_anim.asm" +INCLUDE "engine/pokedex/dex_entry.asm" INCLUDE "engine/pokemon/mail.asm" INCLUDE "engine/crystal.asm" INCLUDE "engine/pokemon/search.asm" @@ -231,8 +235,10 @@ INCLUDE "engine/events/magnet_train.asm" INCLUDE "engine/battle/battlestart_copytilemapatonce.asm" INCLUDE "engine/gfx/sprites.asm" INCLUDE "engine/phone/phone.asm" +INCLUDE "engine/phone/numbers.asm" INCLUDE "engine/rtc/timeset.asm" INCLUDE "engine/pokegear/pokegear.asm" +INCLUDE "engine/pokegear/map.asm" INCLUDE "engine/events/fish.asm" INCLUDE "engine/games/slot_machine.asm" INCLUDE "engine/phone/caller_scripts.asm" diff --git a/mobile/mobile_45.asm b/mobile/mobile_45.asm index 8745613eb74..da70c0e844a 100644 --- a/mobile/mobile_45.asm +++ b/mobile/mobile_45.asm @@ -5156,1459 +5156,8 @@ Function115d80: ld e, $0 ret -;SECTION "Function11619d - Unknown_117356", ROMX -INCLUDE "mobile/mobile_45_sprite_engine.asm" - -Function116567: - ld hl, wc3f7 - dec [hl] - ret nz - ld hl, wc3f6 - inc [hl] -.asm_116570 - ld a, $7 - sla a - ld c, a - ld b, 0 - ld hl, Unknown_1167eb - add hl, bc - ld a, [hli] - ld e, a - ld a, [hli] - ld d, a - push de - pop hl - ld a, [wc3f6] - sla a - ld c, a - ld b, $0 - add hl, bc - ld a, [hli] - cp $fe - jr nz, .asm_116595 - xor a - ld [wc3f6], a - jr .asm_116570 - -.asm_116595 - ld [wc3f5], a - ld a, [hl] - ld [wc3f7], a - ret - -Function11659d: - ld a, [wc314] - cp $12 - ret nc - ld e, a - ld d, 0 - ld hl, Jumptable_1165af - add hl, de - add hl, de - ld a, [hli] - ld h, [hl] - ld l, a - jp hl - -Jumptable_1165af: - dw Function11677e - dw Function1165d5 - dw Function1165d8 - dw Function1165e3 - dw Function1165f5 - dw Function116600 - dw Function116615 - dw Function116618 - dw Function116623 - dw Function116635 - dw Function116640 - dw Function116655 - dw Function11665c - dw Function11668d - dw Function11669f - dw Function1166a2 - dw Function1166c4 - dw Function1166d6 - dw Function1166d6 - -Function1165d5: - call Function11678e - -Function1165d8: - ld a, $0 - ld c, a - ld a, $ff - ld b, a - ld a, $a8 - call Function1166f4 - -Function1165e3: - call Function116747 - ld a, [wc30e] - cp $e8 - ret nz - ld a, $1 - call Function116780 - ret c - jp Function116797 - -Function1165f5: - ld a, $1 - ld c, a - ld a, $1 - ld b, a - ld a, $e8 - call Function1166f4 - -Function116600: - call Function116747 - ld a, [wc30e] - cp $a8 - ret nz - ld a, $1 - call Function116780 - ret c - ld a, $2 - ld [wc314], a - ret - -Function116615: - call Function11678e - -Function116618: - ld a, $3 - ld c, a - ld a, $1 - ld b, a - ld a, $28 - call Function11671f - -Function116623: - call Function116747 - ld a, [wc30f] - cp $a0 - ret nz - ld a, $6 - call Function116780 - ret c - jp Function116797 - -Function116635: - ld a, $2 - ld c, a - ld a, $ff - ld b, a - ld a, $a0 - call Function11671f - -Function116640: - call Function116747 - ld a, [wc30f] - cp $28 - ret nz - ld a, $6 - call Function116780 - ret c - ld a, $7 - ld [wc314], a - ret - -Function116655: - xor a - ld [wc314 + 3], a - call Function11678e - -Function11665c: - ld hl, wc314 + 3 - ld a, $1 - xor [hl] - ld [hl], a - add $4 - ld c, a - call Function11679c - ld a, [wc314 + 3] - and a - jr nz, .asm_116673 - ld a, $48 - jr .asm_116675 - -.asm_116673 - ld a, $78 - -.asm_116675 - ld [wc30f], a - call Random - ldh a, [hRandomAdd] - and $7 - sla a - sla a - sla a - add $30 - ld [wc30e], a - call Function116797 - -Function11668d: - ld a, [wc311] - cp $ff - ret nz - ld a, $b - call Function116780 - ret c - ld a, $c - ld [wc314], a - ret - -Function11669f: - call Function11678e - -Function1166a2: - ld a, $a8 - ld [wc30e], a - ld [wc3f1], a - ld a, $60 - ld [wc30f], a - ld [wc3f3], a - ld a, $ff - ld [wc314 + 2], a - xor a - ld [wc314 + 3], a - ld a, $0 - ld c, a - call Function11679c - call Function116797 - -Function1166c4: - call Function116747 - ld a, [wc30e] - cp $58 - ret nz - ld a, $6 - ld c, a - call Function11679c - call Function116797 - -Function1166d6: - call Function116747 - ld a, [wc30e] - cp $48 - jr nz, .asm_1166e4 - xor a - ld [wc314 + 2], a - -.asm_1166e4 - ld a, [wc311] - cp $ff - ret nz - ld a, $4 - ld [$c319], a - xor a - ld [wc314], a - ret - -Function1166f4: - ld [wc30e], a - ld a, b - ld [wc314 + 2], a - xor a - ld [wc314 + 3], a - ld hl, wc30f -.asm_116702 - call Random - ldh a, [hRandomAdd] - and $7 - jr z, .asm_11670c - dec a - -.asm_11670c - sla a - sla a - sla a - add $48 - cp [hl] - jr z, .asm_116702 - ld [hl], a - call Function11679c - call Function116797 - ret - -Function11671f: - ld [wc30f], a - ld a, b - ld [wc314 + 3], a - xor a - ld [wc314 + 2], a - ld hl, wc30e -.asm_11672d - call Random - ldh a, [hRandomAdd] - and $7 - sla a - sla a - sla a - add $30 - cp [hl] - jr z, .asm_11672d - ld [hl], a - call Function11679c - call Function116797 - ret - -Function116747: - ld hl, wc30e - ld a, [wc314 + 2] - add [hl] - ld [hl], a - ld hl, wc30f - ld a, [wc314 + 3] - add [hl] - ld [hl], a - ret - -Function116758: - ld a, [wc30f] - cp $30 - jr c, .asm_116770 - jr z, .asm_116770 - cp $38 - jr c, .asm_116774 - jr z, .asm_116774 - cp $40 - jr c, .asm_116778 - jr z, .asm_116778 - xor a - jr .asm_11677a - -.asm_116770 - ld a, $c - jr .asm_11677a - -.asm_116774 - ld a, $8 - jr .asm_11677a - -.asm_116778 - ld a, $4 - -.asm_11677a - ld [wc314 + 4], a - ret -Function11677e: - ld a, $0 - -Function116780: - ld hl, wc314 + 1 - cp [hl] - jr z, .asm_11678c - ld a, [hl] - ld [wc314], a - scf - ret - -.asm_11678c - and a - ret - -Function11678e: - ld hl, wc314 - ld a, [hl] - ld [wc314 + 1], a - inc [hl] - ret - -Function116797: - ld hl, wc314 - inc [hl] - ret - -Function11679c: - ld a, c - ld [wc311], a - xor a - ld [wc312], a - jr asm_1167af - -Function1167a6: - ld hl, wc313 - dec [hl] - ret nz - ld hl, wc312 - inc [hl] - -asm_1167af: - ld a, [wc311] - cp $ff - ret z - sla a - ld c, a - ld b, 0 - ld hl, Unknown_1167eb - add hl, bc - ld a, [hli] - ld e, a - ld a, [hli] - ld d, a - push de - pop hl - ld a, [wc312] - sla a - ld c, a - ld b, $0 - add hl, bc - ld a, [hli] - cp $ff - jr z, .asm_1167dc - cp $fe - jr nz, .asm_1167e3 - xor a - ld [wc312], a - jr asm_1167af - -.asm_1167dc - ld a, $ff - ld [wc311], a - ld a, $fd - -.asm_1167e3 - ld [wc310], a - ld a, [hl] - ld [wc313], a - ret - -Unknown_1167eb: - dw Unknown_1167fb - dw Unknown_116808 - dw Unknown_116867 - dw Unknown_116870 - dw Unknown_116815 - dw Unknown_11683e - dw Unknown_116881 - dw Unknown_1168ae - -Unknown_1167fb: - db $0, $6 - db $1, $4 - db $2, $4 - db $3, $6 - db $2, $4 - db $1, $4 - db $fe - -Unknown_116808: - db $4, $6 - db $5, $4 - db $6, $4 - db $7, $6 - db $6, $4 - db $5, $4 - db $fe - -Unknown_116815: - db $fd, $20 - db $8, $c - db $9, $24 - db $a, $4 - db $b, $8 - db $a, $4 - db $9, $6 - db $c, $4 - db $d, $8 - db $c, $5 - db $9, $24 - db $a, $4 - db $b, $8 - db $a, $4 - db $9, $6 - db $c, $4 - db $d, $8 - db $c, $5 - db $9, $8 - db $8, $4 - db -1 ; end - -Unknown_11683e: - db $fd, $20 - db $e, $c - db $f, $24 - db $10, $4 - db $11, $8 - db $10, $4 - db $f, $6 - db $12, $4 - db $13, $8 - db $12, $5 - db $f, $24 - db $10, $4 - db $11, $8 - db $10, $4 - db $f, $6 - db $12, $4 - db $13, $8 - db $12, $5 - db $f, $8 - db $e, $4 - db -1 ; end - -Unknown_116867: - db $14, $8 - db $15, $8 - db $16, $8 - db $15, $8 - db $fe - -Unknown_116870: - db $17, $5 - db $18, $5 - db $19, $5 - db $1a, $5 - db $1b, $5 - db $1a, $5 - db $19, $5 - db $18, $5 - db $fe - -Unknown_116881: - db $1c, $7 - db $1d, $7 - db $1e, $a - db $1f, $a - db $20, $5 - db $21, $5 - db $20, $5 - db $21, $5 - db $20, $18 - db $22, $4 - db $23, $2 - db $22, $2 - db $23, $2 - db $22, $1 - db $23, $1 - db $22, $1 - db $23, $4 - db $fd, $1 - db $23, $1 - db $fd, $2 - db $23, $2 - db $fd, $40 - db -1 ; end - -Unknown_1168ae: - db $24, $4 - db $25, $4 - db $26, $4 - db $27, $4 - db $28, $4 - db $29, $4 - db $2a, $4 - db $2b, $4 - db $2c, $4 - db $2d, $4 - db $2e, $4 - db $fe - -Unknown_1168c5: - dw Unknown_116923 - dw Unknown_116960 - dw Unknown_1169a1 - dw Unknown_1169de - dw Unknown_116a1b - dw Unknown_116a58 - dw Unknown_116a99 - dw Unknown_116ad6 - dw Unknown_116d1b - dw Unknown_116d4c - dw Unknown_116d85 - dw Unknown_116dbe - dw Unknown_116df7 - dw Unknown_116e30 - dw Unknown_116e69 - dw Unknown_116e9a - dw Unknown_116ed3 - dw Unknown_116f0c - dw Unknown_116f45 - dw Unknown_116f7e - dw Unknown_116b13 - dw Unknown_116b54 - dw Unknown_116b95 - dw Unknown_116bd6 - dw Unknown_116c17 - dw Unknown_116c58 - dw Unknown_116c99 - dw Unknown_116cda - dw Unknown_116fb7 - dw Unknown_116fec - dw Unknown_117025 - dw Unknown_117056 - dw Unknown_117083 - dw Unknown_1170c0 - dw Unknown_1170fd - dw Unknown_11713a - dw Unknown_117177 - dw Unknown_11719c - dw Unknown_1171c1 - dw Unknown_1171e6 - dw Unknown_11720b - dw Unknown_117230 - dw Unknown_117255 - dw Unknown_11727a - dw Unknown_11729f - dw Unknown_1172c4 - dw Unknown_1172e9 - -Unknown_116923: - db $f - db $0, $0, $1, $a - db $0, $8, $2, $d - db $0, $10, $3, $d - db $0, $18, $4, $d - db $8, $0, $11, $a - db $8, $8, $12, $a - db $8, $10, $13, $a - db $8, $18, $14, $d - db $10, $0, $21, $a - db $10, $8, $22, $a - db $10, $10, $23, $a - db $10, $18, $24, $a - db $18, $0, $31, $a - db $18, $8, $32, $a - db $18, $10, $33, $a - -Unknown_116960: - db $10 - db $1, $0, $1, $a - db $1, $8, $2, $d - db $1, $10, $3, $d - db $1, $18, $4, $d - db $9, $0, $11, $a - db $9, $8, $12, $a - db $9, $10, $13, $a - db $9, $18, $14, $d - db $11, $0, $5, $a - db $11, $8, $6, $a - db $11, $10, $7, $a - db $11, $18, $34, $a - db $19, $0, $15, $a - db $19, $8, $16, $a - db $19, $10, $17, $a - db $19, $18, $35, $a - -Unknown_1169a1: - db $f - db $1, $0, $1, $a - db $1, $8, $2, $d - db $1, $10, $3, $d - db $1, $18, $4, $d - db $9, $0, $11, $a - db $9, $8, $12, $a - db $9, $10, $13, $a - db $9, $18, $14, $d - db $11, $0, $25, $a - db $11, $8, $26, $a - db $11, $10, $27, $a - db $11, $18, $34, $a - db $19, $8, $36, $a - db $19, $10, $37, $a - db $19, $18, $35, $a - -Unknown_1169de: - db $f - db $0, $0, $1, $a - db $0, $8, $2, $d - db $0, $10, $3, $d - db $0, $18, $4, $d - db $8, $0, $11, $a - db $8, $8, $12, $a - db $8, $10, $13, $a - db $8, $18, $14, $d - db $10, $0, $10, $a - db $10, $8, $20, $a - db $10, $10, $30, $a - db $10, $18, $24, $a - db $18, $0, $31, $a - db $18, $8, $32, $a - db $18, $10, $33, $a - -Unknown_116a1b: - db $f - db $0, $0, $4, $2d - db $0, $8, $3, $2d - db $0, $10, $2, $2d - db $0, $18, $1, $2a - db $8, $0, $14, $2d - db $8, $8, $13, $2a - db $8, $10, $12, $2a - db $8, $18, $11, $2a - db $10, $0, $24, $2a - db $10, $8, $23, $2a - db $10, $10, $22, $2a - db $10, $18, $21, $2a - db $18, $8, $33, $2a - db $18, $10, $32, $2a - db $18, $18, $31, $2a - -Unknown_116a58: - db $10 - db $1, $0, $4, $2d - db $1, $8, $3, $2d - db $1, $10, $2, $2d - db $1, $18, $1, $2a - db $9, $0, $14, $2d - db $9, $8, $13, $2a - db $9, $10, $12, $2a - db $9, $18, $11, $2a - db $11, $0, $34, $2a - db $11, $8, $7, $2a - db $11, $10, $6, $2a - db $11, $18, $5, $2a - db $19, $0, $35, $2a - db $19, $8, $17, $2a - db $19, $10, $16, $2a - db $19, $18, $15, $2a - -Unknown_116a99: - db $f - db $1, $0, $4, $2d - db $1, $8, $3, $2d - db $1, $10, $2, $2d - db $1, $18, $1, $2a - db $9, $0, $14, $2d - db $9, $8, $13, $2a - db $9, $10, $12, $2a - db $9, $18, $11, $2a - db $11, $0, $34, $2a - db $11, $8, $27, $2a - db $11, $10, $26, $2a - db $11, $18, $25, $2a - db $19, $0, $35, $2a - db $19, $8, $37, $2a - db $19, $10, $36, $2a - -Unknown_116ad6: - db $f - db $0, $0, $4, $2d - db $0, $8, $3, $2d - db $0, $10, $2, $2d - db $0, $18, $1, $2a - db $8, $0, $14, $2d - db $8, $8, $13, $2a - db $8, $10, $12, $2a - db $8, $18, $11, $2a - db $10, $0, $24, $2a - db $10, $8, $30, $2a - db $10, $10, $20, $2a - db $10, $18, $10, $2a - db $18, $8, $33, $2a - db $18, $10, $32, $2a - db $18, $18, $31, $2a - -Unknown_116b13: - db $10 - db $18, $0, $0, $b - db $18, $8, $8, $b - db $18, $10, $5c, $b - db $18, $18, $0, $b - db $10, $0, $0, $b - db $10, $8, $5d, $b - db $10, $10, $5e, $b - db $10, $18, $0, $b - db $8, $0, $50, $b - db $8, $8, $51, $b - db $8, $10, $52, $b - db $8, $18, $50, $2b - db $0, $0, $43, $b - db $0, $8, $44, $b - db $0, $10, $44, $2b - db $0, $18, $43, $2b - -Unknown_116b54: - db $10 - db $19, $0, $0, $b - db $19, $8, $18, $b - db $19, $10, $c, $b - db $19, $18, $0, $b - db $11, $0, $42, $b - db $11, $8, $3a, $b - db $11, $10, $3a, $2b - db $11, $18, $42, $2b - db $9, $0, $58, $b - db $9, $8, $45, $b - db $9, $10, $45, $2b - db $9, $18, $58, $2b - db $1, $0, $d, $b - db $1, $8, $44, $b - db $1, $10, $44, $2b - db $1, $18, $d, $2b - -Unknown_116b95: - db $10 - db $18, $0, $0, $b - db $18, $8, $5c, $2b - db $18, $10, $8, $2b - db $18, $18, $0, $b - db $10, $0, $0, $b - db $10, $8, $5e, $2b - db $10, $10, $5d, $2b - db $10, $18, $0, $b - db $8, $0, $50, $b - db $8, $8, $52, $2b - db $8, $10, $51, $2b - db $8, $18, $50, $2b - db $0, $0, $43, $b - db $0, $8, $44, $b - db $0, $10, $44, $2b - db $0, $18, $43, $2b - -Unknown_116bd6: - db $10 - db $18, $0, $0, $a - db $18, $8, $56, $a - db $18, $10, $57, $a - db $18, $18, $0, $a - db $10, $0, $64, $a - db $10, $8, $4a, $a - db $10, $10, $4b, $a - db $10, $18, $71, $a - db $8, $0, $54, $a - db $8, $8, $55, $a - db $8, $10, $55, $2a - db $8, $18, $54, $2a - db $0, $0, $48, $a - db $0, $8, $49, $a - db $0, $10, $49, $2a - db $0, $18, $48, $2a - -Unknown_116c17: - db $10 - db $19, $0, $0, $a - db $19, $8, $76, $a - db $19, $10, $77, $a - db $19, $18, $0, $a - db $11, $0, $64, $a - db $11, $8, $69, $a - db $11, $10, $6a, $a - db $11, $18, $6b, $a - db $9, $0, $6f, $a - db $9, $8, $70, $a - db $9, $10, $70, $2a - db $9, $18, $6f, $2a - db $1, $0, $63, $a - db $1, $8, $19, $a - db $1, $10, $19, $2a - db $1, $18, $63, $2a - -Unknown_116c58: - db $10 - db $1a, $0, $6c, $a - db $1a, $8, $6d, $a - db $1a, $10, $6e, $a - db $1a, $18, $0, $a - db $12, $0, $5f, $a - db $12, $8, $60, $a - db $12, $10, $61, $a - db $12, $18, $62, $a - db $a, $0, $53, $a - db $a, $8, $55, $a - db $a, $10, $55, $2a - db $a, $18, $53, $2a - db $2, $0, $46, $a - db $2, $8, $47, $a - db $2, $10, $47, $2a - db $2, $18, $46, $2a - -Unknown_116c99: - db $10 - db $19, $0, $0, $2a - db $19, $8, $77, $2a - db $19, $10, $76, $2a - db $19, $18, $0, $2a - db $11, $0, $6b, $2a - db $11, $8, $6a, $2a - db $11, $10, $69, $2a - db $11, $18, $64, $2a - db $9, $0, $6f, $a - db $9, $8, $70, $a - db $9, $10, $70, $2a - db $9, $18, $6f, $2a - db $1, $0, $63, $a - db $1, $8, $19, $a - db $1, $10, $19, $2a - db $1, $18, $63, $2a - -Unknown_116cda: - db $10 - db $18, $0, $0, $a - db $18, $8, $57, $2a - db $18, $10, $56, $2a - db $18, $18, $0, $a - db $10, $0, $71, $2a - db $10, $8, $4b, $2a - db $10, $10, $4a, $2a - db $10, $18, $64, $2a - db $8, $0, $54, $a - db $8, $8, $55, $a - db $8, $10, $55, $2a - db $8, $18, $54, $2a - db $0, $0, $48, $a - db $0, $8, $49, $a - db $0, $10, $49, $2a - db $0, $18, $48, $2a - -Unknown_116d1b: - db $c - db $0, $0, $38, $4a - db $0, $8, $39, $4a - db $0, $10, $39, $6a - db $0, $18, $38, $6a - db $8, $0, $28, $4a - db $8, $8, $29, $4a - db $8, $10, $29, $6a - db $8, $18, $28, $6a - db $10, $0, $9, $4d - db $10, $8, $19, $4a - db $10, $10, $19, $6a - db $10, $18, $9, $6d - -Unknown_116d4c: - db $e - db $0, $8, $3b, $4a - db $0, $10, $3b, $6a - db $8, $0, $2a, $4a - db $8, $8, $2b, $4a - db $8, $10, $2b, $6a - db $8, $18, $2a, $6a - db $10, $0, $1a, $4a - db $10, $8, $1b, $4a - db $10, $10, $1b, $6a - db $10, $18, $1a, $6a - db $18, $0, $a, $4a - db $18, $8, $b, $4a - db $18, $10, $b, $6a - db $18, $18, $a, $6a - -Unknown_116d85: - db $e - db $0, $0, $35, $2a - db $0, $8, $3c, $4a - db $0, $10, $3d, $4a - db $0, $18, $3e, $4a - db $8, $0, $2c, $4a - db $8, $8, $2d, $4a - db $8, $10, $2e, $4a - db $8, $18, $2f, $4a - db $10, $0, $1c, $4a - db $10, $8, $1d, $4a - db $10, $10, $1e, $4d - db $10, $18, $1f, $4d - db $18, $10, $e, $4d - db $18, $18, $f, $4a - -Unknown_116dbe: - db $e - db $0, $0, $65, $4a - db $0, $8, $66, $4a - db $0, $10, $67, $4a - db $0, $18, $68, $4a - db $8, $8, $59, $4a - db $8, $10, $5a, $4a - db $8, $18, $5b, $4a - db $10, $0, $4c, $4a - db $10, $8, $4d, $4d - db $10, $10, $4e, $4d - db $10, $18, $4f, $4a - db $18, $0, $3f, $4d - db $18, $8, $40, $4d - db $18, $10, $41, $4d - -Unknown_116df7: - db $e - db $0, $0, $3e, $6a - db $0, $8, $3d, $6a - db $0, $10, $3c, $6a - db $0, $18, $35, $a - db $8, $0, $2f, $6a - db $8, $8, $2e, $6a - db $8, $10, $2d, $6a - db $8, $18, $2c, $6a - db $10, $0, $1f, $6d - db $10, $8, $1e, $6d - db $10, $10, $1d, $6a - db $10, $18, $1c, $6a - db $18, $0, $f, $6a - db $18, $8, $e, $6d - -Unknown_116e30: - db $e - db $0, $0, $68, $6a - db $0, $8, $67, $6a - db $0, $10, $66, $6a - db $0, $18, $65, $6a - db $8, $0, $5b, $6a - db $8, $8, $5a, $6a - db $8, $10, $59, $6a - db $10, $0, $4f, $6a - db $10, $8, $4e, $6d - db $10, $10, $4d, $6d - db $10, $18, $4c, $6a - db $18, $8, $41, $6d - db $18, $10, $40, $6d - db $18, $18, $3f, $6d - -Unknown_116e69: - db $c - db $8, $0, $9, $d - db $8, $8, $19, $a - db $8, $10, $19, $2a - db $8, $18, $9, $2d - db $10, $0, $28, $a - db $10, $8, $29, $a - db $10, $10, $29, $2a - db $10, $18, $28, $2a - db $18, $0, $38, $a - db $18, $8, $39, $a - db $18, $10, $39, $2a - db $18, $18, $38, $2a - -Unknown_116e9a: - db $e - db $0, $0, $a, $a - db $0, $8, $b, $a - db $0, $10, $b, $2a - db $0, $18, $a, $2a - db $8, $0, $1a, $a - db $8, $8, $1b, $a - db $8, $10, $1b, $2a - db $8, $18, $1a, $2a - db $10, $0, $2a, $a - db $10, $8, $2b, $a - db $10, $10, $2b, $2a - db $10, $18, $2a, $2a - db $18, $8, $3b, $a - db $18, $10, $3b, $2a - -Unknown_116ed3: - db $e - db $0, $10, $e, $d - db $0, $18, $f, $a - db $8, $0, $1c, $a - db $8, $8, $1d, $a - db $8, $10, $1e, $d - db $8, $18, $1f, $d - db $10, $0, $2c, $a - db $10, $8, $2d, $a - db $10, $10, $2e, $a - db $10, $18, $2f, $a - db $18, $0, $35, $6a - db $18, $8, $3c, $a - db $18, $10, $3d, $a - db $18, $18, $3e, $a - -Unknown_116f0c: - db $e - db $0, $0, $3f, $d - db $0, $8, $40, $d - db $0, $10, $41, $d - db $8, $0, $4c, $a - db $8, $8, $4d, $d - db $8, $10, $4e, $d - db $8, $18, $4f, $a - db $10, $8, $59, $a - db $10, $10, $5a, $a - db $10, $18, $5b, $a - db $18, $0, $65, $a - db $18, $8, $66, $a - db $18, $10, $67, $a - db $18, $18, $68, $a - -Unknown_116f45: - db $e - db $0, $0, $f, $2a - db $0, $8, $e, $2d - db $8, $0, $1f, $2d - db $8, $8, $1e, $2d - db $8, $10, $1d, $2a - db $8, $18, $1c, $2a - db $10, $0, $2f, $2a - db $10, $8, $2e, $2a - db $10, $10, $2d, $2a - db $10, $18, $2c, $2a - db $18, $0, $3e, $2a - db $18, $8, $3d, $2a - db $18, $10, $3c, $2a - db $18, $18, $35, $4a - -Unknown_116f7e: - db $e - db $0, $8, $41, $2d - db $0, $10, $40, $2d - db $0, $18, $3f, $2d - db $8, $0, $4f, $2a - db $8, $8, $4e, $2d - db $8, $10, $4d, $2d - db $8, $18, $4c, $2a - db $10, $0, $5b, $2a - db $10, $8, $5a, $2a - db $10, $10, $59, $2a - db $18, $0, $68, $2a - db $18, $8, $67, $2a - db $18, $10, $66, $2a - db $18, $18, $65, $2a - -Unknown_116fb7: - db $d - db $fa, $0, $72, $a - db $fa, $8, $73, $d - db $fa, $10, $74, $d - db $fa, $18, $75, $d - db $2, $0, $81, $a - db $2, $8, $82, $a - db $2, $10, $83, $a - db $2, $18, $84, $a - db $a, $0, $91, $a - db $a, $8, $92, $a - db $a, $10, $93, $a - db $a, $18, $94, $a - db $12, $10, $a3, $a - -Unknown_116fec: - db $e - db $fd, $0, $85, $d - db $fd, $8, $86, $d - db $5, $0, $95, $d - db $5, $8, $96, $a - db $5, $10, $97, $a - db $5, $18, $98, $a - db $d, $0, $a5, $a - db $d, $8, $a6, $a - db $d, $10, $a7, $a - db $d, $18, $a8, $a - db $15, $0, $b3, $a - db $15, $8, $b4, $a - db $15, $10, $b5, $a - db $15, $18, $b6, $a - -Unknown_117025: - db $c - db $8, $0, $79, $d - db $8, $8, $7a, $d - db $8, $10, $7b, $a - db $8, $18, $7c, $a - db $10, $0, $89, $d - db $10, $8, $8a, $a - db $10, $10, $8b, $a - db $10, $18, $8c, $a - db $18, $0, $99, $a - db $18, $8, $9a, $a - db $18, $10, $9b, $a - db $18, $18, $9c, $a - -Unknown_117056: - db $b - db $8, $0, $7d, $a - db $8, $8, $7e, $d - db $8, $10, $7f, $d - db $8, $18, $80, $a - db $10, $0, $8d, $a - db $10, $8, $8e, $a - db $10, $10, $8f, $a - db $10, $18, $90, $a - db $18, $8, $9e, $a - db $18, $10, $9f, $a - db $18, $18, $a0, $a - -Unknown_117083: - db $f - db $0, $0, $a1, $a - db $0, $8, $a2, $a - db $0, $10, $a2, $2a - db $0, $18, $a1, $2a - db $8, $0, $b1, $a - db $8, $8, $b2, $d - db $8, $10, $b2, $2d - db $8, $18, $b1, $2a - db $10, $0, $ab, $a - db $10, $8, $ac, $a - db $10, $10, $ac, $2a - db $10, $18, $ab, $2a - db $18, $8, $a4, $a - db $18, $10, $87, $a - db $18, $18, $88, $a - -Unknown_1170c0: - db $f - db $0, $0, $a1, $a - db $0, $8, $a2, $d - db $0, $10, $a2, $2a - db $0, $18, $a1, $2a - db $8, $0, $b1, $a - db $8, $8, $78, $d - db $8, $10, $78, $2d - db $8, $18, $b1, $2a - db $10, $0, $ab, $a - db $10, $8, $ac, $a - db $10, $10, $ac, $2a - db $10, $18, $ab, $2a - db $18, $8, $a4, $a - db $18, $10, $87, $a - db $18, $18, $88, $a - -Unknown_1170fd: - db $f - db $0, $0, $a9, $a - db $0, $8, $aa, $a - db $0, $10, $aa, $2a - db $0, $18, $a9, $2a - db $8, $0, $b7, $a - db $8, $8, $b8, $a - db $8, $10, $b8, $2a - db $8, $18, $b7, $2a - db $10, $0, $ab, $a - db $10, $8, $ac, $a - db $10, $10, $ac, $2a - db $10, $18, $ad, $a - db $18, $8, $a4, $a - db $18, $10, $ba, $a - db $18, $18, $bb, $a - -Unknown_11713a: - db $f - db $0, $0, $ae, $c - db $0, $8, $af, $c - db $0, $10, $af, $2c - db $0, $18, $ae, $2c - db $8, $0, $bc, $c - db $8, $8, $bd, $c - db $8, $10, $bd, $2c - db $8, $18, $bc, $2c - db $10, $0, $bf, $c - db $10, $8, $9d, $c - db $10, $10, $9d, $2c - db $10, $18, $b0, $c - db $18, $8, $b9, $c - db $18, $10, $c0, $c - db $18, $18, $be, $c - -Unknown_117177: - db $9 - db $14, $0, $1f, $6 - db $14, $8, $20, $6 - db $14, $10, $21, $6 - db $c, $0, $10, $6 - db $c, $8, $11, $6 - db $c, $10, $12, $6 - db $4, $0, $1, $6 - db $4, $8, $2, $6 - db $4, $10, $3, $6 - -Unknown_11719c: - db $9 - db $14, $0, $22, $6 - db $14, $8, $23, $6 - db $14, $10, $24, $6 - db $c, $0, $13, $6 - db $c, $8, $14, $6 - db $c, $10, $15, $6 - db $4, $0, $4, $6 - db $4, $8, $5, $6 - db $4, $10, $6, $6 - -Unknown_1171c1: - db $9 - db $14, $0, $25, $6 - db $14, $8, $26, $6 - db $14, $10, $27, $6 - db $c, $0, $16, $6 - db $c, $8, $17, $6 - db $c, $10, $18, $6 - db $4, $0, $7, $6 - db $4, $8, $8, $6 - db $4, $10, $9, $6 - -Unknown_1171e6: - db $9 - db $14, $0, $28, $6 - db $14, $8, $29, $6 - db $14, $10, $2a, $6 - db $c, $0, $19, $6 - db $c, $8, $1a, $6 - db $c, $10, $1b, $6 - db $4, $0, $a, $6 - db $4, $8, $b, $6 - db $4, $10, $c, $6 - -Unknown_11720b: - db $9 - db $14, $0, $2b, $6 - db $14, $8, $2c, $6 - db $14, $10, $2d, $6 - db $c, $0, $1c, $6 - db $c, $8, $1d, $6 - db $c, $10, $1e, $6 - db $4, $0, $d, $6 - db $4, $8, $e, $6 - db $4, $10, $f, $6 - -Unknown_117230: - db $9 - db $14, $0, $47, $6 - db $14, $8, $48, $6 - db $14, $10, $49, $6 - db $c, $0, $3b, $6 - db $c, $8, $3c, $6 - db $c, $10, $3b, $26 - db $4, $0, $2e, $6 - db $4, $8, $2f, $6 - db $4, $10, $30, $6 - -Unknown_117255: - db $9 - db $14, $0, $35, $6 - db $14, $8, $4a, $6 - db $14, $10, $35, $6 - db $c, $0, $3d, $6 - db $c, $8, $35, $6 - db $c, $10, $3d, $26 - db $4, $0, $31, $6 - db $4, $8, $32, $6 - db $4, $10, $31, $26 - -Unknown_11727a: - db $9 - db $14, $0, $4b, $6 - db $14, $8, $4c, $6 - db $14, $10, $4d, $6 - db $c, $0, $3e, $6 - db $c, $8, $3f, $6 - db $c, $10, $40, $6 - db $4, $0, $33, $6 - db $4, $8, $34, $6 - db $4, $10, $35, $6 - -Unknown_11729f: - db $9 - db $14, $0, $4e, $6 - db $14, $8, $4f, $6 - db $14, $10, $50, $6 - db $c, $0, $41, $6 - db $c, $8, $42, $6 - db $c, $10, $43, $6 - db $4, $0, $35, $6 - db $4, $8, $36, $6 - db $4, $10, $37, $6 - -Unknown_1172c4: - db $9 - db $14, $0, $51, $6 - db $14, $8, $52, $6 - db $14, $10, $35, $6 - db $c, $0, $44, $6 - db $c, $8, $45, $6 - db $c, $10, $46, $6 - db $4, $0, $38, $6 - db $4, $8, $39, $6 - db $4, $10, $3a, $6 - -Unknown_1172e9: - db $9 - db $10, $0, $0, $2 - db $10, $8, $0, $2 - db $10, $10, $0, $2 - db $8, $0, $0, $2 - db $8, $8, $0, $2 - db $c, $10, $1f, $6 - db $0, $0, $0, $2 - db $0, $8, $0, $2 - db $4, $10, $10, $6 - -Palette_11730e: - RGB 31, 31, 31 - RGB 7, 5, 4 - RGB 31, 28, 4 - RGB 31, 5, 5 - RGB 31, 31, 31 - RGB 7, 5, 4 - RGB 31, 23, 0 - RGB 31, 28, 4 - RGB 31, 31, 31 - RGB 16, 19, 31 - RGB 17, 31, 31 - RGB 31, 31, 31 - RGB 5, 5, 5 - RGB 7, 5, 4 - RGB 31, 28, 4 - RGB 19, 11, 6 - RGB 31, 31, 31 - RGB 3, 15, 31 - RGB 4, 25, 25 - RGB 0, 7, 12 - RGB 31, 31, 31 - RGB 0, 16, 0 - RGB 0, 16, 0 - RGB 0, 16, 0 - RGB 4, 11, 22 - RGB 0, 16, 0 - RGB 0, 16, 0 - RGB 0, 16, 0 - RGB 22, 11, 8 - RGB 0, 16, 0 - RGB 0, 16, 0 - RGB 0, 16, 0 - -Palette_11734e: - RGB 31, 30, 30 - RGB 2, 0, 0 - RGB 10, 9, 9 - RGB 15, 14, 14 - -Unknown_117356: - db $c9, $c9, $c9, $c9, $c9, $c9, $c9, $c9, $c9, $c9, $c9, $c9, $c9, $c9, $c9, $c9 - db $c9, $c9, $c9, $c9, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1 - db $c5, $c6, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2 - db $c2, $c2, $c6, $c5, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1 - db $c3, $c4, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2 - db $c2, $c2, $c4, $c3, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1 - db $c3, $c4, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2 - db $c2, $c2, $c4, $c3, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1 - db $c3, $c4, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2 - db $c2, $c2, $c4, $c3, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1 - db $c3, $c4, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2 - db $c2, $c2, $c4, $c3, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1 - db $c3, $c4, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2 - db $c2, $c2, $c4, $c3, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1 - db $c3, $c4, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2 - db $c2, $c2, $c4, $c3, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1 - db $c3, $c4, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2 - db $c2, $c2, $c4, $c3, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1 - db $c3, $c4, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $d8, $c2, $c2, $d8, $c2, $c2, $c2 - db $c2, $c2, $c4, $c3, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1 - db $c7, $c8, $ca, $cb, $cc, $cd, $ce, $c2, $cf, $d0, $d1, $d2, $d3, $c2, $d4, $d5 - db $d6, $d7, $c8, $c7, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1 - db $c9, $c9, $c9, $c9, $c9, $c9, $c9, $c9, $c9, $c9, $c9, $c9, $c9, $c9, $c9, $c9 - db $c9, $c9, $c9, $c9, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1 - - db $8f, $8f, $8f, $8f, $8f, $8f, $8f, $8f, $8f, $8f, $8f, $8f, $8f, $8f, $8f, $8f - db $8f, $8f, $8f, $8f, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 - db $8f, $8f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f - db $0f, $0f, $af, $af, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 - db $8f, $8f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f - db $0f, $0f, $af, $af, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 - db $8f, $8f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f - db $0f, $0f, $af, $af, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 - db $8f, $8f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f - db $0f, $0f, $af, $af, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 - db $8f, $8f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f - db $0f, $0f, $af, $af, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 - db $8f, $8f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f - db $0f, $0f, $af, $af, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 - db $8f, $8f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f - db $0f, $0f, $af, $af, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 - db $8f, $8f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f - db $0f, $0f, $af, $af, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 - db $8f, $8f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $8f, $0f, $0f, $8f, $0f, $0f, $0f - db $0f, $0f, $af, $af, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 - db $8f, $8f, $8f, $8f, $8f, $8f, $8f, $0f, $8f, $8f, $8f, $8f, $8f, $0f, $8f, $8f - db $8f, $8f, $af, $af, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 - db $8f, $8f, $8f, $8f, $8f, $8f, $8f, $8f, $8f, $8f, $8f, $8f, $8f, $8f, $8f, $8f - db $8f, $8f, $8f, $8f, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 +INCLUDE "mobile/mobile_45_sprite_engine.asm" SECTION "GiveOddEgg", ROMX diff --git a/mobile/mobile_45_sprite_engine.asm b/mobile/mobile_45_sprite_engine.asm index f41260d7ded..04241157357 100644 --- a/mobile/mobile_45_sprite_engine.asm +++ b/mobile/mobile_45_sprite_engine.asm @@ -901,3 +901,1454 @@ Function116468: ld a, h ld [wc3f3], a ret + +Function116567: + ld hl, wc3f7 + dec [hl] + ret nz + ld hl, wc3f6 + inc [hl] +.asm_116570 + ld a, $7 + sla a + ld c, a + ld b, 0 + ld hl, Unknown_1167eb + add hl, bc + ld a, [hli] + ld e, a + ld a, [hli] + ld d, a + push de + pop hl + ld a, [wc3f6] + sla a + ld c, a + ld b, $0 + add hl, bc + ld a, [hli] + cp $fe + jr nz, .asm_116595 + xor a + ld [wc3f6], a + jr .asm_116570 + +.asm_116595 + ld [wc3f5], a + ld a, [hl] + ld [wc3f7], a + ret + +Function11659d: + ld a, [wc314] + cp $12 + ret nc + ld e, a + ld d, 0 + ld hl, Jumptable_1165af + add hl, de + add hl, de + ld a, [hli] + ld h, [hl] + ld l, a + jp hl + +Jumptable_1165af: + dw Function11677e + dw Function1165d5 + dw Function1165d8 + dw Function1165e3 + dw Function1165f5 + dw Function116600 + dw Function116615 + dw Function116618 + dw Function116623 + dw Function116635 + dw Function116640 + dw Function116655 + dw Function11665c + dw Function11668d + dw Function11669f + dw Function1166a2 + dw Function1166c4 + dw Function1166d6 + dw Function1166d6 + +Function1165d5: + call Function11678e + +Function1165d8: + ld a, $0 + ld c, a + ld a, $ff + ld b, a + ld a, $a8 + call Function1166f4 + +Function1165e3: + call Function116747 + ld a, [wc30e] + cp $e8 + ret nz + ld a, $1 + call Function116780 + ret c + jp Function116797 + +Function1165f5: + ld a, $1 + ld c, a + ld a, $1 + ld b, a + ld a, $e8 + call Function1166f4 + +Function116600: + call Function116747 + ld a, [wc30e] + cp $a8 + ret nz + ld a, $1 + call Function116780 + ret c + ld a, $2 + ld [wc314], a + ret + +Function116615: + call Function11678e + +Function116618: + ld a, $3 + ld c, a + ld a, $1 + ld b, a + ld a, $28 + call Function11671f + +Function116623: + call Function116747 + ld a, [wc30f] + cp $a0 + ret nz + ld a, $6 + call Function116780 + ret c + jp Function116797 + +Function116635: + ld a, $2 + ld c, a + ld a, $ff + ld b, a + ld a, $a0 + call Function11671f + +Function116640: + call Function116747 + ld a, [wc30f] + cp $28 + ret nz + ld a, $6 + call Function116780 + ret c + ld a, $7 + ld [wc314], a + ret + +Function116655: + xor a + ld [wc314 + 3], a + call Function11678e + +Function11665c: + ld hl, wc314 + 3 + ld a, $1 + xor [hl] + ld [hl], a + add $4 + ld c, a + call Function11679c + ld a, [wc314 + 3] + and a + jr nz, .asm_116673 + ld a, $48 + jr .asm_116675 + +.asm_116673 + ld a, $78 + +.asm_116675 + ld [wc30f], a + call Random + ldh a, [hRandomAdd] + and $7 + sla a + sla a + sla a + add $30 + ld [wc30e], a + call Function116797 + +Function11668d: + ld a, [wc311] + cp $ff + ret nz + ld a, $b + call Function116780 + ret c + ld a, $c + ld [wc314], a + ret + +Function11669f: + call Function11678e + +Function1166a2: + ld a, $a8 + ld [wc30e], a + ld [wc3f1], a + ld a, $60 + ld [wc30f], a + ld [wc3f3], a + ld a, $ff + ld [wc314 + 2], a + xor a + ld [wc314 + 3], a + ld a, $0 + ld c, a + call Function11679c + call Function116797 + +Function1166c4: + call Function116747 + ld a, [wc30e] + cp $58 + ret nz + ld a, $6 + ld c, a + call Function11679c + call Function116797 + +Function1166d6: + call Function116747 + ld a, [wc30e] + cp $48 + jr nz, .asm_1166e4 + xor a + ld [wc314 + 2], a + +.asm_1166e4 + ld a, [wc311] + cp $ff + ret nz + ld a, $4 + ld [$c319], a + xor a + ld [wc314], a + ret + +Function1166f4: + ld [wc30e], a + ld a, b + ld [wc314 + 2], a + xor a + ld [wc314 + 3], a + ld hl, wc30f +.asm_116702 + call Random + ldh a, [hRandomAdd] + and $7 + jr z, .asm_11670c + dec a + +.asm_11670c + sla a + sla a + sla a + add $48 + cp [hl] + jr z, .asm_116702 + ld [hl], a + call Function11679c + call Function116797 + ret + +Function11671f: + ld [wc30f], a + ld a, b + ld [wc314 + 3], a + xor a + ld [wc314 + 2], a + ld hl, wc30e +.asm_11672d + call Random + ldh a, [hRandomAdd] + and $7 + sla a + sla a + sla a + add $30 + cp [hl] + jr z, .asm_11672d + ld [hl], a + call Function11679c + call Function116797 + ret + +Function116747: + ld hl, wc30e + ld a, [wc314 + 2] + add [hl] + ld [hl], a + ld hl, wc30f + ld a, [wc314 + 3] + add [hl] + ld [hl], a + ret + +Function116758: + ld a, [wc30f] + cp $30 + jr c, .asm_116770 + jr z, .asm_116770 + cp $38 + jr c, .asm_116774 + jr z, .asm_116774 + cp $40 + jr c, .asm_116778 + jr z, .asm_116778 + xor a + jr .asm_11677a + +.asm_116770 + ld a, $c + jr .asm_11677a + +.asm_116774 + ld a, $8 + jr .asm_11677a + +.asm_116778 + ld a, $4 + +.asm_11677a + ld [wc314 + 4], a + ret + +Function11677e: + ld a, $0 + +Function116780: + ld hl, wc314 + 1 + cp [hl] + jr z, .asm_11678c + ld a, [hl] + ld [wc314], a + scf + ret + +.asm_11678c + and a + ret + +Function11678e: + ld hl, wc314 + ld a, [hl] + ld [wc314 + 1], a + inc [hl] + ret + +Function116797: + ld hl, wc314 + inc [hl] + ret + +Function11679c: + ld a, c + ld [wc311], a + xor a + ld [wc312], a + jr asm_1167af + +Function1167a6: + ld hl, wc313 + dec [hl] + ret nz + ld hl, wc312 + inc [hl] + +asm_1167af: + ld a, [wc311] + cp $ff + ret z + sla a + ld c, a + ld b, 0 + ld hl, Unknown_1167eb + add hl, bc + ld a, [hli] + ld e, a + ld a, [hli] + ld d, a + push de + pop hl + ld a, [wc312] + sla a + ld c, a + ld b, $0 + add hl, bc + ld a, [hli] + cp $ff + jr z, .asm_1167dc + cp $fe + jr nz, .asm_1167e3 + xor a + ld [wc312], a + jr asm_1167af + +.asm_1167dc + ld a, $ff + ld [wc311], a + ld a, $fd + +.asm_1167e3 + ld [wc310], a + ld a, [hl] + ld [wc313], a + ret + +Unknown_1167eb: + dw Unknown_1167fb + dw Unknown_116808 + dw Unknown_116867 + dw Unknown_116870 + dw Unknown_116815 + dw Unknown_11683e + dw Unknown_116881 + dw Unknown_1168ae + +Unknown_1167fb: + db $0, $6 + db $1, $4 + db $2, $4 + db $3, $6 + db $2, $4 + db $1, $4 + db $fe + +Unknown_116808: + db $4, $6 + db $5, $4 + db $6, $4 + db $7, $6 + db $6, $4 + db $5, $4 + db $fe + +Unknown_116815: + db $fd, $20 + db $8, $c + db $9, $24 + db $a, $4 + db $b, $8 + db $a, $4 + db $9, $6 + db $c, $4 + db $d, $8 + db $c, $5 + db $9, $24 + db $a, $4 + db $b, $8 + db $a, $4 + db $9, $6 + db $c, $4 + db $d, $8 + db $c, $5 + db $9, $8 + db $8, $4 + db -1 ; end + +Unknown_11683e: + db $fd, $20 + db $e, $c + db $f, $24 + db $10, $4 + db $11, $8 + db $10, $4 + db $f, $6 + db $12, $4 + db $13, $8 + db $12, $5 + db $f, $24 + db $10, $4 + db $11, $8 + db $10, $4 + db $f, $6 + db $12, $4 + db $13, $8 + db $12, $5 + db $f, $8 + db $e, $4 + db -1 ; end + +Unknown_116867: + db $14, $8 + db $15, $8 + db $16, $8 + db $15, $8 + db $fe + +Unknown_116870: + db $17, $5 + db $18, $5 + db $19, $5 + db $1a, $5 + db $1b, $5 + db $1a, $5 + db $19, $5 + db $18, $5 + db $fe + +Unknown_116881: + db $1c, $7 + db $1d, $7 + db $1e, $a + db $1f, $a + db $20, $5 + db $21, $5 + db $20, $5 + db $21, $5 + db $20, $18 + db $22, $4 + db $23, $2 + db $22, $2 + db $23, $2 + db $22, $1 + db $23, $1 + db $22, $1 + db $23, $4 + db $fd, $1 + db $23, $1 + db $fd, $2 + db $23, $2 + db $fd, $40 + db -1 ; end + +Unknown_1168ae: + db $24, $4 + db $25, $4 + db $26, $4 + db $27, $4 + db $28, $4 + db $29, $4 + db $2a, $4 + db $2b, $4 + db $2c, $4 + db $2d, $4 + db $2e, $4 + db $fe + +Unknown_1168c5: + dw Unknown_116923 + dw Unknown_116960 + dw Unknown_1169a1 + dw Unknown_1169de + dw Unknown_116a1b + dw Unknown_116a58 + dw Unknown_116a99 + dw Unknown_116ad6 + dw Unknown_116d1b + dw Unknown_116d4c + dw Unknown_116d85 + dw Unknown_116dbe + dw Unknown_116df7 + dw Unknown_116e30 + dw Unknown_116e69 + dw Unknown_116e9a + dw Unknown_116ed3 + dw Unknown_116f0c + dw Unknown_116f45 + dw Unknown_116f7e + dw Unknown_116b13 + dw Unknown_116b54 + dw Unknown_116b95 + dw Unknown_116bd6 + dw Unknown_116c17 + dw Unknown_116c58 + dw Unknown_116c99 + dw Unknown_116cda + dw Unknown_116fb7 + dw Unknown_116fec + dw Unknown_117025 + dw Unknown_117056 + dw Unknown_117083 + dw Unknown_1170c0 + dw Unknown_1170fd + dw Unknown_11713a + dw Unknown_117177 + dw Unknown_11719c + dw Unknown_1171c1 + dw Unknown_1171e6 + dw Unknown_11720b + dw Unknown_117230 + dw Unknown_117255 + dw Unknown_11727a + dw Unknown_11729f + dw Unknown_1172c4 + dw Unknown_1172e9 + +Unknown_116923: + db $f + db $0, $0, $1, $a + db $0, $8, $2, $d + db $0, $10, $3, $d + db $0, $18, $4, $d + db $8, $0, $11, $a + db $8, $8, $12, $a + db $8, $10, $13, $a + db $8, $18, $14, $d + db $10, $0, $21, $a + db $10, $8, $22, $a + db $10, $10, $23, $a + db $10, $18, $24, $a + db $18, $0, $31, $a + db $18, $8, $32, $a + db $18, $10, $33, $a + +Unknown_116960: + db $10 + db $1, $0, $1, $a + db $1, $8, $2, $d + db $1, $10, $3, $d + db $1, $18, $4, $d + db $9, $0, $11, $a + db $9, $8, $12, $a + db $9, $10, $13, $a + db $9, $18, $14, $d + db $11, $0, $5, $a + db $11, $8, $6, $a + db $11, $10, $7, $a + db $11, $18, $34, $a + db $19, $0, $15, $a + db $19, $8, $16, $a + db $19, $10, $17, $a + db $19, $18, $35, $a + +Unknown_1169a1: + db $f + db $1, $0, $1, $a + db $1, $8, $2, $d + db $1, $10, $3, $d + db $1, $18, $4, $d + db $9, $0, $11, $a + db $9, $8, $12, $a + db $9, $10, $13, $a + db $9, $18, $14, $d + db $11, $0, $25, $a + db $11, $8, $26, $a + db $11, $10, $27, $a + db $11, $18, $34, $a + db $19, $8, $36, $a + db $19, $10, $37, $a + db $19, $18, $35, $a + +Unknown_1169de: + db $f + db $0, $0, $1, $a + db $0, $8, $2, $d + db $0, $10, $3, $d + db $0, $18, $4, $d + db $8, $0, $11, $a + db $8, $8, $12, $a + db $8, $10, $13, $a + db $8, $18, $14, $d + db $10, $0, $10, $a + db $10, $8, $20, $a + db $10, $10, $30, $a + db $10, $18, $24, $a + db $18, $0, $31, $a + db $18, $8, $32, $a + db $18, $10, $33, $a + +Unknown_116a1b: + db $f + db $0, $0, $4, $2d + db $0, $8, $3, $2d + db $0, $10, $2, $2d + db $0, $18, $1, $2a + db $8, $0, $14, $2d + db $8, $8, $13, $2a + db $8, $10, $12, $2a + db $8, $18, $11, $2a + db $10, $0, $24, $2a + db $10, $8, $23, $2a + db $10, $10, $22, $2a + db $10, $18, $21, $2a + db $18, $8, $33, $2a + db $18, $10, $32, $2a + db $18, $18, $31, $2a + +Unknown_116a58: + db $10 + db $1, $0, $4, $2d + db $1, $8, $3, $2d + db $1, $10, $2, $2d + db $1, $18, $1, $2a + db $9, $0, $14, $2d + db $9, $8, $13, $2a + db $9, $10, $12, $2a + db $9, $18, $11, $2a + db $11, $0, $34, $2a + db $11, $8, $7, $2a + db $11, $10, $6, $2a + db $11, $18, $5, $2a + db $19, $0, $35, $2a + db $19, $8, $17, $2a + db $19, $10, $16, $2a + db $19, $18, $15, $2a + +Unknown_116a99: + db $f + db $1, $0, $4, $2d + db $1, $8, $3, $2d + db $1, $10, $2, $2d + db $1, $18, $1, $2a + db $9, $0, $14, $2d + db $9, $8, $13, $2a + db $9, $10, $12, $2a + db $9, $18, $11, $2a + db $11, $0, $34, $2a + db $11, $8, $27, $2a + db $11, $10, $26, $2a + db $11, $18, $25, $2a + db $19, $0, $35, $2a + db $19, $8, $37, $2a + db $19, $10, $36, $2a + +Unknown_116ad6: + db $f + db $0, $0, $4, $2d + db $0, $8, $3, $2d + db $0, $10, $2, $2d + db $0, $18, $1, $2a + db $8, $0, $14, $2d + db $8, $8, $13, $2a + db $8, $10, $12, $2a + db $8, $18, $11, $2a + db $10, $0, $24, $2a + db $10, $8, $30, $2a + db $10, $10, $20, $2a + db $10, $18, $10, $2a + db $18, $8, $33, $2a + db $18, $10, $32, $2a + db $18, $18, $31, $2a + +Unknown_116b13: + db $10 + db $18, $0, $0, $b + db $18, $8, $8, $b + db $18, $10, $5c, $b + db $18, $18, $0, $b + db $10, $0, $0, $b + db $10, $8, $5d, $b + db $10, $10, $5e, $b + db $10, $18, $0, $b + db $8, $0, $50, $b + db $8, $8, $51, $b + db $8, $10, $52, $b + db $8, $18, $50, $2b + db $0, $0, $43, $b + db $0, $8, $44, $b + db $0, $10, $44, $2b + db $0, $18, $43, $2b + +Unknown_116b54: + db $10 + db $19, $0, $0, $b + db $19, $8, $18, $b + db $19, $10, $c, $b + db $19, $18, $0, $b + db $11, $0, $42, $b + db $11, $8, $3a, $b + db $11, $10, $3a, $2b + db $11, $18, $42, $2b + db $9, $0, $58, $b + db $9, $8, $45, $b + db $9, $10, $45, $2b + db $9, $18, $58, $2b + db $1, $0, $d, $b + db $1, $8, $44, $b + db $1, $10, $44, $2b + db $1, $18, $d, $2b + +Unknown_116b95: + db $10 + db $18, $0, $0, $b + db $18, $8, $5c, $2b + db $18, $10, $8, $2b + db $18, $18, $0, $b + db $10, $0, $0, $b + db $10, $8, $5e, $2b + db $10, $10, $5d, $2b + db $10, $18, $0, $b + db $8, $0, $50, $b + db $8, $8, $52, $2b + db $8, $10, $51, $2b + db $8, $18, $50, $2b + db $0, $0, $43, $b + db $0, $8, $44, $b + db $0, $10, $44, $2b + db $0, $18, $43, $2b + +Unknown_116bd6: + db $10 + db $18, $0, $0, $a + db $18, $8, $56, $a + db $18, $10, $57, $a + db $18, $18, $0, $a + db $10, $0, $64, $a + db $10, $8, $4a, $a + db $10, $10, $4b, $a + db $10, $18, $71, $a + db $8, $0, $54, $a + db $8, $8, $55, $a + db $8, $10, $55, $2a + db $8, $18, $54, $2a + db $0, $0, $48, $a + db $0, $8, $49, $a + db $0, $10, $49, $2a + db $0, $18, $48, $2a + +Unknown_116c17: + db $10 + db $19, $0, $0, $a + db $19, $8, $76, $a + db $19, $10, $77, $a + db $19, $18, $0, $a + db $11, $0, $64, $a + db $11, $8, $69, $a + db $11, $10, $6a, $a + db $11, $18, $6b, $a + db $9, $0, $6f, $a + db $9, $8, $70, $a + db $9, $10, $70, $2a + db $9, $18, $6f, $2a + db $1, $0, $63, $a + db $1, $8, $19, $a + db $1, $10, $19, $2a + db $1, $18, $63, $2a + +Unknown_116c58: + db $10 + db $1a, $0, $6c, $a + db $1a, $8, $6d, $a + db $1a, $10, $6e, $a + db $1a, $18, $0, $a + db $12, $0, $5f, $a + db $12, $8, $60, $a + db $12, $10, $61, $a + db $12, $18, $62, $a + db $a, $0, $53, $a + db $a, $8, $55, $a + db $a, $10, $55, $2a + db $a, $18, $53, $2a + db $2, $0, $46, $a + db $2, $8, $47, $a + db $2, $10, $47, $2a + db $2, $18, $46, $2a + +Unknown_116c99: + db $10 + db $19, $0, $0, $2a + db $19, $8, $77, $2a + db $19, $10, $76, $2a + db $19, $18, $0, $2a + db $11, $0, $6b, $2a + db $11, $8, $6a, $2a + db $11, $10, $69, $2a + db $11, $18, $64, $2a + db $9, $0, $6f, $a + db $9, $8, $70, $a + db $9, $10, $70, $2a + db $9, $18, $6f, $2a + db $1, $0, $63, $a + db $1, $8, $19, $a + db $1, $10, $19, $2a + db $1, $18, $63, $2a + +Unknown_116cda: + db $10 + db $18, $0, $0, $a + db $18, $8, $57, $2a + db $18, $10, $56, $2a + db $18, $18, $0, $a + db $10, $0, $71, $2a + db $10, $8, $4b, $2a + db $10, $10, $4a, $2a + db $10, $18, $64, $2a + db $8, $0, $54, $a + db $8, $8, $55, $a + db $8, $10, $55, $2a + db $8, $18, $54, $2a + db $0, $0, $48, $a + db $0, $8, $49, $a + db $0, $10, $49, $2a + db $0, $18, $48, $2a + +Unknown_116d1b: + db $c + db $0, $0, $38, $4a + db $0, $8, $39, $4a + db $0, $10, $39, $6a + db $0, $18, $38, $6a + db $8, $0, $28, $4a + db $8, $8, $29, $4a + db $8, $10, $29, $6a + db $8, $18, $28, $6a + db $10, $0, $9, $4d + db $10, $8, $19, $4a + db $10, $10, $19, $6a + db $10, $18, $9, $6d + +Unknown_116d4c: + db $e + db $0, $8, $3b, $4a + db $0, $10, $3b, $6a + db $8, $0, $2a, $4a + db $8, $8, $2b, $4a + db $8, $10, $2b, $6a + db $8, $18, $2a, $6a + db $10, $0, $1a, $4a + db $10, $8, $1b, $4a + db $10, $10, $1b, $6a + db $10, $18, $1a, $6a + db $18, $0, $a, $4a + db $18, $8, $b, $4a + db $18, $10, $b, $6a + db $18, $18, $a, $6a + +Unknown_116d85: + db $e + db $0, $0, $35, $2a + db $0, $8, $3c, $4a + db $0, $10, $3d, $4a + db $0, $18, $3e, $4a + db $8, $0, $2c, $4a + db $8, $8, $2d, $4a + db $8, $10, $2e, $4a + db $8, $18, $2f, $4a + db $10, $0, $1c, $4a + db $10, $8, $1d, $4a + db $10, $10, $1e, $4d + db $10, $18, $1f, $4d + db $18, $10, $e, $4d + db $18, $18, $f, $4a + +Unknown_116dbe: + db $e + db $0, $0, $65, $4a + db $0, $8, $66, $4a + db $0, $10, $67, $4a + db $0, $18, $68, $4a + db $8, $8, $59, $4a + db $8, $10, $5a, $4a + db $8, $18, $5b, $4a + db $10, $0, $4c, $4a + db $10, $8, $4d, $4d + db $10, $10, $4e, $4d + db $10, $18, $4f, $4a + db $18, $0, $3f, $4d + db $18, $8, $40, $4d + db $18, $10, $41, $4d + +Unknown_116df7: + db $e + db $0, $0, $3e, $6a + db $0, $8, $3d, $6a + db $0, $10, $3c, $6a + db $0, $18, $35, $a + db $8, $0, $2f, $6a + db $8, $8, $2e, $6a + db $8, $10, $2d, $6a + db $8, $18, $2c, $6a + db $10, $0, $1f, $6d + db $10, $8, $1e, $6d + db $10, $10, $1d, $6a + db $10, $18, $1c, $6a + db $18, $0, $f, $6a + db $18, $8, $e, $6d + +Unknown_116e30: + db $e + db $0, $0, $68, $6a + db $0, $8, $67, $6a + db $0, $10, $66, $6a + db $0, $18, $65, $6a + db $8, $0, $5b, $6a + db $8, $8, $5a, $6a + db $8, $10, $59, $6a + db $10, $0, $4f, $6a + db $10, $8, $4e, $6d + db $10, $10, $4d, $6d + db $10, $18, $4c, $6a + db $18, $8, $41, $6d + db $18, $10, $40, $6d + db $18, $18, $3f, $6d + +Unknown_116e69: + db $c + db $8, $0, $9, $d + db $8, $8, $19, $a + db $8, $10, $19, $2a + db $8, $18, $9, $2d + db $10, $0, $28, $a + db $10, $8, $29, $a + db $10, $10, $29, $2a + db $10, $18, $28, $2a + db $18, $0, $38, $a + db $18, $8, $39, $a + db $18, $10, $39, $2a + db $18, $18, $38, $2a + +Unknown_116e9a: + db $e + db $0, $0, $a, $a + db $0, $8, $b, $a + db $0, $10, $b, $2a + db $0, $18, $a, $2a + db $8, $0, $1a, $a + db $8, $8, $1b, $a + db $8, $10, $1b, $2a + db $8, $18, $1a, $2a + db $10, $0, $2a, $a + db $10, $8, $2b, $a + db $10, $10, $2b, $2a + db $10, $18, $2a, $2a + db $18, $8, $3b, $a + db $18, $10, $3b, $2a + +Unknown_116ed3: + db $e + db $0, $10, $e, $d + db $0, $18, $f, $a + db $8, $0, $1c, $a + db $8, $8, $1d, $a + db $8, $10, $1e, $d + db $8, $18, $1f, $d + db $10, $0, $2c, $a + db $10, $8, $2d, $a + db $10, $10, $2e, $a + db $10, $18, $2f, $a + db $18, $0, $35, $6a + db $18, $8, $3c, $a + db $18, $10, $3d, $a + db $18, $18, $3e, $a + +Unknown_116f0c: + db $e + db $0, $0, $3f, $d + db $0, $8, $40, $d + db $0, $10, $41, $d + db $8, $0, $4c, $a + db $8, $8, $4d, $d + db $8, $10, $4e, $d + db $8, $18, $4f, $a + db $10, $8, $59, $a + db $10, $10, $5a, $a + db $10, $18, $5b, $a + db $18, $0, $65, $a + db $18, $8, $66, $a + db $18, $10, $67, $a + db $18, $18, $68, $a + +Unknown_116f45: + db $e + db $0, $0, $f, $2a + db $0, $8, $e, $2d + db $8, $0, $1f, $2d + db $8, $8, $1e, $2d + db $8, $10, $1d, $2a + db $8, $18, $1c, $2a + db $10, $0, $2f, $2a + db $10, $8, $2e, $2a + db $10, $10, $2d, $2a + db $10, $18, $2c, $2a + db $18, $0, $3e, $2a + db $18, $8, $3d, $2a + db $18, $10, $3c, $2a + db $18, $18, $35, $4a + +Unknown_116f7e: + db $e + db $0, $8, $41, $2d + db $0, $10, $40, $2d + db $0, $18, $3f, $2d + db $8, $0, $4f, $2a + db $8, $8, $4e, $2d + db $8, $10, $4d, $2d + db $8, $18, $4c, $2a + db $10, $0, $5b, $2a + db $10, $8, $5a, $2a + db $10, $10, $59, $2a + db $18, $0, $68, $2a + db $18, $8, $67, $2a + db $18, $10, $66, $2a + db $18, $18, $65, $2a + +Unknown_116fb7: + db $d + db $fa, $0, $72, $a + db $fa, $8, $73, $d + db $fa, $10, $74, $d + db $fa, $18, $75, $d + db $2, $0, $81, $a + db $2, $8, $82, $a + db $2, $10, $83, $a + db $2, $18, $84, $a + db $a, $0, $91, $a + db $a, $8, $92, $a + db $a, $10, $93, $a + db $a, $18, $94, $a + db $12, $10, $a3, $a + +Unknown_116fec: + db $e + db $fd, $0, $85, $d + db $fd, $8, $86, $d + db $5, $0, $95, $d + db $5, $8, $96, $a + db $5, $10, $97, $a + db $5, $18, $98, $a + db $d, $0, $a5, $a + db $d, $8, $a6, $a + db $d, $10, $a7, $a + db $d, $18, $a8, $a + db $15, $0, $b3, $a + db $15, $8, $b4, $a + db $15, $10, $b5, $a + db $15, $18, $b6, $a + +Unknown_117025: + db $c + db $8, $0, $79, $d + db $8, $8, $7a, $d + db $8, $10, $7b, $a + db $8, $18, $7c, $a + db $10, $0, $89, $d + db $10, $8, $8a, $a + db $10, $10, $8b, $a + db $10, $18, $8c, $a + db $18, $0, $99, $a + db $18, $8, $9a, $a + db $18, $10, $9b, $a + db $18, $18, $9c, $a + +Unknown_117056: + db $b + db $8, $0, $7d, $a + db $8, $8, $7e, $d + db $8, $10, $7f, $d + db $8, $18, $80, $a + db $10, $0, $8d, $a + db $10, $8, $8e, $a + db $10, $10, $8f, $a + db $10, $18, $90, $a + db $18, $8, $9e, $a + db $18, $10, $9f, $a + db $18, $18, $a0, $a + +Unknown_117083: + db $f + db $0, $0, $a1, $a + db $0, $8, $a2, $a + db $0, $10, $a2, $2a + db $0, $18, $a1, $2a + db $8, $0, $b1, $a + db $8, $8, $b2, $d + db $8, $10, $b2, $2d + db $8, $18, $b1, $2a + db $10, $0, $ab, $a + db $10, $8, $ac, $a + db $10, $10, $ac, $2a + db $10, $18, $ab, $2a + db $18, $8, $a4, $a + db $18, $10, $87, $a + db $18, $18, $88, $a + +Unknown_1170c0: + db $f + db $0, $0, $a1, $a + db $0, $8, $a2, $d + db $0, $10, $a2, $2a + db $0, $18, $a1, $2a + db $8, $0, $b1, $a + db $8, $8, $78, $d + db $8, $10, $78, $2d + db $8, $18, $b1, $2a + db $10, $0, $ab, $a + db $10, $8, $ac, $a + db $10, $10, $ac, $2a + db $10, $18, $ab, $2a + db $18, $8, $a4, $a + db $18, $10, $87, $a + db $18, $18, $88, $a + +Unknown_1170fd: + db $f + db $0, $0, $a9, $a + db $0, $8, $aa, $a + db $0, $10, $aa, $2a + db $0, $18, $a9, $2a + db $8, $0, $b7, $a + db $8, $8, $b8, $a + db $8, $10, $b8, $2a + db $8, $18, $b7, $2a + db $10, $0, $ab, $a + db $10, $8, $ac, $a + db $10, $10, $ac, $2a + db $10, $18, $ad, $a + db $18, $8, $a4, $a + db $18, $10, $ba, $a + db $18, $18, $bb, $a + +Unknown_11713a: + db $f + db $0, $0, $ae, $c + db $0, $8, $af, $c + db $0, $10, $af, $2c + db $0, $18, $ae, $2c + db $8, $0, $bc, $c + db $8, $8, $bd, $c + db $8, $10, $bd, $2c + db $8, $18, $bc, $2c + db $10, $0, $bf, $c + db $10, $8, $9d, $c + db $10, $10, $9d, $2c + db $10, $18, $b0, $c + db $18, $8, $b9, $c + db $18, $10, $c0, $c + db $18, $18, $be, $c + +Unknown_117177: + db $9 + db $14, $0, $1f, $6 + db $14, $8, $20, $6 + db $14, $10, $21, $6 + db $c, $0, $10, $6 + db $c, $8, $11, $6 + db $c, $10, $12, $6 + db $4, $0, $1, $6 + db $4, $8, $2, $6 + db $4, $10, $3, $6 + +Unknown_11719c: + db $9 + db $14, $0, $22, $6 + db $14, $8, $23, $6 + db $14, $10, $24, $6 + db $c, $0, $13, $6 + db $c, $8, $14, $6 + db $c, $10, $15, $6 + db $4, $0, $4, $6 + db $4, $8, $5, $6 + db $4, $10, $6, $6 + +Unknown_1171c1: + db $9 + db $14, $0, $25, $6 + db $14, $8, $26, $6 + db $14, $10, $27, $6 + db $c, $0, $16, $6 + db $c, $8, $17, $6 + db $c, $10, $18, $6 + db $4, $0, $7, $6 + db $4, $8, $8, $6 + db $4, $10, $9, $6 + +Unknown_1171e6: + db $9 + db $14, $0, $28, $6 + db $14, $8, $29, $6 + db $14, $10, $2a, $6 + db $c, $0, $19, $6 + db $c, $8, $1a, $6 + db $c, $10, $1b, $6 + db $4, $0, $a, $6 + db $4, $8, $b, $6 + db $4, $10, $c, $6 + +Unknown_11720b: + db $9 + db $14, $0, $2b, $6 + db $14, $8, $2c, $6 + db $14, $10, $2d, $6 + db $c, $0, $1c, $6 + db $c, $8, $1d, $6 + db $c, $10, $1e, $6 + db $4, $0, $d, $6 + db $4, $8, $e, $6 + db $4, $10, $f, $6 + +Unknown_117230: + db $9 + db $14, $0, $47, $6 + db $14, $8, $48, $6 + db $14, $10, $49, $6 + db $c, $0, $3b, $6 + db $c, $8, $3c, $6 + db $c, $10, $3b, $26 + db $4, $0, $2e, $6 + db $4, $8, $2f, $6 + db $4, $10, $30, $6 + +Unknown_117255: + db $9 + db $14, $0, $35, $6 + db $14, $8, $4a, $6 + db $14, $10, $35, $6 + db $c, $0, $3d, $6 + db $c, $8, $35, $6 + db $c, $10, $3d, $26 + db $4, $0, $31, $6 + db $4, $8, $32, $6 + db $4, $10, $31, $26 + +Unknown_11727a: + db $9 + db $14, $0, $4b, $6 + db $14, $8, $4c, $6 + db $14, $10, $4d, $6 + db $c, $0, $3e, $6 + db $c, $8, $3f, $6 + db $c, $10, $40, $6 + db $4, $0, $33, $6 + db $4, $8, $34, $6 + db $4, $10, $35, $6 + +Unknown_11729f: + db $9 + db $14, $0, $4e, $6 + db $14, $8, $4f, $6 + db $14, $10, $50, $6 + db $c, $0, $41, $6 + db $c, $8, $42, $6 + db $c, $10, $43, $6 + db $4, $0, $35, $6 + db $4, $8, $36, $6 + db $4, $10, $37, $6 + +Unknown_1172c4: + db $9 + db $14, $0, $51, $6 + db $14, $8, $52, $6 + db $14, $10, $35, $6 + db $c, $0, $44, $6 + db $c, $8, $45, $6 + db $c, $10, $46, $6 + db $4, $0, $38, $6 + db $4, $8, $39, $6 + db $4, $10, $3a, $6 + +Unknown_1172e9: + db $9 + db $10, $0, $0, $2 + db $10, $8, $0, $2 + db $10, $10, $0, $2 + db $8, $0, $0, $2 + db $8, $8, $0, $2 + db $c, $10, $1f, $6 + db $0, $0, $0, $2 + db $0, $8, $0, $2 + db $4, $10, $10, $6 + +Palette_11730e: + RGB 31, 31, 31 + RGB 7, 5, 4 + RGB 31, 28, 4 + RGB 31, 5, 5 + RGB 31, 31, 31 + RGB 7, 5, 4 + RGB 31, 23, 0 + RGB 31, 28, 4 + RGB 31, 31, 31 + RGB 16, 19, 31 + RGB 17, 31, 31 + RGB 31, 31, 31 + RGB 5, 5, 5 + RGB 7, 5, 4 + RGB 31, 28, 4 + RGB 19, 11, 6 + RGB 31, 31, 31 + RGB 3, 15, 31 + RGB 4, 25, 25 + RGB 0, 7, 12 + RGB 31, 31, 31 + RGB 0, 16, 0 + RGB 0, 16, 0 + RGB 0, 16, 0 + RGB 4, 11, 22 + RGB 0, 16, 0 + RGB 0, 16, 0 + RGB 0, 16, 0 + RGB 22, 11, 8 + RGB 0, 16, 0 + RGB 0, 16, 0 + RGB 0, 16, 0 + +Palette_11734e: + RGB 31, 30, 30 + RGB 2, 0, 0 + RGB 10, 9, 9 + RGB 15, 14, 14 + +Unknown_117356: + db $c9, $c9, $c9, $c9, $c9, $c9, $c9, $c9, $c9, $c9, $c9, $c9, $c9, $c9, $c9, $c9 + db $c9, $c9, $c9, $c9, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1 + db $c5, $c6, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2 + db $c2, $c2, $c6, $c5, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1 + db $c3, $c4, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2 + db $c2, $c2, $c4, $c3, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1 + db $c3, $c4, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2 + db $c2, $c2, $c4, $c3, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1 + db $c3, $c4, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2 + db $c2, $c2, $c4, $c3, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1 + db $c3, $c4, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2 + db $c2, $c2, $c4, $c3, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1 + db $c3, $c4, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2 + db $c2, $c2, $c4, $c3, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1 + db $c3, $c4, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2 + db $c2, $c2, $c4, $c3, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1 + db $c3, $c4, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $c2 + db $c2, $c2, $c4, $c3, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1 + db $c3, $c4, $c2, $c2, $c2, $c2, $c2, $c2, $c2, $d8, $c2, $c2, $d8, $c2, $c2, $c2 + db $c2, $c2, $c4, $c3, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1 + db $c7, $c8, $ca, $cb, $cc, $cd, $ce, $c2, $cf, $d0, $d1, $d2, $d3, $c2, $d4, $d5 + db $d6, $d7, $c8, $c7, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1 + db $c9, $c9, $c9, $c9, $c9, $c9, $c9, $c9, $c9, $c9, $c9, $c9, $c9, $c9, $c9, $c9 + db $c9, $c9, $c9, $c9, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1, $c1 + + db $8f, $8f, $8f, $8f, $8f, $8f, $8f, $8f, $8f, $8f, $8f, $8f, $8f, $8f, $8f, $8f + db $8f, $8f, $8f, $8f, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 + db $8f, $8f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f + db $0f, $0f, $af, $af, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 + db $8f, $8f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f + db $0f, $0f, $af, $af, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 + db $8f, $8f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f + db $0f, $0f, $af, $af, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 + db $8f, $8f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f + db $0f, $0f, $af, $af, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 + db $8f, $8f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f + db $0f, $0f, $af, $af, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 + db $8f, $8f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f + db $0f, $0f, $af, $af, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 + db $8f, $8f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f + db $0f, $0f, $af, $af, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 + db $8f, $8f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f + db $0f, $0f, $af, $af, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 + db $8f, $8f, $0f, $0f, $0f, $0f, $0f, $0f, $0f, $8f, $0f, $0f, $8f, $0f, $0f, $0f + db $0f, $0f, $af, $af, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 + db $8f, $8f, $8f, $8f, $8f, $8f, $8f, $0f, $8f, $8f, $8f, $8f, $8f, $0f, $8f, $8f + db $8f, $8f, $af, $af, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 + db $8f, $8f, $8f, $8f, $8f, $8f, $8f, $8f, $8f, $8f, $8f, $8f, $8f, $8f, $8f, $8f + db $8f, $8f, $8f, $8f, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 diff --git a/mobile/mobile_5c.asm b/mobile/mobile_5c.asm index afc35408e0f..c8534c1532e 100644 --- a/mobile/mobile_5c.asm +++ b/mobile/mobile_5c.asm @@ -255,7 +255,7 @@ CheckBTMonMovesForErrors: ret -SECTION "Function170cc6 - ElectroBallMobileGFX", ROMX +SECTION "Function170cc6 - GFX_171848", ROMX Function170cc6: ldh a, [rSVBK] @@ -301,9 +301,6 @@ INCBIN "gfx/mobile/pichu_animated.2bpp.lz" ElectroBallMobileGFX: INCBIN "gfx/mobile/electro_ball.2bpp.lz" - -SECTION "GFX_171848", ROMX - GFX_171848: INCBIN "gfx/unknown/171848.2bpp" diff --git a/pokecrystal.link b/pokecrystal.link index ec45b783b8c..e04bda8e219 100644 --- a/pokecrystal.link +++ b/pokecrystal.link @@ -38,11 +38,8 @@ ROMX $01 "ReanchorBGMap_NoOAMUpdate - HDMATransfer_FillBGMap0WithBlack" ; engine/overworld/init_map.asm "LearnMove - Text_CantForgetHM" ; engine/pokemon/learn.asm "CorrectNickErrors" ; engine/pokemon/correct_nick_errors.asm - - ; engine/math/math.asm - "_Multiply" - "_Divide" - + "_Multiply" ; engine/math/multiply.asm + "_Divide" ; engine/math/divide.asm "ItemAttributes" ; data/items/attributes.asm "CanObjectMoveInDirection - Function7171" ; engine/overworld/npc_movement.asm @@ -130,12 +127,9 @@ ROMX $04 "_InitializeStartDay - CopyDayHourMinToHL" ; engine/overworld/time.asm "CanLearnTMHMMove - TMHMMoves" ; engine/items/tmhm2.asm "_NamingScreen - MailEntry_Lowercase" ; engine/menus/naming_screen.asm - - ; engine/events/misc_scripts.asm - "Script_AbortBugContest" - "FindItemInBallScript" - "HealMachineAnim" - + "Script_AbortBugContest" ; engine/events/bug_contest/abort.asm + "FindItemInBallScript" ; engine/events/item_ball.asm + "HealMachineAnim" ; engine/events/heal_machine_anim.asm "Script_BattleWhiteout - GetWhiteoutSpawn" ; engine/events/whiteout.asm "Script_ForcedMovement" ; engine/events/forced_movement.asm "ItemFinder" ; engine/events/itemfinder.asm @@ -146,15 +140,9 @@ ROMX $04 "GiveParkBalls" "BugCatchingContestBattleScript - BugCatchingContestText_ContestIsOver" - ; engine/events/misc_scripts_2.asm - "RepelWoreOffScript" - "HiddenItemScript" - "SetMemEvent" - - ; engine/events/std_collision.asm - "CheckFacingTileForStdScript - TileCollisionStdScripts" - "Script_JumpStdFromRAM" - + "RepelWoreOffScript" ; engine/events/repel.asm + "HiddenItemScript - SetMemEvent" ; engine/events/hidden_item.asm + "CheckFacingTileForStdScript - Script_JumpStdFromRAM" ; engine/events/std_collision.asm "_BugContestJudging - ContestScore" ; engine/events/bug_contest/judging.asm "ApplyPokerusTick" ; engine/events/pokerus/apply_pokerus_tick.asm @@ -200,22 +188,20 @@ ROMX $05 "ForceMapMusic" "PokemonCenterPC - PokecenterPCText_LinkClosed" ; engine/events/pokecenter_pc.asm - "OpenMartDialog - CheckCoins" ; main.asm + "OpenMartDialog - CheckCoins" ; engine/items/mart.asm "Marts - DefaultMart" ; data/items/marts.asm "BankOfMom - MenuData_0x166bd" ; engine/events/mom.asm "DayCareMan - DayCare_InitBreeding" ; engine/events/daycare.asm ; engine/events/print_unown.asm - "_UnownPrinter - UnownDexVacantString" - "UnownDexATile" - "UnownDexBTile" + "_UnownPrinter - UnownDexBTile" "PlaceUnownPrinterFrontpic" "PhotoStudio" ; engine/events/print_photo.asm ; engine/pokemon/breeding.asm "CheckBreedmonCompatibility - DayCareMonCompatibilityText" - "Unreferenced_DayCareMonPrintEmptyString" + "Unreferenced_GetEmptyString" ROMX $06 "Tileset Data 1" ; (not splitting) gfx/tilesets.asm ROMX $07 @@ -260,17 +246,9 @@ ROMX $09 "MonMenuOptionStrings - AddMonMenuItem" "BattleMonMenu - MenuData_0x24edc" - ; engine/battle/menu.asm - "LoadBattleMenu - MenuData_0x24f91" - "Strings24f9a" - "Function24fb2" - + "LoadBattleMenu - Function24fb2" ; engine/battle/menu.asm "SelectQuantityToToss - SellItem_MenuHeader" ; engine/items/buy_sell_toss.asm - - ; engine/menus/trainer_card.asm - "TrainerCard - TrainerCard_JohtoBadgesOAM" - "CardStatusGFX - CardRightCornerGFX" - + "TrainerCard - CardRightCornerGFX" ; engine/menus/trainer_card.asm "ProfOaksPC - OakPCText4" ; engine/events/prof_oaks_pc.asm ; engine/overworld/decorations.asm @@ -308,7 +286,7 @@ ROMX $0b "PrepMysteryGiftDataToSend" "MysteryGiftGetItemHeldEffect - MysteryGiftDecos" - "TMHMPocket - BeatUpDescription" ; main.asm + "TMHMPocket - BeatUpDescription" ; engine/items/tmhm.asm "GivePokerusAndConvertBerries - ConvertBerriesToBerryJuice" ; engine/events/pokerus/pokerus.asm ; engine/battle/start_battle.asm @@ -337,14 +315,11 @@ ROMX $10 ROMX $11 "FruitTreeScript - NothingHereText" ; engine/events/fruit_trees.asm "AIChooseMove - AIScoringPointers" ; engine/battle/ai/move.asm - - ; engine/pokedex/pokedex_2.asm - "AnimateDexSearchSlowpoke - DoDexSearchSlowpokeFrame" - "DisplayDexEntry - PokedexDataPointerTable" - + "AnimateDexSearchSlowpoke - DoDexSearchSlowpokeFrame" ; engine/pokedex/slowpoke_anim.asm + "DisplayDexEntry - PokedexDataPointerTable" ; engine/pokedex/dex_entry.asm "SendMailToPC - MailboxPC" ; engine/pokemon/mail.asm ROMX $12 - "InitCrystalData - Function4a6d8" ; main.asm + "InitCrystalData - Function4a6d8" ; engine/crystal.asm "BeastsCheck - UpdateOTPointer" ; engine/pokemon/search.asm ; mobile/mobile_12_2.asm @@ -354,7 +329,7 @@ ROMX $12 "AskRememberPassword - Buena_ExitMenu" ; engine/events/buena_menu.asm ROMX $13 - "SwapTextboxPalettes - TilesetBattleTowerOutsidePalMap" ; main.asm + "SwapTextboxPalettes - TilesetBattleTowerOutsidePalMap" ; engine/tilesets/map_palettes.asm "TileCollisionTable" ; data/collision_permissions.asm "EmptyAllSRAMBanks" ; engine/menus/empty_sram.asm "SaveMenu_CopyTilemapAtOnce" ; engine/menus/savemenu_copytilemapatonce.asm @@ -400,10 +375,7 @@ ROMX $13 "BattleIntroSlidingPics" ; engine/battle/sliding_intro.asm "Mobile_PrintOpponentBattleMessage" ; mobile/print_opp_message.asm "CheckBattleScene" ; engine/battle/check_battle_scene.asm - - ; engine/movie/gbc_only.asm - "GBCOnlyScreen - GBCOnlyString" - "GBCOnlyGFX" + "GBCOnlyScreen - GBCOnlyGFX" ; engine/movie/gbc_only.asm ; engine/events/poke_seer.asm "PokeSeer - SeerAdvice5" @@ -632,7 +604,7 @@ ROMX $20 "BattleText_PlayerPickedUpPayDayMoney - BattleText_0x8188e" ; data/text/battle.asm "ColorTest - Function823c7" ; engine/menus/debug.asm ROMX $21 - "Printer_StartTransmission - String84a25" ; main.asm + "Printer_StartTransmission - String84a25" ; engine/printer/printer.asm "AnimObj00GFX - AnimObjAeroblastGFX" ; gfx/battle_anims.asm "HallOfFame - HOF_AnimatePlayerPic" ; engine/events/halloffame.asm ROMX $22 @@ -643,8 +615,7 @@ ROMX $22 "MovePlayerPicRight - MovePlayerPic" "ShowPlayerNamingChoices - Unreferenced_GetPlayerNameArray" "GetPlayerIcon" - "GetCardPic - KrisCardPic" - "CardGFX" + "GetCardPic - CardGFX" "GetPlayerBackpic - GetKrisBackpic" "KrisBackpic" @@ -671,7 +642,7 @@ ROMX $22 "Function8b36c - Unknown_8ba1f" ROMX $23 ; engine/tilesets/timeofday_pals.asm - "DummyPredef35" + "DummyPredef35 - DummyPredef36" "UpdateTimeOfDayPal - GetTimePalFade" ; engine/battle/battle_transition.asm @@ -687,18 +658,13 @@ ROMX $23 "MagnetTrain - MagnetTrainTilemap4" ; engine/events/magnet_train.asm "BattleStart_CopyTilemapAtOnce" ; engine/battle/battlestart_copytilemapatonce.asm "ClearSpriteAnims" ; engine/gfx/sprites.asm - "PlaySpriteAnimationsAndDelayFrame - BigmonIcon" ; main.asm + "PlaySpriteAnimationsAndDelayFrame - BigmonIcon" ; engine/gfx/sprites.asm ROMX $24 - ; engine/phone/phone.asm - "AddPhoneNumber - PermanentNumbers" - "FarPlaceString - UnknownText_0x9066d" - + "AddPhoneNumber - PermanentNumbers" ; engine/phone/numbers.asm + "FarPlaceString - UnknownText_0x9066d" ; engine/phone/phone.asm "InitClock - AdjustHourForAMorPM" ; engine/rtc/timeset.asm - - ; engine/pokgear/pokegear.asm - "PokeGear - PlayRadio" - "PokegearMap - Unreferenced_Function92311" - + "PokeGear - PlayRadio" ; engine/pokegear/pokegear.asm + "PokegearMap - Unreferenced_Function92311" ; engine/pokegear/map.asm "Fish - TimeFishGroups" ; engine/events/fish.asm "_SlotMachine - Slots3LZ" ; engine/games/slot_machine.asm ROMX $25 @@ -756,7 +722,7 @@ ROMX $27 "Route40BattleTowerGate_MapScripts" ; maps/Route40BattleTowerGate.asm "BattleTowerOutside_MapScripts" ; maps/BattleTowerOutside.asm ROMX $28 - "Phone_GenericCall_Male - BikeShopPhoneCallerScript" ; main.asm + "Phone_GenericCall_Male - BikeShopPhoneCallerScript" ; engine/phone/scripts/generic_caller.asm "BuenaPhoneCalleeScript - UnknownText_0xa1e2f" ; engine/phone/buenas_password.asm ROMX $29 "AnthonyAskNumber1Text - AnthonyRematchText" ; data/phone/text/anthony_overworld.asm @@ -901,23 +867,23 @@ ROMX $33 ; engine/events/bug_contest/display_stats.asm "DisplayCaughtContestMonStats - SwitchMonText" "DisplayAlreadyCaughtText" - "DummyPredef2F" + "DummyPredef2F - DummyPredef39" - "PlayBattleAnim - AnimObjGFX" ; main.asm + "PlayBattleAnim - AnimObjGFX" ; engine/battle_anims/core.asm "Music_PostCredits" ; audio/music/PostCredits.asm ROMX $34 "Unused_AnimateMon_Slow_Normal - HOF_AnimateFrontpic" ; engine/gfx/pic_animation.asm - "AnimationPointers - EggAnimationIdle" ; main.asm - "UnownAnimationPointers - UnownZAnimationIdle" ; main.asm - "BitmasksPointers - EggBitmasks" ; main.asm - "UnownBitmasksPointers - UnownZBitmasks" ; main.asm + "AnimationPointers - EggAnimationIdle" ; gfx/pokemon/anims.asm + "UnownAnimationPointers - UnownZAnimationIdle" ; gfx/pokemon/unown_anims.asm + "BitmasksPointers - EggBitmasks" ; gfx/bitmasks.asm + "UnownBitmasksPointers - UnownZBitmasks" ; gfx/pokemon/unown_bitmasks.asm ROMX $35 "FramesPointers" ; gfx/pokemon/frame_pointers.asm "BulbasaurFrames - MewFrames" ; gfx/pokemon/kanto_frames.asm ROMX $36 "FontInversed" ; main.asm "ChikoritaFrames - EggFrames" ; gfx/pokemon/johto_frames.asm - "UnownFramesPointers - UnownZFrames" ; main.asm + "UnownFramesPointers - UnownZFrames" ; gfx/pokemon/unown_frames.asm ROMX $37 "Tileset Data 6" ; (not splitting) gfx/tilesets.asm ROMX $38 @@ -938,12 +904,10 @@ ROMX $39 "_OptionsMenu - Options_UpdateCursorPosition" ; engine/menus/options_menu.asm ; engine/movie/crystal_intro.asm - "Copyright_GFPresents - GameFreakLogoPalettes" - "GameFreakLogo" - "CrystalIntro - IntroGrass3GFX" - "IntroGrass4GFX" + "Copyright_GFPresents - GameFreakLogo" + "CrystalIntro - IntroGrass4GFX" ROMX $3a - "_MapSetup_Sound_Off - SFX" ; audio.asm + "_MapSetup_Sound_Off - SFX" ; audio/engine.asm "Music_Route36" ; audio/music/Route36.asm "Music_RivalBattle" ; audio/music/RivalBattle.asm "Music_RocketBattle" ; audio/music/RocketBattle.asm @@ -1116,10 +1080,7 @@ ROMX $41 "CheckMovingOffEdgeOfMap" "GetCoordOfUpperLeftCorner" - ; engine/link/mystery_gift.asm - "DoMysteryGift - Function1057d7" - "MysteryGiftJP_GFX" - + "DoMysteryGift - MysteryGiftJP_GFX" ; engine/link/mystery_gift.asm "DisplayUsedMoveText - UpdateUsedMoves" ; engine/battle/used_move_text.asm ; mobile/mobile_41.asm @@ -1140,7 +1101,7 @@ ROMX $42 "Credits - CreditsStrings" ; engine/movie/credits.asm ROMX $43 "UnusedTitleScreen - UnusedTitleFG_OAM" ; engine/movie/unused_title.asm - "Function10ed51 - TitleScreenPalettes" ; main.asm + "Function10ed51 - TitleScreenPalettes" ; engine/movie/title.asm ROMX $44 "Mobile Adapter SDK" ; (not splitting) lib/mobile/main.asm ROMX $45 @@ -1152,9 +1113,9 @@ ROMX $45 "Function115dd3 - Unknown_116005" "GFX_11601a" "Function11615a" + "Function11619d - Unknown_117356" ; mobile/mobile_45.asm (cont.) - "Function11619d - Unknown_117356" "GiveOddEgg" "Function11765d - Unknown_117a47" "MobileStudium - MobileStudium_JumptableIncrement" @@ -1210,8 +1171,7 @@ ROMX $5b "Unreferenced_Function16c000 - Unknown_16cfb9" ; mobile/mobile_5b.asm ; engine/link/link_trade.asm - "LinkCommsBorderGFX" - "__LoadTradeScreenBorder - LinkTextbox" + "LinkCommsBorderGFX - LinkTextbox" "Function16d6ce - Function16d6e1" "LinkTradeMenu" @@ -1221,8 +1181,7 @@ ROMX $5c "Function170000" "Function17005a" "BattleTowerRoomMenu - CheckBTMonMovesForErrors" - "Function170cc6 - ElectroBallMobileGFX" - "GFX_171848" + "Function170cc6 - GFX_171848" "Function1719c8 - String_171c73" "Function171c87 - String_172e5d" "Function172e78 - Attrmap_173517" @@ -1576,9 +1535,7 @@ ROMX $77 "PrintPage1" "PrintPage2" "GBPrinterString_Null - GBPrinterString_PrinterError4" - "PrintPartyMonPage1 - String1dc584" - "GBPrinterHPIcon" - "GBPrinterLvIcon" + "PrintPartyMonPage1 - GBPrinterLvIcon" "Tileset Data 7" ; (not splitting) gfx/tilesets.asm