Refactor inventory code and add more labels

Refactored highest sword, shield, and mail counting
Refactored how heart pieces, heart containers, and crystals are counted
Moved quickswap lock bit to high byte of InventoryTracking
Fixed sword and shield item downgrade
Added PreFluteLocations counter
This commit is contained in:
cassidy
2021-12-02 01:37:27 -05:00
parent 14b899d47a
commit 2e97329250
7 changed files with 205 additions and 184 deletions

View File

@@ -28,7 +28,7 @@ QuickSwap:
BRA .store
.special_swap
LDA BowTracking : ORA #$01 : STA BowTracking
LDA InventoryTracking+1 : ORA #$01 : STA InventoryTracking+1
CPX.b #$02 : BEQ + ; boomerang
CPX.b #$01 : BEQ + ; bow
CPX.b #$05 : BEQ + ; powder
@@ -50,10 +50,10 @@ RTL
RCode:
LDX.w $0202
LDA.b $F2 : BIT #$20 : BNE ++ ; Still holding L from a previous frame
LDA BowTracking : AND #$FE : STA BowTracking
LDA InventoryTracking+1 : AND #$FE : STA InventoryTracking+1
BRA +
++
LDA BowTracking : BIT #$01 : BEQ +
LDA InventoryTracking+1 : BIT #$01 : BEQ +
RTS
-
+ CPX.b #$14 : BNE + : LDX.b #$00 ;will wrap around to 1
@@ -65,10 +65,10 @@ RTS
LCode:
LDX.w $0202
LDA.b $F2 : BIT #$10 : BNE ++ ; Still holding R from a previous frame
LDA BowTracking : AND #$FE : STA BowTracking
LDA InventoryTracking+1 : AND #$FE : STA InventoryTracking+1
BRA +
++
LDA BowTracking : BIT #$01 : BEQ +
LDA InventoryTracking+1 : BIT #$01 : BEQ +
RTS
-
+ CPX.b #$01 : BNE + : LDX.b #$15 ; will wrap around to $14