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_LOW ?= 1 ; ROM version (two 16-bit integers)
!ROM_VERSION_HIGH ?= 4 ; !ROM_VERSION_HIGH ?= 5 ;
org $80FFE0 ; Unused hardware vector org $80FFE0 ; Unused hardware vector
RomVersion: RomVersion:
@@ -78,7 +78,7 @@ incsrc ram.asm
incsrc sram.asm incsrc sram.asm
incsrc registers.asm incsrc registers.asm
incsrc vanillalabels.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 org $A08000 ; bank $20
incsrc itemdowngrade.asm incsrc itemdowngrade.asm

View File

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

View File

@@ -163,15 +163,15 @@ AddInventory:
JSR.w IncrementYAItems JSR.w IncrementYAItems
.totalCount .totalCount
LDA.l !MULTIWORLD_RECEIVING_ITEM : BNE .done LDA.l !MULTIWORLD_RECEIVING_ITEM : BNE .done
REP #$20 REP #$30
LDA.l TotalItemCounter : INC : TAY LDA.l TotalItemCounter : INC : TAY
LDA.l BootsEquipment : BNE + LDA.l BootsEquipment : AND.w #$00FF : BNE +
TYA : STA.l PreBootsLocations TYA : STA.l PreBootsLocations
+ +
LDA.l MirrorEquipment : BNE + LDA.l MirrorEquipment : AND.w #$00FF : BNE +
TYA : STA.l PreMirrorLocations TYA : STA.l PreMirrorLocations
+ +
LDA.l FluteEquipment : BNE + LDA.l FluteEquipment : AND.w #$00FF : BNE +
TYA : STA.l PreFluteLocations TYA : STA.l PreFluteLocations
+ +
TYA TYA
@@ -229,7 +229,7 @@ DungeonIncrement:
+ +
CMP.b #$00 : BNE + CMP.b #$00 : BNE +
INC #2 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 + CPX.b #$0D : BNE +
LDA.l BigKeyField : BIT.b #$04 : BNE ++ LDA.l BigKeyField : BIT.b #$04 : BNE ++
LDA.l PreGTBKLocations : INC : STA.l PreGTBKLocations LDA.l PreGTBKLocations : INC : STA.l PreGTBKLocations

View File

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

View File

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

View File

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

View File

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