diff options
| author | Yoann Fievez <yoann.fievez@gmail.com> | 2026-06-24 20:43:48 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-06-24 14:43:48 -0400 |
| commit | d150f7f4f49e9dda08c52199159b30ae9b4f00e8 (patch) | |
| tree | e0c81ae315ccdf2952c10713312427f2c55e1fea | |
| parent | Use OAM constants and decimal coordinates in surfing_pikachu_oam.asm (#157) (diff) | |
| download | pokeyellow-d150f7f4f49e9dda08c52199159b30ae9b4f00e8.tar.gz pokeyellow-d150f7f4f49e9dda08c52199159b30ae9b4f00e8.tar.xz pokeyellow-d150f7f4f49e9dda08c52199159b30ae9b4f00e8.zip | |
Identify `wPikachuSpawnStateFlags` and `wPikachuMapScriptFlags` bits, and `PIKAMOVEMENT_*` constants (#158)
- Rename `wd471` to` wPikachuSpawnStateFlags`, with `BIT_PIKACHU_SPAWN_*` bits
- Rename `wd492` to `wPikachuMapScriptFlags`, with `BIT_PIKACHU_MAP_*` bits
- Introduce `PIKAMOVEMENT_*` constants for `ApplyPikachuMovementData`
- Refactor `BillsHouse` scripts and Pikachu/Bill movement data
| -rw-r--r-- | constants/pikachu_emotion_constants.asm | 34 | ||||
| -rw-r--r-- | engine/events/poison.asm | 4 | ||||
| -rw-r--r-- | engine/events/try_pikachu_movement.asm | 4 | ||||
| -rw-r--r-- | engine/minigame/surfing_pikachu.asm | 4 | ||||
| -rw-r--r-- | engine/pikachu/pikachu_emotions.asm | 6 | ||||
| -rw-r--r-- | engine/pikachu/pikachu_follow.asm | 8 | ||||
| -rw-r--r-- | home/map_objects.asm | 22 | ||||
| -rw-r--r-- | home/overworld.asm | 4 | ||||
| -rw-r--r-- | ram/wram.asm | 4 | ||||
| -rw-r--r-- | scripts/BillsHouse.asm | 110 | ||||
| -rw-r--r-- | scripts/BillsHouse_2.asm | 60 | ||||
| -rw-r--r-- | scripts/CinnabarGym.asm | 4 | ||||
| -rw-r--r-- | scripts/MtMoonB2F_2.asm | 4 | ||||
| -rw-r--r-- | scripts/Museum2F.asm | 4 | ||||
| -rw-r--r-- | scripts/PewterCity.asm | 4 | ||||
| -rw-r--r-- | scripts/PewterGym.asm | 4 | ||||
| -rw-r--r-- | scripts/PewterPokecenter.asm | 4 | ||||
| -rw-r--r-- | scripts/PewterPokecenter_2.asm | 4 | ||||
| -rw-r--r-- | scripts/PokemonFanClub.asm | 20 | ||||
| -rw-r--r-- | scripts/Route25.asm | 10 | ||||
| -rw-r--r-- | scripts/SummerBeachHouse.asm | 42 | ||||
| -rw-r--r-- | scripts/VermilionCity.asm | 4 |
22 files changed, 199 insertions, 165 deletions
diff --git a/constants/pikachu_emotion_constants.asm b/constants/pikachu_emotion_constants.asm index 98d0e6e2..41e5f7ba 100644 --- a/constants/pikachu_emotion_constants.asm +++ b/constants/pikachu_emotion_constants.asm @@ -224,3 +224,37 @@ MACRO pikapic_looptofinish pikapic_waitbgmap pikapic_jump .loop\@ ENDM + +; wPikachuSpawnStateFlags bits + const_def + const BIT_PIKACHU_SPAWN_0 + const BIT_PIKACHU_SPAWN_1 + const BIT_PIKACHU_SPAWN_2 + const BIT_PIKACHU_SPAWN_3 + const BIT_PIKACHU_SPAWN_4 + const BIT_PIKACHU_SPAWN_FOLLOWING + const BIT_PIKACHU_SPAWN_SURFING + const BIT_PIKACHU_SPAWN_STARTER + +; wPikachuMapScriptFlags bits + const_def + const BIT_PIKACHU_MAP_PAUSE_IGT + const BIT_PIKACHU_MAP_SURF_SELECT + const BIT_PIKACHU_MAP_2 + const BIT_PIKACHU_MAP_3 + const BIT_PIKACHU_MAP_4 + const BIT_PIKACHU_MAP_5 + const BIT_PIKACHU_MAP_6 + const BIT_PIKACHU_MAP_SCRIPT_ACTIVE + +; Pikachu movement commands +DEF PIKAMOVEMENT_DELAY EQU $00 +DEF PIKAMOVEMENT_STEP_DOWN EQU $1d +DEF PIKAMOVEMENT_STEP_UP EQU $1e +DEF PIKAMOVEMENT_STEP_LEFT EQU $1f +DEF PIKAMOVEMENT_STEP_RIGHT EQU $20 +DEF PIKAMOVEMENT_LOOK_DOWN EQU $35 +DEF PIKAMOVEMENT_LOOK_UP EQU $36 +DEF PIKAMOVEMENT_LOOK_LEFT EQU $37 +DEF PIKAMOVEMENT_LOOK_RIGHT EQU $38 +DEF PIKAMOVEMENT_END EQU $3f diff --git a/engine/events/poison.asm b/engine/events/poison.asm index e0464ae8..a518f82d 100644 --- a/engine/events/poison.asm +++ b/engine/events/poison.asm @@ -3,8 +3,8 @@ ApplyOutOfBattlePoisonDamage: ASSERT BIT_SCRIPTED_MOVEMENT_STATE == 7 add a ; overflows scripted movement state bit into carry flag jp c, .noBlackOut ; no black out if joypad states are being simulated - ld a, [wd492] - bit 7, a + ld a, [wPikachuMapScriptFlags] + bit BIT_PIKACHU_MAP_SCRIPT_ACTIVE, a jp nz, .noBlackOut ld a, [wStatusFlags4] bit BIT_LINK_CONNECTED, a diff --git a/engine/events/try_pikachu_movement.asm b/engine/events/try_pikachu_movement.asm index 9dd25008..2e05b037 100644 --- a/engine/events/try_pikachu_movement.asm +++ b/engine/events/try_pikachu_movement.asm @@ -1,6 +1,6 @@ TryApplyPikachuMovementData:: - ld a, [wd471] - bit 7, a + ld a, [wPikachuSpawnStateFlags] + bit BIT_PIKACHU_SPAWN_STARTER, a ret z ld a, [wWalkBikeSurfState] and a diff --git a/engine/minigame/surfing_pikachu.asm b/engine/minigame/surfing_pikachu.asm index 27e91ba1..b413bf10 100644 --- a/engine/minigame/surfing_pikachu.asm +++ b/engine/minigame/surfing_pikachu.asm @@ -85,8 +85,8 @@ SurfingPikachuLoop: ret SurfingPikachu_CheckPressedSelect: - ld hl, wd492 - bit 1, [hl] + ld hl, wPikachuMapScriptFlags + bit BIT_PIKACHU_MAP_SURF_SELECT, [hl] ret z ldh a, [hJoyPressed] and PAD_SELECT diff --git a/engine/pikachu/pikachu_emotions.asm b/engine/pikachu/pikachu_emotions.asm index 787b4f94..22501085 100644 --- a/engine/pikachu/pikachu_emotions.asm +++ b/engine/pikachu/pikachu_emotions.asm @@ -304,8 +304,8 @@ MapSpecificPikachuExpression: ld a, [wCurMap] cp POKEMON_FAN_CLUB jr nz, .notFanClub - ld hl, wd492 - bit 7, [hl] + ld hl, wPikachuMapScriptFlags + bit BIT_PIKACHU_MAP_SCRIPT_ACTIVE, [hl] ldpikaemotion a, PikachuEmotion29 jr z, .play_emotion call CheckPikachuFollowingPlayer @@ -323,7 +323,7 @@ MapSpecificPikachuExpression: jr .check_pikachu_status .notPewterPokecenter - callfar Func_f24ae + callfar BillsHouse_CheckPikachuEmotion ld a, e cp $ff jr nz, .play_emotion diff --git a/engine/pikachu/pikachu_follow.asm b/engine/pikachu/pikachu_follow.asm index 11093c29..e6eba17e 100644 --- a/engine/pikachu/pikachu_follow.asm +++ b/engine/pikachu/pikachu_follow.asm @@ -140,8 +140,8 @@ CalculatePikachuPlacementCoords:: inc hl ld [hl], $fe push hl - ld hl, wd471 - set 5, [hl] + ld hl, wPikachuSpawnStateFlags + set BIT_PIKACHU_SPAWN_FOLLOWING, [hl] pop hl ret @@ -1278,8 +1278,8 @@ Func_fcc23: ld a, [wPikachuOverworldStateFlags] bit 7, a jr nz, .asm_fcc40 - ld a, [wd471] - bit 7, a + ld a, [wPikachuSpawnStateFlags] + bit BIT_PIKACHU_SPAWN_STARTER, a jr z, .asm_fcc40 ld a, [wWalkBikeSurfState] and a diff --git a/home/map_objects.asm b/home/map_objects.asm index 3b1a1f08..2c275465 100644 --- a/home/map_objects.asm +++ b/home/map_objects.asm @@ -69,12 +69,12 @@ IsItemInBag:: ret IsSurfingPikachuInParty:: -; set bit 6 of wd471 if any Pikachu with Surf is in party -; set bit 7 of wd471 if starter Pikachu is in party (with or without Surf) +; set bit 6 of wPikachuSpawnStateFlags if any Pikachu with Surf is in party +; set bit 7 of wPikachuSpawnStateFlags if starter Pikachu is in party (with or without Surf) ; also performs a bankswitch to IsStarterPikachuAliveInOurParty - ld a, [wd471] - and $3f - ld [wd471], a + ld a, [wPikachuSpawnStateFlags] + and ~((1 << BIT_PIKACHU_SPAWN_STARTER) | (1 << BIT_PIKACHU_SPAWN_SURFING)) + ld [wPikachuSpawnStateFlags], a ld hl, wPartyMon1 ld c, PARTY_LENGTH ld b, SURF @@ -98,9 +98,9 @@ IsSurfingPikachuInParty:: cp b jr nz, .noSurf .hasSurf - ld a, [wd471] - set 6, a - ld [wd471], a + ld a, [wPikachuSpawnStateFlags] + set BIT_PIKACHU_SPAWN_SURFING, a + ld [wPikachuSpawnStateFlags], a .noSurf pop hl .notPikachu @@ -118,9 +118,9 @@ IsSurfingPikachuInParty:: pop bc pop hl ret nc - ld a, [wd471] - set 7, a - ld [wd471], a + ld a, [wPikachuSpawnStateFlags] + set BIT_PIKACHU_SPAWN_STARTER, a + ld [wPikachuSpawnStateFlags], a ret DisplayPokedex:: diff --git a/home/overworld.asm b/home/overworld.asm index 6fafe717..4586e5c0 100644 --- a/home/overworld.asm +++ b/home/overworld.asm @@ -1752,8 +1752,8 @@ LoadSurfingPlayerSpriteGraphics2:: dec a jr z, .asm_0d7c .asm_0d75 - ld a, [wd471] - bit 6, a + ld a, [wPikachuSpawnStateFlags] + bit BIT_PIKACHU_SPAWN_SURFING, a jr z, LoadSurfingPlayerSpriteGraphics .asm_0d7c ld b, BANK(SurfingPikachuSprite) diff --git a/ram/wram.asm b/ram/wram.asm index b8dcaf42..62ef1c44 100644 --- a/ram/wram.asm +++ b/ram/wram.asm @@ -2068,14 +2068,14 @@ ENDU wPikachuHappiness:: db wPikachuMood:: db -wd471:: db +wPikachuSpawnStateFlags:: db wd472:: db ds 1 wd474:: db ds 4 wd479:: db ds 24 -wd492:: db +wPikachuMapScriptFlags:: db ds 1 wSurfingMinigameHiScore:: dw ; little-endian BCD ds 1 diff --git a/scripts/BillsHouse.asm b/scripts/BillsHouse.asm index 8582e397..53a2a333 100644 --- a/scripts/BillsHouse.asm +++ b/scripts/BillsHouse.asm @@ -1,5 +1,5 @@ BillsHouse_Script: - call BillsHouseScript_1e09e + call BillsHouse_CheckMetBill call EnableAutoTextBoxDrawing ld a, [wBillsHouseCurScript] ld hl, BillsHouse_ScriptPointers @@ -19,33 +19,33 @@ BillsHouse_ScriptPointers: dw_const BillsHouseScript8, SCRIPT_BILLSHOUSE_SCRIPT8 dw_const BillsHouseScript9, SCRIPT_BILLSHOUSE_SCRIPT9 -BillsHouseScript_1e09e: - ld hl, wd492 - bit 7, [hl] - set 7, [hl] +BillsHouse_CheckMetBill: + ld hl, wPikachuMapScriptFlags + bit BIT_PIKACHU_MAP_SCRIPT_ACTIVE, [hl] + set BIT_PIKACHU_MAP_SCRIPT_ACTIVE, [hl] ret nz CheckEventHL EVENT_MET_BILL_2 - jr z, .asm_1e0af - jr .asm_1e0b3 + jr z, .notMetBill + jr .metBill -.asm_1e0af +.notMetBill ld a, SCRIPT_BILLSHOUSE_SCRIPT0 - jr .asm_1e0b5 + jr .setScript -.asm_1e0b3 +.metBill ld a, SCRIPT_BILLSHOUSE_SCRIPT9 -.asm_1e0b5 +.setScript ld [wBillsHouseCurScript], a ret BillsHouseScript0: - ld a, [wd471] - bit 7, a - jr z, .asm_1e0d2 + ld a, [wPikachuSpawnStateFlags] + bit BIT_PIKACHU_SPAWN_STARTER, a + jr z, .done callfar CheckPikachuStatusCondition - jr c, .asm_1e0d2 - callfar Func_f24d5 -.asm_1e0d2 + jr c, .done + callfar BillsHousePikachuConfused +.done xor a ld [wJoyIgnore], a ld a, SCRIPT_BILLSHOUSE_SCRIPT1 @@ -60,13 +60,13 @@ BillsHouseScript2: ld [wJoyIgnore], a ld a, [wSpritePlayerStateData1FacingDirection] and a ; cp SPRITE_FACING_DOWN - ld de, MovementData_1e79c + ld de, BillMovement_WalkToCellSeparator jr nz, .notDown call CheckPikachuFollowingPlayer - jr nz, .asm_1e0f8 - callfar Func_f250b -.asm_1e0f8 - ld de, MovementData_1e7a0 + jr nz, .pikachuNotFollowing + callfar BillsHousePikachuWatchPlayer +.pikachuNotFollowing + ld de, BillMovement_WalkAroundPlayer .notDown ld a, BILLSHOUSE_BILL_POKEMON ldh [hSpriteIndex], a @@ -75,14 +75,14 @@ BillsHouseScript2: ld [wBillsHouseCurScript], a ret -MovementData_1e79c: +BillMovement_WalkToCellSeparator: db NPC_MOVEMENT_UP db NPC_MOVEMENT_UP db NPC_MOVEMENT_UP db -1 ; end ; make Bill walk around the player -MovementData_1e7a0: +BillMovement_WalkAroundPlayer: db NPC_MOVEMENT_RIGHT db NPC_MOVEMENT_UP db NPC_MOVEMENT_UP @@ -98,16 +98,16 @@ BillsHouseScript3: ld [wToggleableObjectIndex], a predef HideObject call CheckPikachuFollowingPlayer - jr z, .asm_1e13e - ld hl, PikachuMovementData_1e14d + jr z, .pikachuNotFollowing + ld hl, PikachuMovement_EnterCellSeparatorDown ld a, [wSpritePlayerStateData1FacingDirection] and a ; cp SPRITE_FACING_DOWN - jr nz, .asm_1e133 - ld hl, PikachuMovementData_1e152 -.asm_1e133 + jr nz, .applyPikachuMovement + ld hl, PikachuMovement_EnterCellSeparatorNotDown +.applyPikachuMovement call ApplyPikachuMovementData callfar InitializePikachuTextID -.asm_1e13e +.pikachuNotFollowing xor a ld [wJoyIgnore], a SetEvent EVENT_BILL_SAID_USE_CELL_SEPARATOR @@ -115,22 +115,22 @@ BillsHouseScript3: ld [wBillsHouseCurScript], a ret -PikachuMovementData_1e14d: - db $00 - db $1e - db $1e - db $1e - db $3f +PikachuMovement_EnterCellSeparatorDown: + db PIKAMOVEMENT_DELAY + db PIKAMOVEMENT_STEP_UP + db PIKAMOVEMENT_STEP_UP + db PIKAMOVEMENT_STEP_UP + db PIKAMOVEMENT_END -PikachuMovementData_1e152: - db $00 - db $1e - db $1f - db $1e - db $1e - db $20 - db $36 - db $3f +PikachuMovement_EnterCellSeparatorNotDown: + db PIKAMOVEMENT_DELAY + db PIKAMOVEMENT_STEP_UP + db PIKAMOVEMENT_STEP_LEFT + db PIKAMOVEMENT_STEP_UP + db PIKAMOVEMENT_STEP_UP + db PIKAMOVEMENT_STEP_RIGHT + db PIKAMOVEMENT_LOOK_UP + db PIKAMOVEMENT_END BillsHouseScript4: CheckEvent EVENT_USED_CELL_SEPARATOR_ON_BILL @@ -158,17 +158,17 @@ BillsHouseScript5: predef ShowObject ld c, 8 call DelayFrames - ld hl, wd471 - bit 7, [hl] - jr z, .asm_1e1c6 + ld hl, wPikachuSpawnStateFlags + bit BIT_PIKACHU_SPAWN_STARTER, [hl] + jr z, .pikachuNotFollowing call CheckPikachuFollowingPlayer - jr z, .asm_1e1c6 + jr z, .pikachuNotFollowing ld a, BILLSHOUSE_BILL1 ldh [hSpriteIndex], a ld a, SPRITE_FACING_DOWN ldh [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay - ld hl, PikachuMovementData_1e1a9 + ld hl, PikachuMovement_ExitCellSeparator call ApplyPikachuMovementData ld a, $f ld [wEmotionBubbleSpriteIndex], a @@ -176,7 +176,7 @@ BillsHouseScript5: ld [wWhichEmotionBubble], a predef EmotionBubble callfar InitializePikachuTextID -.asm_1e1c6 +.pikachuNotFollowing ld a, BILLSHOUSE_BILL1 ldh [hSpriteIndex], a ld de, .BillExitMachineMovement @@ -193,10 +193,10 @@ BillsHouseScript5: db NPC_MOVEMENT_DOWN db -1 ; end -PikachuMovementData_1e1a9: - db $00 - db $37 - db $3f +PikachuMovement_ExitCellSeparator: + db PIKAMOVEMENT_DELAY + db PIKAMOVEMENT_LOOK_LEFT + db PIKAMOVEMENT_END BillsHouseScript6: ld a, [wStatusFlags5] diff --git a/scripts/BillsHouse_2.asm b/scripts/BillsHouse_2.asm index 4a897d87..b8c7997d 100644 --- a/scripts/BillsHouse_2.asm +++ b/scripts/BillsHouse_2.asm @@ -81,12 +81,12 @@ BillsHousePrintBillCheckOutMyRarePokemonText:: text_far _BillsHouseBillCheckOutMyRarePokemonText text_end -Func_f24ae:: +BillsHouse_CheckPikachuEmotion:: ld a, [wCurMap] cp BILLS_HOUSE - jr nz, .asm_f24d2 + jr nz, .noEmotion call CheckPikachuFollowingPlayer - jr z, .asm_f24d2 + jr z, .noEmotion ld a, [wBillsHouseCurScript] cp SCRIPT_BILLSHOUSE_SCRIPT5 ldpikaemotion e, PikachuEmotion27 @@ -100,18 +100,18 @@ Func_f24ae:: ldpikaemotion e, PikachuEmotion31 ret -.asm_f24d2 +.noEmotion ld e, $ff ret -Func_f24d5:: +BillsHousePikachuConfused:: ld a, PAD_BUTTONS | PAD_CTRL_PAD ld [wJoyIgnore], a xor a ld [wPlayerMovingDirection], a call UpdateSprites call UpdateSprites - ld hl, Data_f2505 + ld hl, PikachuMovement_Confused call ApplyPikachuMovementData ld a, $f ; pikachu ld [wEmotionBubbleSpriteIndex], a @@ -122,35 +122,35 @@ Func_f24d5:: callfar InitializePikachuTextID ret -Data_f2505: - db $00 - db $20 - db $20 - db $20 - db $1e - db $3f +PikachuMovement_Confused: + db PIKAMOVEMENT_DELAY + db PIKAMOVEMENT_STEP_RIGHT + db PIKAMOVEMENT_STEP_RIGHT + db PIKAMOVEMENT_STEP_RIGHT + db PIKAMOVEMENT_STEP_UP + db PIKAMOVEMENT_END -Func_f250b:: - ld hl, Data_f251c +BillsHousePikachuWatchPlayer:: + ld hl, PikachuMovement_WatchPlayer1 ld b, SPRITE_FACING_UP call TryApplyPikachuMovementData - ld hl, Data_f2521 + ld hl, PikachuMovement_WatchPlayer2 ld b, SPRITE_FACING_RIGHT call TryApplyPikachuMovementData ret -Data_f251c: - db $00 - db $1f - db $1d - db $38 - db $3f +PikachuMovement_WatchPlayer1: + db PIKAMOVEMENT_DELAY + db PIKAMOVEMENT_STEP_LEFT + db PIKAMOVEMENT_STEP_DOWN + db PIKAMOVEMENT_LOOK_RIGHT + db PIKAMOVEMENT_END -Data_f2521: - db $00 - db $1e - db $1f - db $1f - db $1d - db $38 - db $3f +PikachuMovement_WatchPlayer2: + db PIKAMOVEMENT_DELAY + db PIKAMOVEMENT_STEP_UP + db PIKAMOVEMENT_STEP_LEFT + db PIKAMOVEMENT_STEP_LEFT + db PIKAMOVEMENT_STEP_DOWN + db PIKAMOVEMENT_LOOK_RIGHT + db PIKAMOVEMENT_END diff --git a/scripts/CinnabarGym.asm b/scripts/CinnabarGym.asm index fd3ceda1..3cce302c 100644 --- a/scripts/CinnabarGym.asm +++ b/scripts/CinnabarGym.asm @@ -104,8 +104,8 @@ PikachuMovementData_74f9e: db $3f CinnabarGymScript_74fa3: - ld a, [wd471] - bit 7, a + ld a, [wPikachuSpawnStateFlags] + bit BIT_PIKACHU_SPAWN_STARTER, a ret z push hl push bc diff --git a/scripts/MtMoonB2F_2.asm b/scripts/MtMoonB2F_2.asm index c2515abd..22cd0df5 100644 --- a/scripts/MtMoonB2F_2.asm +++ b/scripts/MtMoonB2F_2.asm @@ -1,6 +1,6 @@ MtMoonB2FScript_ApplyPikachuMovementData: - ld a, [wd471] - bit 7, a + ld a, [wPikachuSpawnStateFlags] + bit BIT_PIKACHU_SPAWN_STARTER, a ret z ld a, [wWalkBikeSurfState] and a diff --git a/scripts/Museum2F.asm b/scripts/Museum2F.asm index 6a0a15a4..e0c45483 100644 --- a/scripts/Museum2F.asm +++ b/scripts/Museum2F.asm @@ -30,8 +30,8 @@ Museum2FBrunetteGirlText: Museum2FHikerText: text_asm - ld a, [wd471] - bit 7, a + ld a, [wPikachuSpawnStateFlags] + bit BIT_PIKACHU_SPAWN_STARTER, a jr nz, .asm_5c1f6 ld hl, Museum2FText_5c20e call PrintText diff --git a/scripts/PewterCity.asm b/scripts/PewterCity.asm index 4d4cdb1a..9533f79e 100644 --- a/scripts/PewterCity.asm +++ b/scripts/PewterCity.asm @@ -1,7 +1,7 @@ PewterCity_Script: call EnableAutoTextBoxDrawing - ld hl, wd492 - res 7, [hl] + ld hl, wPikachuMapScriptFlags + res BIT_PIKACHU_MAP_SCRIPT_ACTIVE, [hl] ld hl, PewterCity_ScriptPointers ld a, [wPewterCityCurScript] call CallFunctionInTable diff --git a/scripts/PewterGym.asm b/scripts/PewterGym.asm index dcda6e16..4d4a4a0e 100644 --- a/scripts/PewterGym.asm +++ b/scripts/PewterGym.asm @@ -189,8 +189,8 @@ PewterGymGuideText: ld a, [wCurrentMenuItem] and a jr nz, .PewterGymGuideBeginAdviceText - ld a, [wd471] - bit 7, a + ld a, [wPikachuSpawnStateFlags] + bit BIT_PIKACHU_SPAWN_STARTER, a jp nz, .asm_5c3fa ld hl, PewterGymGuideBeginAdviceText call PrintText diff --git a/scripts/PewterPokecenter.asm b/scripts/PewterPokecenter.asm index ae5c6349..877a9383 100644 --- a/scripts/PewterPokecenter.asm +++ b/scripts/PewterPokecenter.asm @@ -1,6 +1,6 @@ PewterPokecenter_Script: - ld hl, wd492 - set 7, [hl] + ld hl, wPikachuMapScriptFlags + set BIT_PIKACHU_MAP_SCRIPT_ACTIVE, [hl] call Serial_TryEstablishingExternallyClockedConnection call EnableAutoTextBoxDrawing ret diff --git a/scripts/PewterPokecenter_2.asm b/scripts/PewterPokecenter_2.asm index 2aeb23f7..4495f1ab 100644 --- a/scripts/PewterPokecenter_2.asm +++ b/scripts/PewterPokecenter_2.asm @@ -59,8 +59,8 @@ PewterJigglypuff:: ld c, 48 call DelayFrames call PlayDefaultMusic - ld a, [wd471] - bit 7, a + ld a, [wPikachuSpawnStateFlags] + bit BIT_PIKACHU_SPAWN_STARTER, a ret z callfar CheckPikachuStatusCondition ret c diff --git a/scripts/PokemonFanClub.asm b/scripts/PokemonFanClub.asm index 4c8acd39..5bd881af 100644 --- a/scripts/PokemonFanClub.asm +++ b/scripts/PokemonFanClub.asm @@ -11,19 +11,19 @@ PokemonFanClub_ScriptPointers: dw_const PokemonFanClubScript1, SCRIPT_POKEMONFANCLUB_SCRIPT1 PokemonFanClubScript0: - ld hl, wd492 - bit 7, [hl] + ld hl, wPikachuMapScriptFlags + bit BIT_PIKACHU_MAP_SCRIPT_ACTIVE, [hl] call z, PokemonFanClubScript_59a44 - ld hl, wd492 - set 7, [hl] + ld hl, wPikachuMapScriptFlags + set BIT_PIKACHU_MAP_SCRIPT_ACTIVE, [hl] ret PokemonFanClubScript1: - ld hl, wd492 - bit 7, [hl] + ld hl, wPikachuMapScriptFlags + bit BIT_PIKACHU_MAP_SCRIPT_ACTIVE, [hl] call z, PokemonFanClubScript_59a39 - ld hl, wd492 - set 7, [hl] + ld hl, wPikachuMapScriptFlags + set BIT_PIKACHU_MAP_SCRIPT_ACTIVE, [hl] ret PokemonFanClubScript_59a39: @@ -34,8 +34,8 @@ PokemonFanClubScript_59a39: ret PokemonFanClubScript_59a44: - ld a, [wd471] - bit 7, a + ld a, [wPikachuSpawnStateFlags] + bit BIT_PIKACHU_SPAWN_STARTER, a ret z callfar CheckPikachuStatusCondition ret c diff --git a/scripts/Route25.asm b/scripts/Route25.asm index 23faa396..41134ee8 100644 --- a/scripts/Route25.asm +++ b/scripts/Route25.asm @@ -9,11 +9,11 @@ Route25_Script: ret Route25ToggleBillsScript: - ld hl, wd492 - res 2, [hl] - res 3, [hl] - res 4, [hl] - res 7, [hl] + ld hl, wPikachuMapScriptFlags + res BIT_PIKACHU_MAP_2, [hl] + res BIT_PIKACHU_MAP_3, [hl] + res BIT_PIKACHU_MAP_4, [hl] + res BIT_PIKACHU_MAP_SCRIPT_ACTIVE, [hl] xor a ld [wBillsHouseCurScript], a ld hl, wCurrentMapScriptFlags diff --git a/scripts/SummerBeachHouse.asm b/scripts/SummerBeachHouse.asm index 3842b45c..3cac9fba 100644 --- a/scripts/SummerBeachHouse.asm +++ b/scripts/SummerBeachHouse.asm @@ -13,12 +13,12 @@ SummerBeachHouse_TextPointers: SummerBeachHouseSurfinDudeText: text_asm - ld a, [wd471] + ld a, [wPikachuSpawnStateFlags] vc_patch Bypass_need_Pikachu_with_Surf_for_minigame IF DEF (_YELLOW_VC) - bit 7, a + bit BIT_PIKACHU_SPAWN_STARTER, a ELSE - bit 6, a + bit BIT_PIKACHU_SPAWN_SURFING, a ENDC vc_patch_end jr nz, .next @@ -26,9 +26,9 @@ ENDC call PrintText jr .done .next - ld hl, wd492 - bit 0, [hl] - set 0, [hl] + ld hl, wPikachuMapScriptFlags + bit BIT_PIKACHU_MAP_PAUSE_IGT, [hl] + set BIT_PIKACHU_MAP_PAUSE_IGT, [hl] jr nz, .next2 ld hl, .SurfinDudeText1 jr .next3 @@ -43,8 +43,8 @@ ENDC ld a, 1 ld [wDoNotWaitForButtonPressAfterDisplayingText], a farcall SurfingPikachuMinigame - ld hl, wd492 - set 1, [hl] + ld hl, wPikachuMapScriptFlags + set BIT_PIKACHU_MAP_SURF_SELECT, [hl] jr .done .asm_f226b ld hl, .SurfinDudeText2 @@ -81,8 +81,8 @@ SummerBeachHousePikachuText: SummerBeachHousePoster1Text: text_asm ld hl, .SummerBeachHousePoster1Text2 - ld a, [wd471] - bit 6, a + ld a, [wPikachuSpawnStateFlags] + bit BIT_PIKACHU_SPAWN_SURFING, a jr z, .next ld hl, .SummerBeachHousePoster1Text1 .next @@ -99,8 +99,8 @@ SummerBeachHousePoster1Text: SummerBeachHousePoster2Text: text_asm ld hl, .SummerBeachHousePoster2Text2 - ld a, [wd471] - bit 6, a + ld a, [wPikachuSpawnStateFlags] + bit BIT_PIKACHU_SPAWN_SURFING, a jr z, .next ld hl, .SummerBeachHousePoster2Text1 .next @@ -117,8 +117,8 @@ SummerBeachHousePoster2Text: SummerBeachHousePoster3Text: text_asm ld hl, .SummerBeachHousePoster3Text2 - ld a, [wd471] - bit 6, a + ld a, [wPikachuSpawnStateFlags] + bit BIT_PIKACHU_SPAWN_SURFING, a jr z, .next ld hl, .SummerBeachHousePoster3Text1 .next @@ -136,26 +136,26 @@ SummerBeachHousePrinterText: text_asm ld a, 1 ld [wDoNotWaitForButtonPressAfterDisplayingText], a - ld a, [wd471] + ld a, [wPikachuSpawnStateFlags] vc_patch Bypass_need_Pikachu_with_Surf_for_high_score IF DEF(_YELLOW_VC) - bit 7, a + bit BIT_PIKACHU_SPAWN_STARTER, a ELSE - bit 6, a + bit BIT_PIKACHU_SPAWN_SURFING, a ENDC vc_patch_end jr z, .asm_f2369 - ld hl, wd492 - bit 1, [hl] + ld hl, wPikachuMapScriptFlags + bit BIT_PIKACHU_MAP_SURF_SELECT, [hl] jr z, .next2 ld a, 0 ld [wDoNotWaitForButtonPressAfterDisplayingText], a .next2 ld hl, .SummerBeachHousePrinterText2 call PrintText - ld a, [wd492] - bit 1, a + ld a, [wPikachuMapScriptFlags] + bit BIT_PIKACHU_MAP_SURF_SELECT, a jr z, .asm_f236f ld a, 1 diff --git a/scripts/VermilionCity.asm b/scripts/VermilionCity.asm index 1d9d790d..68dfd617 100644 --- a/scripts/VermilionCity.asm +++ b/scripts/VermilionCity.asm @@ -1,7 +1,7 @@ VermilionCity_Script: call EnableAutoTextBoxDrawing - ld hl, wd492 - res 7, [hl] + ld hl, wPikachuMapScriptFlags + res BIT_PIKACHU_MAP_SCRIPT_ACTIVE, [hl] ld hl, wCurrentMapScriptFlags bit BIT_CUR_MAP_LOADED_2, [hl] res BIT_CUR_MAP_LOADED_2, [hl] |
