rgg@munnari.oz.au (Rupert Graham Goldie) (01/15/90)
I have been using code similar to the following to read the joystick, but I
want to know whether this is a 'legal' method. I know it works on TOS 1.0 and
1.4 (Yes you can get TOS 1.4 in Oz now 8-) but I haven't tested it on other
versions of TOS and I would like to be able to sure it will work with future
versions.
Here is the code:
-------
#include <osbind.h>
main()
{ int i;
int *loc;
long *ssp;
loc = 0xfffc02;
ssp = Super(0);
for (i = 0; i < 500; i++)
printf("%d %d\n ", Bconin(4), *loc);
printf("turning off mouse.\n");
Bconout(4, 0x12);
printf("turning joystick on.\n");
Bconout(4, 0x14);
for (i = 0; i < 500; i++)
printf("%d %d %x\n ", Bconin(4), *loc, *loc);
printf("Turning mouse on.\n");
Bconout(4, 0x08);
Super(ssp);
}
-------
By the way the Bconin doesn't seem to provide anything useful, just a constant
value.
Thanks in advance for any help,
Rupert G. Goldie
rgg@munmurra.cs.mu.OZ.AU
uunet!munnari.mu.oz!munmurra!rgg