PPU Memory

Are you new to 6502, NES, or even programming in general? Post any of your questions here. Remember - the only dumb question is the question that remains unasked.

Moderator: Moderators

Post Reply
Oderjunks
Posts: 1
Joined: Thu Sep 13, 2018 12:46 pm

PPU Memory

Post by Oderjunks »

I am mildly infuriated Because I can't figure out how to:
1. How to change the palettes (mainly the background)
2. How to make graphics
And 3. How to adjust the nametables
if anybody could help me I appreciate it! :)

PS: I am trying to program in pure ASM because I don't know any languages. (I found the opcodes of all of the intructions)
User avatar
dougeff
Posts: 3079
Joined: Fri May 08, 2015 7:17 pm

Re: PPU Memory

Post by dougeff »

Have you tried the Nerdy Nights Tutorial?
http://nintendoage.com/forum/messagevie ... eadid=7155
Sometimes it's good to start from working example code, rather than start from scratch.

The PPU can only be written to with rendering OFF (write zero to 2001)...or during v-blank.

To write to the PPU you must first set an address (2 writes to 2006), then write data to 2007.

When that is done. Set the scroll registers (2005 twice). And turn the screen on (1e to 2001).

The palette is PPU addresses 3f00-3f1f.

The main screen (nametable #0) is ppu addresses 2000-23ff.

The graphics can be made separately, and imported into the .nes file. With a tile editor.

There is a lot more to it...init code. ines header. learn 6502 asm. Which is why I recommend a tutorial.


As Einstein used to say. "Do not worry about your difficulties in Mathematics. I can assure you mine are still greater." I am currently reading through a 2000 line source code that I didn't write, trying to fix a bug that I don't understand (involving NES music). we all get frustrated.
nesdoug.com -- blog/tutorial on programming for the NES
User avatar
Quietust
Posts: 1920
Joined: Sun Sep 19, 2004 10:59 pm
Contact:

Re: PPU Memory

Post by Quietust »

dougeff wrote:To write to the PPU you must first set an address (2 writes to 2006), then write data to 2007.

When that is done. Set the scroll registers (2005 twice). And turn the screen on (1e to 2001).
Don't forget to set the "base" nametable too (lower 2 bits of $2000), otherwise the scroll registers won't necessarily work as expected.
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.
Post Reply