Fix potion refills counting in shops

Bee traps - graphics upgrade
This commit is contained in:
aerinon
2023-09-09 16:41:44 -06:00
parent b67e5c8433
commit 23ef62522b
4 changed files with 49 additions and 22 deletions

View File

@@ -738,18 +738,18 @@ endmacro
%InventoryItem($2B, $0085, $0000, $0000) ; 2B - Full bottle (red)
%InventoryItem($2C, $0085, $0000, $0000) ; 2C - Full bottle (green)
%InventoryItem($2D, $0085, $0000, $0000) ; 2D - Full bottle (blue)
%InventoryItem($2E, $0080, $0000, $0000) ; 2E - Potion refill (red)
%InventoryItem($2F, $0080, $0000, $0000) ; 2F - Potion refill (green)
%InventoryItem($30, $0080, $0000, $0000) ; 30 - Potion refill (blue)
%InventoryItem($2E, $0081, $0000, $0000) ; 2E - Potion refill (red)
%InventoryItem($2F, $0081, $0000, $0000) ; 2F - Potion refill (green)
%InventoryItem($30, $0081, $0000, $0000) ; 30 - Potion refill (blue)
%InventoryItem($31, $0011, $0000, $0000) ; 31 - 10 bombs
%InventoryItem($32, $0001, $0000, $0000) ; 32 - Big key
%InventoryItem($33, $0001, $0000, $0000) ; 33 - Map
%InventoryItem($34, $0001, $0000, $0000) ; 34 - 1 rupee
%InventoryItem($35, $0001, $0000, $0000) ; 35 - 5 rupees
%InventoryItem($36, $0001, $0000, $0000) ; 36 - 20 rupees
%InventoryItem($37, $0000, $0000, $0000) ; 37 - Green pendant
%InventoryItem($38, $0000, $0000, $0000) ; 38 - Red pendant
%InventoryItem($39, $0000, $0000, $0000) ; 39 - Blue pendant
%InventoryItem($37, $0001, $0000, $0000) ; 37 - Green pendant
%InventoryItem($38, $0001, $0000, $0000) ; 38 - Red pendant
%InventoryItem($39, $0001, $0000, $0000) ; 39 - Blue pendant
%InventoryItem($3A, $00A5, $0000, $0000) ; 3A - Bow And Arrows
%InventoryItem($3B, $00A5, $0000, $0000) ; 3B - Silver Bow
%InventoryItem($3C, $0085, $0000, $0000) ; 3C - Full bottle (bee)
@@ -868,13 +868,13 @@ endmacro
%InventoryItem($AD, $0041, $0000, SmallKeyCounter) ; AD - Small key of Ganon's Tower
%InventoryItem($AE, $0001, $0000, $0000) ; AE - Reserved
%InventoryItem($AF, $0001, $0000, SmallKeyCounter) ; AF - Generic small key
%InventoryItem($B0, $0080, $0000, $0000) ; B0 - Crystal 6
%InventoryItem($B1, $0080, $0000, $0000) ; B1 - Crystal 1
%InventoryItem($B2, $0080, $0000, $0000) ; B2 - Crystal 5
%InventoryItem($B3, $0080, $0000, $0000) ; B3 - Crystal 7
%InventoryItem($B4, $0080, $0000, $0000) ; B4 - Crystal 2
%InventoryItem($B5, $0080, $0000, $0000) ; B5 - Crystal 4
%InventoryItem($B6, $0080, $0000, $0000) ; B6 - Crystal 3
%InventoryItem($B0, $0081, $0000, $0000) ; B0 - Crystal 6
%InventoryItem($B1, $0081, $0000, $0000) ; B1 - Crystal 1
%InventoryItem($B2, $0081, $0000, $0000) ; B2 - Crystal 5
%InventoryItem($B3, $0081, $0000, $0000) ; B3 - Crystal 7
%InventoryItem($B4, $0081, $0000, $0000) ; B4 - Crystal 2
%InventoryItem($B5, $0081, $0000, $0000) ; B5 - Crystal 4
%InventoryItem($B6, $0081, $0000, $0000) ; B6 - Crystal 3
%InventoryItem($B7, $0000, $0000, $0000) ; B7 - Reserved
%InventoryItem($B8, $0001, $0000, $0000) ; B8 -
%InventoryItem($B9, $0001, $0000, $0000) ; B9 -
@@ -1434,7 +1434,7 @@ StandingItemGraphicsOffsets:
dw $0 ; CD -
dw $0 ; CE -
dw $0 ; CF -
dw $11E0 ; D0 - Bee trap
dw BigDecompressionBuffer+$09A0 ; D0 - Bee trap
dw $11E0 ; D1 - Apples
dw $11E0 ; D2 - Fairy
dw $11E0 ; D3 - Chicken

View File

@@ -19,6 +19,7 @@ RequestStandingItemVRAMSlot:
; unsure about substitution rules here, because they aren't skipped properly for MW yet
JSL AttemptItemSubstitution
JSL ResolveLootIDLong
JSL ResolveBeeTrapLong
REP #$30
ASL : TAX
LDA.l StandingItemGraphicsOffsets,X
@@ -59,7 +60,9 @@ DrawPotItem:
JSL.l AttemptItemSubstitution
JSL.l ResolveLootIDLong
TAX
LDA.l SpriteProperties_standing_width,X : BEQ .narrow
LDA.l BeeTrapDisguise : BEQ +
TAX
+ LDA.l SpriteProperties_standing_width,X : BEQ .narrow
.full
PLX

View File

@@ -545,7 +545,7 @@ PowderFlag: skip 1 ; Flag for powder junk
ShopPriceColumn: skip 3 ; Stores coordinates for drawing prices in shops
ShopInventoryPlayer: skip 3 ; Multiworld id for player inventory
ShopInventoryDisguise: skip 3 ; Bee trap is disguised as another item in shop
skip 1 ; Unused
BeeTrapDisguise: skip 1 ; Unused
skip 2 ; Reserved for OneMind
OneMindId: skip 1 ; Current OneMind player
OneMindTimerRAM: skip 2 ; Frame counter for OneMind
@@ -961,6 +961,7 @@ endmacro
%assertRAM(ShopPriceColumn, $7F5066)
%assertRAM(ShopInventoryPlayer, $7F5069)
%assertRAM(ShopInventoryDisguise, $7F506C)
%assertRAM(BeeTrapDisguise, $7F506F)
%assertRAM(OneMindId, $7F5072)
%assertRAM(OneMindTimerRAM, $7F5073)
%assertRAM(ClockStatus, $7F507E)

View File

@@ -63,16 +63,35 @@ PrepDynamicTile:
.notRemote
JSR.w ResolveLootID
-
JSR ResolveBeeTrap
JSR.w LoadDynamicTileOAMTable
JSL TransferItemReceiptToBuffer_using_ReceiptID
SEP #$30
LDA.b #$00 : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID ; clear player id
PLB : PLY : PLX
RTL
.loot_resolved ; todo: figure out if this entry point is needed by multiworld
.loot_resolved
PHX : PHY : PHB
BRA -
;--------------------------------------------------------------------------------
; ResolveBeeTrap
; In: A - Loot ID
; Out: A - Resolved Loot ID
;--------------------------------------------------------------------------------
ResolveBeeTrap:
PHA
LDA.b #$00 : STA.l BeeTrapDisguise ; clear it
PLA
CMP.b #$D0 : BNE +
JSL.l GetRandomInt : AND.b #$3F
BNE ++ : LDA.b #$49 : ++ CMP.b #$26 : BNE ++ : LDA.b #$6A : ++
STA.l BeeTrapDisguise
+ RTS
ResolveBeeTrapLong:
JSR ResolveBeeTrap
RTL
;--------------------------------------------------------------------------------
; LoadDynamicTileOAMTable
@@ -84,8 +103,9 @@ LoadDynamicTileOAMTable:
REP #$30
LDA.w #$0000 : STA.l SpriteOAM : STA.l SpriteOAM+2
LDA.w #$0200 : STA.l SpriteOAM+6
LDA.w SpriteID,X : AND.w #$00FF
LDY.w #$0024
LDA.l BeeTrapDisguise : AND.w #$00FF : BNE +
LDA.w SpriteID,X : AND.w #$00FF
+ LDY.w #$0024
PHX : ASL : TAX
LDA.l InventoryTable_properties, X : BIT.w #$8000 : BEQ +
LDA.l VRAMAddressOffset, X : TAY
@@ -93,8 +113,9 @@ LoadDynamicTileOAMTable:
PLX
SEP #$30
LDA.w SpriteID,X
JSL.l GetSpritePalette_resolved
LDA.l BeeTrapDisguise : BNE +
LDA.w SpriteID,X
+ JSL.l GetSpritePalette_resolved
STA.l SpriteOAM+5 : STA.l SpriteOAM+13
PHX
LDA.l SpriteProperties_standing_width,X : BEQ .narrow
@@ -126,7 +147,9 @@ DrawDynamicTile:
JSR PrepDrawRemoteItemSprite
PHX
TAX
LDA.l SpriteProperties_standing_width,X : BEQ .narrow
LDA.l BeeTrapDisguise : BEQ +
TAX
+ LDA.l SpriteProperties_standing_width,X : BEQ .narrow
.full
PLX