nesdev.parodius.com Forum Index nesdev.parodius.com
NES Development and Strangulation Records message boards
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Super Mario and Zelda emulation issues
Goto page 1, 2  Next
 
Post new topic   Reply to topic    nesdev.parodius.com Forum Index -> NESemdev
View previous topic :: View next topic  
Author Message
CaptainMuscles



Joined: 14 Jul 2009
Posts: 10

PostPosted: Sun Jul 19, 2009 3:00 am    Post subject: Super Mario and Zelda emulation issues Reply with quote

I've been writing my own NES emulator for fun over the last couple of weeks. I really only intended for it to play one game at first (Final Fantasy I, and thanks a million Disch for the commented assembly, it was priceless for my early debugging.)

After getting FF1 to where it seemed like it was working fine, I got the itch to try to see if I could get it to run a handful of other games well.

Shortly afterward, I got Super Mario Bros. working and looking great, except for one issue. Whenever Mario dies and falls off of the screen, he continues falling from the top of the screen, all the way down and wrapping back to the top again, all the while flashing colors kinda like when he is invincible after picking up a star, although the game still goes on to the next life when the death music ends. When Mario dies from falling into a pit, the same thing happens, except that Mario can still be steered left and right while falling until the death music ends.

When playing the Legend of Zelda 1, the title and explanation screens look correct, but when entering the character's name, there is no response to any buttons other than Start, 'A' and 'B'. Therefore the player can not use Select to move down to end registration nor move the cursor with the d-pad to select letters other than a.

Other than the mentioned issues, everything seems to work fine in FF1 and Super Mario Bros, and all legal-opcode tests pass in nestest.nes. Has anyone experienced similar problems and have some insight into what is happening here?

P.S. Many thanks go out to everyone on these boards whose documents and forum posts have helped me so far. Way too many to remember and list at the moment.
Back to top
View user's profile Send private message
hap



Joined: 24 Mar 2005
Posts: 348

PostPosted: Sun Jul 19, 2009 5:30 am    Post subject: Reply with quote

Even though nestest passes, the SMB problem still sounds like a CPU bug to me. Try blargg's CPU test too.
Back to top
View user's profile Send private message Visit poster's website
CaptainMuscles



Joined: 14 Jul 2009
Posts: 10

PostPosted: Sun Jul 19, 2009 11:36 am    Post subject: Reply with quote

I was only able to find cpu timing test roms, is this the one you were referring to?
Back to top
View user's profile Send private message
koitsu
Site Admin


Joined: 19 Sep 2004
Posts: 355
Location: Mountain View, CA, USA

PostPosted: Sun Jul 19, 2009 11:48 am    Post subject: Reply with quote

CaptainMuscles wrote:
I was only able to find cpu timing test roms, is this the one you were referring to?


http://www.fly.net/~ant/misc/
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
hap



Joined: 24 Mar 2005
Posts: 348

PostPosted: Sun Jul 19, 2009 1:15 pm    Post subject: Reply with quote

over here: http://nesdev.parodius.com/bbs/viewtopic.php?t=3831
Back to top
View user's profile Send private message Visit poster's website
MrSketch



Joined: 15 Jun 2009
Posts: 4

PostPosted: Mon Jul 20, 2009 9:52 am    Post subject: Reply with quote

Just out of curiosity, what is the trick to getting the vertical scrolling to work in Final Fantasy? I have a bug in my emulator where when you scroll vertically in that game there are graphical glitches at the top and bottom, but horizontal scrolling works just fine. Zelda 2 and Metroid both scroll vertically just fine.

It goes through 3 distinct phases (ex: scrolling up):
The bottom tiles show at the top (for 8 frames)
Then the top tiles show up at the top and bottom. The top tiles are correct, but with incorrect attribute data (only for 1 frame)
The top tiles still show up at the bottom (for 7 frames)

I don't feel too bad since Nestopia v1.40h doesn't scroll it correctly either, but I'd like to know if you got it scrolling right and what the trick was.
Back to top
View user's profile Send private message
tokumaru



Joined: 12 Feb 2005
Posts: 2736
Location: Rio de Janeiro - Brazil

PostPosted: Mon Jul 20, 2009 11:58 am    Post subject: Reply with quote

MrSketch wrote:
I have a bug in my emulator where when you scroll vertically in that game there are graphical glitches at the top and bottom, but horizontal scrolling works just fine.

This is probably correct (specially since other emulators are showing the same thing). Many commercial games have vertical scrolling glitches. It is quite hard to have glitch-free scrolling in both directions with the NES. Most games that scroll in both directions have glitches either vertically or horizontally.
Back to top
View user's profile Send private message
MrSketch



Joined: 15 Jun 2009
Posts: 4

PostPosted: Mon Jul 20, 2009 1:24 pm    Post subject: Reply with quote

I guess I find it hard to believe that this really popular game has this bad of a glitch that isn't talked about more or mentioned on the wiki. I also checked Nintendulator which has the same problem. Here are some screenshots of what I'm talking about:


According to the entry on emuverse, my dump has the correct CRC and MD5 so it should be a good dump.
http://dorando.emuverse.com/html/final-fantasy.html#na

Edit: This page on the wiki explains the overscan issues present with the NTSC PPU and that the top and bottom 8 rows are sometimes not displayed on NTSC TVs.


Last edited by MrSketch on Mon Jul 20, 2009 1:45 pm; edited 1 time in total
Back to top
View user's profile Send private message
tepples



Joined: 19 Sep 2004
Posts: 4889
Location: USA

PostPosted: Mon Jul 20, 2009 1:42 pm    Post subject: Reply with quote

There isn't enough VRAM in the PAL NES for glitch-free scrolling in all directions. The issue is alluded to in Mirroring, and I just added an example of a mirroring glitch in a different game to Game Bugs.

NTSC NES games' scrolling engines were designed to run on NTSC television sets that crop the picture at the top and bottom, and you'll see occasional glitches like this unless either A. your emulator emulates NTSC overscan (like pretty much everything since Nesticle), or B. your game uses raster effects to crop the glitches off (like Jurassic Park).
Back to top
View user's profile Send private message Visit poster's website AIM Address
MrSketch



Joined: 15 Jun 2009
Posts: 4

PostPosted: Mon Jul 20, 2009 1:59 pm    Post subject: Reply with quote

Thank you tepples for clearing this up. I always wondered why Virtual NES had a one tile border around the edges and I guess this explains why.
Back to top
View user's profile Send private message
CaptainMuscles



Joined: 14 Jul 2009
Posts: 10

PostPosted: Mon Jul 20, 2009 2:27 pm    Post subject: Reply with quote

Quote:
NTSC NES games' scrolling engines were designed to run on NTSC television sets that crop the picture at the top and bottom, and you'll see occasional glitches like this unless either A. your emulator emulates NTSC overscan (like pretty much everything since Nesticle), or B. your game uses raster effects to crop the glitches off (like Jurassic Park).


What he said. My screen looked just like yours before I started skipping the top and bottom 8 scanlines to emulate the visibile NTSC area.
Back to top
View user's profile Send private message
tokumaru



Joined: 12 Feb 2005
Posts: 2736
Location: Rio de Janeiro - Brazil

PostPosted: Tue Jul 21, 2009 9:37 am    Post subject: Reply with quote

tepples wrote:
NTSC NES games' scrolling engines were designed to run on NTSC television sets that crop the picture at the top and bottom

Except that they don't always crop. My personal experience is that most of the time the TVs are miscalibrated or something and the glitches are quite visible, either at the top or at the bottom.

MrSketch wrote:
I find it hard to believe that this really popular game has this bad of a glitch

Don't you find hard to believe that the following also popular games have such bad glitches at the left and/or right sides of the screen?











I find these glitches terribly distracting when I'm playing, even though in practive they are not as big as the vertical ones because the leftmost column is hidden by hardware.

IMO, people think too high of the programmers of the time. They were not better than the hobbist programmers of today (generally speaking), they just had a consistent working schedule and the financial incentive to get things done, even if that meant doing some sloppy coding to simplify things and get the games out in time.
Back to top
View user's profile Send private message
Banshaku



Joined: 24 Jun 2008
Posts: 892
Location: Tokyo, Japan

PostPosted: Tue Jul 21, 2009 6:58 pm    Post subject: Reply with quote

tokumaru wrote:
IMO, people think too high of the programmers of the time. They were not better than the hobbist programmers of today (generally speaking), they just had a consistent working schedule and the financial incentive to get things done, even if that meant doing some sloppy coding to simplify things and get the games out in time.


I'm on the same opinion about this part too. If you read what Neil said, they didn't even have an english instruction manual when they started to work on it and they had to figure out how it work by guessing.

So any team of programmers with enough time and pressure from their publisher will be about to churn out a game. The difference with us is that we don't have the team, time and money to put on it.
Back to top
View user's profile Send private message Visit poster's website
CaptainMuscles



Joined: 14 Jul 2009
Posts: 10

PostPosted: Tue Jul 21, 2009 8:58 pm    Post subject: Reply with quote

Thanks for the references to Blargg's test roms. It turns out that the issue was caused by the way I am handling the functions for my operations. ASL, LSR, ROL, and ROR were all handling a zeropage, x that pointed to the memory location $00 as the accumulator version of those commands.

Also, as I mentioned in the CPU test thread, anyone experiencing massive failures in Blargg's test rom number 5 despite a seemingly working emulator should take a look at how they are handling the setting of processor status flags 5 and 6 during IRQ/NMI/BRK/PHP. As per a post I found by Disch somewhere on these boards, Flag 5 should be pushed as set for BRK/PHP and clear for NMI/IRQ. Flag 6 should be pushed as set for all four commands.
Back to top
View user's profile Send private message
TSK



Joined: 21 May 2009
Posts: 2
Location: Wichita, Kansas

PostPosted: Tue Jul 21, 2009 9:16 pm    Post subject: Reply with quote

MrSketch wrote:
Thank you tepples for clearing this up. I always wondered why Virtual NES had a one tile border around the edges and I guess this explains why.


I think, that if I didn't, I'd get complaints from the users, and they're a fickle bunch. This is why you don't do things in Java. I can't even really change the palette much without a dozen emails in my inbox.

But really, it provides a more user-friendly experience, but for an actual program with menus and settings, it's probably worth it to have an option to turn this on and off.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    nesdev.parodius.com Forum Index -> NESemdev All times are GMT - 7 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group