--- hatari/src/includes/ikbd.h 2019/04/01 07:10:01 1.1.1.3 +++ hatari/src/includes/ikbd.h 2019/04/01 07:13:40 1.1.1.6 @@ -1,15 +1,21 @@ /* - Hatari + Hatari - ikbd.h + + This file is distributed under the GNU Public License, version 2 or at + your option any later version. Read the file gpl.txt for details. */ +#ifndef HATARI_IKBD_H +#define HATARI_IKBD_H + #include /* Needed for SDLK_LAST */ /* Keyboard Command */ typedef struct { - unsigned char Command; - unsigned char NumParameters; - void *pCallFunction; + Uint8 Command; + Uint8 NumParameters; + void (*pCallFunction)(void); } IKBD_COMMAND_PARAMS; /* Keyboard processor details */ @@ -17,7 +23,7 @@ typedef struct { typedef struct { int X,Y; /* Position of mouse */ int MaxX,MaxY; /* Max limits of mouse */ - unsigned char PrevReadAbsMouseButtons; /* Previous button mask for 'IKBD_Cmd_ReadAbsMousePos' */ + Uint8 PrevReadAbsMouseButtons; /* Previous button mask for 'IKBD_Cmd_ReadAbsMousePos' */ } ABS_MOUSE; typedef struct { @@ -25,14 +31,14 @@ typedef struct { int DeltaX,DeltaY; /* Final XY mouse position delta */ int XScale,YScale; /* Scale of mouse */ int XThreshold,YThreshold; /* Threshold */ - unsigned char KeyCodeDeltaX,KeyCodeDeltaY; /* Delta X,Y for mouse keycode mode */ + Uint8 KeyCodeDeltaX,KeyCodeDeltaY; /* Delta X,Y for mouse keycode mode */ int YAxis; /* Y-Axis direction */ - unsigned char Action; /* Bit 0-Report abs position of press, Bit 1-Report abs on release */ + Uint8 Action; /* Bit 0-Report abs position of press, Bit 1-Report abs on release */ } MOUSE; typedef struct { - unsigned char JoyData[2]; /* Joystick details */ - unsigned char PrevJoyData[2]; /* Previous joystick details, used to check for 'IKBD_SelAutoJoysticks' */ + Uint8 JoyData[2]; /* Joystick details */ + Uint8 PrevJoyData[2]; /* Previous joystick details, used to check for 'IKBD_SelAutoJoysticks' */ } JOY; typedef struct { @@ -49,10 +55,10 @@ typedef struct { #define KEYBOARD_BUFFER_MASK (SIZE_KEYBOARD_BUFFER-1) #define SIZE_KEYBOARDINPUT_BUFFER 8 typedef struct { - unsigned char KeyStates[SDLK_LAST]; /* State of PC's keys, TRUE is down */ - unsigned char Buffer[SIZE_KEYBOARD_BUFFER]; /* Keyboard buffer */ + Uint8 KeyStates[SDLK_LAST]; /* State of PC's keys, TRUE is down */ + Uint8 Buffer[SIZE_KEYBOARD_BUFFER]; /* Keyboard buffer */ int BufferHead,BufferTail; /* Pointers into above buffer */ - unsigned char InputBuffer[SIZE_KEYBOARDINPUT_BUFFER]; /* Buffer for data send from CPU to keyboard processor (commands) */ + Uint8 InputBuffer[SIZE_KEYBOARDINPUT_BUFFER]; /* Buffer for data send from CPU to keyboard processor (commands) */ int nBytesInInputBuffer; /* Number of command bytes in above buffer */ int bLButtonDown,bRButtonDown; /* Mouse states in emulation system, BUTTON_xxxx */ @@ -79,16 +85,13 @@ typedef struct { #define ACIA_STATUS_REGISTER__OVERRUN_ERROR 0x40 #define ACIA_STATUS_REGISTER__INTERRUPT_REQUEST 0x80 -extern unsigned char ACIAControlRegister; -extern unsigned char ACIAStatusRegister; -extern unsigned char ACIAByte; - extern KEYBOARD_PROCESSOR KeyboardProcessor; extern KEYBOARD Keyboard; +extern void ACIA_Reset(void); extern void IKBD_Reset(BOOL bCold); extern void IKBD_MemorySnapShot_Capture(BOOL bSave); -extern void IKBD_SendAutoKeyboardCommands(); +extern void IKBD_SendAutoKeyboardCommands(void); extern void IKBD_InterruptHandler_ResetTimer(void); extern void IKBD_Cmd_NullFunction(void); @@ -119,9 +122,16 @@ extern void IKBD_Cmd_LoadMemory(void); extern void IKBD_Cmd_ReadMemory(void); extern void IKBD_Cmd_Execute(void); -extern void IKBD_SendByteToKeyboardProcessor(unsigned short bl); -extern unsigned short IKBD_GetByteFromACIA(void); +extern void IKBD_SendByteToKeyboardProcessor(Uint16 bl); +extern Uint16 IKBD_GetByteFromACIA(void); extern void IKBD_InterruptHandler_ACIA(void); extern void IKBD_SendByteToACIA(void); -extern void IKBD_AddKeyToKeyboardBuffer(unsigned char Data); -extern void IKBD_PressSTKey(unsigned char ScanCode,BOOL bPress); +extern void IKBD_AddKeyToKeyboardBuffer(Uint8 Data); +extern void IKBD_PressSTKey(Uint8 ScanCode, BOOL bPress); + +extern void IKBD_KeyboardControl_ReadByte(void); +extern void IKBD_KeyboardData_ReadByte(void); +extern void IKBD_KeyboardControl_WriteByte(void); +extern void IKBD_KeyboardData_WriteByte(void); + +#endif /* HATARI_IKBD_H */