
Apple II Computer Info
into timing problems like the one above.
Read Both Paddles at the Same Time
Insure both paddles are clear, then strobe the paddle switch.
Start counting, and look at both paddles.
As each paddle times out, save the counter value for the paddle.
By strategicly placing NOP instructions into the loop paths, you can
insure that the timing will stay constant for each pass of the counter.
When both paddles have timed out, you are done.
If you write in 65C816 code, you can read both paddle values with a single LDA
instruction. In fact, the code gets a lot tighter in 65C816 code, so your
resolution will be higher than the stock 0-254 of a 1 MHz 6502 call.
This factor can present some problems if the game is running on an accelerated
GS. So you'll want to calibrate the joystick for various speeds, and divide
the joystick results by an appropriate factor.
If you want the joystick routine to be of a consistent length, then you only
need to add on a dummy loop that will waste the time that would have been used
had both paddles been set to thier maximum (highest resistance) value.
I've got copies of routines (65C816) that do this type of thing. When I unpack
my GS, I'll try and upload an example.
[MGM]
###################################################### E N D O F F I L E
### paddles.info
###################################################### E N D O F F I L E
Apple II Computer Technical Information : Apple II Family Hardware Info
ftp://ground.ecn.uiowa.edu/2/apple2/miscinfo/hardware : May 2001 : 329 of 572
Kommentare zu diesen Handbüchern