Adds Chest Key counters to $7EF4E0-F
This commit is contained in:
@@ -58,9 +58,11 @@ GiveBonkItem:
|
|||||||
PHY : LDY.b #$24 : JSL.l AddInventory : PLY ; do inventory processing for a small key
|
PHY : LDY.b #$24 : JSL.l AddInventory : PLY ; do inventory processing for a small key
|
||||||
LDA $7EF36F : INC A : STA $7EF36F
|
LDA $7EF36F : INC A : STA $7EF36F
|
||||||
LDA.b #$2F : JSL.l Sound_SetSfx3PanLong
|
LDA.b #$2F : JSL.l Sound_SetSfx3PanLong
|
||||||
|
JSR CountBonkKey
|
||||||
RTL
|
RTL
|
||||||
.notKey
|
.notKey
|
||||||
PHY : TAY : JSL.l Link_ReceiveItem : PLY
|
PHY : TAY : JSL.l Link_ReceiveItem : PLY
|
||||||
|
JSR CountBonkKey
|
||||||
RTL
|
RTL
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
LoadBonkItem:
|
LoadBonkItem:
|
||||||
|
|||||||
@@ -2,6 +2,12 @@
|
|||||||
; Item Downgrade Fix
|
; Item Downgrade Fix
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
ItemDowngradeFix:
|
ItemDowngradeFix:
|
||||||
|
JSR ItemDowngradeFixMain
|
||||||
|
JSR CountChestKey
|
||||||
|
RTL
|
||||||
|
|
||||||
|
|
||||||
|
ItemDowngradeFixMain:
|
||||||
JSL.l AddInventory
|
JSL.l AddInventory
|
||||||
BMI .dontWrite ; thing we wrote over part 1
|
BMI .dontWrite ; thing we wrote over part 1
|
||||||
|
|
||||||
@@ -27,7 +33,7 @@ ItemDowngradeFix:
|
|||||||
.done
|
.done
|
||||||
STA [$00] ; thing we wrote over part 2
|
STA [$00] ; thing we wrote over part 2
|
||||||
.dontWrite
|
.dontWrite
|
||||||
RTL
|
RTS
|
||||||
.isPowerGloves
|
.isPowerGloves
|
||||||
.isBlueShield
|
.isBlueShield
|
||||||
.isRedShield
|
.isRedShield
|
||||||
@@ -36,7 +42,7 @@ RTL
|
|||||||
.isBowAndArrows
|
.isBowAndArrows
|
||||||
CMP [$00] : !BGE .done ; finished if we're upgrading
|
CMP [$00] : !BGE .done ; finished if we're upgrading
|
||||||
LDA [$00] ; reload old value
|
LDA [$00] ; reload old value
|
||||||
RTL
|
RTS
|
||||||
.isSilverArrowBow
|
.isSilverArrowBow
|
||||||
.isRedBoomerang
|
.isRedBoomerang
|
||||||
.isMagicPowder
|
.isMagicPowder
|
||||||
@@ -47,10 +53,10 @@ RTL
|
|||||||
LDA [$00] : BNE + ; don't upgrade if we already have the toggle for it
|
LDA [$00] : BNE + ; don't upgrade if we already have the toggle for it
|
||||||
PLA
|
PLA
|
||||||
STA [$00]
|
STA [$00]
|
||||||
RTL
|
RTS
|
||||||
+
|
+
|
||||||
PLA
|
PLA
|
||||||
RTL
|
RTS
|
||||||
.isFightersSword
|
.isFightersSword
|
||||||
.isMasterSword
|
.isMasterSword
|
||||||
.isTemperedSword
|
.isTemperedSword
|
||||||
|
|||||||
30
stats.asm
30
stats.asm
@@ -257,6 +257,36 @@ DecrementSmallKeys:
|
|||||||
JSL.l UpdateKeys
|
JSL.l UpdateKeys
|
||||||
RTL
|
RTL
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
|
CountChestKey: ; called from ItemDowngradeFix in itemdowngrade.asm (also from CountBonkItem below)
|
||||||
|
PHA : PHX
|
||||||
|
CPY #$24 : BEQ + ; small key for this dungeon - use $040C
|
||||||
|
CPY #$A0 : !BLT .end ; Ignore most items
|
||||||
|
CPY #$AE : !BGE .end ; Ignore reserved key and generic key
|
||||||
|
TYA : AND.B #$0F : BNE ++ ; If this is a sewers key, instead count it as an HC key
|
||||||
|
INC
|
||||||
|
++ TAX : BRA .count ; use Key id instead of $040C (Keysanity)
|
||||||
|
+ LDA $040C : LSR : TAX
|
||||||
|
.count
|
||||||
|
LDA $7EF4E0, X : INC : STA $7EF4E0, X
|
||||||
|
.end
|
||||||
|
PLX : PLA
|
||||||
|
RTS
|
||||||
|
;--------------------------------------------------------------------------------
|
||||||
|
CountBonkItem: ; called from GetBonkItem in bookofmudora.asm
|
||||||
|
LDA $A0 ; check room ID - only bonk keys in 2 rooms so we're just checking the lower byte
|
||||||
|
CMP #115 : BNE + ; Desert Bonk Key
|
||||||
|
LDA.L BonkKey_Desert : BRA ++
|
||||||
|
+ : CMP #140 : BNE + ; GTower Bonk Key
|
||||||
|
LDA.L BonkKey_GTower : BRA ++
|
||||||
|
+ LDA.B #$24 ; default to small key
|
||||||
|
++
|
||||||
|
CMP #$24 : BNE +
|
||||||
|
PHY
|
||||||
|
TAY : JSR CountChestKey
|
||||||
|
PLY
|
||||||
|
+
|
||||||
|
RTS
|
||||||
|
;--------------------------------------------------------------------------------
|
||||||
IncrementAgahnim2Sword:
|
IncrementAgahnim2Sword:
|
||||||
PHA
|
PHA
|
||||||
LDA !LOCK_STATS : BNE +
|
LDA !LOCK_STATS : BNE +
|
||||||
|
|||||||
Reference in New Issue
Block a user