Page 1 of 3

PC-Sprint negative: joysticks don't function

Posted: Sun Jul 14, 2019 8:02 am
by bagelswitch
So, after some simple A/B testing, I've confirmed that PCJr joysticks don't function when the processor is sped up using a PC-sprint type (dual 8284a(-1)) acceleration technique. I then found this in the technical reference:
Interface Description

The Game Interface has two connectors located at the
rear of the System unit for four paddles (two per
connector) or two joysticks. Each connector has four
input lines: two digital inputs and two resistive inputs.
All the inputs are ' read ' with one ' IN ' from address
hex 201. The interface, plus system software, converts
the present resistive value to a relative paddle or
joystick-position. On receipt of an output signal, four
timing circuits are started. By determining the time
required for the circuit to time out (a function of the
resistance), the paddle or joystick position can be
determined.

.— The four digital inputs each have a IK ohm resistor to

( pull the voltage up to +5V. With no drive on these

inputs, a 1 is read. For a reading, the inputs must be
pulled to ground.

The four resistive inputs are converted to a digital pulse
with a duration proportional to the resistive load,
according to the following equation:



Time = 24.2 jus + 0.011 (r) jus
Where r is the resistance in ohms
So it would seem these "timing circuits" are impacted by the PC-Sprint. Bummer, as it would have been nice to play Sierra AGI games with a bit more speed, but also using the joystick (vs. later AGI/SCI games that are better with a mouse).

If anyone running a PC-Sprint type board could confirm this isn't unique to my system, I'd appreciate it, couldn't find any reference in the forum to non-working joysticks, so it seems unlikely that the controller logic for them on my board failed independantly somehow . . .

Re: PC-Sprint negative: joysticks don't function

Posted: Sun Jul 14, 2019 8:47 am
by jmetal88
I'll try to remember to try it on mine later. I'm not actually using a Sprint-type board, I've just got two 8284s stacked on top of each other with the faster CPU crystal and a switch tacked on, but I think it's essentially the same mod.

Re: PC-Sprint negative: joysticks don't function

Posted: Sun Jul 14, 2019 10:20 am
by Brutman
The 8284 type modifications should not be causing compatibility problems unless the BIOS code is using a timing loop that is dependent on processor speed.

Remember that the original system timing from the first 8284A is preserved as is so that the video, serial ports, memory, and I/O all work correctly. The only effect should be that the 8088 runs faster. Any code using instruction timing is going to be screwy as a result.

Of course the joystick routines are not included in the printed BIOS listing. I started disassembling the BIOS looking for writes to port 201. This is going to take a while ...

Can somebody with a running PCSprint also check their joysticks? And not from BASIC either; BASIC might not be using the BIOS routine.

Re: PC-Sprint negative: joysticks don't function

Posted: Sun Jul 14, 2019 11:02 am
by Brutman
Small update ... the interface is basically:
  • Do a write to start the timers
  • Read the port
  • Wait for the bits to flip and note the time each time one does.
  • The length of the timeout tells you the value for each axis.
So you should be able to look at the schematics and ensure that the joystick timer circuitry is not being influenced by the PC Sprint.

It's possible that some code is counting instruction loops and deriving the time from that. That code would be broken on any speed change. If it was in RAM and it ran from expanded (above 128K memory) it would have similar problems.

Re: PC-Sprint negative: joysticks don't function

Posted: Sun Jul 14, 2019 12:52 pm
by NTEPB
To go along with what everyone is saying, I'd be curious to see how well the joysticks (and every other device in the PCjr) works with PC-Sprint using the built-in Diagnostics (CTRL-ALT-INS). Or, if you're really clever, test everything using the built-in Advanced Diagnostics.

I'd test this myself, but I don't currently have a PC-Sprint. Sorry. :oops:

Jon

Re: PC-Sprint negative: joysticks don't function

Posted: Sun Jul 14, 2019 1:54 pm
by Trixter
Early games used software loops to determine axis values, and the earliest games had hard-coded ideas on what those values should be. Spy Hunter is notorious for only working with joysticks properly on a 4.77 MHz 8088 and nothing else.

Later games (anything after the IBM AT came out) were usually better about this -- they used software timing loops, but they let the user calibrate the stick so that the software knew was "center" was on that specific machine. I believe DOS AGI games have this, so if you're playing an AGI booter, try switching to the later DOS AGI release of that same game.

The BIOS routines on int 15h very likely use hard-coded values, and I would not expect them to work correctly on a sped-up PCjr.

Re: PC-Sprint negative: joysticks don't function

Posted: Sun Jul 14, 2019 3:55 pm
by bagelswitch
NTEPB wrote:To go along with what everyone is saying, I'd be curious to see how well the joysticks (and every other device in the PCjr) works with PC-Sprint using the built-in Diagnostics (CTRL-ALT-INS). Or, if you're really clever, test everything using the built-in Advanced Diagnostics.

I'd test this myself, but I don't currently have a PC-Sprint. Sorry. :oops:

Jon

FWIW, the built-in diagnostics for the joystick are also broken with the speed-up (at least on my system) - when selecting that option, the joystick test screen is displayed for just a split second, and I can see the pip for joystick location is in the lower-left, then the main diag. screen is displayed again, with the character "C" displayed underneath the joystick item.

Re: PC-Sprint negative: joysticks don't function

Posted: Sun Jul 14, 2019 4:02 pm
by bagelswitch
Trixter wrote: I believe DOS AGI games have this, so if you're playing an AGI booter, try switching to the later DOS AGI release of that same game.
Yeah, I've been testing non-booter/DOS versions of KQ1, SQ1, and LL1 - all simply no longer display the "center your joystick" dialog on startup when the processor is sped up.

EDIT: on later AGI games (SQ3), the joystick does seem to be active if enabled vie resource.cfg, but acts as if constantly pushed to the left - the trim levers have no effect . . . so Sierra's code I guess is also timing-dependent, or makes BIOS calls.

Re: PC-Sprint negative: joysticks don't function

Posted: Thu Jul 18, 2019 9:16 pm
by bagelswitch
Can anyone using a JR-IDE confirm joysticks work normally (at any processor speed)?

While I could swear that I was only having a problem in turbo mode when I posted this, today when I tried regular 4.77MHz, I have the same behaviors with the joysticks I described . . . but if I remove my Jr-IDE from the expansion bus (a Racore Drive II controller is then my only sidecar), joysticks work normally regardless of processor speed.

I really need to improve my test protocols, or get my lab assistant to lay off the sauce . . .

Re: PC-Sprint negative: joysticks don't function

Posted: Thu Jul 18, 2019 9:36 pm
by Brutman
I've had a jrIDE on my system since 2012 and I've never had a problem with the joystick controls.

Diagnostics just passed. A BASIC program reports values from 3 to about 130 with 55 being mostly centered. According to the BASIC manual the exact values depend on the joystick.