Hud update flag added for standing items

Ram addresses updated
Minor multiworld fix
This commit is contained in:
aerinon
2023-08-30 10:25:20 -06:00
parent 51011dcada
commit cd67d27798
5 changed files with 48 additions and 86 deletions

View File

@@ -1,25 +1,8 @@
; where we shove the decompressed graphics to send to WRAM
DynamicDropGFX = $7EF500
; this will just count from 0 to 4 to determine which slot we're using
; we're expecting 5 items max per room, and order is irrelevant
; we just need to keep track of where they go
DynamicDropGFXIndex = $7E1E70
; this will keep track of the above for each item
SprItemGFX = $7E0780
; this is the item requested and a flag
DynamicDropRequest = $7E1E71
DynamicDropQueue = $7E1E72
; Come in with
; A = item receipt ID
; X = slot
RequestStandingItemVRAMSlot:
STA.w DynamicDropQueue
LDA.b #$01
STA.w DynamicDropRequest
PHA
LDA.w DynamicDropGFXIndex
INC
@@ -32,21 +15,19 @@ RequestStandingItemVRAMSlot:
STA.w SprItemGFX,X
PHX
LDA.w DynamicDropQueue
PLA : PHX
; unsure about substitution rules here, because they aren't skipped properly for MW yet
JSL AttemptItemSubstitution
JSL ResolveLootIDLong
ASL : TAX : LDA.l StandingItemGraphicsOffsets,X
REP #$30
ASL : TAX
LDA.l StandingItemGraphicsOffsets,X
LDX.w ItemStackPtr
STA.w ItemGFXStack,X
PLX : PHX
REP #$20
STA.l ItemGFXStack,X
LDA.w DynamicDropGFXIndex : AND.w #$000F : ASL : TAX
LDA.l FreeUWGraphics,X
LDX.w ItemStackPtr
STA.w ItemTargetStack,X
SEP #$20
STA.l ItemTargetStack,X
TXA : INC #2 : STA.w ItemStackPtr
SEP #$30
PLX
@@ -56,43 +37,6 @@ RequestStandingItemVRAMSlot:
;===================================================================================================
TransferPotGFX:
SEP #$10
REP #$20
LDX.w DynamicDropRequest
BEQ .no
STZ.w DynamicDropRequest
LDA.w DynamicDropGFXIndex
ASL
TAX
LDA.l FreeUWGraphics,X
STA.w $2116
; calculate bottom row now
CLC : ADC.w #$0200>>1 : PHA
LDX.b #$7E : STX.w $4314
LDA.w #DynamicDropGFX : STA.w $4302
LDX.b #$80 : STX.w $2115
LDA.w #$1801 : STA.w $4300
LDA.w #$0040 : STA.w $4305
LDY.b #$01
STY.w $420B
STA.w $4305
PLA
STA.w $2116
STY.w $420B
.no
RTL
FreeUWGraphics:
dw $8800>>1
dw $8840>>1

View File

@@ -88,22 +88,6 @@ InitializeMirrorHDMA:
org $80E3C4
LoadCommonSprites_long:
; defines
; Ram usage
SpawnedItemID = $7E0720 ; 0x02
SpawnedItemIndex = $7E0722 ; 0x02
SpawnedItemIsMultiWorld = $7E0724 ; 0x02
SpawnedItemFlag = $7E0726 ; 0x02 - one for pot, 2 for sprite drop
; (flag used as a bitmask in conjunction with StandingItemCounterMask)
SpawnedItemMWPlayer = $7E0728 ; 0x02
;!EnemyDropIndicator = $7E072A ; 0x02 either the blank tile or the blue square
; clear all of them in a loop during room load
SprDropsItem = $7E0730 ; 0x16
SprItemReceipt = $7E0740 ; 0x16
SprItemIndex = $7E0750
SprItemMWPlayer = $7E0760 ; 0x16
SprItemFlags = $7E0770 ; 0x16 (used for both pots and drops) (combine with SprDropsItem?)
org $09D62E
UWSpritesPointers: ; 0x250 bytes for 0x128 rooms' 16-bit pointers
@@ -239,9 +223,10 @@ RevealPotItem:
; increment dungeon counts
SEP #$30
LDA $040C : CMP #$FF : BEQ +
BNE ++
CMP.b #$00 : BNE ++
INC #2 ; treat sewers as HC
++ LSR : TAX : LDA DungeonLocationsChecked, X : INC : STA DungeonLocationsChecked, X
INC.w UpdateHUD
; Could increment GT Tower Pre Big Key but we aren't showing that stat right now
+ REP #$30
LDA TotalItemCounter : INC : STA TotalItemCounter ; Increment Item Total
@@ -331,9 +316,10 @@ IncrementCountsForSubstitute:
ORA $0A : STA RoomPotData, X
SEP #$30
LDA $040C : CMP #$FF : BEQ +
BNE ++
CMP.b #$00 : BNE ++
INC #2 ; treat sewers as HC
++ LSR : TAX : LDA DungeonLocationsChecked, X : INC : STA DungeonLocationsChecked, X
INC.w UpdateHUD
; Could increment GT Tower Pre Big Key but we aren't showing that stat right now
+ REP #$30
LDA TotalItemCounter : INC : STA TotalItemCounter ; Increment Item Total
@@ -531,9 +517,10 @@ IncrementCountForMinor:
SEP #$30
JSR SetupEnemyDropIndicator
LDA $040C : CMP #$FF : BEQ +
CMP #$00 : BNE ++
CMP.b #$00 : BNE ++
INC #2 ; treat sewers as HC
++ LSR : TAX : LDA DungeonLocationsChecked, X : INC : STA DungeonLocationsChecked, X
INC.w UpdateHUD
; Could increment GT Tower Pre Big Key but we aren't showing that stat right now
+ REP #$30
LDA TotalItemCounter : INC : STA TotalItemCounter ; Increment Item Total