Let's say I want to write K
to the top of the status bar in SMB. I can use the following set of statements to write to PPU memory.
memory.writebyte(0x2001, 0x00) -- Turn off rendering
memory.readbyte(0x2002) -- PPUSTATUS (reset address latch)
memory.writebyte(0x2006, 0x20) -- PPUADDR high byte
memory.writebyte(0x2006, 0x2A) -- PPUADDR low byte
memory.writebyte(0x2007, 0x14) -- PPUDATA ('K')
memory.writebyte(0x2001, 0x1e) -- Turn on rendering
I tried changing the color of the text by changing the color palette before writing text as -
memory.writebyte(0x2001, 0x00) -- Turn off rendering
memory.readbyte(0x2002) -- PPUSTATUS (reset address latch)
memory.writebyte(0x2006, 0x3F) -- Selecting high byte color palette
memory.writebyte(0x2006, 0x11) -- Selecting low byte color palette
memory.writebyte(0x2007, 0x16) -- Red color
memory.writebyte(0x2006, 0x20) -- PPUADDR high byte
memory.writebyte(0x2006, 0x2A) -- PPUADDR low byte
memory.writebyte(0x2007, 0x14) -- PPUDATA ('K')
memory.writebyte(0x2001, 0x1e) -- Turn on rendering
However that changes the color of the background objects.
My question is how I can set the color of the displayed text?