Rearranged new rotating slotted GFX code to allow drawing to specific slots
This commit is contained in:
@@ -17,7 +17,7 @@ DynamicDropQueue = $7E1E72 ; 0x08 bytes, occupies 1 byte for each slot in the re
|
|||||||
|
|
||||||
; Come in with
|
; Come in with
|
||||||
; A = item receipt ID
|
; A = item receipt ID
|
||||||
; X = slot
|
; X = sprite slot
|
||||||
RequestSlottedTile:
|
RequestSlottedTile:
|
||||||
PHX : PHY
|
PHX : PHY
|
||||||
|
|
||||||
@@ -36,7 +36,7 @@ RequestSlottedTile:
|
|||||||
TYX
|
TYX
|
||||||
+
|
+
|
||||||
|
|
||||||
LDA 1,S : JSL.l GetSpritePalette : STA $0F50, X ; setup the palette
|
LDA.b 1,S : JSL.l GetSpritePalette : STA.w $0F50, X ; setup the palette
|
||||||
PLA
|
PLA
|
||||||
|
|
||||||
; gfx that are already present, use that instead of a new slot
|
; gfx that are already present, use that instead of a new slot
|
||||||
@@ -80,39 +80,42 @@ RequestSlottedTile:
|
|||||||
JMP .success
|
JMP .success
|
||||||
+
|
+
|
||||||
|
|
||||||
PHA : PHX
|
PHA
|
||||||
LDY.b #$00
|
LDA.w DynamicDropGFXIndex
|
||||||
LDA.w DynamicDropRequest
|
INC
|
||||||
- LSR : INY : BCS -
|
PHX
|
||||||
CPY.b #$08 : BCC +
|
LDX.b $1B : BEQ +
|
||||||
; all request slots occupied, exit without drawing
|
CMP.b #!DynamicDropGFXSlotCount_UW : BCC .setIndex
|
||||||
PLX : PLA
|
BRA ++
|
||||||
LDY.b #$FE ; indicate failure
|
+ CMP.b #!DynamicDropGFXSlotCount_OW : BCC .setIndex
|
||||||
BRA .return
|
++ LDA.b #$00
|
||||||
+ TYX
|
|
||||||
LDA.b #$00 : SEC
|
.setIndex
|
||||||
- ROL : DEX : BNE -
|
PLX
|
||||||
DEY ; y = slot index, a = new request bit flag
|
STA.w DynamicDropGFXIndex
|
||||||
ORA.w DynamicDropRequest
|
STA.w SprItemGFX,X
|
||||||
STA.w DynamicDropRequest
|
|
||||||
PLX : PLA
|
|
||||||
|
.initRequest
|
||||||
|
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
|
||||||
|
PLX
|
||||||
|
PLA
|
||||||
STA.w DynamicDropQueue,Y
|
STA.w DynamicDropQueue,Y
|
||||||
|
|
||||||
LDA.w DynamicDropGFXIndex
|
|
||||||
INC
|
|
||||||
PHX
|
|
||||||
LDX.b $1B : BEQ +
|
|
||||||
CMP.b #!DynamicDropGFXSlotCount_UW : BCC .fine
|
|
||||||
BRA ++
|
|
||||||
+ CMP.b #!DynamicDropGFXSlotCount_OW : BCC .fine
|
|
||||||
|
|
||||||
++ LDA.b #$00
|
|
||||||
|
|
||||||
.fine
|
|
||||||
PLX
|
|
||||||
STA.w DynamicDropGFXIndex
|
|
||||||
STA.w SprItemGFX,X
|
|
||||||
|
|
||||||
; decompress graphics
|
; decompress graphics
|
||||||
PHX : PHY
|
PHX : PHY
|
||||||
|
|
||||||
@@ -129,8 +132,9 @@ RequestSlottedTile:
|
|||||||
|
|
||||||
SEP #$30
|
SEP #$30
|
||||||
PLY : PLX
|
PLY : PLX
|
||||||
LDA.w DynamicDropGFXIndex : STA.w DynamicDropQueue,Y
|
LDA.w DynamicDropQueue,Y : PHA ; we want A to return the loot id
|
||||||
LDA.w DynamicDropQueue,Y ; we want A to return the loot id
|
LDA.w SprItemGFX,X : STA.w DynamicDropQueue,Y
|
||||||
|
PLA
|
||||||
|
|
||||||
.success
|
.success
|
||||||
STZ.w !SPRITE_REDRAW, X
|
STZ.w !SPRITE_REDRAW, X
|
||||||
@@ -204,7 +208,9 @@ FreeUWGraphics:
|
|||||||
dw $9C00>>1
|
dw $9C00>>1
|
||||||
; dw $9CA0>>1
|
; dw $9CA0>>1
|
||||||
dw $9DC0>>1
|
dw $9DC0>>1
|
||||||
|
; add new slots above this line
|
||||||
.end
|
.end
|
||||||
|
; above this line, add slots that we want to draw to specific slots
|
||||||
|
|
||||||
FreeOWGraphics:
|
FreeOWGraphics:
|
||||||
dw $8180>>1 ; Push Block
|
dw $8180>>1 ; Push Block
|
||||||
@@ -213,7 +219,9 @@ FreeOWGraphics:
|
|||||||
dw $9C00>>1 ; Heart Piece
|
dw $9C00>>1 ; Heart Piece
|
||||||
;dw $9CA0>>1 ; Apple
|
;dw $9CA0>>1 ; Apple
|
||||||
;dw $9DC0>>1 ; Whirlpool
|
;dw $9DC0>>1 ; Whirlpool
|
||||||
|
; add new slots above this line
|
||||||
.end
|
.end
|
||||||
|
; above this line, add slots that we want to draw to specific slots
|
||||||
|
|
||||||
;===================================================================================================
|
;===================================================================================================
|
||||||
; Come in with
|
; Come in with
|
||||||
@@ -332,6 +340,10 @@ DynamicOAMTileUW_thin:
|
|||||||
|
|
||||||
; add new slots above this line
|
; add new slots above this line
|
||||||
|
|
||||||
|
; <none>
|
||||||
|
|
||||||
|
; above this line, add slots that we want to draw to specific slots
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
@@ -360,7 +372,11 @@ DynamicOAMTileUW_full:
|
|||||||
dw -4, -1 : db $EE, $00, $20, $02
|
dw -4, -1 : db $EE, $00, $20, $02
|
||||||
dd 0, 0
|
dd 0, 0
|
||||||
|
|
||||||
; add new slots above this line
|
; add new rotating slots above this line
|
||||||
|
|
||||||
|
; <none>
|
||||||
|
|
||||||
|
; above this line, add slots that we want to draw to specific slots
|
||||||
|
|
||||||
dw -4, -1 : db $EA, $00, $20, $02 ; fairy
|
dw -4, -1 : db $EA, $00, $20, $02 ; fairy
|
||||||
dd 0, 0
|
dd 0, 0
|
||||||
@@ -389,6 +405,10 @@ DynamicOAMTileOW_thin:
|
|||||||
|
|
||||||
; add new slots above this line
|
; add new slots above this line
|
||||||
|
|
||||||
|
; <none>
|
||||||
|
|
||||||
|
; above this line, add slots that we want to draw to specific slots
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
@@ -419,6 +439,10 @@ DynamicOAMTileOW_full:
|
|||||||
|
|
||||||
; add new slots above this line
|
; add new slots above this line
|
||||||
|
|
||||||
|
; <none>
|
||||||
|
|
||||||
|
; above this line, add slots that we want to draw to specific slots
|
||||||
|
|
||||||
dw 0, 0 : db $EA, $00, $20, $02 ; fairy
|
dw 0, 0 : db $EA, $00, $20, $02 ; fairy
|
||||||
dd 0, 0
|
dd 0, 0
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user