It is currently Thu Nov 14, 2019 2:58 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Joystick issue
PostPosted: Thu May 16, 2019 12:51 am 
Offline

Joined: Mon Mar 11, 2019 10:56 pm
Posts: 15
My joystick does work on Balloon Fight, Bomberman, however in Balloon fight it doesn't work. I pass nestest and Blarrg's CPU test and I have no idea why it could not work. Controller code is checked rechecked and rewritten few times still to no avail.
Now I have an idea maybe it's somehow related to dummy reads/writes. I've not implemented those however now start to think if they would help?
Can anyone shed me some light?


Top
 Profile  
 
 Post subject: Re: Joystick issue
PostPosted: Thu May 16, 2019 10:39 am 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 8670
Location: Seattle
LukasP wrote:
My joystick does work on Balloon Fight, Bomberman, however in Balloon fight it doesn't work. I pass nestest and Blarrg's CPU test and I have no idea why it could not work. Controller code is checked rechecked and rewritten few times still to no avail.
Even so, I think you've got a CPU bug.

Paperboy is the only game that we know of that relies on correct open bus behavior on the upper three bits of the controller ports, and I can't imagine we'd recommend people try Balloon Fight if it also depended on same.

Quote:
Now I have an idea maybe it's somehow related to dummy reads/writes. I've not implemented those however now start to think if they would help?
Unless you explicitly see something wacky like lda $3FFF,x being used to load the controller port, no, that won't help.


Top
 Profile  
 
 Post subject: Re: Joystick issue
PostPosted: Thu Jun 06, 2019 5:04 am 
Offline

Joined: Mon Mar 11, 2019 10:56 pm
Posts: 15
@lidnariq you were totally correct about the CPU issue. Tired of shooting in the dark I just went to NMI of a balloon fight and just looked what are the instructions used inside of it. There were only several so I hand checked them super super carefully and found a bug in my LSR routine. Now i'm amazed that nestest passed with my faulty implementation of it. As I fixed LSR a bunch of games fixed - donkey kong started to show proper loading screen instead of trash, input works on all of the games.
Thanks for reaffirming that it's a CPU issue as otherwise I would have probably poked elsewhere for a while


Top
 Profile  
 
 Post subject: Re: Joystick issue
PostPosted: Thu Jun 06, 2019 6:51 am 
Offline
User avatar

Joined: Mon Dec 29, 2014 1:46 pm
Posts: 929
Location: New York, NY
LukasP wrote:
i'm amazed that nestest passed with my faulty implementation of it


What was the bug? Maybe the test ROM can be enhanced.


Top
 Profile  
 
 Post subject: Re: Joystick issue
PostPosted: Thu Jun 06, 2019 7:42 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 21688
Location: NE Indiana, USA (NTSC)
Correct behavior: LSR sets carry to bit 0 of input value
The defect in this case: LSR sets carry to old carry AND bit 0 of input value. Can clear to 0 but not set to 1.

If carry is 1 before the test, or if input bit 0 is 0, there is no difference. The defect is apparent only if carry was 0 before the test and input bit 0 is 1.

_________________
Pin Eight | Twitter | GitHub | Patreon


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

All times are UTC - 7 hours


Who is online

Users browsing this forum: MSN [Bot], Rhad and 6 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