It is currently Fri Jun 22, 2018 4:31 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Thu Jan 13, 2011 4:32 pm 
Offline

Joined: Mon Oct 06, 2008 6:03 pm
Posts: 40
I've been trying to fix a lot of games that have been broken in my emulation code, and recently tracked down another hard-to-find bug that I'd like to make a note of in case anyone else encounters a similar problem.

Back ~8 years ago when I wrote my input handling code for the standard controllers, I based it off of koitsu's document that stated that the 4 bytes read for a given controller after the first 8 bytes encode a 4-bit device signature - 1 for controller 1, 2 for controller 2, etc. This code worked for the vast majority of games, however Monster Truck Rally would fail to read my "Start" button presses on the title screen. (I also saw similar failures in the SMB + Duck Hunt + XXX games)

A lot has changed since then and after taking a look at the wiki I now see that reads after the first 8 bytes should always return 1 (or 0 in the case of an inauthentic controller.) When I changed my code to always return 1 when $4016/$4017 are queried beyond 8 bytes Monster Truck Rally worked just fine. Always returning 0 made it work as well; something about returning a combination of 0's and 1's made the game fail.

Long story short: Monster Truck Rally reads more than 8 bytes from $4016/$4017 after clearing the input strobe, and will fail if an emulator does not handle these reads properly.

That being said, having finally had a chance to play Monster Truck Rally I promptly reverted my changes and left the bug in, to spare anyone else the misfortune of playing such an awful game. :lol:


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 13, 2011 4:39 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 20164
Location: NE Indiana, USA (NTSC)
The standard controllers have no signature, but as I understand it, the 4-player adapters (Four Score and Satellite) use one so that the game knows that 1. the adapter is connected and turned on and 2. reads haven't lost a bit due to DMC DMA double clocking.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 07, 2012 5:37 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 20164
Location: NE Indiana, USA (NTSC)
In #nesdev several days ago, someone experienced frustration at figuring out how to compensate for the DMC's habit of bit deletions on the NES Four Score hub. So I bought a Four Score and two extra controllers and made a little demo of reading all four controllers on a Four Score while ignoring glitched reads. It works in FCEUX and on my NES with a PowerPak, but it won't work with Famicom expansion controllers.

Download Eighty (source and binary)

PROTIP: Droid does what iDon't. Select wisely.


Attachments:
File comment: Mirror
eighty-0.01.zip [86.16 KiB]
Downloaded 51 times
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 4 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