Graphics:
JSR GET_DRAW_INFO
LDA $157C,x
STA $02
PHX
LDX #$00 ; number of times to loop
Loop:
LDA $00 ;\
CLC ; | Apply X displacement of the sprite.
ADC XDISP,x ; |
STA $0300,y ;/
LDA $01 ;\
CLC ; | Y displacement is added for the Y position, so one tile is higher than the other.
ADC YDISP,x ; | Otherwise, both tiles would have been drawn to the same position!
STA $0301,y
LDA TILEMAP,x
STA $0302,y
PHX
LDX $02
LDA PROPERTIES,x
ORA $64
STA $0303,y
PLX
INY
INY
INY
INY
DEX
BPL Loop
PLX
LDY #$02
LDA #$00
JSL $01B7B3
PHX
LDX #$01 ; number of times to loop for 8x8 tiles
Loop8:
LDA $00 ;\
CLC ; | Apply X displacement of the sprite.
ADC XDISP8,x ; |
STA $0300,y ;/
LDA $01 ;\
CLC ; | Y displacement is added for the Y position, so one tile is higher than the other.
ADC YDISP8,x ; | Otherwise, both tiles would have been drawn to the same position!
STA $0301,y
LDA TILEMAP8,x
STA $0302,y
PHX
LDX $02
LDA PROPERTIES,x
ORA $64
STA $0303,y
PLX
INY
INY
INY
INY
DEX
BPL Loop8
PLX
LDY #$00
LDA #$01
JSL $01B7B3
RTS