mirror of
https://github.com/lscharen/iigs-game-engine.git
synced 2024-12-02 14:49:43 +00:00
Copy OAM source on-demand instead of on DMA REG access
This commit is contained in:
parent
576c402d0b
commit
63d2f0ea46
@ -571,6 +571,7 @@ no_pal
|
|||||||
|
|
||||||
; Trigger a copy from a page of memory to OAM. Since this is a DMA operation, we can cheat and do a 16-bit copy
|
; Trigger a copy from a page of memory to OAM. Since this is a DMA operation, we can cheat and do a 16-bit copy
|
||||||
PPUDMA_WRITE ENT
|
PPUDMA_WRITE ENT
|
||||||
|
rtl
|
||||||
php
|
php
|
||||||
pha
|
pha
|
||||||
|
|
||||||
@ -613,24 +614,29 @@ scanOAMSprites
|
|||||||
ldy #0
|
ldy #0
|
||||||
|
|
||||||
:loop
|
:loop
|
||||||
lda PPU_OAM,x ; Y-coordinate
|
; lda PPU_OAM,x ; Y-coordinate
|
||||||
|
ldal ROMBase+$200,x
|
||||||
cmp #max_nes_y+1 ; Skip anything that is beyond this line
|
cmp #max_nes_y+1 ; Skip anything that is beyond this line
|
||||||
bcs :skip
|
bcs :skip
|
||||||
cmp #y_offset
|
cmp #y_offset
|
||||||
bcc :skip
|
bcc :skip
|
||||||
|
|
||||||
lda PPU_OAM+1,x ; $FC is an empty tile, don't draw it
|
; lda PPU_OAM+1,x ; $FC is an empty tile, don't draw it
|
||||||
|
ldal ROMBase+$201,x
|
||||||
cmp #$FC
|
cmp #$FC
|
||||||
beq :skip
|
beq :skip
|
||||||
|
|
||||||
lda PPU_OAM+3,x ; If X-coordinate is off the edge skip it, too.
|
; lda PPU_OAM+3,x ; If X-coordinate is off the edge skip it, too.
|
||||||
|
ldal ROMBase+$203,x
|
||||||
cmp #255-8
|
cmp #255-8
|
||||||
bcs :skip
|
bcs :skip
|
||||||
|
|
||||||
rep #$20
|
rep #$20
|
||||||
lda PPU_OAM,x
|
; lda PPU_OAM,x
|
||||||
|
ldal ROMBase+$200,x
|
||||||
sta OAM_COPY,y
|
sta OAM_COPY,y
|
||||||
lda PPU_OAM+2,x
|
; lda PPU_OAM+2,x
|
||||||
|
ldal ROMBase+$202,x
|
||||||
sta OAM_COPY+2,y
|
sta OAM_COPY+2,y
|
||||||
sep #$20
|
sep #$20
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user