🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.atari.st
Article #7012

How to read the joystick ?

#7012
From: Rupert Graham Goldie
Date: Mon, 15 Jan 1990 12:20
47 lines
1401 bytes

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
Technical Details
Message-ID: <3006@munnari.oz.au>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!rpi!brutus.cs.uiuc.edu!samsung!munnari.oz.au!rgg

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!rpi!brutus.cs.uiuc.edu!samsung!munnari.oz.au!rgg
From: rgg@munnari.oz.au (Rupert Graham Goldie)
Newsgroups: comp.sys.atari.st
Subject: How to read the joystick ?
Keywords: joystick technical
Message-ID: <3006@munnari.oz.au>
Date: 15 Jan 90 12:20:37 GMT
Sender: news@cs.mu.oz.au
Lines: 47