It is currently Wed Oct 23, 2019 8:05 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Sat Jun 01, 2019 7:24 pm 
Offline

Joined: Thu Aug 16, 2012 7:55 pm
Posts: 39
Hello everyone! First of all, thanks to all the documentation on this site, forum help and nestech.txt that I have actually gotten my emulator rendering, with controller input support! However, i'm a bit stumped on this and was wondering if anyone has any expertise in guiding me on where to actually start looking for debugging.

My test ROM is Mario Bros. and the preview gameplay looks to be working fine, however after about 3 rounds of this, I begin seeing artifacts on the background. They look like this:

Image

Image

I was wondering if anyone has experienced this, and what would be a probable cause.

A hunch I have is that the background table address is being set improperly somehow at certain points in the game. Could it also be that I'm rendering at the wrong points?


Top
 Profile  
 
PostPosted: Thu Jun 06, 2019 4:18 am 
Offline

Joined: Mon Mar 11, 2019 10:56 pm
Posts: 15
How did you imlement your PPU? Can you print out and compare with working emulator that you indeed get correct nametable indexes at those positions? How do other UNROM games look like in your emulator?
I've had similar issue with my first PPU iteration which was - render everything in one go each frame. The game may change and many will do the nametable base address mid frame so if you did the same then you need to record the register changes and replay them back when rendering.


Top
 Profile  
 
PostPosted: Thu Jun 06, 2019 1:13 pm 
Offline
User avatar

Joined: Sun Sep 19, 2004 9:28 pm
Posts: 4210
Location: A world gone mad
Fairly certain Mario Bros does not do what's described in the above post. You can use a render-full-frame approach and Mario Bros will work just fine. I base this on anecdotal evidence (writing a NES emulator in the late 90s called VeNES that worked exactly this way, and Mario Bros was our primary test ROM, combined with looking at it in more detail in Mesen). Mario Bros is really pretty bare-bones and "simple" in the PPU work it's doing -- nothing fancy at all (unlike SMB).

The problem is very likely elsewhere. Said "hunch" is likely along the right lines. Impossible for me to tell you where though; your emulator = your code = only you know it. I could sit here and list off a billion "ideas" but zero are going to be helpful in narrowing it down.

P.S. -- Not sure how to interpret "after about 3 rounds of this", as screenshots depicted are exclusively phase 1 (round 1).


Top
 Profile  
 
PostPosted: Sun Jun 09, 2019 10:09 am 
Offline

Joined: Thu Aug 16, 2012 7:55 pm
Posts: 39
Thanks for the responses. I actually ended up dumping the name table contents after a full frame and implemented a few debug features to take a few snapshots of the current console's state. I found that the name table bytes themselves were incorrect. Some junk bytes are being written to the PPU nametable. I don't know what the root cause is yet since I had found a few other CPU bugs along the way...

Even though I had passed the nestest rom, I found there were a few bugs in my CPU. After fixing them, a lot of other graphical glitches which I had not presented in this post started disappearing.

I think then all this coupled with an incorrect nametable at various points means that there is probably something wrong with my CPU. I will continue to debug. :)

I also meant by "3 rounds" meaning the intro screen transition from: Title Screen -> Autoplay -> Title Screen -> Autoplay, etc.

The graphical glitches don't seem to appear until after a few iterations of going from Title Screen -> Autoplay.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: InconspicuousBrick and 6 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