diff options
Diffstat (limited to 'event')
-rw-r--r-- | event/battle_tower.asm | 10 | ||||
-rw-r--r-- | event/buena.asm | 3 | ||||
-rwxr-xr-x | event/bug_contest_2.asm | 9 | ||||
-rwxr-xr-x | event/bug_contest_judging.asm | 27 | ||||
-rwxr-xr-x | event/celebi.asm | 7 | ||||
-rwxr-xr-x | event/daycare.asm | 2 | ||||
-rw-r--r-- | event/dratini.asm | 3 | ||||
-rwxr-xr-x | event/elevator.asm | 6 | ||||
-rwxr-xr-x | event/field_moves.asm | 13 | ||||
-rwxr-xr-x | event/forced_movement.asm | 16 | ||||
-rwxr-xr-x | event/halloffame.asm | 24 | ||||
-rwxr-xr-x | event/happiness_egg.asm | 4 | ||||
-rw-r--r-- | event/kurt.asm | 6 | ||||
-rw-r--r-- | event/magikarp.asm | 5 | ||||
-rwxr-xr-x | event/magnet_train.asm | 33 | ||||
-rw-r--r-- | event/mom.asm | 72 | ||||
-rwxr-xr-x | event/overworld.asm | 8 | ||||
-rwxr-xr-x | event/photo.asm | 16 | ||||
-rw-r--r-- | event/poke_seer.asm | 3 | ||||
-rwxr-xr-x | event/special.asm | 4 | ||||
-rwxr-xr-x | event/squirtbottle.asm | 34 | ||||
-rw-r--r-- | event/unown.asm | 149 | ||||
-rwxr-xr-x | event/whiteout.asm | 4 |
23 files changed, 221 insertions, 237 deletions
diff --git a/event/battle_tower.asm b/event/battle_tower.asm index 091fe7fe1..de6022145 100644 --- a/event/battle_tower.asm +++ b/event/battle_tower.asm @@ -157,9 +157,9 @@ BattleTower_ExecuteJumptable: ; 8b25b ; 8b281 .GetTextPointers: ; 8b281 -rept 3 inc de -endr + inc de + inc de ld a, [de] ld l, a inc de @@ -200,13 +200,11 @@ endr .PrintNthText: ; 8b2a9 push bc call .GetTextPointers -rept 2 inc hl -endr + inc hl ld b, $0 -rept 2 add hl, bc -endr + add hl, bc call .LoadTextPointer call PrintText pop bc diff --git a/event/buena.asm b/event/buena.asm index 5cff72d53..4802943f9 100644 --- a/event/buena.asm +++ b/event/buena.asm @@ -322,9 +322,8 @@ Buena_getprize: ; 8b154 ld hl, .prizes ld b, 0 ld c, a -rept 2 add hl, bc -endr + add hl, bc ret ; 8b15e diff --git a/event/bug_contest_2.asm b/event/bug_contest_2.asm index 72fa8a31b..493c69d0c 100755 --- a/event/bug_contest_2.asm +++ b/event/bug_contest_2.asm @@ -13,9 +13,8 @@ Special_SelectRandomBugContestContestants: ; 139a8 ld b, RESET_FLAG call EventFlagAction pop hl -rept 2 inc hl -endr + inc hl pop bc dec c jr nz, .loop1 @@ -34,9 +33,8 @@ endr ld e, b ld d, 0 ld hl, BugCatchingContestantEventFlagTable -rept 2 add hl, de -endr + add hl, de ld e, [hl] inc hl ld d, [hl] @@ -66,9 +64,8 @@ Special_CheckBugContestContestantFlag: ; 139ed ld hl, BugCatchingContestantEventFlagTable ld e, a ld d, 0 -rept 2 add hl, de -endr + add hl, de ld e, [hl] inc hl ld d, [hl] diff --git a/event/bug_contest_judging.asm b/event/bug_contest_judging.asm index 420c46aac..0d400bb39 100755 --- a/event/bug_contest_judging.asm +++ b/event/bug_contest_judging.asm @@ -1,6 +1,6 @@ _BugContestJudging: ; 1369d call ContestScore - callba MobileFn_105f79 + callba TrainerRankings_BugContestScore call BugContest_JudgeContestants ld a, [wBugContestThirdPlacePersonID] call LoadContestantName @@ -85,9 +85,8 @@ LoadContestantName: ; 13730 ld c, a ld b, 0 ld hl, BugContestantPointers -rept 2 add hl, bc -endr + add hl, bc ld a, [hli] ld h, [hl] ld l, a @@ -320,23 +319,20 @@ ComputeAIContestantScores: ; 138b0 pop de jr nz, .done ld a, e -rept 2 inc a -endr + inc a ld [wBugContestTempPersonID], a dec a ld c, a ld b, 0 ld hl, BugContestantPointers -rept 2 add hl, bc -endr + add hl, bc ld a, [hli] ld h, [hl] ld l, a -rept 2 inc hl -endr + inc hl .loop2 call Random and 3 @@ -344,9 +340,9 @@ endr jr z, .loop2 ld c, a ld b, 0 -rept 3 add hl, bc -endr + add hl, bc + add hl, bc ld a, [hli] ld [wBugContestTempMon], a ld a, [hli] @@ -412,9 +408,8 @@ ContestScore: ; 13900 ld a, [wContestMonDVs + 0] ld b, a and 2 -rept 2 add a -endr + add a ld c, a swap b @@ -433,12 +428,10 @@ endr ld a, b and 2 srl a -rept 2 add c -endr -rept 2 + add c + add d add d -endr call .AddContestStat diff --git a/event/celebi.asm b/event/celebi.asm index c6d8346b0..05f26fe2e 100755 --- a/event/celebi.asm +++ b/event/celebi.asm @@ -55,9 +55,9 @@ Special_CelebiShrineEvent: ; 4989a ld c, $4 .OAMloop: ld [hli], a -rept 3 inc hl -endr + inc hl + inc hl inc a dec c jr nz, .OAMloop @@ -259,9 +259,8 @@ CelebiEvent_Cosine: ; 49b3b (12:5b3b) ld a, d ld d, $0 ld hl, .sinewave -rept 2 add hl, de -endr + add hl, de ld e, [hl] inc hl ld d, [hl] diff --git a/event/daycare.asm b/event/daycare.asm index 3fa8e30c2..a6d8842a9 100755 --- a/event/daycare.asm +++ b/event/daycare.asm @@ -723,7 +723,7 @@ DayCare_InitBreeding: ; 16a3b ld a, [wBreedMon2Species] cp DITTO jr z, .GotDVs - ld a, BREEDMON + ld a, TEMPMON ld [MonType], a push hl callba GetGender diff --git a/event/dratini.asm b/event/dratini.asm index 5923ca363..f110b34ab 100644 --- a/event/dratini.asm +++ b/event/dratini.asm @@ -37,9 +37,8 @@ SpecialDratini: ; 0x8b170 ; get address of mon's first move pop de -rept 2 inc de -endr + inc de .GiveMoves: ld a, [hl] diff --git a/event/elevator.asm b/event/elevator.asm index 316bf382a..7626989b3 100755 --- a/event/elevator.asm +++ b/event/elevator.asm @@ -70,9 +70,8 @@ Elevator:: ; 1342d call GetFarByte cp -1 jr z, .fail -rept 2 inc hl -endr + inc hl ld a, [wElevatorPointerBank] call GetFarByte inc hl @@ -222,9 +221,8 @@ FloorToString: ; 13575 ld e, a ld d, 0 ld hl, .floors -rept 2 add hl, de -endr + add hl, de ld a, [hli] ld h, [hl] ld l, a diff --git a/event/field_moves.asm b/event/field_moves.asm index cf9e1bef0..c1b3bc236 100755 --- a/event/field_moves.asm +++ b/event/field_moves.asm @@ -164,9 +164,8 @@ OWCutJumptable: ; 8ca0c ld e, a ld d, 0 ld hl, .dw -rept 2 add hl, de -endr + add hl, de ld a, [hli] ld h, [hl] ld l, a @@ -192,9 +191,8 @@ Cut_SpawnAnimateTree: ; 8ca23 (23:4a23) ld [wcf64], a ; Cut_StartWaiting ld hl, wJumptableIndex -rept 2 inc [hl] -endr + inc [hl] ret Cut_SpawnAnimateLeaves: ; 8ca3c (23:4a3c) @@ -269,9 +267,8 @@ Cut_GetLeafSpawnCoords: ; 8ca8e (23:4a8e) add e ld e, a ld hl, .Coords -rept 2 add hl, de -endr + add hl, de ld e, [hl] inc hl ld d, [hl] @@ -401,9 +398,9 @@ FlyToAnim: ; 8cb33 ld c, $4 .loop2 ld [hli], a -rept 3 inc hl -endr + inc hl + inc hl inc a dec c jr nz, .loop2 diff --git a/event/forced_movement.asm b/event/forced_movement.asm index aa0473803..136698501 100755 --- a/event/forced_movement.asm +++ b/event/forced_movement.asm @@ -29,32 +29,32 @@ Script_ForcedMovement:: ; 0x1253d .MovementData_up: ; 0x12564 step_dig 16 - turn_in_down + turn_in DOWN step_dig 16 - turn_head_down + turn_head DOWN step_end ; 0x1256b .MovementData_down: ; 0x1256b step_dig 16 - turn_in_up + turn_in UP step_dig 16 - turn_head_up + turn_head UP step_end ; 0x12572 .MovementData_right: ; 0x12572 step_dig 16 - turn_in_left + turn_in LEFT step_dig 16 - turn_head_left + turn_head LEFT step_end ; 0x12579 .MovementData_left: ; 0x12579 step_dig 16 - turn_in_right + turn_in RIGHT step_dig 16 - turn_head_right + turn_head RIGHT step_end ; 0x12580 diff --git a/event/halloffame.asm b/event/halloffame.asm index d6f2d15ed..8d542addb 100755 --- a/event/halloffame.asm +++ b/event/halloffame.asm @@ -3,7 +3,7 @@ HallOfFame:: ; 0x8640e ld a, [StatusFlags] push af ld a, 1 - ld [wc2cd], a + ld [wGameLogicPaused], a call DisableSpriteUpdates ld a, SPAWN_LANCE ld [wSpawnAfterChampion], a @@ -25,7 +25,7 @@ HallOfFame:: ; 0x8640e callba AddHallOfFameEntry xor a - ld [wc2cd], a + ld [wGameLogicPaused], a call AnimateHallOfFame pop af ld b, a @@ -44,7 +44,7 @@ RedCredits:: ; 86455 xor a ld [VramState], a ld [hMapAnims], a - callba Function4e8c2 + callba InitDisplayForRedCredits ld c, 8 call DelayFrames call DisableSpriteUpdates @@ -67,7 +67,7 @@ HallOfFame_FadeOutMusic: ; 8648e xor a ld [VramState], a ld [hMapAnims], a - callba Function4e881 + callba InitDisplayForHallOfFame ld c, 100 jp DelayFrames ; 864b4 @@ -230,14 +230,13 @@ GetHallOfFameParty: ; 8653f AnimateHOFMonEntrance: ; 865b5 push hl call ClearBGPalettes - callba Function4e906 + callba ResetDisplayBetweenHallOfFameMons pop hl ld a, [hli] ld [TempMonSpecies], a ld [CurPartySpecies], a -rept 2 inc hl -endr + inc hl ld a, [hli] ld [TempMonDVs], a ld a, [hli] @@ -262,7 +261,7 @@ endr call WaitBGMap xor a ld [hBGMapMode], a - ld b, SCGB_1A + ld b, SCGB_PLAYER_OR_MON_FRONTPIC_PALS call GetSGBLayout call SetPalettes call HOF_SlideBackpic @@ -298,9 +297,8 @@ HOF_SlideFrontpic: ld a, [hSCX] and a ret z -rept 2 dec a -endr + dec a ld [hSCX], a call DelayFrame jr .frontpicloop @@ -398,7 +396,7 @@ _HallOfFamePC: ; 86650 ld de, .EmptyString call PlaceString call WaitBGMap - ld b, SCGB_1A + ld b, SCGB_PLAYER_OR_MON_FRONTPIC_PALS call GetSGBLayout call SetPalettes decoord 6, 5 @@ -497,7 +495,7 @@ DisplayHOFMon: ; 86748 call GetBasePokemonName hlcoord 7, 13 call PlaceString - ld a, BREEDMON + ld a, TEMPMON ld [MonType], a callba GetGender ld a, " " @@ -555,7 +553,7 @@ HOF_AnimatePlayerPic: ; 86810 xor a ld [hBGMapMode], a ld [CurPartySpecies], a - ld b, SCGB_1A + ld b, SCGB_PLAYER_OR_MON_FRONTPIC_PALS call GetSGBLayout call SetPalettes call HOF_SlideBackpic diff --git a/event/happiness_egg.asm b/event/happiness_egg.asm index 1e8c2a853..e7eece7c8 100755 --- a/event/happiness_egg.asm +++ b/event/happiness_egg.asm @@ -67,9 +67,9 @@ ChangeHappiness: ; 71c2 dec c ld b, 0 ld hl, .Actions -rept 3 add hl, bc -endr + add hl, bc + add hl, bc ld d, 0 add hl, de ld a, [hl] diff --git a/event/kurt.asm b/event/kurt.asm index ac341de49..e1fff12c0 100644 --- a/event/kurt.asm +++ b/event/kurt.asm @@ -362,9 +362,8 @@ Kurt_GetAddressOfApricornQuantity: ; 88201 inc hl ld c, a ld b, $0 -rept 2 add hl, bc -endr + add hl, bc inc hl ld a, [hl] pop bc @@ -379,9 +378,8 @@ Kurt_GetRidOfItem: ; 88211 ld c, a ld b, $0 inc hl -rept 2 add hl, bc -endr + add hl, bc ld a, [CurItem] ld c, a ld a, [hli] diff --git a/event/magikarp.asm b/event/magikarp.asm index b9f73552c..f926196cd 100644 --- a/event/magikarp.asm +++ b/event/magikarp.asm @@ -28,7 +28,7 @@ Special_CheckMagikarpLength: ; fbb32 ld c, l call CalcMagikarpLength call PrintMagikarpLength - callba MagikarpLength_Mobile + callba TrainerRankings_MagikarpLength ld hl, .MeasureItText call PrintText @@ -250,9 +250,8 @@ CalcMagikarpLength: ; fbbfc ; hl = de × 10 ld h, d ld l, e -rept 2 add hl, hl -endr + add hl, hl add hl, de add hl, hl diff --git a/event/magnet_train.asm b/event/magnet_train.asm index c074e6835..ccc41a59d 100755 --- a/event/magnet_train.asm +++ b/event/magnet_train.asm @@ -48,7 +48,7 @@ Special_MagnetTrain: ; 8cc04 callab PlaySpriteAnimations call MagnetTrain_Jumptable call MagnetTrain_UpdateLYOverrides - call Function3b0c + call PushLYOverrides call DelayFrame jr .loop @@ -61,9 +61,9 @@ Special_MagnetTrain: ; 8cc04 ld [hVBlank], a call ClearBGPalettes xor a - ld [hFFC6], a - ld [hFFC7], a - ld [hFFC8], a + ld [hLCDCPointer], a + ld [hLYOverrideStart], a + ld [hLYOverrideEnd], a ld [hSCX], a ld [Requested2bppSource], a ld [Requested2bppSource + 1], a @@ -101,9 +101,8 @@ MagnetTrain_UpdateLYOverrides: ; 8cc99 ld d, a ld hl, wcf64 ld a, [hl] -rept 2 add d -endr + add d ld [hl], a ret @@ -150,9 +149,9 @@ MagntTrain_LoadGFX_PlayMusic: ; 8ccc9 xor a ld [hli], a ld a, [wMagnetTrainInitPosition] -rept 3 ld [hli], a -endr + ld [hli], a + ld [hli], a ld de, MUSIC_MAGNET_TRAIN call PlayMusic2 ret @@ -211,9 +210,8 @@ GetMagnetTrainBGTiles: ; 8cd74 ld e, a ld d, 0 ld hl, MagnetTrainBGTiles -rept 2 add hl, de -endr + add hl, de ld e, [hl] inc hl ld d, [hl] @@ -253,8 +251,8 @@ MagnetTrain_InitLYOverrides: ; 8cda6 ld bc, LYOverridesBackupEnd - LYOverridesBackup ld a, [wMagnetTrainInitPosition] call ByteFill - ld a, $43 - ld [hFFC6], a + ld a, rSCX - $ff00 + ld [hLCDCPointer], a ret ; 8cdc3 @@ -296,9 +294,8 @@ MagnetTrain_Jumptable: ; 8cdf7 ld e, a ld d, 0 ld hl, .Jumptable -rept 2 add hl, de -endr + add hl, de ld a, [hli] ld h, [hl] ld l, a @@ -398,17 +395,15 @@ endr inc a ld d, a ld a, e -rept 2 add d -endr + add d ld [wcf65], a ld hl, wGlobalAnimXOffset ld a, [wMagnetTrainDirection] ld d, a ld a, [hl] -rept 2 add d -endr + add d ld [hl], a ret @@ -431,7 +426,7 @@ MagnetTrain_Jumptable_FirstRunThrough: ; 8ceae callba PlaySpriteAnimations call MagnetTrain_Jumptable call MagnetTrain_UpdateLYOverrides - call Function3b0c + call PushLYOverrides call DelayFrame ld a, [rSVBK] push af diff --git a/event/mom.asm b/event/mom.asm index d2b7d2a7c..4002f69d2 100644 --- a/event/mom.asm +++ b/event/mom.asm @@ -23,9 +23,8 @@ Special_BankOfMom: ; 16218 ld e, a ld d, 0 ld hl, .dw -rept 2 add hl, de -endr + add hl, de ld a, [hli] ld h, [hl] ld l, a @@ -143,16 +142,15 @@ endr call PrintText xor a ld hl, StringBuffer2 -rept 2 ld [hli], a -endr + ld [hli], a ld [hl], a ld a, $5 ld [wcf64], a call LoadStandardMenuDataHeader - call Function16517 - call Function1656b - call Function16571 + call Mom_SetUpDepositMenu + call Mom_Wait10Frames + call Mom_WithdrawDepositMenuJoypad call CloseWindow jr c, .CancelDeposit ld hl, StringBuffer2 @@ -211,16 +209,15 @@ endr call PrintText xor a ld hl, StringBuffer2 -rept 2 ld [hli], a -endr + ld [hli], a ld [hl], a ld a, $5 ld [wcf64], a call LoadStandardMenuDataHeader - call Function16512 - call Function1656b - call Function16571 + call Mom_SetUpWithdrawMenu + call Mom_Wait10Frames + call Mom_WithdrawDepositMenuJoypad call CloseWindow jr c, .CancelWithdraw ld hl, StringBuffer2 @@ -324,13 +321,13 @@ DSTChecks: ; 16439 call .ClearBox bccoord 1, 14 ld hl, .Text_AdjustClock - call PlaceWholeStringInBoxAtOnce + call PlaceHLTextAtBC call YesNoBox ret c call .ClearBox bccoord 1, 14 ld hl, .Text_LostInstructionBooklet - call PlaceWholeStringInBoxAtOnce + call PlaceHLTextAtBC ret .loop @@ -340,7 +337,7 @@ DSTChecks: ; 16439 bit 7, a jr z, .SetDST ld hl, .Text_IsDSTOver - call PlaceWholeStringInBoxAtOnce + call PlaceHLTextAtBC call YesNoBox ret c ld a, [wDST] @@ -350,12 +347,12 @@ DSTChecks: ; 16439 call .ClearBox bccoord 1, 14 ld hl, .Text_SetClockBack - call PlaceWholeStringInBoxAtOnce + call PlaceHLTextAtBC ret .SetDST: ld hl, .Text_SwitchToDST - call PlaceWholeStringInBoxAtOnce + call PlaceHLTextAtBC call YesNoBox ret c ld a, [wDST] @@ -365,7 +362,7 @@ DSTChecks: ; 16439 call .ClearBox bccoord 1, 14 ld hl, .Text_SetClockForward - call PlaceWholeStringInBoxAtOnce + call PlaceHLTextAtBC ret ; 164b9 @@ -444,14 +441,13 @@ DSTChecks: ; 16439 db "@" ; 0x16512 -Function16512: ; 16512 - ld de, String_1669f - jr Function1651a +Mom_SetUpWithdrawMenu: ; 16512 + ld de, Mon_WithdrawString + jr Mom_ContinueMenuSetup -Function16517: ; 16517 - ld de, String_166a8 - -Function1651a: ; 1651a +Mom_SetUpDepositMenu: ; 16517 + ld de, Mom_DepositString +Mom_ContinueMenuSetup: ; 1651a push de xor a ld [hBGMapMode], a @@ -459,14 +455,14 @@ Function1651a: ; 1651a lb bc, 6, 18 call TextBox hlcoord 1, 2 - ld de, String_16699 + ld de, Mom_SavedString call PlaceString hlcoord 12, 2 ld de, wMomsMoney lb bc, PRINTNUM_MONEY | 3, 6 call PrintNum hlcoord 1, 4 - ld de, String_166b0 + ld de, Mom_HeldString call PlaceString hlcoord 12, 4 ld de, Money @@ -484,13 +480,13 @@ Function1651a: ; 1651a ret ; 1656b -Function1656b: ; 1656b +Mom_Wait10Frames: ; 1656b ld c, 10 call DelayFrames ret ; 16571 -Function16571: ; 16571 +Mom_WithdrawDepositMenuJoypad: ; 16571 .loop call JoyTextDelay ld hl, hJoyPressed @@ -532,9 +528,8 @@ Function16571: ; 16571 .pressedA and a ret -; 165b9 -.dpadaction ; 165b9 +.dpadaction ld hl, hJoyLast ld a, [hl] and D_UP @@ -584,16 +579,15 @@ Function16571: ; 16571 ld de, StringBuffer2 callba TakeMoney ret -; 16607 -.getdigitquantity ; 16607 +.getdigitquantity ld a, [wMomBankDigitCursorPosition] push de ld e, a ld d, 0 -rept 3 add hl, de -endr + add hl, de + add hl, de pop de ret ; 16613 @@ -717,19 +711,19 @@ UnknownText_0x16694: ; 0x16694 db "@" ; 0x16699 -String_16699: ; 16699 +Mom_SavedString: ; 16699 db "SAVED@" ; 1669f -String_1669f: ; 1669f +Mon_WithdrawString: ; 1669f db "WITHDRAW@" ; 166a8 -String_166a8: ; 166a8 +Mom_DepositString: ; 166a8 db "DEPOSIT@" ; 166b0 -String_166b0: ; 166b0 +Mom_HeldString: ; 166b0 db "HELD@" ; 166b5 diff --git a/event/overworld.asm b/event/overworld.asm index c9fe754fe..b27093a00 100755 --- a/event/overworld.asm +++ b/event/overworld.asm @@ -472,7 +472,7 @@ UsedSurfScript: ; c986 end .empty_fn ; c9a2 - callba MobileFn_1060bb ; empty + callba TrainerRankings_Surf ret UsedSurfText: ; c9a9 @@ -745,13 +745,13 @@ Script_UsedWaterfall: ; 0xcb20 ld a, [PlayerStandingTile] call CheckWaterfallTile ret z - callba MobileFn_1060c1 + callba TrainerRankings_Waterfall ld a, $1 ld [ScriptVar], a ret .WaterfallStep: ; cb4f - turn_waterfall_up + turn_waterfall UP step_end .Text_UsedWaterfall: ; 0xcb51 @@ -1632,7 +1632,7 @@ Script_GotABite: ; 0xd035 fish_got_bite fish_got_bite fish_got_bite - step_sleep_1 + step_sleep 1 show_emote step_end diff --git a/event/photo.asm b/event/photo.asm index 7f6ec9e66..c47445fc5 100755 --- a/event/photo.asm +++ b/event/photo.asm @@ -59,7 +59,7 @@ UnownPrinter: ; 16be4 ld [TempMonDVs], a ld [TempMonDVs + 1], a - ld b, SCGB_FRONTPICPALS + ld b, SCGB_TRAINER_OR_MON_FRONTPIC_PALS call GetSGBLayout call SetPalettes @@ -132,7 +132,7 @@ UnownPrinter: ; 16be4 .UpdateUnownFrontpic: ; 16cc8 ld a, [wJumptableIndex] cp 26 - jr z, Function16d20 + jr z, .vacant inc a ld [UnownLetter], a ld a, UNOWN @@ -141,18 +141,17 @@ UnownPrinter: ; 16be4 ld [wBoxAlignment], a ld de, VTiles2 predef GetFrontpic - call Function16cff + call .Load2bppToSRAM hlcoord 1, 6 xor a ld [hGraphicStartTile], a lb bc, 7, 7 predef PlaceGraphic ld de, VTiles2 tile $31 - callba Functione0000 + callba RotateUnownFrontpic ret -; 16cff -Function16cff: ; 16cff +.Load2bppToSRAM: ; 16cff ld a, [rSVBK] push af ld a, $6 @@ -171,9 +170,8 @@ Function16cff: ; 16cff pop af ld [rSVBK], a ret -; 16d20 -Function16d20: ; 16d20 +.vacant hlcoord 1, 6 lb bc, 7, 7 call ClearBox @@ -221,7 +219,7 @@ UnownDexBTile: ; 16da4 INCBIN "gfx/unknown/016da4.1bpp" ; 16dac -Function16dac: ; 16dac +PlaceUnownPrinterFrontpic: ; 16dac hlcoord 0, 0 ld bc, SCREEN_WIDTH * SCREEN_HEIGHT ld a, " " diff --git a/event/poke_seer.asm b/event/poke_seer.asm index 2e942ef07..5e93acc5d 100644 --- a/event/poke_seer.asm +++ b/event/poke_seer.asm @@ -298,9 +298,8 @@ PrintSeerText: ; 4f26d ld e, a ld d, 0 ld hl, SeerTexts -rept 2 add hl, de -endr + add hl, de ld a, [hli] ld h, [hl] ld l, a diff --git a/event/special.asm b/event/special.asm index c5ddabbcf..f1228abc6 100755 --- a/event/special.asm +++ b/event/special.asm @@ -188,9 +188,9 @@ MassageOrHaircut: ; 7420 .loop sub [hl] jr c, .ok -rept 3 inc hl -endr + inc hl + inc hl jr .loop .ok diff --git a/event/squirtbottle.asm b/event/squirtbottle.asm index 5f43e4029..7b47a96f6 100755 --- a/event/squirtbottle.asm +++ b/event/squirtbottle.asm @@ -1,50 +1,46 @@ _Squirtbottle: ; 50730 - ld hl, UnknownScript_0x5073c + ld hl, .SquirtbottleScript call QueueScript ld a, $1 ld [wItemEffectSucceeded], a ret -; 5073c -UnknownScript_0x5073c: ; 0x5073c +.SquirtbottleScript: reloadmappart special UpdateTimePals - callasm Function50753 - iffalse UnknownScript_0x5074b + callasm .CheckCanUseSquirtbottle + iffalse .NothingHappenedScript farjump WateredWeirdTreeScript -; 0x5074b -UnknownScript_0x5074b: ; 0x5074b - jumptext UnknownText_0x5074e -; 0x5074e +.NothingHappenedScript: + jumptext .NothingHappenedText -UnknownText_0x5074e: ; 0x5074e +.NothingHappenedText: ; sprinkled water. But nothing happened… text_jump UnknownText_0x1c0b3b db "@" -; 0x50753 -Function50753: ; 50753 +.CheckCanUseSquirtbottle: ld a, [MapGroup] cp GROUP_ROUTE_36 - jr nz, .asm_50774 + jr nz, .nope ld a, [MapNumber] cp MAP_ROUTE_36 - jr nz, .asm_50774 + jr nz, .nope callba GetFacingObject - jr c, .asm_50774 + jr c, .nope ld a, d - cp $17 - jr nz, .asm_50774 + cp SPRITEMOVEDATA_SUDOWOODO + jr nz, .nope - ld a, $1 + ld a, 1 ld [ScriptVar], a ret -.asm_50774 +.nope xor a ld [ScriptVar], a ret diff --git a/event/unown.asm b/event/unown.asm index b37df3b3a..6b65877f9 100644 --- a/event/unown.asm +++ b/event/unown.asm @@ -107,18 +107,18 @@ SpecialKabutoChamber: ; 8ae4e Special_DisplayUnownWords: ; 8ae68 ld a, [ScriptVar] - ld hl, MenuDataHeader_0x8aed5 + ld hl, .MenuDataHeader_Escape and a - jr z, .asm_8ae79 + jr z, .load ld d, $0 ld e, $5 -.asm_8ae75 +.loop add hl, de dec a - jr nz, .asm_8ae75 + jr nz, .loop -.asm_8ae79 +.load call LoadMenuDataHeader xor a ld [hBGMapMode], a @@ -127,29 +127,27 @@ Special_DisplayUnownWords: ; 8ae68 call ApplyTilemap call MenuBoxCoord2Tile inc hl - ld d, $0 - ld e, $14 -rept 2 + ld d, 0 + ld e, SCREEN_WIDTH + add hl, de add hl, de -endr ld a, [ScriptVar] ld c, a - ld de, Unknown_8aebc + ld de, .UnownText and a - jr z, .asm_8aea5 -.asm_8ae9c + jr z, .copy +.loop2 ld a, [de] inc de cp $ff - jr nz, .asm_8ae9c + jr nz, .loop2 dec c - jr nz, .asm_8ae9c - -.asm_8aea5 - call Function8af09 + jr nz, .loop2 +.copy + call .CopyWord ld bc, AttrMap - TileMap add hl, bc - call Function8aee9 + call .FillAttr call WaitBGMap2 call JoyWaitAorB call PlayClickSFX @@ -157,59 +155,91 @@ endr ret ; 8aebc -Unknown_8aebc: ; 8aebc - db $08, $44, $04, $00, $2e, $08, $ff - db $26, $20, $0c, $0e, $46, $ff - db $4c, $00, $46, $08, $42, $ff - db $0e, $2c, $64, $2c, $0e, $ff +.UnownText: ; 8aebc + +unownwall: MACRO +rept _NARG +if \1 == "-" +x = $64 +else +if \1 >= "Y" +x = 2 * (\1 - "Y") + $60 +else +if \1 >= "Q" +x = 2 * (\1 - "Q") + $40 +else +if \1 >= "I" +x = 2 * (\1 - "I") + $20 +else +x = 2 * (\1 - "A") +endc +endc +endc +endc + db x +shift +endr + db $ff +endm + +.UnownText_Escape: + ; db $08, $44, $04, $00, $2e, $08, $ff + unownwall "E", "S", "C", "A", "P", "E" +.UnownText_Light: + ; db $26, $20, $0c, $0e, $46, $ff + unownwall "L", "I", "G", "H", "T" +.UnownText_Water: + ; db $4c, $00, $46, $08, $42, $ff + unownwall "W", "A", "T", "E", "R" +.UnownText_Ho_Oh: + ; db $0e, $2c, $64, $2c, $0e, $ff + unownwall "H", "O", "-", "O", "H" ; 8aed5 -MenuDataHeader_0x8aed5: ; 0x8aed5 +.MenuDataHeader_Escape: ; 0x8aed5 db $40 ; flags db 04, 03 ; start coords db 09, 16 ; end coords -MenuDataHeader_0x8aeda: ; 0x8aeda +.MenuDataHeader_Light: ; 0x8aeda db $40 ; flags db 04, 04 ; start coords db 09, 15 ; end coords -MenuDataHeader_0x8aedf: ; 0x8aedf +.MenuDataHeader_Water: ; 0x8aedf db $40 ; flags db 04, 04 ; start coords db 09, 15 ; end coords -MenuDataHeader_0x8aee4: ; 0x8aee4 +.MenuDataHeader_Ho_Oh: ; 0x8aee4 db $40 ; flags db 04, 04 ; start coords db 09, 15 ; end coords ; 8aee9 -Function8aee9: ; 8aee9 -.asm_8aee9 +.FillAttr: ; 8aee9 ld a, [de] cp $ff ret z cp $60 - ld a, $d - jr c, .asm_8aef5 - ld a, $5 + ld a, (1 << 3) | PAL_BG_BROWN + jr c, .got_pal + ld a, PAL_BG_BROWN -.asm_8aef5 - call Function8aefd -rept 2 +.got_pal + call .PlaceSquare + inc hl inc hl -endr inc de - jr .asm_8aee9 + jr .FillAttr ; 8aefd -Function8aefd: ; 8aefd +.PlaceSquare: ; 8aefd push hl ld [hli], a ld [hld], a - ld b, $0 - ld c, $14 + ld b, 0 + ld c, SCREEN_WIDTH add hl, bc ld [hli], a ld [hl], a @@ -217,42 +247,41 @@ Function8aefd: ; 8aefd ret ; 8af09 -Function8af09: ; 8af09 +.CopyWord: ; 8af09 push hl push de -.asm_8af0b +.word_loop ld a, [de] cp $ff - jr z, .asm_8af19 + jr z, .word_done ld c, a - call Function8af1c -rept 2 + call .ConvertChar + inc hl inc hl -endr inc de - jr .asm_8af0b + jr .word_loop -.asm_8af19 +.word_done pop de pop hl ret ; 8af1c -Function8af1c: ; 8af1c +.ConvertChar: ; 8af1c push hl ld a, c cp $60 - jr z, .asm_8af3b + jr z, .Tile60 cp $62 - jr z, .asm_8af4b + jr z, .Tile62 cp $64 - jr z, .asm_8af5b + jr z, .Tile64 ld [hli], a inc a ld [hld], a dec a - ld b, $0 - ld c, $14 + ld b, 0 + ld c, SCREEN_WIDTH add hl, bc ld c, $10 add c @@ -262,11 +291,11 @@ Function8af1c: ; 8af1c pop hl ret -.asm_8af3b +.Tile60: ld [hl], $5b inc hl ld [hl], $5c - ld bc, $0013 + ld bc, SCREEN_WIDTH - 1 add hl, bc ld [hl], $4d inc hl @@ -274,11 +303,11 @@ Function8af1c: ; 8af1c pop hl ret -.asm_8af4b +.Tile62: ld [hl], $4e inc hl ld [hl], $4f - ld bc, $0013 + ld bc, SCREEN_WIDTH - 1 add hl, bc ld [hl], $5e inc hl @@ -286,11 +315,11 @@ Function8af1c: ; 8af1c pop hl ret -.asm_8af5b +.Tile64: ld [hl], $2 inc hl ld [hl], $3 - ld bc, $0013 + ld bc, SCREEN_WIDTH - 1 add hl, bc ld [hl], $3 inc hl diff --git a/event/whiteout.asm b/event/whiteout.asm index a076bdcb6..38049b3b5 100755 --- a/event/whiteout.asm +++ b/event/whiteout.asm @@ -49,9 +49,7 @@ BattleBGMap: ; 1250a ; 12513 HalveMoney: ; 12513 - -; Empty function... - callba MobileFn_1060c7 + callba TrainerRankings_WhiteOuts ; Halve the player's money. ld hl, Money |