Revert "Fix mixing progressive/non-progressive swords and shields"

This reverts commit d05169d5e2.
This commit is contained in:
2022-10-12 15:55:48 -07:00
parent d05169d5e2
commit 3cec56c5d8
6 changed files with 63 additions and 30 deletions

View File

@@ -150,13 +150,13 @@ org $30B414 ; PC 0x183414-0x183416
InitMapOverlay: dw $0000 InitMapOverlay: dw $0000
org $30B417 ; PC 0x183417 org $30B417 ; PC 0x183417
InitProgressiveSwords: db $00 InitHighestSword: db $00
org $30B414 ; PC 0x183418-0x183419 org $30B414 ; PC 0x183418-0x183419
InitGoalCounter: dw $0000 InitGoalCounter: dw $0000
org $30B422 ; PC 0x183422 org $30B422 ; PC 0x183422
InitProgressiveShields: db $00 InitHighestShield: db $00
org $30B428 ; PC 0x183428 org $30B428 ; PC 0x183428
InitMapsCompasses: db $00 InitMapsCompasses: db $00

View File

@@ -354,16 +354,33 @@ AddInventory:
+ +
CPY.b #$00 : BNE + ; Fighter's Sword & Fighter's Shield CPY.b #$00 : BNE + ; Fighter's Sword & Fighter's Shield
JSR .stampSword LDX #$01
JSR .incrementSword
JSR .incrementShield
JMP .done JMP .done
+ CPY.b #$01 : BNE + ; Master Sword + CPY.b #$01 : BNE + ; Master Sword
JSR .stampSword LDX #$02
JSR .incrementSword
JMP .done JMP .done
+ CPY.b #$02 : BNE + ; Tempered Sword + CPY.b #$02 : BNE + ; Tempered Sword
JSR .stampSword LDX #$03
JSR .incrementSword
JMP .done JMP .done
+ CPY.b #$03 : BNE + ; Golden Sword + CPY.b #$03 : BNE + ; Golden Sword
JSR .stampSword LDX #$04
JSR .incrementSword
JMP .done
+ CPY.b #$04 : BNE + ; Fighter's Shield
LDX #$01
JSR .incrementShield
JMP .done
+ CPY.b #$05 : BNE + ; Red Shield
LDX #$02
JSR .incrementShield
JMP .done
+ CPY.b #$06 : BNE + ; Mirror Shield
LDX #$03
JSR .incrementShield
JMP .done JMP .done
+ CPY.b #$07 : !BLT + ; Items $07 - $0D + CPY.b #$07 : !BLT + ; Items $07 - $0D
CPY.b #$0E : !BGE + CPY.b #$0E : !BGE +
@@ -463,7 +480,8 @@ AddInventory:
JSR .incrementY JSR .incrementY
JMP .done JMP .done
+ CPY.b #$49 : BNE + ; Fighter's Sword + CPY.b #$49 : BNE + ; Fighter's Sword
JSR .stampSword LDX #$01
JSR .incrementSword
JMP .done JMP .done
+ CPY.b #$4A : BNE + ; Flute (Active) + CPY.b #$4A : BNE + ; Flute (Active)
JSR .stampFlute JSR .stampFlute
@@ -482,7 +500,8 @@ AddInventory:
JSR .incrementCapacity JSR .incrementCapacity
JMP .done JMP .done
+ CPY.b #$50 : BNE + ; Master Sword (Safe) + CPY.b #$50 : BNE + ; Master Sword (Safe)
JSR .stampSword LDX #$02
JSR .incrementSword
JMP .done JMP .done
+ CPY.b #$51 : BNE + ; 5 Bomb Capacity Upgrade + CPY.b #$51 : BNE + ; 5 Bomb Capacity Upgrade
LDX #$02 LDX #$02
@@ -500,11 +519,12 @@ AddInventory:
JSR .incrementBow JSR .incrementBow
JMP .done JMP .done
+ CPY.b #$5E : BNE + ; Progressive Sword + CPY.b #$5E : BNE + ; Progressive Sword
JSR .stampSword LDA SwordEquipment : INC : TAX
LDA.l ProgressiveSwords : INC : STA.l ProgressiveSwords JSR .incrementSword
JMP .done JMP .done
+ CPY.b #$5F : BNE + ; Progressive Shield + CPY.b #$5F : BNE + ; Progressive Shield
LDA.l ProgressiveShields : INC : STA.l ProgressiveShields LDA ShieldEquipment : INC : TAX
JSR .incrementShield
JMP .done JMP .done
+ CPY.b #$60 : BNE + ; Progressive Armor + CPY.b #$60 : BNE + ; Progressive Armor
LDA ArmorEquipment : INC : TAX LDA ArmorEquipment : INC : TAX
@@ -596,6 +616,21 @@ RTS
SEP #$20 ; set 8-bit accumulator SEP #$20 ; set 8-bit accumulator
RTS RTS
.incrementSword
JSR .stampSword
LDA HighestSword
INC : STA $04 : CPX $04 : !BLT + ; don't increment unless we're getting a better sword
TXA : STA HighestSword
+
RTS
.incrementShield
LDA HighestShield
INC : STA $04 : CPX $04 : !BLT + ; don't increment unless we're getting a better shield
TXA : STA HighestShield
+
RTS
.incrementBow .incrementBow
LDA BowEquipment : BNE .dontCount ; Don't increment Y item count for extra bows LDA BowEquipment : BNE .dontCount ; Don't increment Y item count for extra bows
.incrementY .incrementY

View File

@@ -60,7 +60,7 @@ RTS
RTS RTS
.isSword .isSword
PHA PHA
LDA SwordEquipment : STA $04 LDA HighestSword : STA $04
TYA ; load sword item TYA ; load sword item
CMP.b #$49 : BNE + : LDA.b #$00 : + ; convert extra fighter's sword to normal one CMP.b #$49 : BNE + : LDA.b #$00 : + ; convert extra fighter's sword to normal one
CMP.b #$50 : BNE + : LDA.b #$01 : + ; convert extra master sword to normal one CMP.b #$50 : BNE + : LDA.b #$01 : + ; convert extra master sword to normal one
@@ -73,11 +73,9 @@ RTS
JMP .done JMP .done
.isUncleSwordShield .isUncleSwordShield
PHA PHA
; set sword to 1 if current sword is 0 LDA HighestSword : STA [$00] ; already set to 1 if we had no sword, always keep highest
LDA [$00] : BNE + : LDA.b #$01 : STA [$00] : +
INC $00 INC $00
; set shield to 1 if current shield is 0 LDA HighestShield : STA [$00]
LDA [$00] : BNE + : LDA.b #$01 : STA [$00] : +
PLA PLA
RTS RTS
;================================================================================ ;================================================================================

View File

@@ -523,7 +523,7 @@ AddReceivedItemExpanded:
+++ : JMP .done +++ : JMP .done
++ : CMP.b #$5E : BNE ++ ; Progressive Sword ++ : CMP.b #$5E : BNE ++ ; Progressive Sword
LDA !MULTIWORLD_ITEM_PLAYER_ID : BNE + LDA !MULTIWORLD_ITEM_PLAYER_ID : BNE +
LDA ProgressiveSwords : CMP.l ProgressiveSwordLimit : !BLT + LDA HighestSword : CMP.l ProgressiveSwordLimit : !BLT +
LDA.l ProgressiveSwordReplacement : STA $02D8 : JMP .done LDA.l ProgressiveSwordReplacement : STA $02D8 : JMP .done
+ +
LDA SwordEquipment : CMP.b #$FF : BNE + ; Swordless LDA SwordEquipment : CMP.b #$FF : BNE + ; Swordless
@@ -545,10 +545,10 @@ AddReceivedItemExpanded:
+++ ; Everything Else +++ ; Everything Else
LDA.b #$06 : STA $02D8 : JMP .done LDA.b #$06 : STA $02D8 : JMP .done
+ +
LDA ProgressiveShields : CMP.l ProgressiveShieldLimit : !BLT + LDA HighestShield : CMP.l ProgressiveShieldLimit : !BLT +
LDA.l ProgressiveShieldReplacement : STA $02D8 : JMP .done LDA.l ProgressiveShieldReplacement : STA $02D8 : JMP .done
+ +
LDA ProgressiveShields : BNE + ; No Shield LDA HighestShield : BNE + ; No Shield
LDA.b #$04 : BRA .shielddone LDA.b #$04 : BRA .shielddone
+ : CMP.b #$01 : BNE + ; Fighter Shield + : CMP.b #$01 : BNE + ; Fighter Shield
LDA.b #$05 : BRA .shielddone LDA.b #$05 : BRA .shielddone

View File

@@ -256,7 +256,7 @@ IgnoreFaeries: ;
HasGroveItem: ; HasGroveItem: ;
GeneralFlags: skip 1 ; - - h - - i - g (bitfield) GeneralFlags: skip 1 ; - - h - - i - g (bitfield)
; h = HUD Flag | i = ignore faeries | g = has diggable grove item ; h = HUD Flag | i = ignore faeries | g = has diggable grove item
ProgressiveSwords: skip 1 ; Number of Progressive Swords obatined (integer) HighestSword: skip 1 ; Highest sword level (integer)
GoalCounter: skip 2 ; Goal items collected (16-bit integer) GoalCounter: skip 2 ; Goal items collected (16-bit integer)
ProgrammableItemOne: skip 2 ; \ Reserved for programmable items ProgrammableItemOne: skip 2 ; \ Reserved for programmable items
ProgrammableItemTwo: skip 2 ; | ProgrammableItemTwo: skip 2 ; |
@@ -264,7 +264,7 @@ ProgrammableItemThree: skip 2 ; /
BonkCounter: skip 1 ; Number of times the player has bonked (integer) BonkCounter: skip 1 ; Number of times the player has bonked (integer)
YAItemCounter: skip 1 ; y y y y y a a a (packed integers) YAItemCounter: skip 1 ; y y y y y a a a (packed integers)
; Number of Y and A items collected represented as packed integers ; Number of Y and A items collected represented as packed integers
ProgressiveShields: skip 1 ; Number of Progressive Shields obtained HighestShield: skip 1 ; Highest Shield level
TotalItemCounter: skip 2 ; Total items collected (integer) TotalItemCounter: skip 2 ; Total items collected (integer)
SwordBossKills: skip 2 ; t t t t g g g g f f f f m m m m (packed integers) SwordBossKills: skip 2 ; t t t t g g g g f f f f m m m m (packed integers)
; t = Tempered Sword boss kills | g = Gold Sword boss kills ; t = Tempered Sword boss kills | g = Gold Sword boss kills
@@ -562,14 +562,14 @@ endmacro
%assertSRAM(IgnoreFaeries, $7EF416) %assertSRAM(IgnoreFaeries, $7EF416)
%assertSRAM(HasGroveItem, $7EF416) %assertSRAM(HasGroveItem, $7EF416)
%assertSRAM(GeneralFlags, $7EF416) %assertSRAM(GeneralFlags, $7EF416)
%assertSRAM(ProgressiveSwords, $7EF417) %assertSRAM(HighestSword, $7EF417)
%assertSRAM(GoalCounter, $7EF418) %assertSRAM(GoalCounter, $7EF418)
%assertSRAM(ProgrammableItemOne, $7EF41A) %assertSRAM(ProgrammableItemOne, $7EF41A)
%assertSRAM(ProgrammableItemTwo, $7EF41C) %assertSRAM(ProgrammableItemTwo, $7EF41C)
%assertSRAM(ProgrammableItemThree, $7EF41E) %assertSRAM(ProgrammableItemThree, $7EF41E)
%assertSRAM(BonkCounter, $7EF420) %assertSRAM(BonkCounter, $7EF420)
%assertSRAM(YAItemCounter, $7EF421) %assertSRAM(YAItemCounter, $7EF421)
%assertSRAM(ProgressiveShields, $7EF422) %assertSRAM(HighestShield, $7EF422)
%assertSRAM(TotalItemCounter, $7EF423) %assertSRAM(TotalItemCounter, $7EF423)
%assertSRAM(SwordBossKills, $7EF425) %assertSRAM(SwordBossKills, $7EF425)
%assertSRAM(BigKeysBigChests, $7EF427) %assertSRAM(BigKeysBigChests, $7EF427)

View File

@@ -61,7 +61,7 @@ RTL
LDA.b #$04 : RTL LDA.b #$04 : RTL
++ CMP.b #$FE : BNE ++ ; Progressive Sword ++ CMP.b #$FE : BNE ++ ; Progressive Sword
LDA !MULTIWORLD_SPRITEITEM_PLAYER_ID : BNE .skipswordlimit LDA !MULTIWORLD_SPRITEITEM_PLAYER_ID : BNE .skipswordlimit
LDA ProgressiveSwords LDA HighestSword
CMP.l ProgressiveSwordLimit : !BLT + ; Progressive Sword Limit CMP.l ProgressiveSwordLimit : !BLT + ; Progressive Sword Limit
LDA.l ProgressiveSwordReplacement LDA.l ProgressiveSwordReplacement
JMP GetSpriteID JMP GetSpriteID
@@ -79,11 +79,11 @@ RTL
+ +
++ : CMP.b #$FF : BNE ++ ; Progressive Shield ++ : CMP.b #$FF : BNE ++ ; Progressive Shield
LDA !MULTIWORLD_SPRITEITEM_PLAYER_ID : BNE .skipshieldlimit LDA !MULTIWORLD_SPRITEITEM_PLAYER_ID : BNE .skipshieldlimit
LDA ProgressiveShields LDA HighestShield
CMP.l ProgressiveShieldLimit : !BLT + ; Progressive Shield Limit CMP.l ProgressiveShieldLimit : !BLT + ; Progressive Shield Limit
LDA.l ProgressiveShieldReplacement LDA.l ProgressiveShieldReplacement
JMP GetSpriteID JMP GetSpriteID
.skipshieldlimit : LDA.l ProgressiveShields .skipshieldlimit : LDA.l HighestShield
+ : 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
@@ -200,7 +200,7 @@ GetSpritePalette:
RTL RTL
.specialHandling .specialHandling
CMP.b #$FD : BNE ++ ; Progressive Sword CMP.b #$FD : BNE ++ ; Progressive Sword
LDA ProgressiveSwords LDA HighestSword
CMP.l ProgressiveSwordLimit : !BLT + ; Progressive Sword Limit CMP.l ProgressiveSwordLimit : !BLT + ; Progressive Sword Limit
LDA.l ProgressiveSwordReplacement LDA.l ProgressiveSwordReplacement
JMP GetSpritePalette JMP GetSpritePalette
@@ -213,7 +213,7 @@ RTL
+ ; Everything Else + ; Everything Else
LDA.b #$08 : RTL LDA.b #$08 : RTL
++ : CMP.b #$FE : BNE ++ ; Progressive Shield ++ : CMP.b #$FE : BNE ++ ; Progressive Shield
LDA ProgressiveShields LDA HighestShield
CMP.l ProgressiveShieldLimit : !BLT + ; Progressive Shield Limit CMP.l ProgressiveShieldLimit : !BLT + ; Progressive Shield Limit
LDA.l ProgressiveShieldReplacement LDA.l ProgressiveShieldReplacement
JMP GetSpritePalette JMP GetSpritePalette
@@ -343,13 +343,13 @@ IsNarrowSprite:
+ : JMP .continue + : JMP .continue
.notBottle .notBottle
CMP.b #$5E : BNE ++ ; Progressive Sword CMP.b #$5E : BNE ++ ; Progressive Sword
LDA ProgressiveSwords : CMP.l ProgressiveSwordLimit : !BLT + ; Progressive Sword Limit LDA HighestSword : CMP.l ProgressiveSwordLimit : !BLT + ; Progressive Sword Limit
LDA.l ProgressiveSwordReplacement LDA.l ProgressiveSwordReplacement
JSL.l IsNarrowSprite JSL.l IsNarrowSprite
JMP .done JMP .done
+ : JMP .continue + : JMP .continue
++ CMP.b #$5F : BNE ++ ; Progressive Shield ++ CMP.b #$5F : BNE ++ ; Progressive Shield
LDA ProgressiveShields : BNE + : JMP .done ; No Shield LDA HighestShield : BNE + : JMP .done ; No Shield
+ : CMP.l ProgressiveShieldLimit : !BLT .continue + : CMP.l ProgressiveShieldLimit : !BLT .continue
LDA.l ProgressiveShieldReplacement LDA.l ProgressiveShieldReplacement
JSL.l IsNarrowSprite JSL.l IsNarrowSprite