It is currently Mon Dec 10, 2018 12:19 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Fri Mar 02, 2018 12:38 am 
Offline

Joined: Fri Mar 02, 2018 12:22 am
Posts: 7
Hello friends!

Like many before me I've been writing an emulator in my spare time for the last few months. Mostly for my own personal enjoyment and learning, and to help prepare me to better contribute to open source projects. I do have some fun graphical effects eventually planned out, but for now I consider it mostly writing a toy emulator.

I'm running into a problem with Super Mario Bros. Certain large sprites will have an odd line drawn in the middle of them. I've attached screenshots below. Notice the coin, the depleted question mark block, and the squished goomba. They all have a strange line appearing though them.

I was wondering if anyone had any insights as to what could potentially be causing this odd line.

A couple notes on the emulator:

1. Other than these lines (and a similar one with smashed turtles), no other obvious graphical artifacts are present in SMB or in any other NROM game I've tested. (Excitebike, Donkey Kong, Donkey Kong Jr.)
2. I have scrolling implemented correctly as laid out on the wiki.
3. Buffered reads, latched reads, and sprite zero detection are all emulated. (As far as I can tell at least).
4. I have no APU support added to speak of.
5. I do sprite evalution for the next scanline at PPU cycle 257. My sprite evaluation is fairly straightforward and simple.

Any ideas?

Thanks so much guys!


Attachments:
Capture1.PNG
Capture1.PNG [ 39.68 KiB | Viewed 2087 times ]
Capture.PNG
Capture.PNG [ 40.12 KiB | Viewed 2087 times ]
Top
 Profile  
 
PostPosted: Fri Mar 02, 2018 1:29 am 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 7006
Location: Canada
The thing I see in common with all of the problem sprites in your example is that they are vertically flipped sprites.

So, my guess is you have an off by one error in whatever code draws your sprites upside down for that case. (Maybe the starting address for the CHR fetch is off by 1? e.g. +8 instead of +7?)

That block sprite and Mario seem shifted to the right by one pixel as well. (Are all your sprites shifted to the right?)


Top
 Profile  
 
PostPosted: Fri Mar 02, 2018 8:20 pm 
Offline

Joined: Fri Mar 02, 2018 12:22 am
Posts: 7
You are a wizard rainwarrior! Off by one error in my vertical flip was exactly what was happening. I'm super impressed you were able to spot that so quickly!

Also sharp eye on the sprite pixel shift.

Both problem are officially solved. Now I can go onward to implementing some basic APU and mapper support.


Woot! Thank you so much! :)


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

All times are UTC - 7 hours


Who is online

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