PPU Nametables
Moderator: Moderators
PPU Nametables
I am in the process of implementing the PPU, but I am having problems trying to get the nametables to load properly. Here is a comparison of nametables for Donkey Kong on my emulator & FCEUXDSP.
Would this be a result of improper initial PPU loading, or would it be changes to the nametables through PPUDATA?
I can provide more information and/or code if this is too obscure a problem to determine from the picture.
Would this be a result of improper initial PPU loading, or would it be changes to the nametables through PPUDATA?
I can provide more information and/or code if this is too obscure a problem to determine from the picture.
Your windows are blank. I don't see Donkey Kong's graphics at all.
Again just because code is executing and not hitting a bad opcode doesn't mean the game is running. At the very least check that the contents of name table memory match what they are in FCEUX when the title screen is up. And infact if the game is running even without any input the nametable will change after awhile as the game will run an attract mode/demo. If this isn't happening then the game isn't actually running yet.
Again just because code is executing and not hitting a bad opcode doesn't mean the game is running. At the very least check that the contents of name table memory match what they are in FCEUX when the title screen is up. And infact if the game is running even without any input the nametable will change after awhile as the game will run an attract mode/demo. If this isn't happening then the game isn't actually running yet.
- cpow
- NESICIDE developer
- Posts: 1097
- Joined: Mon Oct 13, 2008 7:55 pm
- Location: Minneapolis, MN
- Contact:
The main emu window looks like it's just displaying uninitialized (garbage) video memory.miker00lz wrote:looks like you're reading the same row of tiles over and over... and i have no idea whats going on with your main display. again, if you can post the source code we can point out what's going wrong.
yeah, exactly.MottZilla wrote:Your name table mirroring is broken. You shouldn't have 4 unique name tables unless the game is using "Four Screen Mirroring" whic is actually No Mirroring. If you fix name table mirroring you might fix those issues in the background.
Elessar, there are four mirroring cases you need to account for on reads/writes to/from your PPU memory.
for horizontal mirroring:
on accesses to $2400 thru $27FF, subtract $400 from the address
on accesses to $2800 thru $2BFF, subtract $400 from the address
on accesses to $2C00 thru $2FFF, subtract $800 from the address
for vertical mirroring:
on accesses to $2800 thru $2FFF, subtract $800 from the address
for one screen mirroring:
on accesses anywhere from $2000 thru $2FFF, you get the new address by AND'ing the given address by $03FF, then OR'ing that result with $2000.
and like MottZilla said, for four screen mirroring just leave the address as it is.
I will start implementing mirroring now, but that should not be causing the glitches. I have verified that all the PPU memory accesses have stayed within the $2000 nametable, and the nametable viewer I wrote displays the nametable perfectly.
EDIT: I implemented mirroring, but the glitches still remain.
Is there anything else that could cause this?
EDIT: I implemented mirroring, but the glitches still remain.
Is there anything else that could cause this?
From experience, nametables should be initialized by the emulator with zeroes ($00), and not $FFs.Dwedit wrote:Memory initialization? The game probably isn't zeroing out the second nametable. If you're not initializing memory to anything, you could get glitchy areas on the second nametable.
Last edited by Zepper on Sat Mar 10, 2012 10:48 am, edited 1 time in total.
Zepper
RockNES author
RockNES author