Keys stop working in Mario

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

Post Reply
takeda
Posts: 1
Joined: Thu Aug 27, 2009 8:07 pm

Keys stop working in Mario

Post by takeda » Thu Aug 27, 2009 8:20 pm

Hello everyone,

This is strange question to ask especially since you haven't seen my code. But I'm hoping that perhaps someone experienced it before in the past and might point where I should look for a problem.

I finished my emulator (no sound support yet) to a point that can play Super Mario Bros (the first one) as far as I know it emulates correctly up to level 8-2 (where I died :). Everything works fine, until I die, after that none of the keys appear to work.

I added debugging output and it shows that the event handler handles the keys. Also when I reset the game the game starts accepting the keys.

Any idea where the problem might be? It's possible that I missed something and am not emulating it.

This is perhaps topic for another thread. I'm planning to add sound support, since I never did any programming with sound before I'm not sure where to start, any advice? I feel also that sound is not as well documented as other parts of emulation (or maybe it's just my lack of experience in that area)

qeed
Posts: 61
Joined: Tue Jun 17, 2008 11:51 am

Post by qeed » Sat Aug 29, 2009 5:32 am

It is hard to guess what is wrong, since there is no source to show, and if the mario works up until the end of the game, then b0rks, there is a high chance that the error is somewhere else rather than basic joypad reading. I would double check nestest.nes or other cpu tests to see if you got all the CPU behavior right. Check if the sprite hit is correct, but I assume it would be to a point, since it can play it all the way to the end. I am not certain if mario uses the frame counter to trigger a interrupt in the CPU, I never got to the end of mario before I got the APU working. Check writes to the frame counter registers would be a good idea, since you said you haven't done the sound yet. There exists a full mario assembly, maybe you can check that and see. For the sound, I think this is a good thread to read, http://nesdev.com/bbs/viewtopic.php?t=6 ... +synthesis

Post Reply