Problems with palette data

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

Post Reply
rustynes
Posts: 1
Joined: Tue Jun 16, 2020 6:16 am

Problems with palette data

Post by rustynes » Tue Jun 16, 2020 7:07 am

Hi all! I'm fairly new to emulation development, and am in the process of building my first NES emulator. I've run into a bit of a problem, though, when it comes to getting the palette information from the attribute table. I've only implemented the background sprite logic at this point, which is why the following picture looks kinda weird:
broken_nes.png

For reference, here's what it should look like according to javidx9:
Screen Shot 2020-06-16 at 9.56.22 AM.png

Has anyone ever seen this problem before? I've already done CPU tests, so I think the problem must be in the PPU. The palette index after cycle 224 is always one lower than it should be (ie. it's 2 when it should be 3). The pixel offset for the palette is correct, though, so everything looks OK despite being the wrong colour. When looking at my logs, it appears as though the attribute value stored at that tile was never overwritten after being initialized at the start of the game. This would indicate that something is wrong with the VRAM address logic in the PPU, but then why would everything but the palette index by OK?

User avatar
Dwedit
Posts: 4306
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Re: Problems with palette data

Post by Dwedit » Tue Jun 16, 2020 9:24 am

There is only one background color. The other background colors found among the background palettes don't actually do anything.

Meanwhile, the Game Boy Color does things the opposite way, and does not share a single background color.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!

Post Reply