Fix bomb downgrades and track bomb stats in bomb-mode
This commit is contained in:
@@ -544,6 +544,10 @@ AddInventory:
|
|||||||
CPY.b #$B0 : !BGE +
|
CPY.b #$B0 : !BGE +
|
||||||
JSR .incrementKey
|
JSR .incrementKey
|
||||||
JMP .done
|
JMP .done
|
||||||
|
+ CPY.b #$B1 : !BLT + ; Items $B1 - $B6 - Bomb Upgrades
|
||||||
|
CPY.b #$B7 : !BGE +
|
||||||
|
JSR .incrementBombLevel
|
||||||
|
JMP .done
|
||||||
+
|
+
|
||||||
.done
|
.done
|
||||||
PLP : PLX : PLA
|
PLP : PLX : PLA
|
||||||
@@ -613,6 +617,10 @@ RTS
|
|||||||
LDA $7EF422 : !ADD #$20 : STA $7EF422 ; increment sword counter
|
LDA $7EF422 : !ADD #$20 : STA $7EF422 ; increment sword counter
|
||||||
RTS
|
RTS
|
||||||
|
|
||||||
|
.incrementBombLevel
|
||||||
|
JSR .stampSword ; update "first bomb" timestamp
|
||||||
|
RTS
|
||||||
|
|
||||||
.incrementShield
|
.incrementShield
|
||||||
; CHECK FOR DUPLICATE SHIELDS
|
; CHECK FOR DUPLICATE SHIELDS
|
||||||
LDA $7EF422 : !ADD #$08 : AND #$18 : TAX
|
LDA $7EF422 : !ADD #$08 : AND #$18 : TAX
|
||||||
@@ -709,7 +717,10 @@ RTS
|
|||||||
RTL
|
RTL
|
||||||
|
|
||||||
.incrementBossSword
|
.incrementBossSword
|
||||||
LDA $7EF359
|
LDA SpecialBombs : BEQ +
|
||||||
|
LDA $7EF4A8 : BRA ++
|
||||||
|
+ : LDA $7EF359
|
||||||
|
++
|
||||||
BNE + : -
|
BNE + : -
|
||||||
%TopHalf($7EF452) : RTS
|
%TopHalf($7EF452) : RTS
|
||||||
+ CMP #$FF : BEQ -
|
+ CMP #$FF : BEQ -
|
||||||
|
|||||||
@@ -9,26 +9,28 @@ RTL
|
|||||||
ItemDowngradeFixMain:
|
ItemDowngradeFixMain:
|
||||||
JSL.l AddInventory
|
JSL.l AddInventory
|
||||||
BMI .dontWrite ; thing we wrote over part 1
|
BMI .dontWrite ; thing we wrote over part 1
|
||||||
|
|
||||||
CPY.b #$1B : BEQ .isPowerGloves ; Power Gloves
|
CPY.b #$1B : BEQ .isPowerGloves ; Power Gloves
|
||||||
CPY.b #$05 : BEQ .isRedShield ; Red Shield
|
CPY.b #$05 : BEQ .isRedShield ; Red Shield
|
||||||
CPY.b #$04 : BEQ .isBlueShield ; Blue Shield
|
CPY.b #$04 : BEQ .isBlueShield ; Blue Shield
|
||||||
CPY.b #$0C : BEQ .isBlueBoomerang ; Blue Boomerang
|
CPY.b #$0C : BEQ .isBlueBoomerang ; Blue Boomerang
|
||||||
CPY.b #$0B : BEQ .isBow ; Bow
|
CPY.b #$0B : BEQ .isBow ; Bow
|
||||||
CPY.b #$3A : BEQ .isBowAndArrows ; Bow
|
CPY.b #$3A : BEQ .isBowAndArrows ; Bow
|
||||||
|
|
||||||
CPY.b #$49 : BEQ .isFightersSword ; Fighter's Sword
|
CPY.b #$49 : BEQ .isFightersSword ; Fighter's Sword
|
||||||
CPY.b #$01 : BEQ .isMasterSword ; Master Sword
|
CPY.b #$01 : BEQ .isMasterSword ; Master Sword
|
||||||
CPY.b #$50 : BEQ .isMasterSword ; Master Sword (Safe)
|
CPY.b #$50 : BEQ .isMasterSword ; Master Sword (Safe)
|
||||||
CPY.b #$02 : BEQ .isTemperedSword ; Tempered Sword
|
CPY.b #$02 : BEQ .isTemperedSword ; Tempered Sword
|
||||||
|
|
||||||
CPY.b #$3B : BEQ .isSilverArrowBow ; Silver Arrow Bow
|
CPY.b #$3B : BEQ .isSilverArrowBow ; Silver Arrow Bow
|
||||||
CPY.b #$2A : BEQ .isRedBoomerang ; Red Boomerang
|
CPY.b #$2A : BEQ .isRedBoomerang ; Red Boomerang
|
||||||
CPY.b #$0D : BEQ .isMagicPowder ; Magic Powder
|
CPY.b #$0D : BEQ .isMagicPowder ; Magic Powder
|
||||||
CPY.b #$14 : BEQ .isFlute ; Flute
|
CPY.b #$14 : BEQ .isFlute ; Flute
|
||||||
CPY.b #$13 : BEQ .isShovel ; Shovel
|
CPY.b #$13 : BEQ .isShovel ; Shovel
|
||||||
CPY.b #$29 : BEQ .isMushroom ; Mushroom
|
CPY.b #$29 : BEQ .isMushroom ; Mushroom
|
||||||
|
|
||||||
|
CPY.b #$B1 : !BLT + : CPY.b #$B6 : !BLT .isBombUpgrade : +
|
||||||
|
|
||||||
.done
|
.done
|
||||||
STA [$00] ; thing we wrote over part 2
|
STA [$00] ; thing we wrote over part 2
|
||||||
.dontWrite
|
.dontWrite
|
||||||
@@ -70,4 +72,15 @@ RTS
|
|||||||
+
|
+
|
||||||
PLA
|
PLA
|
||||||
JMP .done
|
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
|
||||||
|
;================================================================================
|
||||||
|
|||||||
Reference in New Issue
Block a user