home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
499.lha
/
GamePortDeviceToolKit
/
gameport.lzh
/
src
/
DeviceToolKits
/
GamePort
/
test
/
test9.c
< prev
next >
Wrap
C/C++ Source or Header
|
1991-01-03
|
1KB
|
52 lines
#include <stdio.h>
#include "DeviceToolKits/GamePort.h"
#ifndef TESTPROTO
#define NO_PRAGMAS 1
#endif
#include "DeviceToolKits/proto/GamePort.h"
#include "DeviceToolKits/GamePortBase.h"
LONG joy0dat;
LONG joy1dat;
LONG lbutton0;
LONG lbutton1;
LONG rbutton0;
LONG rbutton1;
LONG mbutton0;
LONG mbutton1;
main(argc,argv)
int argc;
char *argv[];
{
#ifdef TESTSHARED
/* Open the GamePort library */
DTGamePortOpen(DTGAMEPORTREV);
#endif
/* Read the joystick ports */
while (1) {
joy0dat = DTGamePortJoy0Dat();
joy1dat = DTGamePortJoy1Dat();
lbutton0 = DTGamePortLButton0();
lbutton1 = DTGamePortLButton1();
rbutton0 = DTGamePortRButton0();
rbutton1 = DTGamePortRButton1();
mbutton0 = DTGamePortMButton0();
mbutton1 = DTGamePortMButton1();
printf("Joy0: %x Joy1: %x\n",joy0dat,joy1dat);
printf("Buttons: %x %x %x %x %x %x\n",lbutton0,lbutton1,
rbutton0,rbutton1,mbutton0,mbutton1);
Delay(25L);
}
#ifdef TESTSHARED
DTGamePortClose();
#endif
}