|
|
1.1 root 1: /* 1.1.1.4 ! root 2: Hatari - ikbd.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.4 ! root 8: #ifndef HATARI_IKBD_H ! 9: #define HATARI_IKBD_H ! 10: 1.1.1.2 root 11: #include <SDL_keysym.h> /* Needed for SDLK_LAST */ 12: 13: 14: /* Keyboard Command */ 1.1 root 15: typedef struct { 16: unsigned char Command; 17: unsigned char NumParameters; 18: void *pCallFunction; 19: } IKBD_COMMAND_PARAMS; 20: 1.1.1.2 root 21: /* Keyboard processor details */ 1.1 root 22: 23: typedef struct { 1.1.1.2 root 24: int X,Y; /* Position of mouse */ 25: int MaxX,MaxY; /* Max limits of mouse */ 26: unsigned char PrevReadAbsMouseButtons; /* Previous button mask for 'IKBD_Cmd_ReadAbsMousePos' */ 1.1 root 27: } ABS_MOUSE; 28: 29: typedef struct { 1.1.1.3 root 30: int dx, dy; /* Mouse delta to be added */ 31: int DeltaX,DeltaY; /* Final XY mouse position delta */ 1.1.1.2 root 32: int XScale,YScale; /* Scale of mouse */ 33: int XThreshold,YThreshold; /* Threshold */ 34: unsigned char KeyCodeDeltaX,KeyCodeDeltaY; /* Delta X,Y for mouse keycode mode */ 35: int YAxis; /* Y-Axis direction */ 36: unsigned char Action; /* Bit 0-Report abs position of press, Bit 1-Report abs on release */ 1.1 root 37: } MOUSE; 38: 39: typedef struct { 1.1.1.2 root 40: unsigned char JoyData[2]; /* Joystick details */ 41: unsigned char PrevJoyData[2]; /* Previous joystick details, used to check for 'IKBD_SelAutoJoysticks' */ 1.1 root 42: } JOY; 43: 44: typedef struct { 45: ABS_MOUSE Abs; 46: MOUSE Mouse; 47: JOY Joy; 1.1.1.2 root 48: int MouseMode; /* AUTOMODE_xxxx */ 49: int JoystickMode; /* AUTOMODE_xxxx */ 50: BOOL bReset; /* Set to TRUE is keyboard 'RESET' and now active */ 1.1 root 51: } KEYBOARD_PROCESSOR; 52: 1.1.1.2 root 53: /* Keyboard state */ 54: #define SIZE_KEYBOARD_BUFFER 1024 /* Allow this many bytes to be stored in buffer (waiting to send to ACIA) */ 55: #define KEYBOARD_BUFFER_MASK (SIZE_KEYBOARD_BUFFER-1) 56: #define SIZE_KEYBOARDINPUT_BUFFER 8 57: typedef struct { 58: unsigned char KeyStates[SDLK_LAST]; /* State of PC's keys, TRUE is down */ 59: unsigned char Buffer[SIZE_KEYBOARD_BUFFER]; /* Keyboard buffer */ 60: int BufferHead,BufferTail; /* Pointers into above buffer */ 61: unsigned char InputBuffer[SIZE_KEYBOARDINPUT_BUFFER]; /* Buffer for data send from CPU to keyboard processor (commands) */ 62: int nBytesInInputBuffer; /* Number of command bytes in above buffer */ 1.1 root 63: 1.1.1.2 root 64: int bLButtonDown,bRButtonDown; /* Mouse states in emulation system, BUTTON_xxxx */ 1.1 root 65: int bOldLButtonDown,bOldRButtonDown; 66: int LButtonDblClk,RButtonDblClk; 67: int LButtonHistory,RButtonHistory; 68: } KEYBOARD; 69: 1.1.1.2 root 70: /* Button states, a bit mask so can mimick joystick/right mouse button duplication */ 71: #define BUTTON_NULL 0x00 /* Button states, so can OR together mouse/joystick buttons */ 72: #define BUTTON_MOUSE 0x01 73: #define BUTTON_JOYSTICK 0x02 1.1 root 74: 1.1.1.2 root 75: /* Mouse/Joystick modes */ 76: #define AUTOMODE_OFF 0 1.1 root 77: #define AUTOMODE_MOUSEREL 1 78: #define AUTOMODE_MOUSEABS 2 1.1.1.2 root 79: #define AUTOMODE_MOUSECURSOR 3 1.1 root 80: #define AUTOMODE_JOYSTICK 4 81: 1.1.1.2 root 82: /* 0xfffc00 (read status from ACIA) */ 1.1 root 83: #define ACIA_STATUS_REGISTER__RX_BUFFER_FULL 0x01 84: #define ACIA_STATUS_REGISTER__TX_BUFFER_EMPTY 0x02 85: #define ACIA_STATUS_REGISTER__OVERRUN_ERROR 0x40 86: #define ACIA_STATUS_REGISTER__INTERRUPT_REQUEST 0x80 87: 88: extern KEYBOARD_PROCESSOR KeyboardProcessor; 89: extern KEYBOARD Keyboard; 90: 91: extern void IKBD_Reset(BOOL bCold); 92: extern void IKBD_MemorySnapShot_Capture(BOOL bSave); 1.1.1.4 ! root 93: extern void IKBD_SendAutoKeyboardCommands(void); 1.1 root 94: extern void IKBD_InterruptHandler_ResetTimer(void); 95: 96: extern void IKBD_Cmd_NullFunction(void); 97: extern void IKBD_Cmd_Reset(void); 98: extern void IKBD_Cmd_MouseAction(void); 99: extern void IKBD_Cmd_RelMouseMode(void); 100: extern void IKBD_Cmd_AbsMouseMode(void); 101: extern void IKBD_Cmd_MouseCursorKeycodes(void); 102: extern void IKBD_Cmd_SetMouseThreshold(void); 103: extern void IKBD_Cmd_SetMouseScale(void); 104: extern void IKBD_Cmd_ReadAbsMousePos(void); 105: extern void IKBD_Cmd_SetInternalMousePos(void); 106: extern void IKBD_Cmd_SetYAxisDown(void); 107: extern void IKBD_Cmd_SetYAxisUp(void); 108: extern void IKBD_Cmd_StartKeyboardTransfer(void); 109: extern void IKBD_Cmd_TurnMouseOff(void); 110: extern void IKBD_Cmd_StopKeyboardTransfer(void); 111: extern void IKBD_Cmd_ReturnJoystickAuto(void); 112: extern void IKBD_Cmd_StopJoystick(void); 113: extern void IKBD_Cmd_ReturnJoystick(void); 114: extern void IKBD_Cmd_SetJoystickDuration(void); 115: extern void IKBD_Cmd_SetJoystickFireDuration(void); 116: extern void IKBD_Cmd_SetCursorForJoystick(void); 117: extern void IKBD_Cmd_DisableJoysticks(void); 118: extern void IKBD_Cmd_SetClock(void); 119: extern void IKBD_Cmd_ReadClock(void); 120: extern void IKBD_Cmd_LoadMemory(void); 121: extern void IKBD_Cmd_ReadMemory(void); 122: extern void IKBD_Cmd_Execute(void); 123: 124: extern void IKBD_SendByteToKeyboardProcessor(unsigned short bl); 125: extern unsigned short IKBD_GetByteFromACIA(void); 126: extern void IKBD_InterruptHandler_ACIA(void); 127: extern void IKBD_SendByteToACIA(void); 128: extern void IKBD_AddKeyToKeyboardBuffer(unsigned char Data); 129: extern void IKBD_PressSTKey(unsigned char ScanCode,BOOL bPress); 1.1.1.4 ! root 130: ! 131: extern void IKBD_KeyboardControl_ReadByte(void); ! 132: extern void IKBD_KeyboardData_ReadByte(void); ! 133: extern void IKBD_KeyboardControl_WriteByte(void); ! 134: extern void IKBD_KeyboardData_WriteByte(void); ! 135: ! 136: #endif /* HATARI_IKBD_H */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.