|
|
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 */
1.1.1.8 ! root 14: int XAxisID,YAxisID; /* the IDs of the physical PC joystick'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.8 ! root 18: typedef struct
! 19: {
! 20: char SDLJoystickName[50];
! 21: int XAxisID,YAxisID; /* the IDs associated with a certain SDL joystick */
! 22: } JOYAXISMAPPING;
! 23:
1.1.1.3 root 24: enum
25: {
26: JOYSTICK_SPACE_NULL, /* Not up/down */
27: JOYSTICK_SPACE_DOWN,
28: JOYSTICK_SPACE_UP
1.1 root 29: };
30:
1.1.1.3 root 31: enum
32: {
33: JOYID_JOYSTICK0,
34: JOYID_JOYSTICK1,
35: JOYID_STEPADA,
36: JOYID_STEPADB,
37: JOYID_PARPORT1,
38: JOYID_PARPORT2,
39: };
1.1 root 40:
1.1.1.2 root 41: #define JOYRANGE_UP_VALUE -16384 /* Joystick ranges in XY */
42: #define JOYRANGE_DOWN_VALUE 16383
43: #define JOYRANGE_LEFT_VALUE -16384
44: #define JOYRANGE_RIGHT_VALUE 16383
1.1 root 45:
1.1.1.6 root 46: #define ATARIJOY_BITMASK_UP 0x01
47: #define ATARIJOY_BITMASK_DOWN 0x02
48: #define ATARIJOY_BITMASK_LEFT 0x04
49: #define ATARIJOY_BITMASK_RIGHT 0x08
50: #define ATARIJOY_BITMASK_FIRE 0x80
51:
1.1 root 52: extern int JoystickSpaceBar;
53:
54: extern void Joy_Init(void);
1.1.1.4 root 55: extern void Joy_UnInit(void);
1.1.1.3 root 56: extern Uint8 Joy_GetStickData(int nStJoyId);
1.1.1.5 root 57: extern bool Joy_SetCursorEmulation(int port);
1.1 root 58: extern void Joy_ToggleCursorEmulation(void);
1.1.1.5 root 59: extern bool Joy_KeyDown(int symkey, int modkey);
60: extern bool Joy_KeyUp(int symkey, int modkey);
1.1.1.3 root 61: extern void Joy_StePadButtons_ReadWord(void);
62: extern void Joy_StePadMulti_ReadWord(void);
63: extern void Joy_StePadMulti_WriteWord(void);
64:
65: #endif /* ifndef HATARI_JOY_H */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.