Compass and map HUD display modes properly skip or draw

Minor key count refactor, count HC and Sewers as both in all cases
This commit is contained in:
cassidoxa
2023-03-12 17:20:54 -04:00
parent c0986d6bbc
commit 7968ddf020
5 changed files with 52 additions and 51 deletions

View File

@@ -115,21 +115,24 @@ CountChestKeyLong: ; called from ItemDowngradeFix in itemdowngrade.asm
RTL
;--------------------------------------------------------------------------------
CountChestKey: ; called by neighbor functions
PHA : PHX
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 : BNE ++ ; If this is an HC key, instead count it as a sewers key
INC
++ TAX : BRA .count ; use Key id instead of DungeonID (Keysanity)
+ LDA.w DungeonID : LSR
BNE +
INC ; combines HC and Sewer counts
+ TAX
.count
LDA.l DungeonCollectedKeys, X : INC : STA.l DungeonCollectedKeys, X
.end
PLX : PLA
PHA : PHX
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
TAX : BRA .count ; use Key id instead of DungeonID (Keysanity)
+
LDA.w DungeonID : LSR : TAX
.count
LDA.l DungeonCollectedKeys, X : INC : STA.l DungeonCollectedKeys, X
CPX.b #$00 : BNE +
STA.l HCCollectedKeys ; copy HC to sewers
+
CPX.b #$01 : BNE +
STA.l SewerCollectedKeys ; copy sewers to HC
+
.end
PLX : PLA
RTS
;--------------------------------------------------------------------------------
CountBonkItem: ; called from GetBonkItem in bookofmudora.asm