PPU memory mirroring

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
PPU memory mirroring
by on (#79819)
Hi,

I am writing a NES emulator for fun, and I have already have the CPU executing all the instructions correctly according to nestest.nes. Now I am starting to write the PPU, but I find the memory map somewhat confusing.

According to NinTech and other documents, the memory map for the PPU is more or less like this:
Code:
+---------------+---------------+---------------+-----------------------+
|    Address    |   End         |    Size       | Description           |
+---------------+---------------+---------------+-----------------------+
|    $0000      |    $0FFF      |    $1000      | Tile Set #0           |
|    $1000      |    $1FFF      |    $1000      | Tile Set #1           |
+---------------+---------------+---------------+-----------------------+
|    $2000      |    $23FF      |    $0400      | Name Table #0         |  \
|    $2400      |    $27FF      |    $0400      | Name Table #1         |   \
|    $2800      |    $2BFF      |    $0400      | Name Table #2         |    } Size = $1000
|    $2C00      |    $2FFF      |    $0400      | Name Table #3         |   /
+---------------+---------------+---------------+-----------------------+  /
|    $3000      |    $3EFF      |    $3EFF      | Name Table Mirror *1  |  } Size = $0F00
|    $3F00      |    $3FFF      |    $0020      | Palette *2            |
|    $4000      |    $FFFF      |    $C000      | Mirrors of Above *3   |
+---------------+---------------+---------------+-----------------------+


So how does the mirroring work out if $3000-$3EFF is $0100 bytes too short to mirror all of $2000-$2FFF? (Am I missing something obvious?)

by on (#79821)
I believe $3000-$3EFF is simply a mirror of $2000-$2EFF.

by on (#79840)
NickMass wrote:
I believe $3000-$3EFF is simply a mirror of $2000-$2EFF.


$3000-$3FFF is a mirror of $2000-$2FFF. The PPU actually does a video ram read above $3F00 into the read buffer, but replaces the data sent back to the CPU with its internal palette data.

Reference: blargg's ppu test, specifically vram_access.nes.