Fix bomb downgrades and track bomb stats in bomb-mode

This commit is contained in:
2021-07-11 13:58:04 -07:00
parent 374abe7e88
commit 6d52427696
2 changed files with 30 additions and 6 deletions

View File

@@ -553,6 +553,10 @@ AddInventory:
CPY.b #$B0 : !BGE +
JSR .incrementKey
JMP .done
+ CPY.b #$B1 : !BLT + ; Items $B1 - $B6 - Bomb Upgrades
CPY.b #$B7 : !BGE +
JSR .incrementBombLevel
JMP .done
+
.done
PLP : PLX : PLA
@@ -622,6 +626,10 @@ RTS
LDA $7EF422 : !ADD #$20 : STA $7EF422 ; increment sword counter
RTS
.incrementBombLevel
JSR .stampSword ; update "first bomb" timestamp
RTS
.incrementShield
; CHECK FOR DUPLICATE SHIELDS
LDA $7EF422 : !ADD #$08 : AND #$18 : TAX
@@ -718,7 +726,10 @@ RTS
RTL
.incrementBossSword
LDA $7EF359
LDA SpecialBombs : BEQ +
LDA $7EF4A8 : BRA ++
+ : LDA $7EF359
++
BNE + : -
%TopHalf($7EF452) : RTS
+ CMP #$FF : BEQ -

View File

@@ -29,6 +29,8 @@ ItemDowngradeFixMain:
CPY.b #$13 : BEQ .isShovel ; Shovel
CPY.b #$29 : BEQ .isMushroom ; Mushroom
CPY.b #$B1 : !BLT + : CPY.b #$B6 : !BLT .isBombUpgrade : +
.done
STA [$00] ; thing we wrote over part 2
.dontWrite
@@ -69,5 +71,16 @@ RTS
JMP .done
+
PLA
JMP .done
.isBombUpgrade
PHA
TYA ; load bomb upgrade item
!SUB #$B0 ; convert to bomb level
CMP.l $7EF4A8 : !BGE + ; skip if highest is lower (this is an upgrade)
LDA.l $7EF4A8 : !ADD #$B0 ; convert to item id
TAY : PLA : LDA.l $7EF4A8 ; put bomb level into the thing to write
JMP .done
+
PLA
JMP .done
;================================================================================