liveBook · Manning

PPU VRAM I/O register

As explained in Classic Game Programming on the NES: Make your own retro video game

An NES PPU data-port register used to read or write data at the current VRAM address.

The PPU VRAM I/O register is the NES PPU data port. Write a value to it to store data at the current VRAM address. After each write, the address automatically increases by one, allowing sequential transfers. section 5.13

Use the register for a palette transfer during an NMI routine:

  • Select the palette area by writing $3F and then $00 to the VRAM address register, producing address $3F00. section 5.13
  • Set an index to zero, load each palette value, and write it to PPU_VRAM_IO. section 5.13
  • Repeat until 32 values have been written; automatic address increment advances through VRAM. section 5.13

Writing a palette

After setting the VRAM address to $3F00, load palette values with indexed addressing and store each one to PPU_VRAM_IO. Increment the index and stop after 32 writes.

How Classic Game Programming on the NES: Make your own retro video game covers it

How deep it goes
Explains sequential writes and automatic address increment, stopping short of the alternate increment mode.
Examples
Demonstrates writing 32 palette values beginning at VRAM address $3F00.
What you can do after
Build it from scratch by setting a VRAM address and streaming indexed data through the PPU data port.
How it connects
Connects VRAM writes with the PPU VRAM address register, palette data, NMI interrupts, and rendering control.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Classic Game Programming on the NES: Make your own retro video game. The section links point to the parts of the book it draws on.