Check new value in SRAM to determine if Aga 2 duck comes

Added pushpc/pullpc to sram.asm
This commit is contained in:
cassidoxa
2022-01-19 20:17:02 -05:00
parent cad5a43d4b
commit 6c4acb1e5b
3 changed files with 13 additions and 9 deletions

View File

@@ -80,8 +80,9 @@ OnUncleItemGet:
RTL
;--------------------------------------------------------------------------------
OnAga2Defeated:
JSL.l Dungeon_SaveRoomData_justKeys ; thing we wrote over, make sure this is first
JML.l IncrementAgahnim2Sword
JSL.l Dungeon_SaveRoomData_justKeys ; thing we wrote over, make sure this is first
LDA.b #$01 : STA Aga2Duck
JML.l IncrementAgahnim2Sword
;--------------------------------------------------------------------------------
OnFileCreation:
TAX ; what we wrote over

View File

@@ -2394,15 +2394,13 @@ Overworld_Hole_End:
;--------------------------------------------------------------------------------
;================================================================================
; Disable pyramid hole check for killing aga2
; Replace pyramid hole check for killing aga2
;
; this check is intended to prevent getting fluted out a second time if you
; return to his room after already killing him once. But with a pre-opened
; pyramid hole, it can cause you to get stuck there on killing him the first
; time. So we change it, and accept the flute out if you return.
; return to his room after already killing him once.
;---------------------------------------------------------------------------------
org $01C753 ; 0C753 = Bank01:10398 (LDA $7EF2DB : AND.b #$20 : BNE .return)
db $00 ; (originally $20)
org $01C74E ; 00C74E - bank_01.asm:13281 - (LDA.l $7EF2DB : AND.b #$20)
LDA.l Aga2Duck : NOP #2
;================================================================================
; Music fixes

View File

@@ -8,6 +8,7 @@
; $7F6000 - $7F6FFF in WRAM maps to the next 4k bytes, occupying the 2nd and 3rd vanilla
; save file locations. ($700500 - $701500)
;--------------------------------------------------------------------------------
pushpc
org 0 ; This module writes no bytes. Asar gives bank cross errors without this.
;================================================================================
@@ -225,7 +226,9 @@ CompassCountDisplay: skip 2 ; Compass count display flags (bitfield)
; High Byte: x c e d a s p m
; x = Sewers | c = Hyrule Castle | e = Eastern Palace | d = Desert Palace
; a = Castle Tower | s = Swamp Palace | p = PoD | m = Mire
skip 11 ;
skip 10 ;
Aga2Duck: skip 1 ; Used in lieu of pyramid hole for checking if the duck should come
; 0 = Haven't called post-Aga 2 bird | 1 = Have called post-Aga 2 bird
NpcFlags: skip 2 ; l - c s t k z o (bitfield)
; l = Library | c = Catfish | s = Sahasrahla | t = Stumpy
; k = Sick Kid | z = King Zora | o = Old Man
@@ -514,6 +517,7 @@ endmacro
%assertSRAM(GameCounter, $7EF3FF)
%assertSRAM(PostGameCounter, $7EF401)
%assertSRAM(CompassCountDisplay, $7EF403)
%assertSRAM(Aga2Duck, $7EF40F)
%assertSRAM(NpcFlags, $7EF410)
%assertSRAM(MapOverlay, $7EF414)
%assertSRAM(HudFlag, $7EF416)
@@ -636,3 +640,4 @@ endmacro
%assertSRAM(RomVersionSRAM, $701FFC)
%assertSRAM(PasswordSRAM, $703000)
pullpc