[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: IIgs questions...



Labelas Enoreth <labelas@hotmail.com> wrote:

> In article <3701F226.BC9CE5B4@swbell.net>, rubywand@swbell.net wrote:
> > 
> >      It sounds like your IIgs is not slowing down for joystick access.
> > If you are running with an accelerator, try setting the switch which
> > tells the GS to slow down for joystick accesses. Otherwise, try setting
> > Speed to "Normal" in the Control Panel.
>
> Nope, I'm just using a plain old IIgs, no accelleration. As for the Normal
> vs Fast speeds, these are GS native games, why would they not work with
> Fast (and would that even really apply? I only thought that was really
> mainly for IIe compatibility)

The speed setting has a major impact on the joystick, due to the way the
paddle hardware works.

To read the joystick, the computer accesses a location ($C070) which
triggers a hardware timer circuit simultaneously for all four paddle
inputs (only two of which are used on a single joystick).

The computer must then sit in a tight loop monitoring the desired paddle
input by polling location $C064 for the X axis (paddle 0) or $C065 for
the Y axis (paddle 1), and counting how many times it has looped around.
As soon as the computer sees bit 7 change to a 1, it can use the loop
count as the current position of the appropriate axis.  It takes about
three milliseconds for the circuit to time out if the paddle or joystick
is set to its maximum (right/down) position.

The faster the CPU goes, the more times the loop will run before the
paddle hardware times out, and the higher the apparent reading will be.

If software is written expecting the CPU to be running at 1.023 MHz, and
it is actually running at 2.8 MHz, then the joystick reading will be
something like 2.6 times higher than expected, and the computer will
think the joystick is further to the right and down than it actually is.

> It's strange...in IIe mode, even when it's set to fast, it works
> fine...

The IIe version of the program is probably using the standard routine
provided by the firmware to read the paddles.  On the IIgs, this routine
forces the machine to run at normal speed while timing the paddle.  The
configured speed setting is restored when the operation is complete.

If a program implements its own routine to read the joystick, it will
misbehave when run on a IIgs in fast mode, unless the program is aware
of this situation and handles it by forcing normal mode or taking the
extra speed into account.  This is unlikely for older ][+ or IIe
software, but newer software might be aware of a IIgs and handle this.

Some programs let you calibrate the joystick, which may allow them to
cope with an "unusual" CPU speed (as long as the counter doesn't run out
of bits on a fast enough CPU).

> but in the IIgs version of the same game, it chokes.

I'd say this is a bug in the program.  I notice that your original
description says it seems to lock into the upper right corner.  This is
somewhat surprising - it should be the lower right corner if the problem
is due to the system speed.

Have you tried running the game in Normal mode?  If that doesn't help,
then there must be a bug in the joystick support for the IIgs version.

Is the joystick its normal method of control, or does it also work with
a mouse and/or keyboard?
-- 
David Empson
dempson@actrix.gen.nz
Snail mail: P.O. Box 27-103, Wellington, New Zealand