[SOLVED] SMB Title Screen isn't rendering in a proper way

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

Post Reply
User avatar
dawid9554
Posts: 12
Joined: Sun Mar 17, 2019 10:15 am
Location: Poland

[SOLVED] SMB Title Screen isn't rendering in a proper way

Post by dawid9554 » Sun Mar 17, 2019 11:23 am

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.

User avatar
Zepper
Formerly Fx3
Posts: 3194
Joined: Fri Nov 12, 2004 4:59 pm
Location: Brazil
Contact:

Re: SMB Title Screen isn't rendering in a proper way & more

Post by Zepper » Sun Mar 17, 2019 3:16 pm

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.

User avatar
dawid9554
Posts: 12
Joined: Sun Mar 17, 2019 10:15 am
Location: Poland

Re: SMB Title Screen isn't rendering in a proper way & more

Post by dawid9554 » Sun Mar 17, 2019 4:07 pm

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 ^-^

User avatar
tokumaru
Posts: 11772
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: SMB Title Screen isn't rendering in a proper way & more

Post by tokumaru » Sun Mar 17, 2019 5:27 pm

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...

User avatar
dawid9554
Posts: 12
Joined: Sun Mar 17, 2019 10:15 am
Location: Poland

Re: SMB Title Screen isn't rendering in a proper way & more

Post by dawid9554 » Sun Mar 17, 2019 6:30 pm

Well, at first I was pretty sure it was, but it actually wasn't done the way it should be done.

ashkalov
Posts: 1
Joined: Thu May 14, 2020 3:58 am

Re: [SOLVED] SMB Title Screen isn't rendering in a proper way

Post by ashkalov » Mon Jun 01, 2020 3:46 am

Good day.
I am Russian and apologize in advance for my English.
I could not resist and say thank you!
I had the same problem!
Attachments
bad render
bad render
good render
good render

Post Reply