i am testing my emu with blarggs test, and its failing.
blargg_ppu_tests_2005.09.15b/palette_ram.nes displays $05,
meaning....
5) Write to $10 should be mirrored at $00
so i re read the docs on palettes.
the image palette is 0x3f00 - 0x3f0f ?
the sprite palette is 0x3f10 - ox3f1f ?
mirrored through 0x3fxx ?
i dont understand the mirroring of image and sprites ? could anyone help explain what i am missing.
thanks
matt
The palette only has 28 ($1C) unique entries. 4 entries mirror others:
$3F10 mirrors $3F00
$3F14 mirrors $3F04
$3F18 mirrors $3F08
$3F1C mirrors $3F0C
correct me if i'm wrong but the palette consists of $20 entries. eight of those are mirrors of color 0 starting at $3F00 and its the every 4th one.
half the palette is used for drawing sprites and the other half is for backgrounds.
the whole $20 byte palette is mirrored many times in PPU address space starting at $3F20, so if it is referenced it shoud return the same value as it is mirroring.
never-obsolete wrote:
eight of those are mirrors of color 0 starting at $3F00 and its the every 4th one.
No. $3F04, $3F08, and $3F0C contain unique values. They just never come into play during normal rendering.
Here's the long version that leaves little room for quibbling. The main thing is to be clear about the logical address space (the PPU address) and the physical RAM that stores values.
The NES PPU has 28 total internal palette entries, each 6 bits. They are mapped to the PPU address space from $3F00 to $3FFF. When the PPU address is in this range, only the low 5 bits are relevant for selecting one of the internal palette entries. These 32 logical addresses are each mapped to a separate internal entry except for addresses $10, $14, $18, and $1C, which map to the same internal entries as $00, $04, $08, and $0C, respectively.
All of the 28 internal palette entries can be accessed by the PPU and be displayed on-screen. Entries $04, $08, and $0C can only be displayed on-screen when PPU rendering is turned off and the PPU address is pointing to one of them.