Merge pull request #96 from aerinon/ChestKeyCounter

Hera basement key fix
This commit is contained in:
KatDevsGames
2021-02-18 17:30:52 -06:00
committed by GitHub

View File

@@ -244,7 +244,8 @@ IncrementSmallKeysNoPrimary:
LDA $1B : BEQ + ; skip room check if outdoors LDA $1B : BEQ + ; skip room check if outdoors
PHP : REP #$20 ; set 16-bit accumulator PHP : REP #$20 ; set 16-bit accumulator
LDA $048E : CMP.w #$0087 : BNE ++ ; hera basement LDA $048E : CMP.w #$0087 : BNE ++ ; hera basement
PLP : PHY : LDY.b #24 : JSL.l FullInventoryExternal : PLY : BRA + PLP : PHY : LDY.b #$24 : JSL.l FullInventoryExternal
JSR CountChestKey : PLY : BRA +
++ ++
PLP PLP
+ +
@@ -269,7 +270,10 @@ CountChestKey: ; called by neighbor functions
TYA : AND.B #$0F : BNE ++ ; If this is a sewers key, instead count it as an HC key TYA : AND.B #$0F : BNE ++ ; If this is a sewers key, instead count it as an HC key
INC INC
++ TAX : BRA .count ; use Key id instead of $040C (Keysanity) ++ TAX : BRA .count ; use Key id instead of $040C (Keysanity)
+ LDA $040C : LSR : TAX + LDA $040C : LSR
BNE +
INC ; combines HC and Sewer counts
+ TAX
.count .count
LDA $7EF4E0, X : INC : STA $7EF4E0, X LDA $7EF4E0, X : INC : STA $7EF4E0, X
.end .end