diff --git a/inventory.asm b/inventory.asm index 1e41976..130d24e 100644 --- a/inventory.asm +++ b/inventory.asm @@ -811,12 +811,18 @@ RTL ; SaveKeys: ;-------------------------------------------------------------------------------- SaveKeys: - PHA - LDA.l GenericKeys : BEQ + - PLA : STA.l CurrentGenericKeys - RTL - + - PLA : STA.l DungeonKeys, X + PHA + LDA.l GenericKeys : BEQ + + PLA : STA.l CurrentGenericKeys + RTL + + + PLA : STA.l DungeonKeys, X + CPX.b #$00 : BNE + + STA.l HyruleCastleKeys ; copy HC to sewers + + + CPX.b #$01 : BNE + + STA.l SewerKeys ; copy sewers to HC + + RTL ;-------------------------------------------------------------------------------- diff --git a/pendantcrystalhud.asm b/pendantcrystalhud.asm index 9086510..da24319 100644 --- a/pendantcrystalhud.asm +++ b/pendantcrystalhud.asm @@ -189,7 +189,7 @@ UpdateKeys: SEP #$30 ; set 8-bit accumulator & index registers LDA.w DungeonID : CMP.b #$1F : !BGE .skip LSR : TAX ; get dungeon index and store to X - LDA.l DungeonKeys, X : INC : STA.l DungeonKeys, X + LDA.l CurrentSmallKeys : STA.l DungeonKeys, X CPX.b #$00 : BNE + STA.l HyruleCastleKeys ; copy HC to sewers diff --git a/stats.asm b/stats.asm index ed0cc5b..ccaaa52 100644 --- a/stats.asm +++ b/stats.asm @@ -119,6 +119,7 @@ CountChestKey: ; called by neighbor functions CPY.b #$24 : BEQ + ; small key for this dungeon - use DungeonID CPY.b #$A0 : !BLT .end ; Ignore most items CPY.b #$AE : !BGE .end ; Ignore reserved key and generic key + TYA : AND.B #$0F TAX : BRA .count ; use Key id instead of DungeonID (Keysanity) + LDA.w DungeonID : LSR : TAX