If I write 4 or 5 tiles to the background everything is fine. I am trying to copy over 4 entire rows of tiles starting with the top left corner of my large asteroid. (this isn't meant to be a long term solution, just a test)
Code: Select all
lda PPU_STATUS ; PPU_STATUS = $2002
lda #$21
sta PPU_ADDR ; PPU_ADDR = $2006
lda #$08
sta PPU_ADDR ; PPU_ADDR = $2006
@render_loop:
lda asteroid_background,x ;#LARGE_ASTEROID_SPRITE_START
sta PPU_DATA
inx
cpx #40 ; I've been playing with this number
bne @render_loop
I also tried something roughly like this (killed the code so this isn't exactly what I was testing).
Code: Select all
lda PPU_STATUS ; PPU_STATUS = $2002
lda #$21
sta PPU_ADDR ; PPU_ADDR = $2006
lda #$08
sta PPU_ADDR ; PPU_ADDR = $2006
@render_loop:
lda asteroid_background,x ;#LARGE_ASTEROID_SPRITE_START
sta PPU_DATA
inx
cpx #4
bne @render_loop
lda PPU_STATUS ; PPU_STATUS = $2002
lda #$21
sta PPU_ADDR ; PPU_ADDR = $2006
lda #$28
sta PPU_ADDR ; PPU_ADDR = $2006
@render_loop_2:
lda asteroid_background,x ;#LARGE_ASTEROID_SPRITE_START
sta PPU_DATA
inx
cpx #4
bne @render_loop_2
This also gives me garbage in my background.
Do I have too much code in my nmi? Or am I fundamentally doing this the wrong way?
Thanks