The code I use takes significantly less than a scanline:tepples wrote:and it's not even really wasting if you defer computation of some of the written values until that line.
Code: Select all
;start setting the scroll before the horizontal blank (48 cycles)
lda ScrollX+1
lsr
lda ScrollY+1
rol
asl
asl
sta PPUADDR
lda ScrollY+0
sta PPUSCROLL
asl
asl
and #%11100000
ldx ScrollX+0
sta ScrollX+0
txa
lsr
lsr
lsr
ora ScrollX+0
;finish setting the scroll during HBlank (11 cycles)
stx PPUSCROLL
sta PPUADDR
stx ScrollX+0