Hud update flag added for standing items
Ram addresses updated Minor multiworld fix
This commit is contained in:
@@ -39,6 +39,8 @@ DRHUD_DrawIndicators:
|
|||||||
DRHUD_BossIndicator:
|
DRHUD_BossIndicator:
|
||||||
LDA.l DRMode : BNE .continue
|
LDA.l DRMode : BNE .continue
|
||||||
.early_exit
|
.early_exit
|
||||||
|
REP #$10
|
||||||
|
LDY.w #!BlankTile : STY.w !IndicatorAddress
|
||||||
JMP DRHUD_Finished
|
JMP DRHUD_Finished
|
||||||
.continue
|
.continue
|
||||||
LDA.w $040C : CMP.b #$1B : BCS .early_exit
|
LDA.w $040C : CMP.b #$1B : BCS .early_exit
|
||||||
|
|||||||
@@ -256,6 +256,7 @@ PostItemAnimation:
|
|||||||
LDA !MULTIWORLD_ITEM_PLAYER_ID : BEQ +
|
LDA !MULTIWORLD_ITEM_PLAYER_ID : BEQ +
|
||||||
STZ $02E9
|
STZ $02E9
|
||||||
LDA #$00 : STA !MULTIWORLD_ITEM_PLAYER_ID
|
LDA #$00 : STA !MULTIWORLD_ITEM_PLAYER_ID
|
||||||
|
PLB
|
||||||
JML.l Ancilla_ReceiveItem_objectFinished
|
JML.l Ancilla_ReceiveItem_objectFinished
|
||||||
+
|
+
|
||||||
|
|
||||||
@@ -291,6 +292,5 @@ PostItemAnimation:
|
|||||||
|
|
||||||
STZ.w ItemReceiptMethod : LDA.w AncillaGet, X ; thing we wrote over to get here
|
STZ.w ItemReceiptMethod : LDA.w AncillaGet, X ; thing we wrote over to get here
|
||||||
PLB
|
PLB
|
||||||
RTL
|
|
||||||
JML Ancilla_ReceiveItem_optimus+6
|
JML Ancilla_ReceiveItem_optimus+6
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -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
|
; Come in with
|
||||||
; A = item receipt ID
|
; A = item receipt ID
|
||||||
; X = slot
|
; X = slot
|
||||||
RequestStandingItemVRAMSlot:
|
RequestStandingItemVRAMSlot:
|
||||||
STA.w DynamicDropQueue
|
PHA
|
||||||
LDA.b #$01
|
|
||||||
STA.w DynamicDropRequest
|
|
||||||
|
|
||||||
LDA.w DynamicDropGFXIndex
|
LDA.w DynamicDropGFXIndex
|
||||||
INC
|
INC
|
||||||
@@ -32,21 +15,19 @@ RequestStandingItemVRAMSlot:
|
|||||||
STA.w SprItemGFX,X
|
STA.w SprItemGFX,X
|
||||||
|
|
||||||
|
|
||||||
PHX
|
PLA : PHX
|
||||||
LDA.w DynamicDropQueue
|
|
||||||
; unsure about substitution rules here, because they aren't skipped properly for MW yet
|
; unsure about substitution rules here, because they aren't skipped properly for MW yet
|
||||||
JSL AttemptItemSubstitution
|
JSL AttemptItemSubstitution
|
||||||
JSL ResolveLootIDLong
|
JSL ResolveLootIDLong
|
||||||
ASL : TAX : LDA.l StandingItemGraphicsOffsets,X
|
REP #$30
|
||||||
|
ASL : TAX
|
||||||
|
LDA.l StandingItemGraphicsOffsets,X
|
||||||
LDX.w ItemStackPtr
|
LDX.w ItemStackPtr
|
||||||
STA.w ItemGFXStack,X
|
STA.l ItemGFXStack,X
|
||||||
|
LDA.w DynamicDropGFXIndex : AND.w #$000F : ASL : TAX
|
||||||
PLX : PHX
|
|
||||||
REP #$20
|
|
||||||
LDA.l FreeUWGraphics,X
|
LDA.l FreeUWGraphics,X
|
||||||
LDX.w ItemStackPtr
|
LDX.w ItemStackPtr
|
||||||
STA.w ItemTargetStack,X
|
STA.l ItemTargetStack,X
|
||||||
SEP #$20
|
|
||||||
TXA : INC #2 : STA.w ItemStackPtr
|
TXA : INC #2 : STA.w ItemStackPtr
|
||||||
SEP #$30
|
SEP #$30
|
||||||
PLX
|
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:
|
FreeUWGraphics:
|
||||||
dw $8800>>1
|
dw $8800>>1
|
||||||
dw $8840>>1
|
dw $8840>>1
|
||||||
|
|||||||
@@ -88,22 +88,6 @@ InitializeMirrorHDMA:
|
|||||||
org $80E3C4
|
org $80E3C4
|
||||||
LoadCommonSprites_long:
|
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
|
org $09D62E
|
||||||
UWSpritesPointers: ; 0x250 bytes for 0x128 rooms' 16-bit pointers
|
UWSpritesPointers: ; 0x250 bytes for 0x128 rooms' 16-bit pointers
|
||||||
|
|
||||||
@@ -239,9 +223,10 @@ RevealPotItem:
|
|||||||
; increment dungeon counts
|
; increment dungeon counts
|
||||||
SEP #$30
|
SEP #$30
|
||||||
LDA $040C : CMP #$FF : BEQ +
|
LDA $040C : CMP #$FF : BEQ +
|
||||||
BNE ++
|
CMP.b #$00 : BNE ++
|
||||||
INC #2 ; treat sewers as HC
|
INC #2 ; treat sewers as HC
|
||||||
++ LSR : TAX : LDA DungeonLocationsChecked, X : INC : STA DungeonLocationsChecked, X
|
++ 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
|
; Could increment GT Tower Pre Big Key but we aren't showing that stat right now
|
||||||
+ REP #$30
|
+ REP #$30
|
||||||
LDA TotalItemCounter : INC : STA TotalItemCounter ; Increment Item Total
|
LDA TotalItemCounter : INC : STA TotalItemCounter ; Increment Item Total
|
||||||
@@ -331,9 +316,10 @@ IncrementCountsForSubstitute:
|
|||||||
ORA $0A : STA RoomPotData, X
|
ORA $0A : STA RoomPotData, X
|
||||||
SEP #$30
|
SEP #$30
|
||||||
LDA $040C : CMP #$FF : BEQ +
|
LDA $040C : CMP #$FF : BEQ +
|
||||||
BNE ++
|
CMP.b #$00 : BNE ++
|
||||||
INC #2 ; treat sewers as HC
|
INC #2 ; treat sewers as HC
|
||||||
++ LSR : TAX : LDA DungeonLocationsChecked, X : INC : STA DungeonLocationsChecked, X
|
++ 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
|
; Could increment GT Tower Pre Big Key but we aren't showing that stat right now
|
||||||
+ REP #$30
|
+ REP #$30
|
||||||
LDA TotalItemCounter : INC : STA TotalItemCounter ; Increment Item Total
|
LDA TotalItemCounter : INC : STA TotalItemCounter ; Increment Item Total
|
||||||
@@ -531,9 +517,10 @@ IncrementCountForMinor:
|
|||||||
SEP #$30
|
SEP #$30
|
||||||
JSR SetupEnemyDropIndicator
|
JSR SetupEnemyDropIndicator
|
||||||
LDA $040C : CMP #$FF : BEQ +
|
LDA $040C : CMP #$FF : BEQ +
|
||||||
CMP #$00 : BNE ++
|
CMP.b #$00 : BNE ++
|
||||||
INC #2 ; treat sewers as HC
|
INC #2 ; treat sewers as HC
|
||||||
++ LSR : TAX : LDA DungeonLocationsChecked, X : INC : STA DungeonLocationsChecked, X
|
++ 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
|
; Could increment GT Tower Pre Big Key but we aren't showing that stat right now
|
||||||
+ REP #$30
|
+ REP #$30
|
||||||
LDA TotalItemCounter : INC : STA TotalItemCounter ; Increment Item Total
|
LDA TotalItemCounter : INC : STA TotalItemCounter ; Increment Item Total
|
||||||
|
|||||||
33
ram.asm
33
ram.asm
@@ -274,7 +274,24 @@ TileMapTile32 = $7E0698 ; Tilemap location of new tile32 objects, such
|
|||||||
;
|
;
|
||||||
SkipOAM = $7E0710 ; Set to skip OAM updates. High byte written $FF with exploding walls
|
SkipOAM = $7E0710 ; Set to skip OAM updates. High byte written $FF with exploding walls
|
||||||
OWScreenSize = $7E0712 ; Flags overworld screen size.
|
OWScreenSize = $7E0712 ; Flags overworld screen size.
|
||||||
;
|
|
||||||
|
SpawnedItemID = $7E0720 ; ID of the Item Spawning. Word
|
||||||
|
SpawnedItemIndex = $7E0722 ; Sprite/Pot Index of Item Spawning. Word
|
||||||
|
SpawnedItemIsMultiWorld = $7E0724 ; Multiworld World Flag. Word
|
||||||
|
SpawnedItemFlag = $7E0726 ; 0x02 - one for pot, 2 for sprite drop
|
||||||
|
; (flag used as a bitmask in conjunction with StandingItemCounterMask)
|
||||||
|
SpawnedItemMWPlayer = $7E0728 ; Player Id for spawned item if Multiworld item 0x02
|
||||||
|
|
||||||
|
SprDropsItem = $7E0730 ; Array for whether a sprite drops an item 0x16
|
||||||
|
SprItemReceipt = $7E0740 ; Array for item id for each sprite 0x16
|
||||||
|
SprItemIndex = $7E0750 ; Array for item index (see code)
|
||||||
|
SprItemMWPlayer = $7E0760 ; Player id for each sprite drop 0x16
|
||||||
|
SprItemFlags = $7E0770 ; Array 0x16 (used for both pots and drops) (combine with SprDropsItem?)
|
||||||
|
SprItemGFX = $7E0780 ; this will keepa track of the DynamicDropGFXIndex for each item
|
||||||
|
DynamicDropGFXIndex = $7E0790 ; 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
|
||||||
|
DynamicDropQueue = $7E1E72 ; this is the item requested and a flag
|
||||||
OAMBuffer = $7E0800 ; Main OAM buffer sent to OAM. $200 bytes.
|
OAMBuffer = $7E0800 ; Main OAM buffer sent to OAM. $200 bytes.
|
||||||
OAMBuffer2 = $7E0A00 ;
|
OAMBuffer2 = $7E0A00 ;
|
||||||
;
|
;
|
||||||
@@ -477,7 +494,7 @@ HUDKeyDigits = $7EC764 ;
|
|||||||
;
|
;
|
||||||
BigRAM = $7EC900 ; Big buffer of free ram (0x1F00)
|
BigRAM = $7EC900 ; Big buffer of free ram (0x1F00)
|
||||||
ItemGFXStack = $7ECB00 ; Pointers to source of decompressed item tiles deferred to NMI loading.
|
ItemGFXStack = $7ECB00 ; Pointers to source of decompressed item tiles deferred to NMI loading.
|
||||||
ItemGFXSBankStack = $7ECB20 ; Source bank byte for above.
|
ItemGFXSBankStack = $7ECB20 ; Source bank byte for above. (not used yet)
|
||||||
ItemTargetStack = $7ECB40 ; Pointers to VRAM targets for ItemGFXStack.
|
ItemTargetStack = $7ECB40 ; Pointers to VRAM targets for ItemGFXStack.
|
||||||
TotalItemCountTiles = $7ECF00 ; Cached total item count tiles for HUD. Four words high to low.
|
TotalItemCountTiles = $7ECF00 ; Cached total item count tiles for HUD. Four words high to low.
|
||||||
|
|
||||||
@@ -774,6 +791,18 @@ endmacro
|
|||||||
%assertRAM(TileMapTile32, $7E0698)
|
%assertRAM(TileMapTile32, $7E0698)
|
||||||
%assertRAM(SkipOAM, $7E0710)
|
%assertRAM(SkipOAM, $7E0710)
|
||||||
%assertRAM(OWScreenSize, $7E0712)
|
%assertRAM(OWScreenSize, $7E0712)
|
||||||
|
%assertRAM(SpawnedItemID, $7E0720)
|
||||||
|
%assertRAM(SpawnedItemIndex, $7E0722)
|
||||||
|
%assertRAM(SpawnedItemIsMultiWorld, $7E0724)
|
||||||
|
%assertRAM(SpawnedItemFlag, $7E0726)
|
||||||
|
%assertRAM(SpawnedItemMWPlayer, $7E0728)
|
||||||
|
%assertRAM(SprDropsItem, $7E0730)
|
||||||
|
%assertRAM(SprItemReceipt, $7E0740)
|
||||||
|
%assertRAM(SprItemIndex, $7E0750)
|
||||||
|
%assertRAM(SprItemMWPlayer, $7E0760)
|
||||||
|
%assertRAM(SprItemFlags, $7E0770)
|
||||||
|
%assertRAM(SprItemGFX, $7E0780)
|
||||||
|
%assertRAM(DynamicDropGFXIndex, $7E0790)
|
||||||
%assertRAM(OAMBuffer, $7E0800)
|
%assertRAM(OAMBuffer, $7E0800)
|
||||||
%assertRAM(OAMBuffer2, $7E0A00)
|
%assertRAM(OAMBuffer2, $7E0A00)
|
||||||
%assertRAM(TransparencyFlag, $7E0ABD)
|
%assertRAM(TransparencyFlag, $7E0ABD)
|
||||||
|
|||||||
Reference in New Issue
Block a user