Stupid fun with the Joystick Calibration value:
I was reading the apple2.cpp source and noticed that the calibration for the x and y axes is different.
The x has 12 msec and the y has 13 msec.
/src/mame/drivers/apple2.cpp:316: m_x_calibration = attotime::from_usec(12).as_double();
/src/mame/drivers/apple2.cpp:317: m_y_calibration = attotime::from_usec(13).as_double();
![[Linked Image from i.imgur.com]](https://i.imgur.com/3ZTgVh4.png)
According to the Apple II reference manual, 3060 ms is how long it should take to read the joystick which sounds right: 12ms * 256 = 3072 ms.
If you divide 3060 ms/256 you get 11.953 ms.
My calibration "program" is just a little applesoft one-liner:
100 PRINT PDL(0),PDL(1): GOTO 100
This would report 142 at rest for the PDL(0) and 154 at rest for PDL(1).
![[Linked Image from i.imgur.com]](https://i.imgur.com/wr3H0Rs.png)
What if I set both to 12 msec? Then I got 142 at rest for both axes.
I got to thinking, what's the minimum values that would give the "full range" and 128 at rest.
It appears to be around 10800 nsec (or 10.8 msec)
// precalculate joystick time constants
m_x_calibration = attotime::from_nsec(10800).as_double();
m_y_calibration = attotime::from_nsec(10700).as_double();
![[Linked Image from i.imgur.com]](https://i.imgur.com/oB5SPQO.png)
With 10800 nsec, I can get 0 to 255. With 10700 nsec, the range reported is from 0 to 253.
A value too small won't give you a wide enough range.
Just for fun, I thought I'd see how Stellar 7 plays under the IIgs, but I noticed that it doesn't read the joystick properly with the faster CPU speed. Stellar 7 doesn't have any kind of pre-game joystick calibration.
So if I set the calibration down to 6 msec in the IIGS driver, the joystick reads properly and it's playable at the faster IIgs speed. Now Stellar 7 is a fast action game! Whee!
Interestingly, Stellar 7 loads very slowly (or it feels very slow to load) under the IIgs. I wonder why? I thought it'd be faster all around or at least the same speed.