
Apple II Computer Info
#############################################################################
### FILE : joystick.orca
#############################################################################
### Created : Sunday, January 14, 1996 Modified: Sunday, January 14, 1996
### File Type: "TEXT" File Creator: "LMAN"
### File Size: 5171 bytes 5 KB
#############################################################################
Newsgroups: comp.sys.apple2.programmer
Path:
news.uiowa.edu!uunet!usc!elroy.jpl.nasa.gov!decwrl!waikato!comp.vuw.ac.nz!actrix.g
en.nz!dempson
Subject: Re: Joystick and stuff
Organization: Actrix Information Exchange
Date: Thu, 16 Mar 1995 15:02:06 GMT
X-Nntp-Posting-Host: atlantis.actrix.gen.nz
Lines: 138
> I am on a GS and was wondering how I can read the Joystick
> I am using Orca/c (if that helps any)
It certainly affects how you will go about reading the joystick.
There is no firmware or toolbox support provided for reading the
joystick from GS/OS. Apart from writing your own assembly language
code to read it, the easiest way is to use the FWEntry tool call in
the Miscellaneous toolset to call the old PREAD routine in the
monitor. This will allow one axis of the joystick to be read. You
can then call it again with different parameters to read the other
axis.
Note: you have to ensure each axis has timed out before trying to read
it. If you try to read the X and Y values immediately after each
other, you will probably get a false reading on the second one. A
delay of at least three milliseconds is recommended. One commonly
used solution is to separate the reading of the X and Y values and do
several other operations between them.
Reading the buttons is easier: it is just a matter of reading the
appropriate I/O locations directly.
Now for the details:
First, a very major warning: the FWEntry toolbox call has been
implemented incorrectly in all versions of ORCA/C: its parameters are
in a different order than they are listed in the toolbox reference.
Even worse, the parameter order varies depending on which compiler
version you have (all of them are wrong).
The official definition of FWEntry is:
regs = FWEntry(aReg, xReg, yReg, entryPt);
Apple II Computer Technical Information : Apple II Family Hardware Info
ftp://ground.ecn.uiowa.edu/2/apple2/miscinfo/hardware : May 2001 : 228 of 572
Komentarze do niniejszej Instrukcji