It is currently Wed Dec 13, 2017 6:14 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 35 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: PPU Nametables
PostPosted: Wed Feb 22, 2012 12:00 pm 
Offline
User avatar

Joined: Tue Jun 14, 2011 6:42 pm
Posts: 11
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.

Image

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.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 22, 2012 1:14 pm 
Offline
User avatar

Joined: Wed Dec 06, 2006 8:18 pm
Posts: 2806
Are you certain the game is even running? It would also help if you had actual tile graphics showing.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 22, 2012 1:25 pm 
Offline
User avatar

Joined: Tue Jun 14, 2011 6:42 pm
Posts: 11
Yes, the game is running (the debugger runs through the code).

Quote:
It would also help if you had actual tile graphics showing.

Do you mean the tile sets? Here they are:
Image

I apologize if I misunderstood you, it's been a long day.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 22, 2012 2:21 pm 
Offline
User avatar

Joined: Thu Sep 23, 2010 7:28 pm
Posts: 232
can you post your code to draw the tile data?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 22, 2012 5:37 pm 
Offline
User avatar

Joined: Wed Dec 06, 2006 8:18 pm
Posts: 2806
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.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 22, 2012 5:55 pm 
Offline
Formerly Fx3
User avatar

Joined: Fri Nov 12, 2004 4:59 pm
Posts: 3076
Location: Brazil
Put a screen of the game running.

_________________
Zepper
RockNES developer


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 24, 2012 12:51 pm 
Offline
User avatar

Joined: Tue Jun 14, 2011 6:42 pm
Posts: 11
I realized that the tile set preview wasn't reading the bytes correctly. Here is a screenshot of the game running with the tile sets and name tables:

Image


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 24, 2012 1:48 pm 
Offline
User avatar

Joined: Thu Sep 23, 2010 7:28 pm
Posts: 232
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.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 24, 2012 7:10 pm 
Offline
NESICIDE developer
User avatar

Joined: Mon Oct 13, 2008 7:55 pm
Posts: 1058
Location: Minneapolis, MN
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.


The main emu window looks like it's just displaying uninitialized (garbage) video memory.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 09, 2012 9:38 am 
Offline
User avatar

Joined: Tue Jun 14, 2011 6:42 pm
Posts: 11
It looks like I had overlooked two essential items: NMI & DMA.

Here is what the system looks like now:
Image
Image

As you can see, the left side and some of the top is not showing correctly. What could be causing this?

(I don't have sprites implemented yet, just the background.)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 09, 2012 11:25 am 
Offline
User avatar

Joined: Wed Dec 06, 2006 8:18 pm
Posts: 2806
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.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 09, 2012 2:02 pm 
Offline
User avatar

Joined: Thu Sep 23, 2010 7:28 pm
Posts: 232
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.


yeah, exactly.

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.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 09, 2012 2:56 pm 
Offline
User avatar

Joined: Tue Jun 14, 2011 6:42 pm
Posts: 11
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.
Image
Image

Is there anything else that could cause this?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 09, 2012 3:58 pm 
Offline
User avatar

Joined: Fri Nov 19, 2004 7:35 pm
Posts: 3968
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.

_________________
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 09, 2012 7:29 pm 
Offline
Formerly Fx3
User avatar

Joined: Fri Nov 12, 2004 4:59 pm
Posts: 3076
Location: Brazil
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.


From experience, nametables should be initialized by the emulator with zeroes ($00), and not $FFs.

_________________
Zepper
RockNES developer


Last edited by Zepper on Sat Mar 10, 2012 10:48 am, edited 1 time in total.

Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 35 posts ]  Go to page 1, 2, 3  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group