diff options
Diffstat (limited to 'main.asm')
-rw-r--r-- | main.asm | 414 |
1 files changed, 224 insertions, 190 deletions
@@ -132,7 +132,7 @@ NewGame: ; 5b6b ld [wc2cc], a call ResetWRAM call Function5b44 - call Function5b8f + call AreYouABoyOrAreYouAGirl call OakSpeech call InitializeWorld ld a, 1 @@ -146,8 +146,8 @@ NewGame: ; 5b6b jp FinishContinueFunction ; 5b8f -Function5b8f: ; 5b8f - callba Function10632f +AreYouABoyOrAreYouAGirl: ; 5b8f + callba Function10632f ; some mobile stuff jr c, .ok callba InitGender ret @@ -415,7 +415,7 @@ Continue: ; 5d65 callba TryLoadSaveFile jr c, .FailToLoad callba Function150b9 - call Function1d6e + call LoadMenuDataHeader_0x1d75 call Function5e85 ld a, $1 ld [hBGMapMode], a @@ -1587,7 +1587,7 @@ Function64db: ; 64db ; 6508 LearnMove: ; 6508 - call Function309d + call LoadTileMapToTempTileMap ld a, [CurPartyMon] ld hl, PartyMonNicknames call GetNick @@ -1749,7 +1749,7 @@ ForgetMove: ; 65d3 ld [wcfa7], a call Function1bc9 push af - call Function30b4 + call Call_LoadTempTileMapToTileMap pop af pop hl bit 1, a @@ -3192,7 +3192,7 @@ Function8000: ; 8000 ld a, $7 call ByteFill call Function3200 - call Function32f9 + call SetPalettes ret ; 8029 @@ -5197,7 +5197,7 @@ FlyFunction: ; ca3b .outdoors xor a ld [$ffde], a - call Function1d6e + call LoadMenuDataHeader_0x1d75 call ClearSprites callba _FlyMap ld a, e @@ -7931,6 +7931,7 @@ Functiond839: ; d839 TryAddMonToParty: ; d88c +; Check if to copy wild Pkmn or generate new Pkmn ; Whose is it? ld de, PartyCount ld a, [MonType] @@ -8198,12 +8199,15 @@ endr ld [de], a inc de ld hl, EnemyMonStatus + ; Copy EnemyMonStatus ld a, [hli] ld [de], a inc de + ; Copy EnemyMonUnused ld a, [hli] ld [de], a inc de + ; Copy EnemyMonHP ld a, [hli] ld [de], a inc de @@ -8216,17 +8220,18 @@ endr dec a jr nz, .generatestats ld hl, EnemyMonMaxHP - ld bc, 12 + ld bc, 2*6 ; MaxHP + 5 Stats call CopyBytes pop hl jr .next3 .generatestats pop hl - ld bc, $000a + ld bc, 2*5 ; 5 Stats add hl, bc - ld b, $0 - call Functione167 + ld b, $0 ; if b = 1, then the Stats of the Pkmn are calculated + ; only the current HP aren't set to MaxHP after this + call CalcPkmnStats .next3 ld a, [MonType] @@ -8248,6 +8253,7 @@ endr ret ; da6d + FillPP: ; da6d push bc ld b, NUM_MOVES @@ -8285,6 +8291,7 @@ Functionda96: ; da96 cp PARTY_LENGTH scf ret z + inc a ld [hl], a ld c, a @@ -8358,30 +8365,37 @@ Functionda96: ; da96 and a ret -; db3f -Functiondb3f: ; db3f + +SentGetPkmnIntoFromBox: ; db3f +; Sents/Gets Pkmn into/from Box depending on Parameter +; wd10b == 0: get Pkmn into Party +; wd10b == 1: sent Pkmn into Box + ld a, BANK(sBoxCount) call GetSRAMBank ld a, [wd10b] and a - jr z, .asm_db60 + jr z, .check_IfPartyIsFull cp $2 - jr z, .asm_db60 + jr z, .check_IfPartyIsFull cp $3 ld hl, wBreedMon1Species jr z, .asm_db9b + + ; we want to sent a Pkmn into the Box + ; so check if there's enough space ld hl, sBoxCount ld a, [hl] cp MONS_PER_BOX jr nz, .asm_db69 - jp Functiondcb1 + jp CloseSRAM_And_SetCFlag -.asm_db60 +.check_IfPartyIsFull ld hl, PartyCount ld a, [hl] cp PARTY_LENGTH - jp z, Functiondcb1 + jp z, CloseSRAM_And_SetCFlag .asm_db69 inc a @@ -8409,7 +8423,7 @@ Functiondb3f: ; db3f ld a, [sBoxCount] .asm_db97 - dec a + dec a ; PartyCount - 1 call AddNTimes .asm_db9b @@ -8512,7 +8526,7 @@ Functiondb3f: ; db3f srl a add $2 ld [MonType], a - predef Function5084a + predef CopyPkmnToTempMon callab Function50e1b ld a, d ld [CurPartyLevel], a @@ -8530,7 +8544,7 @@ Functiondb3f: ; db3f add hl, bc push bc ld b, $1 - call Functione167 + call CalcPkmnStats pop bc ld a, [wd10b] and a @@ -8575,7 +8589,7 @@ endr ret ; dcb1 -Functiondcb1: ; dcb1 +CloseSRAM_And_SetCFlag: ; dcb1 call CloseSRAM scf ret @@ -8583,7 +8597,6 @@ Functiondcb1: ; dcb1 Functiondcb6: ; dcb6 - ld a, b ld hl, sBoxMons ld bc, sBoxMon1End - sBoxMon1 @@ -8747,7 +8760,7 @@ Functiondd64: ; dd64 add hl, bc push bc ld b, $1 - call Functione167 + call CalcPkmnStats ld hl, PartyMon1Moves ld a, [PartyCount] dec a @@ -8891,8 +8904,9 @@ SentPkmnIntoBox: ; de6e ld [de], a inc de + ; Set all 5 Experience Values to 0 xor a - ld b, $a + ld b, 2*5 .asm_dee5 ld [de], a inc de @@ -8935,10 +8949,12 @@ SentPkmnIntoBox: ; de6e ld de, TempMonMoves ld bc, NUM_MOVES call CopyBytes + ld hl, sBoxMon1PP ld de, TempMonPP ld bc, NUM_MOVES call CopyBytes + ld b, 0 call Functiondcb6 @@ -8947,6 +8963,7 @@ SentPkmnIntoBox: ; de6e ret ; df42 + Functiondf42: ; df42 call CloseSRAM and a @@ -9061,7 +9078,7 @@ GiveEgg:: ; df8c dec a ld hl, PartyMonNicknames call SkipNames - ld de, Stringe035 + ld de, String_Egg call CopyName2 ld a, [PartyCount] dec a @@ -9088,12 +9105,11 @@ GiveEgg:: ; df8c ret ; e035 -Stringe035: ; e035 +String_Egg: ; e035 db "EGG@" ; e039 Functione039: ; e039 - ld hl, PartyCount ld a, [wd10b] @@ -9261,7 +9277,7 @@ Functione134: ; e134 ld a, PartyMon1Exp + 2 - PartyMon1 call GetPartyParamLocation ld b, $1 - call Functione167 + call CalcPkmnStats pop de ld a, PartyMon1HP - PartyMon1 call GetPartyParamLocation @@ -9273,7 +9289,12 @@ Functione134: ; e134 ret ; e167 -Functione167: ; e167 +CalcPkmnStats: ; e167 +; Calculates all 6 Stats of a Pkmn +; b = 0 or 1 +; 'c' counts from 1-6 and points with 'BaseStats' to the base value +; results in $ffb5 and $ffb6 are saved in [de] + ld c, $0 .asm_e169 inc c @@ -9291,14 +9312,16 @@ Functione167: ; e167 ; e17b Functione17b: ; e17b +; 'c' is 1-6 and points to the BaseStat + push hl push de push bc ld a, b ld d, a push hl - ld hl, BaseHP - dec hl + ld hl, BaseStats + dec hl ; has to be decreased, because 'c' begins with 1 ld b, $0 add hl, bc ld a, [hl] @@ -9669,6 +9692,7 @@ Functione3d4: ; e3d4 ret ; e3d9 + TextJump_WasSentToBillsPC: ; 0xe3d9 ; was sent to BILL's PC. text_jump Text_WasSentToBillsPC @@ -9677,7 +9701,7 @@ TextJump_WasSentToBillsPC: ; 0xe3d9 Functione3de: ; e3de push de - call Function1d6e + call LoadMenuDataHeader_0x1d75 call DisableSpriteUpdates pop de push de @@ -9718,7 +9742,7 @@ UnknownText_0xe417: ; 0xe417 Functione41c: ; e41c (3:641c) xor a ld [hBGMapMode], a ; $ff00+$d4 - call Function1d6e + call LoadMenuDataHeader_0x1d75 call ClearPCItemScreen ld hl, Options ld a, [hl] @@ -9748,7 +9772,7 @@ Functione443: ; e443 (3:6443) ld a, $1 .asm_e44b ld [wMenuCursorBuffer], a - call Function32f9 + call SetPalettes xor a ld [wcf76], a ld [hBGMapMode], a ; $ff00+$d4 @@ -9814,7 +9838,7 @@ Functione4cb: ; e4cb ; e4cd Functione4cd: ; e4cd - call Function1d6e + call LoadMenuDataHeader_0x1d75 callba Function44781 jr nc, .asm_e4e0 ld hl, UnknownText_0xe4f9 @@ -9841,7 +9865,7 @@ UnknownText_0xe4f9: ; 0xe4f9 ; 0xe4fe Functione4fe: ; e4fe (3:64fe) - call Function1d6e + call LoadMenuDataHeader_0x1d75 callba Functione2391 call Function222a call ClearPCItemScreen @@ -9917,7 +9941,7 @@ CheckCurPartyMonFainted: ; e538 Functione559: ; e559 (3:6559) - call Function1d6e + call LoadMenuDataHeader_0x1d75 callba Functione2583 call Function222a call ClearPCItemScreen @@ -9968,7 +9992,7 @@ ClearPCItemScreen: ; e58b ld bc, $0412 call TextBox call Function3200 - call Function32f9 ; load regular palettes? + call SetPalettes ; load regular palettes? ret ; 0xe5bb @@ -10476,7 +10500,7 @@ Function116f8: ; 116f8 call Function1171d call WaitBGMap call WaitTop - call Function32f9 + call SetPalettes call Function11be0 ret ; 1171d @@ -12252,7 +12276,7 @@ Function124fa: ; 124fa Function1250a: ; 1250a ld b, $0 call GetSGBLayout - call Function32f9 + call SetPalettes ret ; 12513 @@ -12563,7 +12587,7 @@ endr .Clear ; 126b7 call WhiteBGMap - call Function1d7d + call Call_ExitMenu call Function2bae call .DrawMenuAccount_ call MenuFunc_1e7f @@ -12963,7 +12987,7 @@ StartMenu_Pokemon: ; 12976 callba WritePartyMenuTilemap callba PrintPartyMenuText call WaitBGMap - call Function32f9 ; load regular palettes? + call SetPalettes ; load regular palettes? call DelayFrame callba PartyMenuSelect jr c, .return ; if cancelled or pressed B @@ -13185,7 +13209,7 @@ SwitchPartyMons: ; 12aec call AddNTimes ld [hl], "▷" call WaitBGMap - call Function32f9 + call SetPalettes call DelayFrame callba PartyMenuSelect @@ -13234,7 +13258,7 @@ GiveTakePartyMonItem: ; 12b60 cp 1 jr nz, .asm_12ba0 - call Function1d6e + call LoadMenuDataHeader_0x1d75 call ClearPalettes call Function12ba9 call ClearPalettes @@ -13647,7 +13671,7 @@ MonMailAction: ; 12d45 OpenPartyStats: ; 12e00 - call Function1d6e + call LoadMenuDataHeader_0x1d75 call ClearSprites ; PartyMon xor a @@ -13655,7 +13679,7 @@ OpenPartyStats: ; 12e00 call LowVolume predef StatsScreenInit call MaxVolume - call Function1d7d + call Call_ExitMenu ld a, 0 ret ; 12e1b @@ -13826,19 +13850,19 @@ Function12f05: ; 12f05 ld a, PartyMon1MaxHP - PartyMon1 call GetPartyParamLocation ld a, [hli] - ld [hProduct], a + ld [hDividend + 0], a ld a, [hl] - ld [hMultiplicand], a + ld [hDividend + 1], a ld a, $5 - ld [hMultiplier], a + ld [hDivisor], a ld b, $2 call Divide ld a, PartyMon1HP + 1 - PartyMon1 call GetPartyParamLocation - ld a, [$ffb6] + ld a, [hQuotient + 2] sub [hl] dec hl - ld a, [$ffb5] + ld a, [hQuotient + 1] sbc [hl] ret ; 12f26 @@ -14209,7 +14233,7 @@ Function13172: ; 13172 hlcoord 5, 1 call PlaceString push bc - callba Function5084a + callba CopyPkmnToTempMon pop hl call PrintLevel ld hl, PlayerHPPal @@ -14226,7 +14250,7 @@ Function131ef: ; 131ef ld [hBGMapMode], a ld [wd0e3], a ld [MonType], a - predef Function5084a + predef CopyPkmnToTempMon ld hl, TempMonMoves ld de, wListMoves_MoveIndicesBuffer ld bc, NUM_MOVES @@ -14238,7 +14262,7 @@ Function131ef: ; 131ef hlcoord 10, 4 predef Function50c50 call WaitBGMap - call Function32f9 + call SetPalettes ld a, [wd0eb] inc a ld [wcfa3], a @@ -14707,7 +14731,7 @@ Function134c0: ; 134c0 ; 134dd Function134dd: ; 134dd - call Function1d6e + call LoadMenuDataHeader_0x1d75 ld hl, Elevator_WhichFloorText call PrintText call Elevator_GetCurrentFloorText @@ -15760,7 +15784,7 @@ Function13a47: ; unreferenced ld hl, PartyMon1Exp + 2 - PartyMon1 add hl, bc ld b, $1 - predef Functione167 + predef CalcPkmnStats pop hl ld bc, PartyMon2 - PartyMon1 add hl, bc @@ -18092,7 +18116,7 @@ UnknownText_0x157cc: ; 0x157cc ; 0x157d1 KrisWithdrawItemMenu: ; 0x157d1 - call Function1d6e + call LoadMenuDataHeader_0x1d75 callba ClearPCItemScreen .asm_157da call Function15985 @@ -18171,7 +18195,7 @@ Function157e9: ; 0x157e9 KrisTossItemMenu: ; 0x1585f - call Function1d6e + call LoadMenuDataHeader_0x1d75 callba ClearPCItemScreen .asm_15868 call Function15985 @@ -18208,7 +18232,7 @@ KrisDepositItemMenu: ; 0x1588b call Function158b8 jr c, .asm_158b6 call DisableSpriteUpdates - call Function1d6e + call LoadMenuDataHeader_0x1d75 callba Function106a5 .asm_1589c callba Function106be @@ -18513,7 +18537,7 @@ MartDialog: ; 15a61 HerbShop: ; 15a6e call ReadMart - call Function1d6e + call LoadMenuDataHeader_0x1d75 ld hl, UnknownText_0x15e4a call Function15fcd call Function15c62 @@ -18527,7 +18551,7 @@ BargainShop: ; 15a84 ld de, BargainShopData call LoadMartPointer call Function15c25 - call Function1d6e + call LoadMenuDataHeader_0x1d75 ld hl, UnknownText_0x15e6d call Function15fcd call Function15c62 @@ -18546,7 +18570,7 @@ BargainShop: ; 15a84 Pharmacist: ; 15aae call ReadMart - call Function1d6e + call LoadMenuDataHeader_0x1d75 ld hl, UnknownText_0x15e90 call Function15fcd call Function15c62 @@ -18567,7 +18591,7 @@ RooftopSale: ; 15ac4 .ok call LoadMartPointer call Function15c25 - call Function1d6e + call LoadMenuDataHeader_0x1d75 ld hl, UnknownText_0x15f83 call Function15fcd call Function15c62 @@ -18652,7 +18676,7 @@ Function15b47: ; 15b47 ; 15b62 Function15b62: ; 15b62 - call Function1d6e + call LoadMenuDataHeader_0x1d75 ld hl, UnknownText_0x15f83 call PrintText ld a, $1 @@ -18705,7 +18729,7 @@ Function15ba3: ; 15ba3 ; 15baf Function15baf: ; 15baf - call Function1d6e + call LoadMenuDataHeader_0x1d75 ld hl, UnknownText_0x15fb9 call PrintText ld a, $1 @@ -20223,7 +20247,7 @@ Function169ac: ; 169ac pop hl push bc ld b, $0 - predef Functione167 + predef CalcPkmnStats pop bc ld hl, PartyMon1HP - PartyMon1 add hl, bc @@ -20513,7 +20537,7 @@ Function16be4: ; 16be4 ld b, $1c call GetSGBLayout - call Function32f9 + call SetPalettes .asm_16c6b call JoyTextDelay @@ -20940,7 +20964,7 @@ DoEggStep:: ; 16f3e OverworldHatchEgg:: ; 16f5e call ResetWindow - call Function1d6e + call LoadMenuDataHeader_0x1d75 call Function16f70 call Function2b4d call RestartMapMusic @@ -21027,7 +21051,7 @@ Function16f7a: ; 16f7a (5:6f7a) ld bc, PartyMon1Exp + 2 - PartyMon1 add hl, bc ld b, $0 - predef Functione167 + predef CalcPkmnStats pop bc ld hl, PartyMon1MaxHP - PartyMon1 add hl, bc @@ -21421,7 +21445,7 @@ Function17254: ; 17254 (5:7254) predef FillBox pop af call Function17363 - call Function32f9 + call SetPalettes jp WaitBGMap Function1727f: ; 1727f (5:727f) @@ -21782,7 +21806,7 @@ Function20021: ; 20021 (8:4021) ld a, [hl] push af set 4, [hl] - call Function1d6e + call LoadMenuDataHeader_0x1d75 call ClearTileMap ld hl, UnknownText_0x2004c call PrintText @@ -24845,7 +24869,7 @@ Function2513b: ; 2513b (9:513b) call WaitBGMap ld b, $15 call GetSGBLayout - call Function32f9 + call SetPalettes call WaitBGMap ld hl, wJumptableIndex xor a @@ -26028,7 +26052,7 @@ Function2695b: ; 2695b ld d, 0 add hl, de ld [hl], -1 - call Function1d6e + call LoadMenuDataHeader_0x1d75 ld hl, MenuDataHeader_0x269c5 call CopyMenuDataHeader xor a @@ -27125,9 +27149,9 @@ Function2715c: ; 2715c callba Function3ed9f call ClearSGB call WriteBackup - call Function1d6e + call LoadMenuDataHeader_0x1d75 call WaitBGMap - jp Function32f9 + jp SetPalettes ; 27192 Function27192: ; 27192 @@ -28587,7 +28611,7 @@ Function2891c: ; 2891c ; 28926 Function28926: ; 28926 - call Function309d + call LoadTileMapToTempTileMap ld a, [wcfa9] push af hlcoord 0, 15 @@ -28628,7 +28652,7 @@ Function28926: ; 28926 .asm_28983 pop af ld [wcfa9], a - call Function30b4 + call Call_LoadTempTileMapToTileMap jp Function2888b .asm_2898d @@ -28666,7 +28690,7 @@ Function28926: ; 28926 ld [wd263], a callab Function50db9 callba Function4d319 - call Function30b4 + call Call_LoadTempTileMapToTileMap hlcoord 6, 1 ld bc, $0601 ld a, $7f @@ -28906,7 +28930,7 @@ Function28b87: ; 28b87 ld hl, UnknownText_0x28eb8 bccoord 1, 14 call PlaceWholeStringInBoxAtOnce - call Function1d6e + call LoadMenuDataHeader_0x1d75 hlcoord 10, 7 ld b, $3 ld c, $7 @@ -28935,7 +28959,7 @@ Function28b87: ; 28b87 callba Function4d354 call Function1bd3 push af - call Function1d7d + call Call_ExitMenu call Function3200 pop af bit 1, a @@ -29248,7 +29272,7 @@ Function28ef8: ; 28ef8 Function28eff: ; 28eff callba Function16d6a7 - call Function32f9 + call SetPalettes ret ; 28f09 @@ -32507,13 +32531,13 @@ Function2b9a6: ; 2b9a6 jr z, .asm_2b9d7 dec hl xor a - ld [hProduct], a + ld [hDividend + 0], a ld a, [hli] - ld [hMultiplicand], a + ld [hDividend + 1], a ld a, [hli] - ld [$ffb5], a + ld [hDividend + 2], a xor a - ld [$ffb6], a + ld [hDividend + 3], a ld a, [hli] ld b, a ld a, [hld] @@ -32521,13 +32545,13 @@ Function2b9a6: ; 2b9a6 rr a srl b rr a - ld [hMultiplier], a + ld [hDivisor], a ld b, $4 call Divide - ld a, [$ffb6] + ld a, [hQuotient + 2] add e ld e, a - ld a, [$ffb5] + ld a, [hQuotient + 1] adc d ld d, a dec hl @@ -32864,7 +32888,7 @@ _ShowLinkBattleParticipants: ; 2c1b2 callba Function2c10d ; no need to callba ld b, $8 call GetSGBLayout - call Function32f9 + call SetPalettes ld a, $e4 ld [rOBP0], a ret @@ -33465,7 +33489,7 @@ Function2c80a: ; 2c80a callba WritePartyMenuTilemap callba PrintPartyMenuText call WaitBGMap - call Function32f9 + call SetPalettes call DelayFrame callba PartyMenuSelect push af @@ -35033,7 +35057,7 @@ endr push hl xor a ld [MonType], a - predef Function5084a + predef CopyPkmnToTempMon pop hl .asm_42230 @@ -35243,7 +35267,7 @@ endr ld hl, TempMonExp + 2 ld de, TempMonMaxHP ld b, $1 - predef Functione167 + predef CalcPkmnStats ld a, [CurPartyMon] ld hl, PartyMons @@ -35677,7 +35701,7 @@ AIChooseMove: ; 440ce ret nz ; No use picking a move if there's no choice. - callba Function3e8d1 + callba CheckSubstatus_RechargeChargedRampageBideRollout ret nz @@ -36487,7 +36511,7 @@ Function44781: ; 44781 _KrisMailBoxMenu: ; 0x447a0 call InitMail jr z, .nomail - call Function1d6e + call LoadMenuDataHeader_0x1d75 call Function44806 jp WriteBackup @@ -36681,7 +36705,7 @@ Function4484a: ; 0x4484a callba WritePartyMenuTilemap callba PrintPartyMenuText call WaitBGMap - call Function32f9 + call SetPalettes call DelayFrame callba PartyMenuSelect jr c, .asm_44939 @@ -36901,7 +36925,7 @@ Function4802f: ; 4802f (12:402f) call PlaceString call Function48187 call Function3200 - call Function32f9 + call SetPalettes call Function1bc9 ld hl, wcfa9 ld b, [hl] @@ -38587,11 +38611,11 @@ Function48d4a: ; 48d4a (12:4d4a) Function48d94: ; 48d94 (12:4d94) xor a ld [hDividend + 0], a - ld [hQuotient], a ; $ff00+$b4 (aliases: hMultiplicand) + ld [hDividend + 1], a ; $ff00+$b4 (aliases: hMultiplicand) ld a, [hli] ld [hDividend + 0], a ld a, [hl] - ld [hQuotient], a ; $ff00+$b4 (aliases: hMultiplicand) + ld [hDividend + 1], a ; $ff00+$b4 (aliases: hMultiplicand) ld a, 100 ld [hDivisor], a ; $ff00+$b7 (aliases: hMultiplier) ld b, 2 @@ -38621,8 +38645,8 @@ InitGender: ; 48dcb (12:4dcb) call Function48e47 call Function48e64 call Function3200 - call Function32f9 - ld hl, UnknownText_0x48e0f + call SetPalettes + ld hl, TextJump_AreYouABoyOrAreYouAGirl call PrintText ld hl, .MenuDataHeader call LoadMenuDataHeader @@ -38652,9 +38676,9 @@ InitGender: ; 48dcb (12:4dcb) db "Girl@" ; 0x48e0f -UnknownText_0x48e0f: ; 0x48e0f +TextJump_AreYouABoyOrAreYouAGirl: ; 0x48e0f ; Are you a boy? Or are you a girl? - text_jump UnknownText_0x1c0ca3 + text_jump Text_AreYouABoyOrAreYouAGirl db "@" ; 0x48e14 @@ -39835,7 +39859,7 @@ MainMenu: ; 49cdc call Function49ed0 ld b, $8 call GetSGBLayout - call Function32f9 + call SetPalettes ld hl, GameTimerPause res 0, [hl] call Function49da4 @@ -40216,7 +40240,7 @@ Function49f16: ; 49f16 hlcoord 1, 14 call PlaceString call Function3200 - call Function32f9 + call SetPalettes call Function1bc9 ld hl, wcfa9 ld b, [hl] @@ -40361,9 +40385,9 @@ Function4a098: ; 4a098 (12:6098) call Function1ff8 call Function1bee call WaitBGMap - call Function1d6e + call LoadMenuDataHeader_0x1d75 callba Function89de0 - call Function1d7d + call Call_ExitMenu call Function49351 call Function4a485 pop bc @@ -40472,7 +40496,7 @@ Function4a149: ; 4a149 (12:6149) hlcoord 1, 14 call PlaceString callba Function104148 - call Function32f9 + call SetPalettes call Function1bc9 ld hl, wcfa9 ld b, [hl] @@ -40580,7 +40604,7 @@ Function4a28a: ; 4a28a (12:628a) call Function4a6d8 call Function1bee call WaitBGMap - call Function1d6e + call LoadMenuDataHeader_0x1d75 ld a, $5 call GetSRAMBank ld a, [$aa4b] @@ -40610,7 +40634,7 @@ Function4a28a: ; 4a28a (12:628a) .asm_4a2df callba Function11765d call WhiteBGMap - call Function1d7d + call Call_ExitMenu call Functione5f scf ret @@ -40644,7 +40668,7 @@ Function4a28a: ; 4a28a (12:628a) .asm_4a338 call ExitMenu .asm_4a33b - call Function1d7d + call Call_ExitMenu callba Function104148 xor a ret @@ -40721,7 +40745,7 @@ Function4a39a: ; 4a39a call Function4a485 call Function4a492 call Function4a3aa - call Function32f9 + call SetPalettes ret ; 4a3a7 @@ -40901,7 +40925,7 @@ Function4a4c4: ; 4a4c4 (12:64c4) hlcoord 1, 16 call PlaceString call Function3200 - call Function32f9 + call SetPalettes call Function1bc9 ld hl, wcfa9 ld b, [hl] @@ -41545,7 +41569,7 @@ Function4a94e: ; 4a94e ld [wd019], a ld b, $14 call GetSGBLayout - call Function32f9 + call SetPalettes call Function4aa22 jr c, .asm_4a985 jr z, .asm_4a9a1 @@ -41676,7 +41700,7 @@ Function4aa34: ; 4aa34 callba PrintPartyMenuText call Function4aab6 call WaitBGMap - call Function32f9 + call SetPalettes call DelayFrame call Function4ab1a jr z, .asm_4aa66 @@ -44172,7 +44196,7 @@ Function4ddf2: ; 4ddf2 (13:5df2) call CopyBytes jr .asm_4de2a .asm_4de10 - callba Function5084a + callba CopyPkmnToTempMon ld a, [CurPartySpecies] cp EGG jr z, .asm_4de2a @@ -44426,7 +44450,7 @@ Function4dfb6: ; 4dfb6 (13:5fb6) ld hl, wcf64 bit 4, [hl] jr nz, .asm_4dfd6 - call Function32f9 + call SetPalettes ret .asm_4dfd6 call Function4e226 @@ -44739,14 +44763,14 @@ Function4e226: ; 4e226 (13:6226) jr .asm_4e246 .asm_4e238 call Function4e271 - call Function32f9 + call SetPalettes ret .asm_4e23f call Function4e253 - call Function32f9 + call SetPalettes ret .asm_4e246 - call Function32f9 + call SetPalettes call Function4e253 ld a, [CurPartySpecies] call PlayCry2 @@ -44930,7 +44954,7 @@ EggStatsScreen: ; 4e33a call PlaceString ld hl, wcf64 set 5, [hl] - call Function32f9 ; pals + call SetPalettes ; pals call DelayFrame hlcoord 0, 0 call Function3786 @@ -45573,7 +45597,7 @@ Function4e881: ; 4e881 ld hl, UnknownText_0x4e8bd call PrintText call Function3200 - call Function32f9 + call SetPalettes ret ; 4e8bd @@ -45613,7 +45637,7 @@ Function4e8c2: ; 4e8c2 ld [hSCX], a call EnableLCD call Function3200 - call Function32f9 + call SetPalettes ret ; 4e906 @@ -45931,7 +45955,7 @@ SelectMonFromParty: ; 50000 call WhiteBGMap call Function5003f call WaitBGMap - call Function32f9 + call SetPalettes call DelayFrame call PartyMenuSelect call Function2b74 @@ -45948,7 +45972,7 @@ Function5001d: ; 5001d call WaitBGMap ld b, $a call GetSGBLayout - call Function32f9 + call SetPalettes call DelayFrame call PartyMenuSelect call Function2b74 @@ -47004,7 +47028,7 @@ Function5067b: ; 5067b ld a, [PartyCount] cp [hl] jr nz, .asm_50682 - predef Function3d873 + predef CheckPlayerPartyForFitPkmn ld a, d ld [ScriptVar], a ret @@ -47302,10 +47326,13 @@ UnknownText_0x50845: ; 0x50845 db "@" ; 0x5084a -Function5084a: ; 5084a +CopyPkmnToTempMon: ; 5084a +; gets the BaseData of a Pkmn +; and copys the PkmnStructure to TempMon + ld a, [CurPartyMon] ld e, a - call Function508d5 + call GetPkmnSpecies ld a, [CurPartySpecies] ld [CurSpecies], a call GetBaseData @@ -47326,7 +47353,7 @@ Function5084a: ; 5084a .copywholestruct ld a, [CurPartyMon] call AddNTimes - ld de, TempMonSpecies + ld de, TempMon ld bc, PartyMon2 - PartyMon1 call CopyBytes @@ -47358,7 +47385,7 @@ Function50893: ; 50893 add hl, bc push bc ld b, $1 - predef Functione167 + predef CalcPkmnStats pop bc ld hl, TempMonHP - TempMon add hl, bc @@ -47390,7 +47417,10 @@ Function50893: ; 50893 ret ; 508d5 -Function508d5: ; 508d5 +GetPkmnSpecies: ; 508d5 +; [MonType] has the type of the Pkmn +; e = Nr. of Pkmn (i.e. [CurPartyMon]) + ld a, [MonType] and a ; PARTYMON jr z, .partymon @@ -47893,7 +47923,7 @@ Function50cdb: ; 50cdb call GetNick pop hl call PlaceString - call Function5084a + call CopyPkmnToTempMon pop hl ld a, [CurPartySpecies] cp EGG @@ -48114,15 +48144,15 @@ Function50e1b: ; 50e1b call Function50e47 push hl ld hl, TempMonExp + 2 - ld a, [$ffb6] + ld a, [hMultiplicand + 2] ld c, a ld a, [hld] sub c - ld a, [$ffb5] + ld a, [hMultiplicand + 1] ld c, a ld a, [hld] sbc c - ld a, [hMultiplicand] + ld a, [hMultiplicand + 0] ld c, a ld a, [hl] sbc c @@ -48159,15 +48189,15 @@ endr ld a, [hli] and $f - ld [hMultiplier], a + ld [hDivisor], a ld b, $4 call Divide - ld a, [hMultiplicand + 0] + ld a, [hQuotient + 0] push af - ld a, [hMultiplicand + 1] + ld a, [hQuotient + 1] push af - ld a, [hMultiplicand + 2] + ld a, [hQuotient + 2] push af call Function50eed @@ -48368,12 +48398,12 @@ Function50f62: ; 50f62 (14:4f62) ld bc, $30 call CopyBytes ld a, [Buffer2] ; wd1eb (aliases: MovementType) - ld hl, PartyMonOT ; wddff (aliases: PartyMonOT) + ld hl, PartyMonOT call SkipNames push hl call Function51036 ld a, [wd1ec] - ld hl, PartyMonOT ; wddff (aliases: PartyMonOT) + ld hl, PartyMonOT call SkipNames pop de push hl @@ -52550,11 +52580,11 @@ Function84560: ; 84560 ld [hl], $4 xor a ld [hBGMapMode], a - call Function309d + call LoadTileMapToTempTileMap callba Function16dac ld a, $0 call Function84419 - call Function30b4 + call Call_LoadTempTileMapToTileMap call Function84742 ld a, $9 ld [wcf65], a @@ -52582,7 +52612,7 @@ Function84560: ; 84560 pop af ld [hVBlank], a call Function84411 - call Function30b4 + call Call_LoadTempTileMapToTileMap xor a ld [rIF], a pop af @@ -52715,13 +52745,13 @@ Function84688: ; 84688 call Function84411 ld c, $c call DelayFrames - call Function309d + call LoadTileMapToTempTileMap xor a ld [hBGMapMode], a callba Function1dd7ae ld a, $3 call Function84419 - call Function30b4 + call Call_LoadTempTileMapToTileMap call Function84742 ld a, $9 ld [wcf65], a @@ -53492,7 +53522,7 @@ endr ld [hBGMapMode], a ld b, $1a call GetSGBLayout - call Function32f9 + call SetPalettes call Function86635 xor a ld [wc2c6], a @@ -53630,7 +53660,7 @@ Function86692: ; 86692 call WaitBGMap ld b, $1a call GetSGBLayout - call Function32f9 + call SetPalettes decoord 6, 5 ld c, $6 predef Functiond066e @@ -53791,7 +53821,7 @@ Function86810: ; 86810 ld [CurPartySpecies], a ld b, $1a call GetSGBLayout - call Function32f9 + call SetPalettes call Function86635 xor a ld [wc2c6], a @@ -58966,7 +58996,7 @@ Special_SetDayOfWeek: ; 90913 hlcoord 0, 12 lb bc, 4, 18 call TextBox - call Function1d6e + call LoadMenuDataHeader_0x1d75 ld hl, UnknownText_0x90a3f call PrintText hlcoord 9, 3 @@ -59062,7 +59092,7 @@ Function909de: ; 909de ld a, [wd002] ld e, a ld d, 0 - ld hl, Unknown_909f2 + ld hl, WeekdaysStrings rept 2 add hl, de endr @@ -59074,7 +59104,7 @@ endr ret ; 909f2 -Unknown_909f2: ; 909f2 +WeekdaysStrings: ; 909f2 dw Sunday dw Monday dw Tuesday @@ -59134,13 +59164,13 @@ UnknownText_0x90a6c: ; 90a6c ld c, a decoord 1, 14 callba Function1dd6bb - ld hl, UnknownText_0x90a83 + ld hl, TextJump_DSTIsThatOK ret ; 90a83 (24:4a83) -UnknownText_0x90a83: ; 0x90a83 +TextJump_DSTIsThatOK: ; 0x90a83 ; DST, is that OK? - text_jump UnknownText_0x1c5fde + text_jump Text_DSTIsThatOK db "@" ; 0x90a88 @@ -59393,7 +59423,7 @@ Function90bea: ; 90bea (24:4bea) call Function90da8 ld b, $2 call GetSGBLayout - call Function32f9 + call SetPalettes ld a, [hCGB] and a ret z @@ -60777,7 +60807,7 @@ Function9191c: ; 9191c ld [wd005], a ld b, $2 call GetSGBLayout - call Function32f9 + call SetPalettes ld a, [hCGB] and a jr z, .asm_9198b @@ -61031,7 +61061,7 @@ _FlyMap: ; 91af3 call Function91c8f ld b, $2 call GetSGBLayout - call Function32f9 + call SetPalettes .loop call JoyTextDelay ld hl, hJoyPressed @@ -61453,7 +61483,7 @@ Function91d11: ; 91d11 call TownMapBGUpdate ld b, $2 call GetSGBLayout - call Function32f9 + call SetPalettes xor a ld [hBGMapMode], a xor a @@ -61963,7 +61993,7 @@ Function92311: ; 92311 ld [wd004], a ld b, $2 call GetSGBLayout - call Function32f9 + call SetPalettes .loop call JoyTextDelay ld hl, hJoyPressed @@ -65109,7 +65139,7 @@ ReadAnyMail: ; b9237 ld a, [wd1ec] ld e, a callba Function8cb4 - call Function32f9 + call SetPalettes xor a ld [hJoyPressed], a call Functionb929a @@ -66317,7 +66347,7 @@ DisplayCaughtContestMonStats: ; cc000 call WaitBGMap ld b, $8 call GetSGBLayout - call Function32f9 + call SetPalettes ret ; cc0a7 @@ -69887,7 +69917,7 @@ BillsPCDepositFuncDeposit: ; e24a9 (38:64a9) ret BillsPCDepositFuncStats: ; e24c8 (38:64c8) - call Function1d6e + call LoadMenuDataHeader_0x1d75 call Functione2f7e call ExitMenu call PCMonInfo @@ -69906,7 +69936,7 @@ BillsPCDepositFuncRelease: ; e24e0 (38:64e0) push af ld de, PCString_ReleasePKMN call Functione2a6e - call Function1d6e + call LoadMenuDataHeader_0x1d75 lb bc, 14, 11 call PlaceYesNoBox ld a, [wcfa9] @@ -70152,7 +70182,7 @@ endr ret .stats: ; e26c0 (38:66c0) - call Function1d6e + call LoadMenuDataHeader_0x1d75 call Functione2f7e call ExitMenu call PCMonInfo @@ -70169,7 +70199,7 @@ endr jr c, .FailedRelease ld de, PCString_ReleasePKMN call Functione2a6e - call Function1d6e + call LoadMenuDataHeader_0x1d75 lb bc, 14, 11 call PlaceYesNoBox ld a, [wcfa9] @@ -70412,7 +70442,7 @@ Functione2887: ; e2887 ; e28a5 Functione28a5: ; e28a5 - call Function1d6e + call LoadMenuDataHeader_0x1d75 call Functione2f7e call ExitMenu call PCMonInfo @@ -71528,7 +71558,7 @@ Functione2fd6: ; e2fd6 (38:6fd6) call Functione3357 ld hl, PartyMonNicknames call Functione3363 - ld hl, PartyMonOT ; wddff (aliases: PartyMonOT) + ld hl, PartyMonOT call Functione3376 ld hl, PartyMons ; wdcdf (aliases: PartyMon1, PartyMon1Species) ld bc, $30 @@ -71575,8 +71605,8 @@ Functione307c: ; e307c (38:707c) call GetNick ld a, $1 ld [wd10b], a - predef Functiondb3f - jr c, .asm_e30e4 + predef SentGetPkmnIntoFromBox + jr c, .asm_boxisfull xor a ld [wd10b], a callba Functione039 @@ -71605,7 +71635,8 @@ Functione307c: ; e307c (38:707c) call DelayFrames and a ret -.asm_e30e4 + +.asm_boxisfull ld de, PCString_BoxFull call Functione2a6e ld de, SFX_WRONG @@ -71629,7 +71660,7 @@ TryWithdrawPokemon: ; e30fa (38:70fa) call CloseSRAM xor a ld [wd10b], a - predef Functiondb3f + predef SentGetPkmnIntoFromBox jr c, .PartyFull ld a, $1 ld [wd10b], a @@ -71659,6 +71690,7 @@ TryWithdrawPokemon: ; e30fa (38:70fa) call DelayFrames and a ret + .PartyFull ld de, PCString_PartyFull call Functione2a6e @@ -71670,6 +71702,7 @@ TryWithdrawPokemon: ; e30fa (38:70fa) scf ret + Functione3180: ; e3180 (38:7180) hlcoord 0, 0 lb bc, 15, 8 @@ -72047,7 +72080,7 @@ PCString_NoReleasingEGGS: db "No releasing EGGS!@" ; e35aa Functione35aa: ; e35aa (38:75aa) - call Function1d6e + call LoadMenuDataHeader_0x1d75 call Functione35e2 .loop xor a @@ -72409,7 +72442,7 @@ _OptionsMenu: ; e41d0 call WaitBGMap ld b, $8 call GetSGBLayout - call Function32f9 + call SetPalettes .asm_e4217 call JoyTextDelay ld a, [hJoyPressed] @@ -72976,7 +73009,7 @@ Functione4579: ; e4579 call WaitBGMap ld b, $19 call GetSGBLayout - call Function32f9 + call SetPalettes ld c, 10 call DelayFrames callab Copyright @@ -76093,7 +76126,7 @@ Functionfb8c8: ; fb8c8 ld [TempMonDVs + 1], a ld b, $1c call GetSGBLayout - call Function32f9 + call SetPalettes ret ; fb8f1 @@ -78492,7 +78525,7 @@ DoMysteryGift: ; 1048ba (41:48ba) call WaitBGMap ld b, $8 call GetSGBLayout - call Function32f9 + call SetPalettes pop de hlcoord 2, 8 ld a, d @@ -79793,7 +79826,7 @@ Function105153: ; 105153 (41:5153) call WaitBGMap ld b, $1d call GetSGBLayout - call Function32f9 + call SetPalettes ret Function10522e: ; 10522e (41:522e) @@ -79971,7 +80004,7 @@ Function105777: ; 105777 (41:5777) call WaitBGMap ld b, $8 call GetSGBLayout - call Function32f9 + call SetPalettes ret Function10578c: ; 10578c (41:578c) @@ -80096,7 +80129,7 @@ Function1057d7: ; 1057d7 (41:57d7) call WaitBGMap ld b, $2 callba Function4930f - jp Function32f9 + jp SetPalettes Function1058c6: ; 1058c6 (41:58c6) ld b, $6 @@ -81231,10 +81264,11 @@ endr ld [$ffbb], a ret -Function1062f7 +Function1062f7: ld a, [$ffbc] bit 7, a ret z + ld [hl], $f6 ret ; 1062ff @@ -81869,7 +81903,7 @@ Function1dc381: ; 1dc381 xor a ld [MonType], a - callba Function5084a + callba CopyPkmnToTempMon hlcoord 0, 7 ld b, $9 ld c, $12 @@ -81940,7 +81974,7 @@ Function1dc381: ; 1dc381 call WaitBGMap ld b, $3 call GetSGBLayout - call Function32f9 + call SetPalettes ret ; 1dc47b @@ -81953,7 +81987,7 @@ Function1dc47b: ; 1dc47b call LoadFontsBattleExtra xor a ld [MonType], a - callba Function5084a + callba CopyPkmnToTempMon hlcoord 0, 0 ld b, 15 ld c, 18 @@ -81992,7 +82026,7 @@ Function1dc47b: ; 1dc47b call WaitBGMap ld b, $3 call GetSGBLayout - call Function32f9 + call SetPalettes ret ; 1dc507 @@ -82134,18 +82168,18 @@ Function1dd6bb: ; 1dd6bb (77:56bb) lb bc, PRINTNUM_LEADINGZEROS | 1, 2 call PrintNum pop bc - ld de, String_1dd6fc + ld de, String_AM pop af jr c, .asm_1dd6f7 - ld de, String_1dd6ff + ld de, String_PM .asm_1dd6f7 inc hl call PlaceString ret ; 1dd6fc (77:56fc) -String_1dd6fc: db "AM@" -String_1dd6ff: db "PM@" +String_AM: db "AM@" ; 1dd6fc +String_PM: db "PM@" ; 1dd6ff ; 1dd702 |