|
|
1.1 root 1: /*
1.1.1.3 root 2: Hatari - joy.h
3:
4: This file is distributed under the GNU Public License, version 2 or at
5: your option any later version. Read the file gpl.txt for details.
1.1 root 6: */
7:
1.1.1.3 root 8: #ifndef HATARI_JOY_H
9: #define HATARI_JOY_H
10:
11: typedef struct
12: {
1.1.1.7 ! root 13: int XPos,YPos; /* the actually read axis values in range of -32768...0...32767 */
! 14: int XAxisID,YAxisID; /* the IDs of the physical PC jyostick's axis to be used to gain ST joystick axis input */
1.1.1.3 root 15: int Buttons; /* JOY_BUTTON1 */
1.1 root 16: } JOYREADING;
17:
1.1.1.3 root 18: enum
19: {
20: JOYSTICK_SPACE_NULL, /* Not up/down */
21: JOYSTICK_SPACE_DOWN,
22: JOYSTICK_SPACE_UP
1.1 root 23: };
24:
1.1.1.3 root 25: enum
26: {
27: JOYID_JOYSTICK0,
28: JOYID_JOYSTICK1,
29: JOYID_STEPADA,
30: JOYID_STEPADB,
31: JOYID_PARPORT1,
32: JOYID_PARPORT2,
33: };
1.1 root 34:
1.1.1.2 root 35: #define JOYRANGE_UP_VALUE -16384 /* Joystick ranges in XY */
36: #define JOYRANGE_DOWN_VALUE 16383
37: #define JOYRANGE_LEFT_VALUE -16384
38: #define JOYRANGE_RIGHT_VALUE 16383
1.1 root 39:
1.1.1.6 root 40: #define ATARIJOY_BITMASK_UP 0x01
41: #define ATARIJOY_BITMASK_DOWN 0x02
42: #define ATARIJOY_BITMASK_LEFT 0x04
43: #define ATARIJOY_BITMASK_RIGHT 0x08
44: #define ATARIJOY_BITMASK_FIRE 0x80
45:
1.1 root 46: extern int JoystickSpaceBar;
47:
48: extern void Joy_Init(void);
1.1.1.4 root 49: extern void Joy_UnInit(void);
1.1.1.3 root 50: extern Uint8 Joy_GetStickData(int nStJoyId);
1.1.1.5 root 51: extern bool Joy_SetCursorEmulation(int port);
1.1 root 52: extern void Joy_ToggleCursorEmulation(void);
1.1.1.5 root 53: extern bool Joy_KeyDown(int symkey, int modkey);
54: extern bool Joy_KeyUp(int symkey, int modkey);
1.1.1.3 root 55: extern void Joy_StePadButtons_ReadWord(void);
56: extern void Joy_StePadMulti_ReadWord(void);
57: extern void Joy_StePadMulti_WriteWord(void);
58:
59: #endif /* ifndef HATARI_JOY_H */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.