It is currently Wed May 22, 2019 3:38 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Sun Mar 17, 2019 11:23 am 
Offline
User avatar

Joined: Sun Mar 17, 2019 10:15 am
Posts: 11
Location: Poland
Hi, everyone!

Okay, first of all, I apologize in advance if you have any problems with reading this post caused due to my english language skills.

Back to the topic... A few weeks ago I started a project of my own NES emulator. I already finished the CPU emulation and I'm currently working on a PPU emulation and screen display. However, when I test it, things seem to behave quite weird.
I'm going to describe my problem and show you a few examples.

The title screen in Super Mario Bros. 1 is not rendering in a proper way:
Image

Also there are those garbage tiles during demo play:
Image

But during a normal gameplay, everything displays properly:
Image

Battle City's title screen seems to suffer from a same problem:
Image

But the game is completely unplayable:
Image

In Mappy, when you walk on a flat floor, you suddenly fall through it and loses a life and in Pacman you can eat walls and escape the maze.

Another weird thing is when I tested my emulator with a Nestest, it passed all documented opcodes tests.
Image

But when I run any of Blargg's CPU opcode test ROMs, it failes and in result I get an unreadable garbage.

I double checked all the CPU code, opcodes execution, addresing modes, JMPs, JSR, NMI and couldn't manage to find any bug that would cause those kinds of glitches. ROMs are not corrupted in any way and the read buffer during the $2007 read is implemented correctly.
Also please, don't pay much attention to the incorrect color assignment and white dots, I haven't implemented tile coloring based on attribute tables yet and sprites are temporarily represented as dots.

Thank you in advance for any ideas and your help ^-^


Last edited by dawid9554 on Mon Mar 18, 2019 1:33 am, edited 1 time in total.

Top
 Profile  
 
PostPosted: Sun Mar 17, 2019 3:16 pm 
Offline
Formerly Fx3
User avatar

Joined: Fri Nov 12, 2004 4:59 pm
Posts: 3182
Location: Brazil
Hmm... Try checking $2007 reads, the 1-byte buffered stuff.
Another point is the PPU address. Look at writes to $2007 and how the address is handled there.


Top
 Profile  
 
PostPosted: Sun Mar 17, 2019 4:07 pm 
Offline
User avatar

Joined: Sun Mar 17, 2019 10:15 am
Posts: 11
Location: Poland
Zepper wrote:
Try checking $2007 reads, the 1-byte buffered stuff.

Oh my goodness... for a whole time I was reading values from $2007 immediately, not through a 1 byte buffer delay!
I fixed that and now everything works like a charm! Oh me silly :\

Image

Thank you a lot, Zepper ^-^


Top
 Profile  
 
PostPosted: Sun Mar 17, 2019 5:27 pm 
Online
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 11348
Location: Rio de Janeiro - Brazil
That's the first thing that comes to mind, but you did say that "the read buffer during the $2007 read is implemented correctly", so...


Top
 Profile  
 
PostPosted: Sun Mar 17, 2019 6:30 pm 
Offline
User avatar

Joined: Sun Mar 17, 2019 10:15 am
Posts: 11
Location: Poland
Well, at first I was pretty sure it was, but it actually wasn't done the way it should be done.


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

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 11 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