My include list looks like this:
Code: Select all
.segment "CHRROM"
.incbin "spritesheet.chr" ;4k
.incbin "bgsheet.chr" ;4k
.incbin "nametable.nam" ;1k
BG loading code looks like this:
Code: Select all
lda #$90 ; CPU addr $8000+ 4kB offset
sta ptr+1
sty ptr+0 ;y reg is known to be zero
lda #$10 ;headache be here, i think?
sta PPUADDR
sty PPUADDR
ldx #20 ; + 20 pages' worth - 16 for bg chr and 4 for nt
loop:
lda (ptr), y
sta PPUDATA
iny
bne loop ; done a page yet? (y reg)
inc ptr+1
dex
bne loop ; done all pages yet? (x reg)