utilities: refactor some JSL X : RTL into JMP X

This commit is contained in:
cassidy
2021-09-06 20:20:12 -04:00
parent 9f1933d8c0
commit c37dcec6ea

View File

@@ -23,8 +23,7 @@ GetSpriteID:
.bottle .bottle
PHA : JSR.w CountBottles : CMP.l BottleLimit : !BLT + PHA : JSR.w CountBottles : CMP.l BottleLimit : !BLT +
PLA : LDA.l BottleLimitReplacement PLA : LDA.l BottleLimitReplacement
JSL.l GetSpriteID JMP GetSpriteID
RTL
+ +
PLA : BRA .normal PLA : BRA .normal
.server_F0 .server_F0
@@ -57,16 +56,14 @@ RTL
++ CMP.b #$FD : BNE ++ ; Progressive Armor ++ CMP.b #$FD : BNE ++ ; Progressive Armor
LDA $7EF35B : CMP.l ProgressiveArmorLimit : !BLT + ; Progressive Armor Limit LDA $7EF35B : CMP.l ProgressiveArmorLimit : !BLT + ; Progressive Armor Limit
LDA.l ProgressiveArmorReplacement LDA.l ProgressiveArmorReplacement
JSL.l GetSpriteID JMP GetSpriteID
RTL
+ +
LDA.b #$04 : RTL LDA.b #$04 : RTL
++ CMP.b #$FE : BNE ++ ; Progressive Sword ++ CMP.b #$FE : BNE ++ ; Progressive Sword
LDA $7EF359 LDA $7EF359
CMP.l ProgressiveSwordLimit : !BLT + ; Progressive Sword Limit CMP.l ProgressiveSwordLimit : !BLT + ; Progressive Sword Limit
LDA.l ProgressiveSwordReplacement LDA.l ProgressiveSwordReplacement
JSL.l GetSpriteID JMP GetSpriteID
RTL
+ : CMP.b #$00 : BNE + ; No Sword + : CMP.b #$00 : BNE + ; No Sword
LDA.b #$43 : RTL LDA.b #$43 : RTL
+ : CMP.b #$01 : BNE + ; Fighter Sword + : CMP.b #$01 : BNE + ; Fighter Sword
@@ -80,8 +77,7 @@ RTL
LDA !PROGRESSIVE_SHIELD : AND #$C0 : LSR #6 LDA !PROGRESSIVE_SHIELD : AND #$C0 : LSR #6
CMP.l ProgressiveShieldLimit : !BLT + ; Progressive Shield Limit CMP.l ProgressiveShieldLimit : !BLT + ; Progressive Shield Limit
LDA.l ProgressiveShieldReplacement LDA.l ProgressiveShieldReplacement
JSL.l GetSpriteID JMP GetSpriteID
RTL
+ : CMP.b #$00 : BNE + ; No Shield + : CMP.b #$00 : BNE + ; No Shield
LDA.b #$2D : RTL LDA.b #$2D : RTL
+ : CMP.b #$01 : BNE + ; Fighter Shield + : CMP.b #$01 : BNE + ; Fighter Shield
@@ -92,8 +88,7 @@ RTL
LDA $7EF340 : INC : LSR LDA $7EF340 : INC : LSR
CMP.l ProgressiveBowLimit : !BLT + CMP.l ProgressiveBowLimit : !BLT +
LDA.l ProgressiveBowReplacement LDA.l ProgressiveBowReplacement
JSL.l GetSpriteID JMP GetSpriteID
RTL
+ : CMP.b #$00 : BNE + ; No Bow + : CMP.b #$00 : BNE + ; No Bow
LDA.b #$29 : RTL LDA.b #$29 : RTL
+ ; Any Bow + ; Any Bow
@@ -176,8 +171,7 @@ GetSpritePalette:
.bottle .bottle
PHA : JSR.w CountBottles : CMP.l BottleLimit : !BLT + PHA : JSR.w CountBottles : CMP.l BottleLimit : !BLT +
PLA : LDA.l BottleLimitReplacement PLA : LDA.l BottleLimitReplacement
JSL.l GetSpritePalette JMP GetSpritePalette
RTL
+ +
PLA : .notBottle PLA : .notBottle
PHX PHX
@@ -192,8 +186,7 @@ RTL
LDA $7EF359 LDA $7EF359
CMP.l ProgressiveSwordLimit : !BLT + ; Progressive Sword Limit CMP.l ProgressiveSwordLimit : !BLT + ; Progressive Sword Limit
LDA.l ProgressiveSwordReplacement LDA.l ProgressiveSwordReplacement
JSL.l GetSpritePalette JMP GetSpritePalette
RTL
+ : CMP.b #$00 : BNE + ; No Sword + : CMP.b #$00 : BNE + ; No Sword
LDA.b #$04 : RTL LDA.b #$04 : RTL
+ : CMP.b #$01 : BNE + ; Fighter Sword + : CMP.b #$01 : BNE + ; Fighter Sword
@@ -206,8 +199,7 @@ RTL
LDA !PROGRESSIVE_SHIELD : AND #$C0 : LSR #6 LDA !PROGRESSIVE_SHIELD : AND #$C0 : LSR #6
CMP.l ProgressiveShieldLimit : !BLT + ; Progressive Shield Limit CMP.l ProgressiveShieldLimit : !BLT + ; Progressive Shield Limit
LDA.l ProgressiveShieldReplacement LDA.l ProgressiveShieldReplacement
JSL.l GetSpritePalette JMP GetSpritePalette
RTL
+ : CMP.b #$00 : BNE + ; No Shield + : CMP.b #$00 : BNE + ; No Shield
LDA.b #$04 : RTL LDA.b #$04 : RTL
+ : CMP.b #$01 : BNE + ; Fighter Shield + : CMP.b #$01 : BNE + ; Fighter Shield
@@ -217,8 +209,7 @@ RTL
++ : CMP.b #$FF : BNE ++ ; Progressive Armor ++ : CMP.b #$FF : BNE ++ ; Progressive Armor
LDA $7EF35B : CMP.l ProgressiveArmorLimit : !BLT + ; Progressive Armor Limit LDA $7EF35B : CMP.l ProgressiveArmorLimit : !BLT + ; Progressive Armor Limit
LDA.l ProgressiveArmorReplacement LDA.l ProgressiveArmorReplacement
JSL.l GetSpritePalette JMP GetSpritePalette
RTL
+ : CMP.b #$00 : BNE + ; Green Tunic + : CMP.b #$00 : BNE + ; Green Tunic
LDA.b #$04 : RTL LDA.b #$04 : RTL
+ ; Everything Else + ; Everything Else
@@ -232,8 +223,7 @@ RTL
LDA $7EF340 : INC : LSR LDA $7EF340 : INC : LSR
CMP.l ProgressiveBowLimit : !BLT + CMP.l ProgressiveBowLimit : !BLT +
LDA.l ProgressiveBowReplacement LDA.l ProgressiveBowReplacement
JSL.l GetSpritePalette JMP GetSpritePalette
RTL
+ : CMP.b #$00 : BNE + ; No Bow + : CMP.b #$00 : BNE + ; No Bow
LDA.b #$08 : RTL LDA.b #$08 : RTL
+ ; Any Bow + ; Any Bow