From 3177ccc395224fd0216b76b8ee1a59ce68bfb06b Mon Sep 17 00:00:00 2001 From: Kevin Cathcart Date: Thu, 5 Jul 2018 19:37:55 -0400 Subject: [PATCH] Fix For PoD accidentally arming EG. --- bugfixes.asm | 10 ++++++++++ events.asm | 11 +++++++++++ hooks.asm | 7 +++++++ tables.asm | 6 ++++-- 4 files changed, 32 insertions(+), 2 deletions(-) diff --git a/bugfixes.asm b/bugfixes.asm index 28551e6..04b6697 100644 --- a/bugfixes.asm +++ b/bugfixes.asm @@ -115,3 +115,13 @@ FixFrogSmith: .done RTS ;-------------------------------------------------------------------------------- + +;-------------------------------------------------------------------------------- +;Fix for PoD causing accidental Exploration Glitch +PodEGFix: + LDA Bugfix_PodEG : BNE .done + LDA $040C : CMP.b #$0C : BNE .done ;check if we are in PoD + STZ $047A ;disarm exploration glitch + .done +RTL +;-------------------------------------------------------------------------------- diff --git a/events.asm b/events.asm index d7fc59d..b28879a 100644 --- a/events.asm +++ b/events.asm @@ -27,6 +27,11 @@ OnPlayerDead: RTL ;-------------------------------------------------------------------------------- OnDungeonExit: + PHA : PHP + SEP #$20 ; set 8-bit accumulator + JSL.l PodEGFix + PLP : PLA + STA $040C : STZ $04AC ; thing we wrote over PHA : PHP @@ -36,6 +41,12 @@ OnDungeonExit: PLP : PLA RTL ;-------------------------------------------------------------------------------- +OnQuit: + JSL.l PodEGFix + + LDA.b #$10 : STA $1C ; thing we wrote over +RTL +;-------------------------------------------------------------------------------- OnUncleItemGet: JSL Link_ReceiveItem diff --git a/hooks.asm b/hooks.asm index fd5b6e0..fe3e4eb 100644 --- a/hooks.asm +++ b/hooks.asm @@ -65,6 +65,13 @@ org $02E21B ; <- 1621B - Bank02.asm : 11211 (STA $040C) JSL.l OnDungeonExit : NOP #2 ;-------------------------------------------------------------------------------- +;================================================================================ +; Quit Hook (for both types of save and quit) +;-------------------------------------------------------------------------------- +org $09F60B ; <- 4F60B - module_death.asm : 530 (LDA.b #$10 : STA $1C) +JSL.l OnQuit +;-------------------------------------------------------------------------------- + ;================================================================================ ; Duck Map Load Hook ;-------------------------------------------------------------------------------- diff --git a/tables.asm b/tables.asm index 28fcae0..847c489 100644 --- a/tables.asm +++ b/tables.asm @@ -372,7 +372,7 @@ db #$47 ; #$47 - 20 Rupees (default) ;-------------------------------------------------------------------------------- ; 0x180098 - 0x18009F (unused) ;-------------------------------------------------------------------------------- -org $3080A0 ; PC 0x1800A0 - 0x1800A3 +org $3080A0 ; PC 0x1800A0 - 0x1800A4 Bugfix_MirrorlessSQToLW: db #$01 ; #$00 = Original Behavior - #$01 = Randomizer Behavior (Default) Bugfix_SwampWaterLevel: @@ -381,8 +381,10 @@ Bugfix_PreAgaDWDungeonDeathToFakeDW: db #$01 ; #$00 = Original Behavior - #$01 = Randomizer Behavior (Default) Bugfix_SetWorldOnAgahnimDeath: db #$01 ; #$00 = Original Behavior - #$01 = Randomizer Behavior (Default) +Bugfix_PodEG +db #$01 ; #$00 = Original Behavior - #$01 = Randomizer Behavior (Default) ;-------------------------------------------------------------------------------- -; 0x1800A4- 0x1800FF (unused) +; 0x1800A5- 0x1800FF (unused) ;-------------------------------------------------------------------------------- org $308100 ; PC 0x180100 (0x40 bytes) ShovelSpawnTable: