From 4e0644e54836097dddc134c38b2d50cfb536c142 Mon Sep 17 00:00:00 2001 From: FIEVEZ Yoann Date: Fri, 19 Jun 2026 19:19:24 +0200 Subject: [PATCH] Refactor BillsHouse and Pikachu movement - Rename wd471 to wPikachuSpawnStateFlags globally - Rename wd492 to wPikachuMapScriptFlags globally - Introduce pikachu_movement_constants.asm - Refactor BillsHouse scripts and Pikachu/Bill movement data --- constants/pikachu_movement_constants.asm | 11 +++ engine/events/poison.asm | 2 +- engine/events/try_pikachu_movement.asm | 2 +- engine/minigame/surfing_pikachu.asm | 2 +- engine/pikachu/pikachu_emotions.asm | 4 +- engine/pikachu/pikachu_follow.asm | 4 +- home/map_objects.asm | 16 ++-- home/overworld.asm | 2 +- includes.asm | 1 + ram/wram.asm | 4 +- scripts/BillsHouse.asm | 102 +++++++++++------------ scripts/BillsHouse_2.asm | 60 ++++++------- scripts/CinnabarGym.asm | 2 +- scripts/MtMoonB2F_2.asm | 2 +- scripts/Museum2F.asm | 2 +- scripts/PewterCity.asm | 2 +- scripts/PewterGym.asm | 2 +- scripts/PewterPokecenter.asm | 2 +- scripts/PewterPokecenter_2.asm | 2 +- scripts/PokemonFanClub.asm | 10 +-- scripts/Route25.asm | 2 +- scripts/SummerBeachHouse.asm | 18 ++-- scripts/VermilionCity.asm | 2 +- tools/unnamed.py | 0 24 files changed, 134 insertions(+), 122 deletions(-) create mode 100644 constants/pikachu_movement_constants.asm mode change 100755 => 100644 tools/unnamed.py diff --git a/constants/pikachu_movement_constants.asm b/constants/pikachu_movement_constants.asm new file mode 100644 index 00000000..25dca34f --- /dev/null +++ b/constants/pikachu_movement_constants.asm @@ -0,0 +1,11 @@ +; 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..000babe5 100644 --- a/engine/events/poison.asm +++ b/engine/events/poison.asm @@ -3,7 +3,7 @@ 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] + ld a, [wPikachuMapScriptFlags] bit 7, a jp nz, .noBlackOut ld a, [wStatusFlags4] diff --git a/engine/events/try_pikachu_movement.asm b/engine/events/try_pikachu_movement.asm index 9dd25008..871429c2 100644 --- a/engine/events/try_pikachu_movement.asm +++ b/engine/events/try_pikachu_movement.asm @@ -1,5 +1,5 @@ TryApplyPikachuMovementData:: - ld a, [wd471] + ld a, [wPikachuSpawnStateFlags] bit 7, a ret z ld a, [wWalkBikeSurfState] diff --git a/engine/minigame/surfing_pikachu.asm b/engine/minigame/surfing_pikachu.asm index 27e91ba1..5e813d1c 100644 --- a/engine/minigame/surfing_pikachu.asm +++ b/engine/minigame/surfing_pikachu.asm @@ -85,7 +85,7 @@ SurfingPikachuLoop: ret SurfingPikachu_CheckPressedSelect: - ld hl, wd492 + ld hl, wPikachuMapScriptFlags bit 1, [hl] ret z ldh a, [hJoyPressed] diff --git a/engine/pikachu/pikachu_emotions.asm b/engine/pikachu/pikachu_emotions.asm index 787b4f94..4fd45d54 100644 --- a/engine/pikachu/pikachu_emotions.asm +++ b/engine/pikachu/pikachu_emotions.asm @@ -304,7 +304,7 @@ MapSpecificPikachuExpression: ld a, [wCurMap] cp POKEMON_FAN_CLUB jr nz, .notFanClub - ld hl, wd492 + ld hl, wPikachuMapScriptFlags bit 7, [hl] ldpikaemotion a, PikachuEmotion29 jr z, .play_emotion @@ -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..049d2543 100644 --- a/engine/pikachu/pikachu_follow.asm +++ b/engine/pikachu/pikachu_follow.asm @@ -140,7 +140,7 @@ CalculatePikachuPlacementCoords:: inc hl ld [hl], $fe push hl - ld hl, wd471 + ld hl, wPikachuSpawnStateFlags set 5, [hl] pop hl ret @@ -1278,7 +1278,7 @@ Func_fcc23: ld a, [wPikachuOverworldStateFlags] bit 7, a jr nz, .asm_fcc40 - ld a, [wd471] + ld a, [wPikachuSpawnStateFlags] bit 7, a jr z, .asm_fcc40 ld a, [wWalkBikeSurfState] diff --git a/home/map_objects.asm b/home/map_objects.asm index 3b1a1f08..ababd49d 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] + ld a, [wPikachuSpawnStateFlags] and $3f - ld [wd471], a + 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] + ld a, [wPikachuSpawnStateFlags] set 6, a - ld [wd471], a + ld [wPikachuSpawnStateFlags], a .noSurf pop hl .notPikachu @@ -118,9 +118,9 @@ IsSurfingPikachuInParty:: pop bc pop hl ret nc - ld a, [wd471] + ld a, [wPikachuSpawnStateFlags] set 7, a - ld [wd471], a + ld [wPikachuSpawnStateFlags], a ret DisplayPokedex:: diff --git a/home/overworld.asm b/home/overworld.asm index 6fafe717..221394e7 100644 --- a/home/overworld.asm +++ b/home/overworld.asm @@ -1752,7 +1752,7 @@ LoadSurfingPlayerSpriteGraphics2:: dec a jr z, .asm_0d7c .asm_0d75 - ld a, [wd471] + ld a, [wPikachuSpawnStateFlags] bit 6, a jr z, LoadSurfingPlayerSpriteGraphics .asm_0d7c diff --git a/includes.asm b/includes.asm index d677df59..3c8d9f61 100644 --- a/includes.asm +++ b/includes.asm @@ -53,6 +53,7 @@ INCLUDE "constants/text_constants.asm" INCLUDE "constants/menu_constants.asm" INCLUDE "constants/sprite_anim_constants.asm" INCLUDE "constants/pikachu_emotion_constants.asm" +INCLUDE "constants/pikachu_movement_constants.asm" IF DEF(_YELLOW_VC) INCLUDE "vc/pokeyellow.constants.asm" 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..05380f0b 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 +BillsHouse_CheckMetBill: + ld hl, wPikachuMapScriptFlags bit 7, [hl] set 7, [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] + ld a, [wPikachuSpawnStateFlags] bit 7, a - jr z, .asm_1e0d2 + 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 + ld hl, wPikachuSpawnStateFlags bit 7, [hl] - jr z, .asm_1e1c6 + 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..602e3213 100644 --- a/scripts/CinnabarGym.asm +++ b/scripts/CinnabarGym.asm @@ -104,7 +104,7 @@ PikachuMovementData_74f9e: db $3f CinnabarGymScript_74fa3: - ld a, [wd471] + ld a, [wPikachuSpawnStateFlags] bit 7, a ret z push hl diff --git a/scripts/MtMoonB2F_2.asm b/scripts/MtMoonB2F_2.asm index c2515abd..621241ca 100644 --- a/scripts/MtMoonB2F_2.asm +++ b/scripts/MtMoonB2F_2.asm @@ -1,5 +1,5 @@ MtMoonB2FScript_ApplyPikachuMovementData: - ld a, [wd471] + ld a, [wPikachuSpawnStateFlags] bit 7, a ret z ld a, [wWalkBikeSurfState] diff --git a/scripts/Museum2F.asm b/scripts/Museum2F.asm index 6a0a15a4..1d932860 100644 --- a/scripts/Museum2F.asm +++ b/scripts/Museum2F.asm @@ -30,7 +30,7 @@ Museum2FBrunetteGirlText: Museum2FHikerText: text_asm - ld a, [wd471] + ld a, [wPikachuSpawnStateFlags] bit 7, a jr nz, .asm_5c1f6 ld hl, Museum2FText_5c20e diff --git a/scripts/PewterCity.asm b/scripts/PewterCity.asm index 4d4cdb1a..aedea7f9 100644 --- a/scripts/PewterCity.asm +++ b/scripts/PewterCity.asm @@ -1,6 +1,6 @@ PewterCity_Script: call EnableAutoTextBoxDrawing - ld hl, wd492 + ld hl, wPikachuMapScriptFlags res 7, [hl] ld hl, PewterCity_ScriptPointers ld a, [wPewterCityCurScript] diff --git a/scripts/PewterGym.asm b/scripts/PewterGym.asm index dcda6e16..739a4f45 100644 --- a/scripts/PewterGym.asm +++ b/scripts/PewterGym.asm @@ -189,7 +189,7 @@ PewterGymGuideText: ld a, [wCurrentMenuItem] and a jr nz, .PewterGymGuideBeginAdviceText - ld a, [wd471] + ld a, [wPikachuSpawnStateFlags] bit 7, a jp nz, .asm_5c3fa ld hl, PewterGymGuideBeginAdviceText diff --git a/scripts/PewterPokecenter.asm b/scripts/PewterPokecenter.asm index ae5c6349..81073cfa 100644 --- a/scripts/PewterPokecenter.asm +++ b/scripts/PewterPokecenter.asm @@ -1,5 +1,5 @@ PewterPokecenter_Script: - ld hl, wd492 + ld hl, wPikachuMapScriptFlags set 7, [hl] call Serial_TryEstablishingExternallyClockedConnection call EnableAutoTextBoxDrawing diff --git a/scripts/PewterPokecenter_2.asm b/scripts/PewterPokecenter_2.asm index 2aeb23f7..9861e5d0 100644 --- a/scripts/PewterPokecenter_2.asm +++ b/scripts/PewterPokecenter_2.asm @@ -59,7 +59,7 @@ PewterJigglypuff:: ld c, 48 call DelayFrames call PlayDefaultMusic - ld a, [wd471] + ld a, [wPikachuSpawnStateFlags] bit 7, a ret z callfar CheckPikachuStatusCondition diff --git a/scripts/PokemonFanClub.asm b/scripts/PokemonFanClub.asm index 4c8acd39..20ed5463 100644 --- a/scripts/PokemonFanClub.asm +++ b/scripts/PokemonFanClub.asm @@ -11,18 +11,18 @@ PokemonFanClub_ScriptPointers: dw_const PokemonFanClubScript1, SCRIPT_POKEMONFANCLUB_SCRIPT1 PokemonFanClubScript0: - ld hl, wd492 + ld hl, wPikachuMapScriptFlags bit 7, [hl] call z, PokemonFanClubScript_59a44 - ld hl, wd492 + ld hl, wPikachuMapScriptFlags set 7, [hl] ret PokemonFanClubScript1: - ld hl, wd492 + ld hl, wPikachuMapScriptFlags bit 7, [hl] call z, PokemonFanClubScript_59a39 - ld hl, wd492 + ld hl, wPikachuMapScriptFlags set 7, [hl] ret @@ -34,7 +34,7 @@ PokemonFanClubScript_59a39: ret PokemonFanClubScript_59a44: - ld a, [wd471] + ld a, [wPikachuSpawnStateFlags] bit 7, a ret z callfar CheckPikachuStatusCondition diff --git a/scripts/Route25.asm b/scripts/Route25.asm index 23faa396..53f5e635 100644 --- a/scripts/Route25.asm +++ b/scripts/Route25.asm @@ -9,7 +9,7 @@ Route25_Script: ret Route25ToggleBillsScript: - ld hl, wd492 + ld hl, wPikachuMapScriptFlags res 2, [hl] res 3, [hl] res 4, [hl] diff --git a/scripts/SummerBeachHouse.asm b/scripts/SummerBeachHouse.asm index 3842b45c..b5fc9a4f 100644 --- a/scripts/SummerBeachHouse.asm +++ b/scripts/SummerBeachHouse.asm @@ -13,7 +13,7 @@ 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 @@ -26,7 +26,7 @@ ENDC call PrintText jr .done .next - ld hl, wd492 + ld hl, wPikachuMapScriptFlags bit 0, [hl] set 0, [hl] jr nz, .next2 @@ -43,7 +43,7 @@ ENDC ld a, 1 ld [wDoNotWaitForButtonPressAfterDisplayingText], a farcall SurfingPikachuMinigame - ld hl, wd492 + ld hl, wPikachuMapScriptFlags set 1, [hl] jr .done .asm_f226b @@ -81,7 +81,7 @@ SummerBeachHousePikachuText: SummerBeachHousePoster1Text: text_asm ld hl, .SummerBeachHousePoster1Text2 - ld a, [wd471] + ld a, [wPikachuSpawnStateFlags] bit 6, a jr z, .next ld hl, .SummerBeachHousePoster1Text1 @@ -99,7 +99,7 @@ SummerBeachHousePoster1Text: SummerBeachHousePoster2Text: text_asm ld hl, .SummerBeachHousePoster2Text2 - ld a, [wd471] + ld a, [wPikachuSpawnStateFlags] bit 6, a jr z, .next ld hl, .SummerBeachHousePoster2Text1 @@ -117,7 +117,7 @@ SummerBeachHousePoster2Text: SummerBeachHousePoster3Text: text_asm ld hl, .SummerBeachHousePoster3Text2 - ld a, [wd471] + ld a, [wPikachuSpawnStateFlags] bit 6, a jr z, .next ld hl, .SummerBeachHousePoster3Text1 @@ -136,7 +136,7 @@ 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 @@ -146,7 +146,7 @@ ENDC vc_patch_end jr z, .asm_f2369 - ld hl, wd492 + ld hl, wPikachuMapScriptFlags bit 1, [hl] jr z, .next2 ld a, 0 @@ -154,7 +154,7 @@ ENDC .next2 ld hl, .SummerBeachHousePrinterText2 call PrintText - ld a, [wd492] + ld a, [wPikachuMapScriptFlags] bit 1, a jr z, .asm_f236f diff --git a/scripts/VermilionCity.asm b/scripts/VermilionCity.asm index 1d9d790d..4190cc56 100644 --- a/scripts/VermilionCity.asm +++ b/scripts/VermilionCity.asm @@ -1,6 +1,6 @@ VermilionCity_Script: call EnableAutoTextBoxDrawing - ld hl, wd492 + ld hl, wPikachuMapScriptFlags res 7, [hl] ld hl, wCurrentMapScriptFlags bit BIT_CUR_MAP_LOADED_2, [hl] diff --git a/tools/unnamed.py b/tools/unnamed.py old mode 100755 new mode 100644