liveBook · Manning

Sprite DMA register

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

An NES PPU register whose value selects the CPU memory page containing sprite OAM for a hardware DMA transfer.

The sprite DMA register selects the CPU memory page containing sprite OAM. Storing the OAM address’s high byte triggers the PPU to copy all 256 bytes into its built-in sprite data area. section 5.13

A typical NMI routine performs the transfer in three steps:

  • Reset the PPU sprite-memory address with PPU_SPRRAM_ADDRESS. section 5.13
  • Load the high byte of the OAM label with >oam; for OAM at $0200, this value is $02. section 5.13
  • Store that byte in SPRITE_DMA to start the hardware transfer without tying up the CPU. section 5.13

NMI sprite transfer

ldx #0; stx PPU_SPRRAM_ADDRESS; lda #>oam; sta SPRITE_DMA. This sequence selects the OAM page and transfers the complete sprite table.

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

How deep it goes
Explains high-byte selection and the resulting 256-byte transfer, but does not detail the register’s internal hardware.
Examples
Uses an assembly listing that transfers an OAM table labeled oam through SPRITE_DMA.
What it assumes
Assumes assembly registers and labels, while explaining 8-bit versus 16-bit address handling from zero.
What you can do after
Operate/configure it by writing an OAM page’s high byte during an NMI routine.
How it connects
Connects sprite OAM, NMI, PPU sprite memory, and hardware DMA.

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.