diff options
| author | Ash Ketchum <no-reply@sl0p.foo> | 2026-07-15 10:47:08 +0200 |
|---|---|---|
| committer | Ash Ketchum <no-reply@sl0p.foo> | 2026-07-15 10:47:08 +0200 |
| commit | c7013cfa7ad99444163ff58512b5dff25bc85713 (patch) | |
| tree | 6c3a01918faffb06a140c5c29d2bec08923ca8b2 | |
| parent | fix(menu): push ROM bank before CloseTextDisplay (was corrupting collision) (diff) | |
| download | pokeyellow-c7013cfa7ad99444163ff58512b5dff25bc85713.tar.gz pokeyellow-c7013cfa7ad99444163ff58512b5dff25bc85713.tar.xz pokeyellow-c7013cfa7ad99444163ff58512b5dff25bc85713.zip | |
fix(nowild): use wUnusedFlag (0xCC5B) instead of wc5d8 for the toggle
wc5d8 looked unused but the game writes it via computed addresses (observed it
change 56->44->35 while walking/warping), so the NOWILD flag got clobbered and
encounters still happened. wUnusedFlag is a genuine unused WRAM0 byte (verified
stable at 0 through walking + warping, not in the save block so it defaults off
each boot). NOWILD flag now persists reliably.
| -rw-r--r-- | engine/battle/wild_encounters.asm | 2 | ||||
| -rw-r--r-- | engine/slop_menu.asm | 6 | ||||
| -rw-r--r-- | ram/wram.asm | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/engine/battle/wild_encounters.asm b/engine/battle/wild_encounters.asm index 6e29dd4c..da0097c9 100644 --- a/engine/battle/wild_encounters.asm +++ b/engine/battle/wild_encounters.asm @@ -1,7 +1,7 @@ ; try to initiate a wild pokemon encounter ; returns success in Z TryDoWildEncounter: - ld a, [wSlopNoWild] ; SL0P no-wild-encounters toggle + ld a, [wUnusedFlag] ; SL0P no-wild-encounters toggle and a jr nz, .CantEncounter ld a, [wNPCMovementScriptPointerTableNum] diff --git a/engine/slop_menu.asm b/engine/slop_menu.asm index 7cb779a2..38c5bdcf 100644 --- a/engine/slop_menu.asm +++ b/engine/slop_menu.asm @@ -33,7 +33,7 @@ SlopMenu:: ld de, SlopMenuText call PlaceString ; ON marker for the NOWILD toggle (item 10 -> row 13) - ld a, [wSlopNoWild] + ld a, [wUnusedFlag] and a jr z, .nowildOff hlcoord 13, 13 @@ -394,9 +394,9 @@ SlopMaxCoins: ; NOWILD toggle: no wild encounters (hooked in TryDoWildEncounter) SlopToggleNoWild: - ld a, [wSlopNoWild] + ld a, [wUnusedFlag] xor $01 - ld [wSlopNoWild], a + ld [wUnusedFlag], a and a ret diff --git a/ram/wram.asm b/ram/wram.asm index b753e163..62ef1c44 100644 --- a/ram/wram.asm +++ b/ram/wram.asm @@ -224,7 +224,7 @@ wc5d2:: db wSurfingMinigameWaveFunctionNumber:: dw wc5d5:: db wSurfingMinigamePikachuHP:: dw ; little-endian BCD -wSlopNoWild:: db ; SL0P no-wild-encounters toggle (was unused wc5d8) +wc5d8:: db ; unused? ; number of consecutive tricks wSurfingMinigameRadnessMeter:: db wSurfingMinigameRadnessScore:: dw ; little-endian BCD |
