Converting item GFX drawing to use pottery draw method

This commit is contained in:
codemann8
2023-05-05 00:13:05 -05:00
parent 90396136d3
commit 20f8ef457e
18 changed files with 399 additions and 194 deletions

View File

@@ -44,7 +44,10 @@ dw !ROM_VERSION_HIGH
!MS_GOT = "$7F5031" !MS_GOT = "$7F5031"
!REDRAW = "$7F5000" ;!REDRAW = "$7F5000"
!SPRITE_REDRAW = "$7E0790" ; 16 bytes
!SPRITE_OAM = "$7EC025" ; 16 bytes
!SPRITE_DYNAMIC_OAM = "$7EC035" ; 16 bytes
!GANON_WARP_CHAIN = "$7F5032"; !GANON_WARP_CHAIN = "$7F5032";
!TILE_UPLOAD_BUFFER = "$7EA180"; !TILE_UPLOAD_BUFFER = "$7EA180";

View File

@@ -5,13 +5,12 @@ LoadLibraryItemGFX:
LDA.l LibraryItem_Player : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID LDA.l LibraryItem_Player : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
%GetPossiblyEncryptedItem(LibraryItem, SpriteItemValues) %GetPossiblyEncryptedItem(LibraryItem, SpriteItemValues)
STA $0E80, X ; Store item type STA $0E80, X ; Store item type
JSL.l PrepDynamicTile JML RequestSlottedTile
RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
DrawLibraryItemGFX: DrawLibraryItemGFX:
PHA PHA
LDA $0E80, X ; Retrieve stored item type LDA $0E80, X ; Retrieve stored item type
JSL.l DrawDynamicTile JSL.l DrawSlottedTile
PLA PLA
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
@@ -25,27 +24,22 @@ RTL
;================================================================================ ;================================================================================
; Randomize Bonk Keys ; Randomize Bonk Keys
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
!REDRAW = "$7F5000"
;--------------------------------------------------------------------------------
LoadBonkItemGFX: LoadBonkItemGFX:
LDA.b #$08 : STA $0F50, X ; thing we wrote over LDA.b #$08 : STA $0F50, X ; thing we wrote over
LoadBonkItemGFX_inner: LoadBonkItemGFX_inner:
LDA.b #$00 : STA !REDRAW
JSR LoadBonkItem_Player : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID JSR LoadBonkItem_Player : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
JSR LoadBonkItem JSR LoadBonkItem
JSL.l PrepDynamicTile JML RequestSlottedTile
RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
DrawBonkItemGFX: DrawBonkItemGFX:
PHA PHA
LDA !REDRAW : BEQ .skipInit ; skip init if already ready LDA.w !SPRITE_REDRAW, X : BEQ .skipInit ; skip init if already ready
JSL.l LoadBonkItemGFX_inner JSL.l LoadBonkItemGFX_inner
BRA .done ; don't draw on the init frame BRA .done ; don't draw on the init frame
.skipInit .skipInit
JSR LoadBonkItem JSR LoadBonkItem
JSL.l DrawDynamicTileNoShadow JSL DrawSlottedTile
.done .done
PLA PLA

View File

@@ -200,6 +200,27 @@ LDA $1B : BNE +
+ +
RTL RTL
;--------------------------------------------------------------------------------
; Fix losing VRAM gfx when using quake
PostNMIUpdateBGCharHalf:
STA.w $420B : SEP #$10 ; what we wrote over
LDA.w $0116 : CMP.b #$46 : BNE .return ; checks to see if this is the last VRAM write
LDA.b $5D : CMP.b #$08 : BCC + : CMP.b #$0A+1 : BCS + ; skip if we're mid-medallion
RTL
+ JSL HeartPieceSetRedraw ; set redraw flag for items
.return
RTL
; Force redraws of items following map checks
PostOverworldGfxLoad:
INC.b $11 : STZ.b $13 ; what we wrote over
JSL HeartPieceSetRedraw
RTL
PostUnderworldMap:
JSL HeartPieceSetRedraw
LDA.l $7EC229 ; what we wrote over
RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
FixJingleGlitch: FixJingleGlitch:
LDA.b $11 LDA.b $11

View File

@@ -1,17 +1,15 @@
;================================================================================ ;================================================================================
; Randomize Catfish ; Randomize Catfish
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
!HEART_REDRAW = "$7F5000"
LoadCatfishItemGFX: LoadCatfishItemGFX:
LDA.l CatfishItem_Player : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID LDA.l CatfishItem_Player : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
LDA.l $1DE185 ; location randomizer writes catfish item to LDA.l $1DE185 ; location randomizer writes catfish item to
JML PrepDynamicTile JML RequestSlottedTile
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
DrawThrownItem: DrawThrownItem:
LDA $8A : CMP.b #$81 : BNE .catfish LDA $8A : CMP.b #$81 : BNE .catfish
.zora .zora
LDA.b #$01 : STA !HEART_REDRAW
LDA.l $1DE1C3 ; location randomizer writes zora item to LDA.l $1DE1C3 ; location randomizer writes zora item to
BRA .draw BRA .draw
@@ -19,7 +17,7 @@ DrawThrownItem:
LDA.l $1DE185 ; location randomizer writes catfish item to LDA.l $1DE185 ; location randomizer writes catfish item to
.draw .draw
JML DrawDynamicTile JML DrawSlottedTile
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
MarkThrownItem: MarkThrownItem:
PHA PHA

View File

@@ -7,12 +7,13 @@ SpawnHauntedGroveItem:
LDA.l HauntedGroveItem_Player : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID LDA.l HauntedGroveItem_Player : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
%GetPossiblyEncryptedItem(HauntedGroveItem, HeartPieceOutdoorValues) %GetPossiblyEncryptedItem(HauntedGroveItem, HeartPieceOutdoorValues)
JSL.l PrepDynamicTile
LDA.b #$EB LDA.b #$EB
STA $7FFE00 STA $7FFE00
JSL Sprite_SpawnDynamically JSL Sprite_SpawnDynamically
LDA.b #$01 : STA.w !SPRITE_REDRAW, Y
LDX.b #$00 LDX.b #$00
LDA $2F : CMP.b #$04 : BEQ + : INX : + LDA $2F : CMP.b #$04 : BEQ + : INX : +

View File

@@ -49,27 +49,25 @@ HeartContainerGet:
BRA HeartPieceGet_skipLoad BRA HeartPieceGet_skipLoad
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
!REDRAW = "$7F5000"
DrawHeartPieceGFX: DrawHeartPieceGFX:
PHP PHP
JSL.l Sprite_IsOnscreen : BCC .offscreen JSL.l Sprite_IsOnscreen : BCC .offscreen
PHA : PHY PHA : PHY
LDA !REDRAW : BEQ .skipInit ; skip init if already ready LDA.w !SPRITE_REDRAW, X : BEQ .skipInit ; skip init if already ready
JSL.l HeartPieceSpritePrep JSL.l HeartPieceSpritePrep
JMP .done ; don't draw on the init frame BRA .done ; don't draw on the init frame
.skipInit .skipInit
LDA $0E80, X ; Retrieve stored item type LDA $0E80, X ; Retrieve stored item type
.skipLoad .skipLoad
JSL DrawSlottedTile : BCS .done
JSL.l DrawDynamicTile ; draw shadow
CMP #$03 : BNE + CMP #$03 : BNE +
INC.b $00 : INC.b $00 : INC.b $00 : INC.b $00 ; move narrow sprite shadow over 4 pixels
PHA : LDA $0E60, X : ORA.b #$20 : STA $0E60, X : PLA PHA : LDA $0E60, X : ORA.b #$20 : STA $0E60, X : PLA
+ +
JSL.l Sprite_DrawShadowLong JSL.l Sprite_DrawShadowLong
.done .done
@@ -78,20 +76,17 @@ DrawHeartPieceGFX:
PLP PLP
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
!REDRAW = "$7F5000"
DrawHeartContainerGFX: DrawHeartContainerGFX:
PHP PHP
JSL.l Sprite_IsOnscreen : BCC DrawHeartPieceGFX_offscreen JSL.l Sprite_IsOnscreen : BCC DrawHeartPieceGFX_offscreen
PHA : PHY PHA : PHY
LDA !REDRAW : BEQ .skipInit ; skip init if already ready LDA.w !SPRITE_REDRAW, X : BEQ .skipInit ; skip init if already ready
JSL.l HeartContainerSpritePrep JSL.l HeartContainerSpritePrep
BRA DrawHeartPieceGFX_done ; don't draw on the init frame BRA DrawHeartPieceGFX_done ; don't draw on the init frame
.skipInit .skipInit
LDA $0E80, X ; Retrieve stored item type BRA DrawHeartPieceGFX_skipInit
BRA DrawHeartPieceGFX_skipLoad
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
HeartContainerSound: HeartContainerSound:
LDA !MULTIWORLD_ITEM_PLAYER_ID : BNE + LDA !MULTIWORLD_ITEM_PLAYER_ID : BNE +
@@ -160,34 +155,28 @@ RTL
LDA OverworldEventDataWRAM, X : ORA.b #$40 : STA OverworldEventDataWRAM, X LDA OverworldEventDataWRAM, X : ORA.b #$40 : STA OverworldEventDataWRAM, X
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
!REDRAW = "$7F5000"
HeartPieceSpritePrep: HeartPieceSpritePrep:
PHA PHA
LDA ServerRequestMode : BEQ + : : + LDA ServerRequestMode : BEQ + : : +
LDA #$01 : STA !REDRAW LDA.b #$01 : STA.w !SPRITE_REDRAW, X
LDA $5D : CMP #$14 : BEQ .skip ; skip if we're mid-mirror
LDA #$00 : STA !REDRAW
JSL.l HeartPieceGetPlayer : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID JSL.l HeartPieceGetPlayer : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
JSL.l LoadHeartPieceRoomValue ; load item type JSL.l LoadHeartPieceRoomValue ; load item type
STA $0E80, X ; Store item type STA $0E80, X ; Store item type
JSL.l PrepDynamicTile JSL.l RequestSlottedTile
.skip .skip
PLA PLA
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
!REDRAW = "$7F5000"
HeartContainerSpritePrep: HeartContainerSpritePrep:
PHA PHA
LDA #$00 : STA !REDRAW
JSL.l HeartPieceGetPlayer : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID JSL.l HeartPieceGetPlayer : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
JSL.l LoadHeartContainerRoomValue ; load item type JSL.l LoadHeartContainerRoomValue ; load item type
STA $0E80, X ; Store item type STA $0E80, X ; Store item type
JSL.l PrepDynamicTile JSL.l RequestSlottedTile
PLA PLA
RTL RTL
@@ -202,7 +191,6 @@ LoadHeartPieceRoomValue:
.done .done
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
!REDRAW = "$7F5000"
HPItemReset: HPItemReset:
PHA PHA
LDA !MULTIWORLD_ITEM_PLAYER_ID : BNE .skip LDA !MULTIWORLD_ITEM_PLAYER_ID : BNE .skip
@@ -212,7 +200,6 @@ HPItemReset:
.skip .skip
PLA PLA
.done .done
PHA : LDA #$01 : STA !REDRAW : PLA
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
MaybeMarkDigSpotCollected: MaybeMarkDigSpotCollected:
@@ -857,3 +844,37 @@ HeartPieceGetPlayer:
PLY PLY
RTL RTL
} }
;--------------------------------------------------------------------------------
HeartPieceSetRedraw:
PHY
LDY.b #$0F
.next
LDA.w $0DD0,Y : BEQ ++
LDA.w $0E20,Y : CMP.b #$EB : BEQ + ; heart piece
CMP.b #$E4 : BEQ + ; enemy key drop
CMP.b #$3B : BEQ + ; bonk item (book/key)
CMP.b #$E5 : BEQ + ; enemy big key drop
CMP.b #$E7 : BEQ + ; mushroom item
CMP.b #$E9 : BEQ + ; powder item
BRA ++
+ LDA.b #$01 : STA.w !SPRITE_REDRAW,Y
++ DEY : BPL .next
PLY
RTL
HeartPieceGetRedraw:
PHY
LDY.b #$0F
.next
LDA.w $0DD0,Y : BEQ ++
LDA.w $0E20,Y : CMP.b #$EB : BEQ + ; heart piece
CMP.b #$E4 : BEQ + ; enemy key drop
CMP.b #$3B : BEQ + ; bonk item (book/key)
CMP.b #$E5 : BEQ + ; enemy big key drop
CMP.b #$E7 : BEQ + ; mushroom item
CMP.b #$E9 : BEQ + ; powder item
BRA ++
+ LDA.w !SPRITE_REDRAW,Y : BEQ ++
PLY : SEC : RTL
++ DEY : BPL .next
PLY
CLC : RTL

View File

@@ -36,6 +36,9 @@ org $00821B ; <- 21B - Bank00.asm : 329 (LDA $13 : STA $2100)
JML.l PostNMIHookAction : NOP JML.l PostNMIHookAction : NOP
PostNMIHookReturn: PostNMIHookReturn:
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $008F6C
JSL PostNMIUpdateBGCharHalf : NOP
;--------------------------------------------------------------------------------
;================================================================================ ;================================================================================
; Anti-ZSNES Hook ; Anti-ZSNES Hook
@@ -1069,6 +1072,10 @@ JSL HandleBombAbsorbtion
;org $09873F ; <- 04873F - ancilla_init.asm : 960 (ADC [$00] : STA [$00] ) ;org $09873F ; <- 04873F - ancilla_init.asm : 960 (ADC [$00] : STA [$00] )
;JSL.l AddToStock ;JSL.l AddToStock
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $02EB18
JSL PostOverworldGfxLoad
org $18BD55
JSL PostUnderworldMap
;================================================================================ ;================================================================================
; Kholdstare Shell Fix ; Kholdstare Shell Fix
@@ -1324,7 +1331,7 @@ NOP #5
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $05EE5F ; <- 2EE5F - sprite_mushroom.asm : 30 org $05EE5F ; <- 2EE5F - sprite_mushroom.asm : 30
JSL.l LoadMushroom JSL.l LoadMushroom
NOP BRA + : NOP #7 : +
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $05EE78 ; <- 2EE78 - sprite_mushroom.asm : 58 org $05EE78 ; <- 2EE78 - sprite_mushroom.asm : 58
JSL.l DrawMushroom JSL.l DrawMushroom
@@ -1371,6 +1378,8 @@ org $07A303 ; 3A303 - Bank07.asm : 5622
org $07A3A2 ; 3A3A2 - Bank07.asm : 5720 - JSL DiggingGameGuy_AttemptPrizeSpawn org $07A3A2 ; 3A3A2 - Bank07.asm : 5720 - JSL DiggingGameGuy_AttemptPrizeSpawn
JSL.l SpawnShovelItem JSL.l SpawnShovelItem
BRA _Bank07_5726 BRA _Bank07_5726
org $1DFDAC
JSL.l SpawnShovelGamePrize
org $07A3AB ; 3A3AB - Bank07.asm : 5726 - LDA.b #$12 : JSR Player_DoSfx2 org $07A3AB ; 3A3AB - Bank07.asm : 5726 - LDA.b #$12 : JSR Player_DoSfx2
_Bank07_5726: _Bank07_5726:
;org $07A381 ; 3A381 - Bank07.asm : 5693 - ORA $035B ;org $07A381 ; 3A381 - Bank07.asm : 5693 - ORA $035B

View File

@@ -10,6 +10,7 @@ Init_Primary:
LDX #$00 ; initalize our ram LDX #$00 ; initalize our ram
- -
STA $7EC025, X STA $7EC025, X
STA $7EC035, X
STA $7F5000, X STA $7F5000, X
INX INX
CPX #$10 : !BLT - CPX #$10 : !BLT -

View File

@@ -952,8 +952,7 @@ LoadPowder:
LDA.l WitchItem_Player : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID LDA.l WitchItem_Player : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
%GetPossiblyEncryptedItem(WitchItem, SpriteItemValues) %GetPossiblyEncryptedItem(WitchItem, SpriteItemValues)
STA $0DA0, Y ; Store item type STA $0DA0, Y ; Store item type
JSL.l PrepDynamicTile LDA.b #$01 : STA.w !SPRITE_REDRAW, Y
STA $7F505E
LDA #$00 LDA #$00
STA $7F505F STA $7F505F
STA $7F5060 STA $7F5060
@@ -977,21 +976,16 @@ RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
; DrawPowder: ; DrawPowder:
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
!REDRAW = "$7F5000"
;--------------------------------------------------------------------------------
DrawPowder: DrawPowder:
LDA $02DA : BNE .defer ; defer if link is buying a potion LDA $02DA : BNE .defer ; defer if link is buying a potion
LDA.l !REDRAW : BEQ + LDA.w !SPRITE_REDRAW, X : BEQ +
LDA.l WitchItem_Player : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID LDA.l WitchItem_Player : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
LDA $0DA0, X ; Retrieve stored item type LDA $0DA0, X ; Retrieve stored item type
JSL.l PrepDynamicTile JML RequestSlottedTile
LDA #$00 : STA.l !REDRAW ; reset redraw flag
BRA .defer
+ +
; this fights with the shopkeep code, so had to move the powder draw there when potion shop is custom ; this fights with the shopkeep code, so had to move the powder draw there when potion shop is custom
LDA !SHOP_TYPE : CMP.b #$FF : BNE .defer
LDA $0DA0, X ; Retrieve stored item type LDA $0DA0, X ; Retrieve stored item type
JSL.l DrawDynamicTile JML DrawSlottedTile
.defer .defer
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
@@ -1002,19 +996,12 @@ RTL
LoadMushroom: LoadMushroom:
LDA.b #$00 : STA $0DC0, X ; thing we wrote over LDA.b #$00 : STA $0DC0, X ; thing we wrote over
.justGFX .justGFX
;LDA MushroomItem
;JSL.l PrepDynamicTile
PHA PHA
LDA #$01 : STA !REDRAW
LDA $5D : CMP #$14 : BEQ .skip ; skip if we're mid-mirror
LDA #$00 : STA !REDRAW
LDA.l MushroomItem_Player : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID LDA.l MushroomItem_Player : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
%GetPossiblyEncryptedItem(MushroomItem, SpriteItemValues) %GetPossiblyEncryptedItem(MushroomItem, SpriteItemValues)
STA $0E80, X ; Store item type STA $0E80, X ; Store item type
JSL.l PrepDynamicTile JSL.l RequestSlottedTile
.skip .skip
PLA PLA
@@ -1024,17 +1011,15 @@ RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
; DrawMushroom: ; DrawMushroom:
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
!REDRAW = "$7F5000"
;--------------------------------------------------------------------------------
DrawMushroom: DrawMushroom:
PHA : PHY PHA : PHY
LDA !REDRAW : BEQ .skipInit ; skip init if already ready LDA.w !SPRITE_REDRAW, X : BEQ .skipInit ; skip init if already ready
JSL.l LoadMushroom_justGFX JSL.l LoadMushroom_justGFX
BRA .done ; don't draw on the init frame BRA .done ; don't draw on the init frame
.skipInit .skipInit
LDA $0E80, X ; Retrieve stored item type LDA $0E80, X ; Retrieve stored item type
JSL.l DrawDynamicTile JSL.l DrawSlottedTile
.done .done
PLY : PLA PLY : PLA
@@ -1130,10 +1115,12 @@ RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
; SpawnShovelItem: ; SpawnShovelItem:
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
!REDRAW = "$7F5000" SpawnShovelGamePrize:
JSL Sprite_SpawnDynamically ; thing we wrote over
LDA.b #$01 : STA.w !SPRITE_REDRAW, Y
RTL
;--------------------------------------------------------------------------------
SpawnShovelItem: SpawnShovelItem:
LDA.b #$01 : STA !REDRAW
LDA $03FC : BEQ + LDA $03FC : BEQ +
JSL DiggingGameGuy_AttemptPrizeSpawn JSL DiggingGameGuy_AttemptPrizeSpawn
JMP .skip JMP .skip

View File

@@ -1,57 +1,117 @@
; where we shove the decompressed graphics to send to WRAM ; where we shove the decompressed graphics to send to WRAM
DynamicDropGFX = $7EF500 DynamicDropGFX = $7ECC00
; this will just count from 0 to 4 to determine which slot we're using ; 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're expecting 5 items max per room, and order is irrelevant
; we just need to keep track of where they go ; we just need to keep track of where they go
DynamicDropGFXIndex = $7E1E70 DynamicDropGFXIndex = $7E1E70
!DynamicDropGFXSlotCount = (FreeUWGraphics_end-FreeUWGraphics)>>1 !DynamicDropGFXSlotCount_UW = (FreeUWGraphics_end-FreeUWGraphics)>>1
!DynamicDropGFXSlotCount_OW = (FreeOWGraphics_end-FreeOWGraphics)>>1
; this will keep track of the above for each item ; this will keep track of the above for each item
SprItemGFX = $7E0780 SprItemGFX = $7E0780
; this is the item requested and a flag ; this is the item requested and a flag (we anticipate no more than 3 requests to be active, but built to support 8)
DynamicDropRequest = $7E1E71 DynamicDropRequest = $7E1E71 ; bitfield indicating which request slot to process
DynamicDropQueue = $7E1E72 DynamicDropQueue = $7E1E72 ; 0x08 bytes, occupies 1 byte for each slot in the request queue (loot id at first, but stores GFX index)
; Come in with ; Come in with
; A = item receipt ID ; A = item receipt ID
; X = slot ; X = slot
RequestStandingItemVRAMSlot: RequestSlottedTile:
CMP.b #$34 : BCC + PHX : PHY
CMP.b #$37 : BCS + ; if rupees, use animated rupee OAM slot
LDA.b #!DynamicDropGFXSlotCount : STA.w SprItemGFX,X PHA
RTL ; skip sending the request if busy with other
+ STA.w DynamicDropQueue LDA.b $11 : CMP.b #$21 : BCS ++ ; skip if OW is loading Map16 GFX ; TODO: Figure out how to allow submodule 22, check DMA status instead
LDA.b #$01 LDA.b $5D : CMP.b #$14 : BEQ ++ ; skip if we're mid-mirror
LDA.b $1B : BEQ + ; OW current doesn't occupy any slots that medallion gfx do
CMP.b #$08 : BCC + : CMP.b #$0A+1 : BCS + ; skip if we're mid-medallion
++ PLA : JMP .return
+
LDA.w $0E20, X : CMP.b #$C0 : BNE + ; if catfish
TYX
+ CMP.b #$52 : BNE + ; if zora
TYX
+
LDA 1,S : JSL.l GetSpritePalette : STA $0F50, X ; setup the palette
PLA
; gfx that are already present, use that instead of a new slot
CMP.b #$34 : BCC + : CMP.b #$36+1 : BCS + ; if rupees, use animated rupee OAM slot
LDA.b $1B : BEQ ++
LDA.b #!DynamicDropGFXSlotCount_UW
BRA +++
++ LDA.b #!DynamicDropGFXSlotCount_OW
+++ STA.w SprItemGFX,X
JMP .success
+ CMP.b #$A0 : BCC + : CMP.b #$AF+1 : BCS + ; if key, use key OAM slot
LDA.b $1B : BEQ ++
LDA.b #!DynamicDropGFXSlotCount_UW
BRA +++
++ LDA.b #!DynamicDropGFXSlotCount_OW
+++ INC : STA.w SprItemGFX,X
JMP .success
+
PHA : PHX
LDY.b #$00
LDA.w DynamicDropRequest
- LSR : INY : BCS -
CPY.b #$08 : BCC +
; all request slots occupied, exit without drawing
PLX : PLA
LDY.b #$FE ; indicate failure
BRA .return
+ TYX
LDA.b #$00 : SEC
- ROL : DEX : BNE -
DEY ; y = slot index, a = new request bit flag
ORA.w DynamicDropRequest
STA.w DynamicDropRequest STA.w DynamicDropRequest
PLX : PLA
STA.w DynamicDropQueue,Y
LDA.w DynamicDropGFXIndex LDA.w DynamicDropGFXIndex
INC INC
CMP.b #!DynamicDropGFXSlotCount : BCC .fine PHX
LDX.b $1B : BEQ +
CMP.b #!DynamicDropGFXSlotCount_UW : BCC .fine
BRA ++
+ CMP.b #!DynamicDropGFXSlotCount_OW : BCC .fine
LDA.b #$00 ++ LDA.b #$00
.fine .fine
PLX
STA.w DynamicDropGFXIndex STA.w DynamicDropGFXIndex
STA.w SprItemGFX,X STA.w SprItemGFX,X
; decompress graphics ; decompress graphics
PHX PHX : PHY
LDX.w DynamicDropQueue
REP #$20 REP #$20
LDA.w #DynamicDropGFX-$7E9000 LDA.w #DynamicDropGFX-$7E9000
STA.l !TILE_UPLOAD_OFFSET_OVERRIDE TYX : BEQ +
- CLC : ADC.w #$0080 : DEX : BNE -
+ STA.l !TILE_UPLOAD_OFFSET_OVERRIDE
SEP #$20 SEP #$20
LDA.w DynamicDropQueue LDA.w DynamicDropQueue,Y
JSL.l GetSpriteID JSL.l GetSpriteID
JSL.l GetAnimatedSpriteTile_variable JSL.l GetAnimatedSpriteTile_variable
SEP #$30 SEP #$30
PLX PLY : PLX
LDA.w DynamicDropGFXIndex : STA.w DynamicDropQueue,Y
LDA.w DynamicDropQueue,Y ; we want A to return the loot id
.success
STZ.w !SPRITE_REDRAW, X
.return
PLY : PLX
RTL RTL
;=================================================================================================== ;===================================================================================================
@@ -59,22 +119,38 @@ RequestStandingItemVRAMSlot:
TransferPotGFX: TransferPotGFX:
SEP #$10 SEP #$10
REP #$20 REP #$20
LDX.w DynamicDropRequest LDA.w DynamicDropRequest : AND.w #$00FF
BEQ .no BEQ .no
STZ.w DynamicDropRequest .next
LDY.b #$00
- INY : LSR : BCC -
LDA.w DynamicDropGFXIndex PHY
LDA.w #$0000
- ROL : DEY : BNE -
PLY
DEY ; y = slot index, a = request bit flag
EOR.w DynamicDropRequest : STA.w DynamicDropRequest
LDA.w DynamicDropQueue,Y
ASL ASL
TAX TAX
LDA.b $1B : AND.w #$00FF : BEQ +
LDA.l FreeUWGraphics,X LDA.l FreeUWGraphics,X
STA.w $2116 BRA ++
+ LDA.l FreeOWGraphics,X
++ STA.w $2116
; calculate bottom row now ; calculate bottom row now
CLC : ADC.w #$0200>>1 : PHA CLC : ADC.w #$0200>>1 : PHA
LDX.b #$7E : STX.w $4314 LDX.b #$7E : STX.w $4314
LDA.w #DynamicDropGFX : STA.w $4302 LDA.w #DynamicDropGFX
CPY.b #$00 : BEQ +
- CLC : ADC.w #$0080 : DEY : BNE -
+ STA.w $4302
LDX.b #$80 : STX.w $2115 LDX.b #$80 : STX.w $2115
LDA.w #$1801 : STA.w $4300 LDA.w #$1801 : STA.w $4300
@@ -89,6 +165,9 @@ TransferPotGFX:
STA.w $2116 STA.w $2116
STY.w $420B STY.w $420B
LDA.w DynamicDropRequest : AND.w #$00FF
BNE .next
.no .no
RTL RTL
@@ -97,55 +176,99 @@ FreeUWGraphics:
dw $8800>>1 dw $8800>>1
dw $8840>>1 dw $8840>>1
dw $8980>>1 dw $8980>>1
; dw $9960>>1 # Arghuss Splash apparently ; dw $9960>>1 ; Arghuss Splash apparently
; dw $9C00>>1 ; dw $9C00>>1
dw $9CA0>>1 dw $9CA0>>1
dw $9DC0>>1 dw $9DC0>>1
.end .end
;=================================================================================================== FreeOWGraphics:
;dw $8800>>1 ; Shovel Dirt
dw $9960>>1 ; Arghuss/Zora Splash
dw $9C00>>1 ; Heart Piece
dw $9CA0>>1 ; Apple
;dw $9DC0>>1 ; Whirlpool
.end
DrawPotItem: ;===================================================================================================
; Come in with
; A = item receipt ID
; X = sprite slot
; Returns with Carry flag set if gfx drawing was skipped
DrawSlottedTile:
PHA
; TODO: allow drawing if gfx are not using a VRAM slot that changes during medallion
LDA.b $5D : CMP.b #$08 : BCC + : CMP.b #$0A+1 : BCS + ; skip if we're mid-medallion
PLA : SEC : RTL
+
PLA
JSL.l IsNarrowSprite : BCS .narrow JSL.l IsNarrowSprite : BCS .narrow
; TODO: Instead of loading the whole fixed 16 bytes from DynamicOAMTile**_** into !SPRITE_DYNAMIC_OAM
; Do something more like how DrawDynamicTile does it
; Then we won't need all the separate DynamicOAMTile**_** tables
.full .full
LDA.b #$01 : STA $06 LDA.b #$01 : STA $06
LDA #$0C : JSL.l OAM_AllocateFromRegionC LDA #$0C : JSL.l OAM_AllocateFromRegionC
LDA #$02 : PHA LDA #$02 : PHA
REP #$20 REP #$20
LDA.w #DynamicOAMTile_full LDA.b $1B : AND.w #$00FF : BEQ +
BRA .draw LDA.w #DynamicOAMTileUW_full
BRA .transfer
+ LDA.w #DynamicOAMTileOW_full
BRA .transfer
.narrow .narrow
LDA.b #$02 : STA $06 LDA.b #$02 : STA $06
LDA #$10 : JSL.l OAM_AllocateFromRegionC LDA #$10 : JSL.l OAM_AllocateFromRegionC
LDA #$03 : PHA LDA #$03 : PHA
REP #$20 REP #$20
LDA.w #DynamicOAMTile_thin LDA.b $1B : AND.w #$00FF : BEQ +
.draw LDA.w #DynamicOAMTileUW_thin
PHB : PHK : PLB BRA .transfer
+ LDA.w #DynamicOAMTileOW_thin
.transfer
STA.b $08 STA.b $08
LDA.w SprItemGFX,X LDA.w SprItemGFX,X
AND.w #$00FF AND.w #$00FF
ASL : ASL : ASL : ASL ASL : ASL : ASL : ASL
ADC.b $08 ADC.b $08
STA.b $08 STA.b $08
PHK : PLY : STY.b $0A
LDY #$7E : PHB : PHY : PLB
; transfer fixed table data into WRAM
LDY.b #$0E
- LDA.b [$08],Y : STA.w !SPRITE_DYNAMIC_OAM,Y
DEY : DEY : BPL -
LDA.w SprItemFlags, X : AND.w #$00FF : BNE .draw
LDA.b $06 : LSR : BCC +
; full
LDA.w #$0000
STA.w !SPRITE_DYNAMIC_OAM : STA.w !SPRITE_DYNAMIC_OAM+2
BRA .draw
+ ; narrow
LDA.w $0E20, X : AND.w #$00FF : CMP.w #$003B : BEQ .draw ; bonk item
LDA.w #$0004
STA.w !SPRITE_DYNAMIC_OAM : STA.w !SPRITE_DYNAMIC_OAM+8
.draw
LDA.w #!SPRITE_DYNAMIC_OAM : STA.b $08
SEP #$20 SEP #$20
STZ.b $07 STZ.b $07
LDA.b #$00 : STA.l !SKIP_EOR LDA.b #$00 : STA.l !SKIP_EOR
JSL Sprite_DrawMultiple_quantity_preset JSL Sprite_DrawMultiple_quantity_preset
PLB
LDA.b $90 : CLC : ADC.b #$08 : STA.b $90 LDA.b $90 : CLC : ADC.b #$08 : STA.b $90
INC.b $92 INC.b $92 : INC.b $92
INC.b $92
PLB
PLA PLA
CLC
RTL RTL
DynamicOAMTile_thin: DynamicOAMTileUW_thin:
dw 0, 0 : db $40, $00, $20, $00 dw 0, 0 : db $40, $00, $20, $00
dw 0, 8 : db $50, $00, $20, $00 dw 0, 8 : db $50, $00, $20, $00
@@ -166,7 +289,10 @@ DynamicOAMTile_thin:
dw 0, 0 : db $0B, $00, $20, $00 ; animated rupees slot dw 0, 0 : db $0B, $00, $20, $00 ; animated rupees slot
dw 0, 8 : db $1B, $00, $20, $00 dw 0, 8 : db $1B, $00, $20, $00
DynamicOAMTile_full: dw 0, 0 : db $6B, $00, $20, $00 ; key
dw 0, 8 : db $7B, $00, $20, $00
DynamicOAMTileUW_full:
dw -4, -1 : db $40, $00, $20, $02 dw -4, -1 : db $40, $00, $20, $02
dd 0, 0 dd 0, 0
@@ -181,3 +307,44 @@ DynamicOAMTile_full:
dw -4, -1 : db $EE, $00, $20, $02 dw -4, -1 : db $EE, $00, $20, $02
dd 0, 0 dd 0, 0
DynamicOAMTileOW_thin:
; dw 0, 0 : db $40, $00, $20, $00
; dw 0, 8 : db $50, $00, $20, $00
dw 0, 0 : db $CB, $00, $20, $00
dw 0, 8 : db $DB, $00, $20, $00
dw 0, 0 : db $E0, $00, $20, $00
dw 0, 8 : db $F0, $00, $20, $00
dw 0, 0 : db $E5, $00, $20, $00
dw 0, 8 : db $F5, $00, $20, $00
;dw 0, 0 : db $EE, $00, $20, $00
;dw 0, 8 : db $FE, $00, $20, $00
; add new slots above this line
dw 0, 0 : db $0B, $00, $20, $00 ; animated rupees slot
dw 0, 8 : db $1B, $00, $20, $00
dw 0, 0 : db $6B, $00, $20, $00 ; key
dw 0, 8 : db $7B, $00, $20, $00
DynamicOAMTileOW_full:
; dw 0, 0 : db $40, $00, $20, $02
; dd 0, 0
dw 0, 0 : db $CB, $00, $20, $02
dd 0, 0
dw 0, 0 : db $E0, $00, $20, $02
dd 0, 0
dw 0, 0 : db $E5, $00, $20, $02
dd 0, 0
;dw 0, 0 : db $EE, $00, $20, $02
;dd 0, 0

View File

@@ -436,21 +436,22 @@ SpriteKeyPrep:
LDA.w SpawnedItemMWPlayer : STA SprItemMWPlayer, X LDA.w SpawnedItemMWPlayer : STA SprItemMWPlayer, X
LDA.w SpawnedItemFlag : STA SprItemFlags, X : BEQ + LDA.w SpawnedItemFlag : STA SprItemFlags, X : BEQ +
LDA.l SpawnedItemID : STA $0E80, X LDA.l SpawnedItemID : STA $0E80, X
PHA
JSL.l GetSpritePalette : STA $0F50, X ; setup the palette
PLA
CMP #$24 : BNE ++ ; CMP #$24 : BNE ++ ;
LDA $A0 : CMP.b #$80 : BNE + LDA $A0 : CMP.b #$80 : BNE +
LDA SpawnedItemFlag : BNE + LDA SpawnedItemFlag : BNE +
LDA #$24 ; it's the big key drop? LDA #$24 ; it's the big key drop?
++ JSL RequestStandingItemVRAMSlot ++ JSL RequestSlottedTile
+ PLA + PLA
RTL RTL
SpriteKeyDrawGFX: SpriteKeyDrawGFX:
JSL Sprite_DrawRippleIfInWater JSL Sprite_DrawRippleIfInWater
PHA PHA
LDA.w !SPRITE_REDRAW, X : BEQ +
LDA $0E80, X LDA $0E80, X
JSL RequestSlottedTile
BRA .skipDraw
+ LDA $0E80, X
CMP.b #$24 : BNE + CMP.b #$24 : BNE +
LDA $A0 : CMP #$80 : BNE ++ LDA $A0 : CMP #$80 : BNE ++
LDA SpawnedItemFlag : BNE ++ LDA SpawnedItemFlag : BNE ++
@@ -461,11 +462,14 @@ SpriteKeyDrawGFX:
JML Sprite_DrawAbsorbable JML Sprite_DrawAbsorbable
.jslrtsreturn .jslrtsreturn
RTL RTL
+ JSL DrawPotItem + JSL DrawSlottedTile : BCS .skipDraw
; draw shadow
CMP #$03 : BNE + CMP #$03 : BNE +
PHA : LDA $0E60, X : ORA.b #$20 : STA $0E60, X : PLA PHA : LDA $0E60, X : ORA.b #$20 : STA $0E60, X : PLA
+ JSL.l Sprite_DrawShadowLong + JSL.l Sprite_DrawShadowLong
PLA : RTL .skipDraw
PLA
RTL
KeyGet: KeyGet:
LDA CurrentSmallKeys ; what we wrote over LDA CurrentSmallKeys ; what we wrote over

View File

@@ -495,23 +495,27 @@ OWBonkGoodBeeDrop:
; spawn itemget item ; spawn itemget item
.spawn_item ; A = item id ; Y = bonk sprite slot ; S = Collected .spawn_item ; A = item id ; Y = bonk sprite slot ; S = Collected
PLX : BEQ + : LDA.b #$00 : STA.w $0DD0,Y : BRA .return PLX : BEQ + : LDA.b #$00 : STA.w $0DD0,Y : BRA .return
+ LDA.b #$01 : STA !REDRAW + PHA
LDA.b #$EB : STA.l $7FFE00 LDA.b #$EB : STA.l $7FFE00
JSL Sprite_SpawnDynamically+15 ; +15 to skip finding a new slot, use existing sprite JSL Sprite_SpawnDynamically+15 ; +15 to skip finding a new slot, use existing sprite
TYX : STZ.w $0F20,X ; layer the sprite is on LDA.b #$01 : STA.w !SPRITE_REDRAW,Y
PLA : STA.w $0E80,Y
; affects the rate the item moves in the Y/X direction ; affects the rate the item moves in the Y/X direction
STZ.w $0D40,X LDA.b #$00 : STA.w $0D40,Y
LDA.b #$0A : STA.w $0D50,Y LDA.b #$0A : STA.w $0D50,Y
LDA.b #$1A : STA.w $0F80,Y ; amount of force (gives height to the arch) LDA.b #$1A : STA.w $0F80,Y ; amount of force (gives height to the arch)
LDA.b #$FF : STA.w $0B58,Y ; stun timer LDA.b #$FF : STA.w $0B58,Y ; stun timer
LDA.b #$30 : STA.w $0F10,Y ; aux delay timer 4 ?? dunno what that means LDA.b #$30 : STA.w $0F10,Y ; aux delay timer 4 ?? dunno what that means
LDA.b #$00 : STA.w $0F20,Y ; layer the sprite is on
; sets the tile type that is underneath the sprite, water ; sets the tile type that is underneath the sprite, water
LDA.b #$09 : STA.l $7FF9C2,X ; TODO: Figure out how to get the game to set this TYX : LDA.b #$09 : STA.l $7FF9C2,X ; TODO: Figure out how to get the game to set this
; sets OW event bitmask flag, uses free RAM ; sets OW event bitmask flag, uses free RAM
LDA.l OWBonkPrizeTable[42].flag : STA.w $0ED0,Y LDA.l OWBonkPrizeTable[42].flag : STA.w $0ED0,Y
@@ -520,8 +524,6 @@ OWBonkGoodBeeDrop:
LDA.w $0D00,Y : SEC : SBC.l OWBonkPrizeTable[42].vert_offset : STA.w $0D00,Y LDA.w $0D00,Y : SEC : SBC.l OWBonkPrizeTable[42].vert_offset : STA.w $0D00,Y
LDA.w $0D20,Y : SBC #$00 : STA.w $0D20,Y LDA.w $0D20,Y : SBC #$00 : STA.w $0D20,Y
LDA.b #$01 : STA !REDRAW
.return .return
PLY PLY
LDA #$08 ; makes original good bee not spawn LDA #$08 ; makes original good bee not spawn
@@ -618,13 +620,15 @@ OWBonkDrops:
; spawn itemget item ; spawn itemget item
.spawn_item ; A = item id ; Y = tree sprite slot ; S = Collected, FlagBitmask, X (row + 2) .spawn_item ; A = item id ; Y = tree sprite slot ; S = Collected, FlagBitmask, X (row + 2)
PLX : BEQ + : LDA.b #$00 : STA.w $0DD0,Y : JMP .return ; S = FlagBitmask, X (row + 2) PLX : BEQ + : LDA.b #$00 : STA.w $0DD0,Y : JMP .return ; S = FlagBitmask, X (row + 2)
+ LDA 2,S : TAX : INX + PHA
LDA.b #$01 : STA !REDRAW
LDA.b #$EB : STA.l $7FFE00 LDA.b #$EB : STA.l $7FFE00
JSL Sprite_SpawnDynamically+15 ; +15 to skip finding a new slot, use existing sprite JSL Sprite_SpawnDynamically+15 ; +15 to skip finding a new slot, use existing sprite
LDA.b #$01 : STA.w !SPRITE_REDRAW,Y
PLA : STA.w $0E80,Y
; affects the rate the item moves in the Y/X direction ; affects the rate the item moves in the Y/X direction
LDA.b #$00 : STA.w $0D40,Y LDA.b #$00 : STA.w $0D40,Y
LDA.b #$0A : STA.w $0D50,Y LDA.b #$0A : STA.w $0D50,Y
@@ -643,8 +647,6 @@ OWBonkDrops:
LDA.w $0D00,Y : SEC : SBC.w OWBonkPrizeData,X : STA.w $0D00,Y LDA.w $0D00,Y : SEC : SBC.w OWBonkPrizeData,X : STA.w $0D00,Y
LDA.w $0D20,Y : SBC #$00 : STA.w $0D20,Y LDA.w $0D20,Y : SBC #$00 : STA.w $0D20,Y
LDA.b #$01 : STA !REDRAW
PLB : RTL PLB : RTL
.return .return
@@ -958,7 +960,9 @@ OWNewDestination:
OWLoadSpecialArea: OWLoadSpecialArea:
{ {
LDA.l Overworld_LoadSpecialOverworld_RoomId,X : STA.b $A0 LDA.l Overworld_LoadSpecialOverworld_RoomId,X : STA.b $A0
JSL Overworld_LoadSpecialOverworld ; sets M and X flags CMP.w #$0182 : BNE +
JSL ZoraSplashGfxFix
+ JSL Overworld_LoadSpecialOverworld ; sets M and X flags
TYX TYX
LDY.b #$00 LDY.b #$00
CPX.b #$01 : BNE + ; check if going to water transition CPX.b #$01 : BNE + ; check if going to water transition

View File

@@ -4,7 +4,6 @@
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
!BIGRAM = "$7EC900"; !BIGRAM = "$7EC900";
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
!SPRITE_OAM = "$7EC025"
; A = Tile ID ; A = Tile ID
macro UploadOAM(dest) macro UploadOAM(dest)
PHA : PHP PHA : PHP
@@ -770,8 +769,6 @@ RTS
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
;!SHOP_TYPE = "$7F5051" ;!SHOP_TYPE = "$7F5051"
;!SHOP_INVENTORY = "$7F5052" ;!SHOP_INVENTORY = "$7F5052"
!SPRITE_OAM = "$7EC025"
!REDRAW = "$7F5000"
Shopkeeper_DrawItems: Shopkeeper_DrawItems:
PHB : PHK : PLB PHB : PHK : PLB
PHX : PHY PHX : PHY
@@ -787,14 +784,6 @@ Shopkeeper_DrawItems:
+ CMP.b #$01 : BNE + : ++ + CMP.b #$01 : BNE + : ++
JSR.w Shopkeeper_DrawNextItem JSR.w Shopkeeper_DrawNextItem
+ +
LDA $A0 : CMP.b #$09 : BNE + ; render powder slot if potion shop
LDA !REDRAW : BNE + ; if not redrawing
LDA $02DA : BNE + ; if not buying item
LDA $7F505E : BEQ + ; if potion slot filled
LDA $0ABF : BEQ + ; haven't left the room
LDA NpcFlags+1 : AND.b #$20 : BNE +
LDX.b #$0C : LDY.b #$03 : JSR.w Shopkeeper_DrawNextItem
+
PLY : PLX PLY : PLX
PLB PLB
RTS RTS

View File

@@ -318,9 +318,7 @@ RTL
IndoorTileTransitionCounter: IndoorTileTransitionCounter:
JMP StatTransitionCounter JMP StatTransitionCounter
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
!REDRAW = "$7F5000"
IndoorSubtileTransitionCounter: IndoorSubtileTransitionCounter:
LDA.b #$01 : STA !REDRAW ; set redraw flag for items
STZ $0646 ; stuff we wrote over STZ $0646 ; stuff we wrote over
STZ $0642 STZ $0642
JMP StatTransitionCounter JMP StatTransitionCounter

View File

@@ -1470,8 +1470,9 @@ dw #9999 ; Rupee Limit
; $2F8000 - $2F83FF - RNG Block ; $2F8000 - $2F83FF - RNG Block
;================================================================================ ;================================================================================
; $7EC025 - $7EC034 - Item OAM Table ; $7EC025 - $7EC034 - Item OAM Table
; $7EC035 - $7EC044 - Dynamic Item OAM Table
;================================================================================ ;================================================================================
; $7F5000 - Redraw Flag ; $7F5000 - FREE (Old Global Redraw Flag)
; $7F5001 - Flipper Softlock Possible ; $7F5001 - Flipper Softlock Possible
; $7F5002 - L/R Rotate ; $7F5002 - L/R Rotate
; $7F5003 - HexToDec 1st Digit ; $7F5003 - HexToDec 1st Digit

View File

@@ -34,7 +34,6 @@ SpawnTabletItem:
JSL.l HeartPieceGetPlayer : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID JSL.l HeartPieceGetPlayer : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
JSL.l LoadOutdoorValue JSL.l LoadOutdoorValue
PHA PHA
JSL.l PrepDynamicTile
LDA.b #$01 : STA !FORCE_HEART_SPAWN : STA !SKIP_HEART_SAVE LDA.b #$01 : STA !FORCE_HEART_SPAWN : STA !SKIP_HEART_SAVE
JSL.l SetTabletItem JSL.l SetTabletItem
@@ -43,6 +42,8 @@ SpawnTabletItem:
STA $7FFE00 STA $7FFE00
JSL Sprite_SpawnDynamically JSL Sprite_SpawnDynamically
LDA.b #$01 : STA.w !SPRITE_REDRAW, Y
PLA : STA $0E80, Y ; Store item type PLA : STA $0E80, Y ; Store item type
LDA $22 : STA $0D10, Y LDA $22 : STA $0D10, Y
LDA $23 : STA $0D30, Y LDA $23 : STA $0D30, Y

View File

@@ -411,8 +411,7 @@ PrepDynamicTile:
+ +
TXA TXA
JSR.w LoadDynamicTileOAMTable JSR.w LoadDynamicTileOAMTable
CMP.b #$34 : BCC + CMP.b #$34 : BCC + : CMP.b #$36+1 : BCS + : BRA ++ ; if rupees, don't draw to OAM
CMP.b #$36+1 : BCS + : BRA ++ ; if rupees, don't draw to OAM
+ JSL.l GetSpriteID ; convert loot id to sprite id + JSL.l GetSpriteID ; convert loot id to sprite id
JSL.l GetAnimatedSpriteTile_variable JSL.l GetAnimatedSpriteTile_variable
++ LDA.b #$00 : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID ++ LDA.b #$00 : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
@@ -424,8 +423,6 @@ RTL
; LoadDynamicTileOAMTable ; LoadDynamicTileOAMTable
; in: A - Loot ID ; in: A - Loot ID
;-------------------------------------------------------------------------------- 20/847B ;-------------------------------------------------------------------------------- 20/847B
!SPRITE_OAM = "$7EC025"
;--------------------------------------------------------------------------------
LoadDynamicTileOAMTable: LoadDynamicTileOAMTable:
PHA : PHP PHA : PHP
@@ -435,8 +432,8 @@ LoadDynamicTileOAMTable:
STA.l !SPRITE_OAM+2 STA.l !SPRITE_OAM+2
LDA.w #$0200 : STA.l !SPRITE_OAM+6 LDA.w #$0200 : STA.l !SPRITE_OAM+6
SEP #$20 ; set 8-bit accumulator SEP #$20 ; set 8-bit accumulator
LDA $01,s : CMP.b #$34 : BCC + LDA $01,s
CMP.b #$36+1 : BCS + ; if rupees, use animated gfx already in OAM CMP.b #$34 : BCC + : CMP.b #$36+1 : BCS + ; if rupees, use animated gfx already in OAM
LDA.b #$0B : BRA ++ LDA.b #$0B : BRA ++
+ LDA.b #$24 + LDA.b #$24
++ STA.l !SPRITE_OAM+4 ++ STA.l !SPRITE_OAM+4
@@ -451,8 +448,8 @@ LoadDynamicTileOAMTable:
BRA .done BRA .done
.narrow .narrow
LDA $02,s : CMP.b #$34 : BCC + LDA $02,s
CMP.b #$36+1 : BCS + ; if rupees, use animated gfx already in OAM CMP.b #$34 : BCC + : CMP.b #$36+1 : BCS + ; if rupees, use animated gfx already in OAM
REP #$20 REP #$20
LDA.w #$1B00 : BRA ++ LDA.w #$1B00 : BRA ++
+ REP #$20 + REP #$20
@@ -474,7 +471,6 @@ RTS
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
; This wastes two OAM slots if you don't want a shadow - fix later - I wrote "fix later" over a year ago and it's still not fixed (Aug 6, 2017) - lol (May 25th, 2019) ; This wastes two OAM slots if you don't want a shadow - fix later - I wrote "fix later" over a year ago and it's still not fixed (Aug 6, 2017) - lol (May 25th, 2019)
;-------------------------------------------------------------------------------- 2084B8 ;-------------------------------------------------------------------------------- 2084B8
!SPRITE_OAM = "$7EC025"
!SKIP_EOR = "$7F5008" !SKIP_EOR = "$7F5008"
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
DrawDynamicTile: DrawDynamicTile:

View File

@@ -4,7 +4,17 @@
LoadZoraKingItemGFX: LoadZoraKingItemGFX:
LDA.l ZoraItem_Player : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID LDA.l ZoraItem_Player : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
LDA.l $1DE1C3 ; location randomizer writes zora item to LDA.l $1DE1C3 ; location randomizer writes zora item to
JML.l PrepDynamicTile JML RequestSlottedTile
;--------------------------------------------------------------------------------
ZoraSplashGfxFix:
PHA : PHX : PHY : SEP #$30
; below should be set to the index used for Arrghus/Zora Splash
; FreeOWGraphics in dynamic_si_vram.asm, whatever index is $9960
; this makes it so the first gfx that is loading is AFTER the splash
LDA.b #$00 : STA.w DynamicDropGFXIndex
JSL LoadCommonSprites_long
REP #$30 : PLY : PLX : PLA
RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
JumpToSplashItemTarget: JumpToSplashItemTarget:
LDA $0D90, X LDA $0D90, X