Are you familiar with the various indirect addressing mode? That's because you will need to deal with 16-bit quantities, and indexed addressing won't cut it, because it can only be used with 8-bit indexes.
There are several ways to do this, but essentially, you need to put a pointer in zero page, have some sort of counter and iterate until done. The counter will have to be some sort of 16-bit variable, obviously.
Code: Select all
lda $2002 ; this is just to reset the upper/lower byte latch, btw
sta $2006 ; hardcoded to load into $2000 in PPU space, per your code
lda (zptemp), y
There are several smallish optimizations possible in this code, but I preferred to let them aside so you can understand the code better. But even then, it's possible you don't understand some parts of this code, especially if you don't understand indirect indexed addressing, how status flags work, etc. Just tell what's not clear and we'll answer your questions. And a warning: I haven't tested that code, but I'm confident it works, although rendering must be disabled when using this code, because it will run long enough to be longer than V-blank and things will break badly if you're still manipuling PPU memory while the PPU is rendering.
On a related note: I'm surprised I didn't find this on the wiki (code that uploads an entire nametable, well, without the attribute table).
P.S.: it's really painful to reply on a mobile device...