Odd Problem with nametables

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

Post Reply
miguelfsp
Posts: 23
Joined: Sun Jan 13, 2013 5:35 pm

Odd Problem with nametables

Post by miguelfsp » Mon Jan 21, 2013 12:40 pm

Hello guys, I'm kinda stuck with a messed up problem concerning the PPU... Please check this out:

I started the PPU few days ago and I'm now creating a debug window where I'll draw the palletes, tiles, nametables, etc... in order to learn more about the PPU itself, before "compiling" everything to draw the actual game.

However I'm stuck with some sort of name tables bug. Guys please check out the screenshots. As you see Nestest nametable loads correctly (and I got horizontal and vertical mirroring implemented), except for the facto that if you notice, the nametable is drawn a little more to the left then it should (can't understand why). But please check the "Mario bros" (not SMario) and the Donkey Kong games... The nametable seems to be completely messed up, and I really can't figure out where the problem is :/ My CPU passes nestest (tested without the PPU, comparing with nintendulator's log) so I assume that the cpu is not the cause... I generate NMIs when I reach scanline no. 242, so I don't know if there is something wrong about it.

I also just finished implementing the colors by reading the attribute tables.

Do you guys have any ideas from where this problem is being caused? It looks like the games are not filling up the nametables correctly or something like that, but don't understand why because nestest screen is showing the right tiles.

Thanks a lot for reading!
Attachments
donkey kong
donkey kong
running "mario bros"
running "mario bros"
running nestest
running nestest

tepples
Posts: 22277
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Odd Problem with nametables

Post by tepples » Mon Jan 21, 2013 1:37 pm

When $2006 is written, are you making sure that the first/second write flag is set properly?

miguelfsp
Posts: 23
Joined: Sun Jan 13, 2013 5:35 pm

Re: Odd Problem with nametables

Post by miguelfsp » Mon Jan 21, 2013 2:18 pm

You know, I spent the entire day trying to figure this out, and in the matter of minutes you point me exacly in the right direction. I just had to remove a stupid line of code (I was anding the result address with a value) and suddenly everything worked :) :)

Many thanks!!!!! I gotta include you guys in my About Box when I finish this!

How do you guys know so much about this platform?

Thank you very much! :)
Attachments
WORKS.png

Zelex
Posts: 268
Joined: Fri Apr 29, 2011 9:44 pm

Re: Odd Problem with nametables

Post by Zelex » Tue Jan 22, 2013 5:17 pm

miguelfsp wrote:You know, I spent the entire day trying to figure this out, and in the matter of minutes you point me exacly in the right direction. I just had to remove a stupid line of code (I was anding the result address with a value) and suddenly everything worked :) :)

Many thanks!!!!! I gotta include you guys in my About Box when I finish this!

How do you guys know so much about this platform?

Thank you very much! :)
They are wizards :)

Post Reply