Fixed ExtendedSRAM not saving

Fix enemy drops and pots with Fairies/Chickens/Big Magic
Fixed Big Magic refill when in chests/standing items
Changed shop code to respect ShopEnableCount flag
This commit is contained in:
aerinon
2023-09-01 14:13:01 -06:00
parent aecc65595e
commit 9fc85218ae
6 changed files with 15 additions and 11 deletions

View File

@@ -181,6 +181,7 @@ ShopCheck:
; TODO: If we write all shops, we can use the ShopPurchase flag instead of this ; TODO: If we write all shops, we can use the ShopPurchase flag instead of this
LDA.b IndoorsFlag : BEQ .count LDA.b IndoorsFlag : BEQ .count
LDA.w ItemReceiptMethod : CMP.b #$01 : BEQ .count LDA.w ItemReceiptMethod : CMP.b #$01 : BEQ .count
LDA.l ShopEnableCount : BNE .count
LDA.w InventoryTable_properties,Y : BIT.b #$02 : BNE .count LDA.w InventoryTable_properties,Y : BIT.b #$02 : BNE .count
REP #$20 REP #$20
LDA.b RoomIndex LDA.b RoomIndex

View File

@@ -347,7 +347,7 @@ endmacro
%ReceiptProps($D1, -4, 0, $47, $F36A, $FF, skip, skip) ; D1 - Apples %ReceiptProps($D1, -4, 0, $47, $F36A, $FF, skip, skip) ; D1 - Apples
%ReceiptProps($D2, -4, 0, $47, $F36A, $FF, fairy, skip) ; D2 - Fairy %ReceiptProps($D2, -4, 0, $47, $F36A, $FF, fairy, skip) ; D2 - Fairy
%ReceiptProps($D3, -4, 0, $47, $F36A, $FF, chicken, skip) ; D3 - Chicken %ReceiptProps($D3, -4, 0, $47, $F36A, $FF, chicken, skip) ; D3 - Chicken
%ReceiptProps($D4, -4, 4, $3B, $F373, $80, skip, skip) ; D4 - Big Magic %ReceiptProps($D4, -4, 4, $3B, $F373, $80, refill_magic, skip) ; D4 - Big Magic
%ReceiptProps($D5, -4, 0, $02, $F376, $05, skip, skip) ; D5 - 5 Arrows %ReceiptProps($D5, -4, 0, $02, $F376, $05, skip, skip) ; D5 - 5 Arrows
%ReceiptProps($D6, -4, 0, $49, $F36A, $FF, skip, skip) ; D6 - %ReceiptProps($D6, -4, 0, $49, $F36A, $FF, skip, skip) ; D6 -
%ReceiptProps($D7, -4, 0, $49, $F36A, $FF, skip, skip) ; D7 - %ReceiptProps($D7, -4, 0, $49, $F36A, $FF, skip, skip) ; D7 -

View File

@@ -502,10 +502,10 @@ db $36, $DB ; RED RUPEE ($36)
db $42, $D8 ; HEART ($42) db $42, $D8 ; HEART ($42)
db $44, $E2 ; ARROW REFILL 10 ($44) db $44, $E2 ; ARROW REFILL 10 ($44)
db $45, $DF ; SMALL MAGIC DECANTER ($45) db $45, $DF ; SMALL MAGIC DECANTER ($45)
db $B2, $E3 ; FAERIE ($B2) db $D2, $E3 ; FAERIE ($D2)
db $B3, $0B ; CUCCO ($B3) db $D3, $0B ; CUCCO ($D3)
db $B4, $E0 ; LARGE MAGIC DECANTER ($B4) db $D4, $E0 ; LARGE MAGIC DECANTER ($D4)
db $B5, $E1 ; ARROW REFILL 5 (x??) db $D5, $E1 ; ARROW REFILL 5 (x$D5)
IncrementCountForMinor: IncrementCountForMinor:

View File

@@ -677,6 +677,9 @@ ItemBehavior:
.done .done
RTS RTS
.refill_magic
SEP #$30 : LDA.b #$80 : STA.l MagicFiller : RTS
.bee_trap .bee_trap
SEP #$30 SEP #$30
LDA.b #$79 : JSL Sprite_SpawnDynamically : BMI + ; DashBeeHive_SpawnBee LDA.b #$79 : JSL Sprite_SpawnDynamically : BMI + ; DashBeeHive_SpawnBee

View File

@@ -173,8 +173,8 @@ RTL
CopyExtendedWRAMSaveFileToSRAM: CopyExtendedWRAMSaveFileToSRAM:
PHB PHB
LDA.w #$0FFF LDA.w #$0FFF
LDX.w #ExtendedSaveDataSRAM LDX.w #ExtendedSaveDataWRAM
LDY.w #ExtendedSaveDataWRAM LDY.w #ExtendedSaveDataSRAM
MVN CartridgeSRAM>>16, ExtendedSaveDataWRAM>>16 MVN CartridgeSRAM>>16, ExtendedSaveDataWRAM>>16
PLB PLB
TDC TDC

View File

@@ -2589,7 +2589,7 @@ db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
; 0x30EC00 - 0x30EE2B Multiworld Item's PlayerID ; 0x30EC00 - 0x30EE2B Multiworld Item's PlayerID
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $30EC00 org $B0EC00
ChestData_Player: ChestData_Player:
dl $000000, $000000, $000000, $000000, $000000, $000000, $000000, $000000 dl $000000, $000000, $000000, $000000, $000000, $000000, $000000, $000000
dl $000000, $000000, $000000, $000000, $000000, $000000, $000000, $000000 dl $000000, $000000, $000000, $000000, $000000, $000000, $000000, $000000
@@ -2717,16 +2717,16 @@ db #$00
ChestGameItem_Player: ; EE2B ChestGameItem_Player: ; EE2B
db #$00 db #$00
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $30EE30 ; PC 0x18636C org $B0EE30 ; PC 0x18636C
RemoteItems: RemoteItems:
db #$00 ; $00 = off; $01 = on (default: off) db #$00 ; $00 = off; $01 = on (default: off)
org $30EE31 ; PC 0x18637D org $B0EE31 ; PC 0x18637D
Enable_TerrorPin_AI_Fix: Enable_TerrorPin_AI_Fix:
db #$00 db #$00
;Shop slot count as check ;Shop slot count as check
org $30EE40 ; org $B0EE40 ;
EnableShopItemCount: EnableShopItemCount:
db #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00 db #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00
db #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00 db #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00