Progressive Shields fix

Fix for collection rate overflow
Fix for progressive shield standing item (narrow version)
Fix for double key counts
Multiworld item substitution
Made map key coutner not depend on new flag for now
This commit is contained in:
aerinon
2023-09-08 13:42:22 -06:00
parent 134651e4fb
commit e772b4a931
7 changed files with 32 additions and 47 deletions

View File

@@ -34,7 +34,7 @@ db $20, $19, $08, $31 ; year/month/day
;================================================================================
!ROM_VERSION_LOW ?= 1 ; ROM version (two 16-bit integers)
!ROM_VERSION_HIGH ?= 4 ;
!ROM_VERSION_HIGH ?= 5 ;
org $80FFE0 ; Unused hardware vector
RomVersion:
@@ -78,7 +78,7 @@ incsrc ram.asm
incsrc sram.asm
incsrc registers.asm
incsrc vanillalabels.asm
incsrc overworldmap.asm ; Overwrites some code in bank $8A
incsrc menu/overworldmap.asm ; Overwrites some code in bank $8A
org $A08000 ; bank $20
incsrc itemdowngrade.asm

View File

@@ -249,7 +249,7 @@ PreItemGet:
RTL
;--------------------------------------------------------------------------------
PostItemGet:
STZ.w ShopPurchaseFlag
STZ.w ProgressiveFlag
LDA.w ItemReceiptMethod : CMP.b #$01 : BEQ +
LDX.w CurrentSpriteSlot
STZ.w SpriteMetaData,X

View File

@@ -163,21 +163,21 @@ AddInventory:
JSR.w IncrementYAItems
.totalCount
LDA.l !MULTIWORLD_RECEIVING_ITEM : BNE .done
REP #$20
REP #$30
LDA.l TotalItemCounter : INC : TAY
LDA.l BootsEquipment : BNE +
LDA.l BootsEquipment : AND.w #$00FF : BNE +
TYA : STA.l PreBootsLocations
+
LDA.l MirrorEquipment : BNE +
LDA.l MirrorEquipment : AND.w #$00FF : BNE +
TYA : STA.l PreMirrorLocations
+
LDA.l FluteEquipment : BNE +
LDA.l FluteEquipment : AND.w #$00FF : BNE +
TYA : STA.l PreFluteLocations
+
TYA
STA.l TotalItemCounter
.done
SEP #$30
.done
SEP #$30
PLB : PLP : PLY : PLX : PLA
RTL
@@ -229,7 +229,7 @@ DungeonIncrement:
+
CMP.b #$00 : BNE +
INC #2
TAX : REP #$20 : LDA.l DungeonLocationsChecked, X : INC : STA.l DungeonLocationsChecked, X : SEP #$20
+ TAX : REP #$20 : LDA.l DungeonLocationsChecked, X : INC : STA.l DungeonLocationsChecked, X : SEP #$20
CPX.b #$0D : BNE +
LDA.l BigKeyField : BIT.b #$04 : BNE ++
LDA.l PreGTBKLocations : INC : STA.l PreGTBKLocations

View File

@@ -55,7 +55,10 @@ FreeUWGraphics:
;===================================================================================================
DrawPotItem:
PHX : TAX
PHX
JSL.l AttemptItemSubstitution
JSL.l ResolveLootIDLong
TAX
LDA.l SpriteProperties_standing_width,X : BEQ .narrow
.full

View File

@@ -228,7 +228,7 @@ RevealPotItem:
++ LDA.l DungeonLocationsChecked, X : INC : STA.l DungeonLocationsChecked, X
; Could increment GT Tower Pre Big Key but we aren't showing that stat right now
+ REP #$10
LDA TotalItemCounter : INC : STA TotalItemCounter ; Increment Item Total
LDA.l TotalItemCounter : INC : STA.l TotalItemCounter ; Increment Item Total
INC.w UpdateHUD
.obtained
PLY : PLX
@@ -279,7 +279,7 @@ SaveMajorItemDrop:
LDA.w #$0018 : BRA .substitute
+ CPY.w #$0031 : BNE + ; 10 pack bombs
LDA.w #$0019 : BRA .substitute
+ STA $0B9C ; indicates we should use the key routines or a substitute
+ STA.w $0B9C ; indicates we should use the key routines or a substitute
RTL
.substitute
PHA
@@ -321,7 +321,7 @@ IncrementCountsForSubstitute:
++ LDA.l DungeonLocationsChecked, X : INC : STA.l DungeonLocationsChecked, X
; Could increment GT Tower Pre Big Key but we aren't showing that stat right now
+
LDA TotalItemCounter : INC : STA TotalItemCounter ; Increment Item Total
LDA.l TotalItemCounter : INC : STA.l TotalItemCounter ; Increment Item Total
INC.w UpdateHUD
.obtained
SEP #$30 : PLX
@@ -521,8 +521,8 @@ IncrementCountForMinor:
INX #2 ; treat sewers as HC
++ LDA.l DungeonLocationsChecked, X : INC : STA.l DungeonLocationsChecked, X
; Could increment GT Tower Pre Big Key but we aren't showing that stat right now
+ REP #$10
LDA TotalItemCounter : INC : STA TotalItemCounter ; Increment Item Total
+
LDA.l TotalItemCounter : INC : STA.l TotalItemCounter ; Increment Item Total
INC.w UpdateHUD
.obtained
SEP #$30 : PLX
@@ -647,7 +647,7 @@ KeyGet:
LDA $00 : CMP.l KeyTable, X : BNE +
.countIt
LDA.l StandingItemCounterMask : AND SpawnedItemFlag : BEQ ++
JSL.l AddInventory : JSL CountChestKeyLong
JSL.l AddInventory
++ PLX : PLA : RTL
+ CMP.b #$AF : beq .countIt ; universal key
CMP.b #$24 : beq .countIt ; small key for this dungeon

View File

@@ -214,34 +214,14 @@ ItemBehavior:
JSR .increment_sword
RTS
.fighter_shield
SEP #$10
LDA.w ShopPurchaseFlag : BNE ..shop_shield
-
LDX.b #$01
JSR .increment_shield
RTS
..shop_shield
LDA.l InventoryTable_properties,X : BIT.b #$02 : BNE -
RTS
.fighter_shield
.red_shield
SEP #$10
LDA.w ShopPurchaseFlag : BNE ..shop_shield
-
LDX.b #$02
JSR .increment_shield
RTS
..shop_shield
LDA.l InventoryTable_properties,X : BIT.b #$02 : BNE -
RTS
.mirror_shield
SEP #$10
LDX.b #$03
JSR .increment_shield
REP #$10
RTS
LDA.l ProgressiveFlag : BEQ +
LDA.l HighestShield : INC : TAX
JSR .increment_shield
+ RTS
.blue_mail
SEP #$10
@@ -273,8 +253,8 @@ ItemBehavior:
.prog_shield
SEP #$10
LDA.l ShieldEquipment : INC : TAX
JSR .increment_shield
LDA.l HighestShield : INC : TAX
JSR .increment_shield
REP #$10
RTS
@@ -793,6 +773,7 @@ ResolveLootID:
.shields
SEP #$20
LDA !MULTIWORLD_SPRITEITEM_PLAYER_ID : BNE ++
LDA.b #$01 : STA.l ProgressiveFlag
LDA.l HighestShield
CMP.l ProgressiveShieldLimit : BCC +
LDA.l ProgressiveShieldReplacement
@@ -1095,6 +1076,7 @@ RTS
;--------------------------------------------------------------------------------
AttemptItemSubstitution:
PHX : PHA
LDA.l !MULTIWORLD_ITEM_PLAYER_ID : BNE .exit
LDX.b #$00
-
LDA.l ItemSubstitutionRules, X
@@ -1159,7 +1141,7 @@ MaybeFlagCompassTotalPickup:
RTL
MaybeFlagMapTotalPickup:
LDA.l MapHUDMode : AND.b #$0F : BEQ .done
; LDA.l MapHUDMode : AND.b #$0F : BEQ .done
LDA.w DungeonID : BMI .done
LDA.w ItemReceiptID : CMP.b #$33 : BEQ .set_flag
REP #$20
@@ -1181,7 +1163,7 @@ MaybeFlagDungeonTotalsEntrance:
LDA.l CompassMode : AND.w #$000F : BEQ .maps ; Skip if we're not showing compass counts
JSR.w FlagCompassCount
.maps
LDA.l MapHUDMode : AND.w #$000F : BEQ .done
; LDA.l MapHUDMode : AND.w #$000F : BEQ .done
LDX.w DungeonID
JSR.w FlagMapCount
.done

View File

@@ -188,7 +188,7 @@ RaceGameFlag = $7E021B ;
;
MessageJunk = $7E0223 ; Zeroed but never used (?)
;
ShopPurchaseFlag = $7E0224 ; $01 = Shop purchase item receipt.
ProgressiveFlag = $7E0224 ; unused
;CoolScratch = $7E0224 ; 0x5C bytes of free ram
ItemStackPtr = $7E0226 ; Pointer into Item GFX and VRAM target queues. Word length.
; If not zero, pointer should always be left pointing at the