--- hatari/src/includes/ikbd.h 2019/04/09 08:53:11 1.1.1.11 +++ hatari/src/includes/ikbd.h 2019/04/09 08:54:27 1.1.1.12 @@ -8,9 +8,6 @@ #ifndef HATARI_IKBD_H #define HATARI_IKBD_H -#include /* Needed for SDLK_LAST */ - - /* Keyboard processor details */ typedef struct { @@ -31,7 +28,7 @@ typedef struct { typedef struct { Uint8 JoyData[2]; /* Joystick details */ - Uint8 PrevJoyData[2]; /* Previous joystick details, used to check for 'IKBD_SelAutoJoysticks' */ + Uint8 PrevJoyData[2]; /* Previous joystick details, used to check for 'IKBD_SendAutoJoysticks' */ } JOY; typedef struct { @@ -43,15 +40,17 @@ typedef struct { } KEYBOARD_PROCESSOR; /* Keyboard state */ +#define KBD_MAX_SCANCODE 0x72 #define SIZE_KEYBOARD_BUFFER 1024 /* Allow this many bytes to be stored in buffer (waiting to send to ACIA) */ #define KEYBOARD_BUFFER_MASK (SIZE_KEYBOARD_BUFFER-1) #define SIZE_KEYBOARDINPUT_BUFFER 8 typedef struct { - Uint8 KeyStates[SDLK_LAST]; /* State of PC's keys, TRUE is down */ + Uint8 KeyStates[KBD_MAX_SCANCODE + 1]; /* State of ST keys, TRUE is down */ Uint8 Buffer[SIZE_KEYBOARD_BUFFER]; /* Keyboard output buffer */ int BufferHead,BufferTail; /* Pointers into above buffer */ int NbBytesInOutputBuffer; /* Number of bytes in output buffer */ + bool PauseOutput; /* If true, don't send bytes anymore (see command 0x13) */ Uint8 InputBuffer[SIZE_KEYBOARDINPUT_BUFFER]; /* Buffer for data send from CPU to keyboard processor (commands) */ int nBytesInInputBuffer; /* Number of command bytes in above buffer */ @@ -60,6 +59,8 @@ typedef struct { int bOldLButtonDown,bOldRButtonDown; int LButtonDblClk,RButtonDblClk; int LButtonHistory,RButtonHistory; + + int AutoSendCycles; /* Number of cpu cycles to call INTERRUPT_IKBD_AUTOSEND */ } KEYBOARD; /* Button states, a bit mask so can mimick joystick/right mouse button duplication */ @@ -68,11 +69,12 @@ typedef struct { #define BUTTON_JOYSTICK 0x02 /* Mouse/Joystick modes */ -#define AUTOMODE_OFF 0 -#define AUTOMODE_MOUSEREL 1 -#define AUTOMODE_MOUSEABS 2 -#define AUTOMODE_MOUSECURSOR 3 -#define AUTOMODE_JOYSTICK 4 +#define AUTOMODE_OFF 0 +#define AUTOMODE_MOUSEREL 1 +#define AUTOMODE_MOUSEABS 2 +#define AUTOMODE_MOUSECURSOR 3 +#define AUTOMODE_JOYSTICK 4 +#define AUTOMODE_JOYSTICK_MONITORING 5 /* 0xfffc00 (read status from ACIA) */ #define ACIA_STATUS_REGISTER__RX_BUFFER_FULL 0x01