Here is a relevant part of my code:
Code: Select all
SetPals:
LDA $2002 ;Read PPU status to reset it (It is reset by reading from it)
LDA #$3F ;\ High byte
STA $2006 ;/
LDA #$00 ;\ Low byte
STA $2006 ;/
LDX #$00 ;We start at 00
SetPalsLoop:
LDA palette,x ;Load from palette table from data section below
STA $2007 ;And we write it to the PPU I/O
INX ;We set the start of a loop
CPX #$20 ;We're writing 16 bytes so hex $10 = decimal 16
BNE SetPalsLoop ;Loop if not zeroAgh, this as been bothering me all day.
Any help would be appreciated.