CLK icon indicating copy to clipboard operation
CLK copied to clipboard

MSX: problems reading controls with the BIOS

Open reidrac opened this issue 7 years ago • 5 comments

I'm using GTSTCK and GTTRIG from the BIOS to manage the controllers and I've found that sometimes those stop working. ~~Then I close my X11 session, login again, and it works back to normal.~~ This is red herring; it is working again, no change in the code and I can't find a reason.

It works fine with OpenMSX, and I've tried some games with CLK and they seem to work fine, but of course that doesn't mean they're using the BIOS to read the controls...

So this is mostly a question and it could be me being confused but, does this make any sense?

Thanks!

reidrac avatar Nov 20 '18 22:11 reidrac

It's very possible I made an error in implementation; joystick support was added somewhat after the fact, after I'd finally caught the Mac version up with the SDL version by adding real joystick support. So I'll need to take a look at it when I get a chance. Though I'm currently deeply enmeshed in the video output stream and its current deficiencies, and am absent for most of December, so I daren't make any promises as to when that might be.

TomHarte avatar Nov 26 '18 15:11 TomHarte

No problem, take your time. I can use OpenMSX meanwhile.

reidrac avatar Nov 26 '18 17:11 reidrac

It's probably unrelated, but I have recently corrected AY behaviour when a port that is connected as an output is software configured as an input. Supposing you were configuring Port B as an input, under the old code it will have been only very loosely defined whether you'd have ended up seeing input from joystick 1 or joystick 2. It strikes me as technically just about possible that you were seeing the emulator switch from providing input from joystick 1 to providing it from joystick 2 and therefore making joystick 1 look non-operational, so I thought I'd mention it.

TomHarte avatar Mar 15 '19 18:03 TomHarte

I found a bug in the AY player that was doing the wrong thing with the ports. It is now fixed, and coincidentally I haven't seen the keyboard issue.

Could it be related? Not sure. When I found the bug in a real MSX, both CLK and openMSX were happy with the wrong configuration.

Thanks Tom!

reidrac avatar Mar 15 '19 18:03 reidrac

Yes, that was definitely the same thing: in my code if you configured Port B as input then, previously, what it was outputting was undefined, but usually a historic value. So usually it would select joystick 1 because usually joystick 1 had previously been selected.

Per the data sheet it should output 0xff and therefore should always, regardless of history, select joystick 2. That's now what the emulator does.

TomHarte avatar Mar 15 '19 19:03 TomHarte