Merge pull request #189 from cassidoxa/keys_hud

Fix small key stats tracker
This commit is contained in:
Lexi Rose
2023-03-13 12:28:15 -05:00
committed by GitHub
3 changed files with 14 additions and 7 deletions

View File

@@ -811,12 +811,18 @@ RTL
; SaveKeys: ; SaveKeys:
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
SaveKeys: SaveKeys:
PHA PHA
LDA.l GenericKeys : BEQ + LDA.l GenericKeys : BEQ +
PLA : STA.l CurrentGenericKeys PLA : STA.l CurrentGenericKeys
RTL RTL
+ +
PLA : STA.l DungeonKeys, X 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 RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------

View File

@@ -189,7 +189,7 @@ UpdateKeys:
SEP #$30 ; set 8-bit accumulator & index registers SEP #$30 ; set 8-bit accumulator & index registers
LDA.w DungeonID : CMP.b #$1F : !BGE .skip LDA.w DungeonID : CMP.b #$1F : !BGE .skip
LSR : TAX ; get dungeon index and store to X 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 + CPX.b #$00 : BNE +
STA.l HyruleCastleKeys ; copy HC to sewers STA.l HyruleCastleKeys ; copy HC to sewers

View File

@@ -119,6 +119,7 @@ CountChestKey: ; called by neighbor functions
CPY.b #$24 : BEQ + ; small key for this dungeon - use DungeonID CPY.b #$24 : BEQ + ; small key for this dungeon - use DungeonID
CPY.b #$A0 : !BLT .end ; Ignore most items CPY.b #$A0 : !BLT .end ; Ignore most items
CPY.b #$AE : !BGE .end ; Ignore reserved key and generic key 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) TAX : BRA .count ; use Key id instead of DungeonID (Keysanity)
+ +
LDA.w DungeonID : LSR : TAX LDA.w DungeonID : LSR : TAX