1 /* Catacomb Apocalypse Source Code
\r
2 * Copyright (C) 1993-2014 Flat Rock Software
\r
4 * This program is free software; you can redistribute it and/or modify
\r
5 * it under the terms of the GNU General Public License as published by
\r
6 * the Free Software Foundation; either version 2 of the License, or
\r
7 * (at your option) any later version.
\r
9 * This program is distributed in the hope that it will be useful,
\r
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
12 * GNU General Public License for more details.
\r
14 * You should have received a copy of the GNU General Public License along
\r
15 * with this program; if not, write to the Free Software Foundation, Inc.,
\r
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
\r
21 // ID_IN.h - Header file for Input Manager
\r
23 // By Jason Blochowiak
24 // Open Watcom port by sparky4
\r
31 #include "src/lib/lib_head.h"
\r
33 //++++#ifdef __DEBUG__
\r
34 #define __DEBUG_InputMgr__
\r
38 #define TESTCONTROLNOISY
\r
40 #define KeyInt 9 // The keyboard ISR number
\r
42 // Stuff for the joystick
\r
43 #define JoyScaleMax 32768
\r
44 #define JoyScaleShift 8
\r
45 #define MaxJoyValue 5000
\r
47 #define MaxPlayers 4
\r
51 #define NumCodes 128
\r
53 typedef byte ScanCode;
\r
56 #define sc_Return 0x1c
\r
57 #define sc_Enter sc_Return
\r
58 #define sc_Escape 0x01
\r
59 #define sc_Space 0x39
\r
60 #define sc_BackSpace 0x0e
\r
63 #define sc_Control 0x1d
\r
64 #define sc_CapsLock 0x3a
\r
65 #define sc_LShift 0x2a
\r
66 #define sc_RShift 0x36
\r
67 #define sc_UpArrow 0x48
\r
68 #define sc_DownArrow 0x50
\r
69 #define sc_LeftArrow 0x4b
\r
70 #define sc_RightArrow 0x4d
\r
71 #define sc_Insert 0x52
\r
72 #define sc_Delete 0x53
\r
73 #define sc_Home 0x47
\r
75 #define sc_PgUp 0x49
\r
76 #define sc_PgDn 0x51
\r
129 #define key_Return 0x0d
\r
130 #define key_Enter key_Return
\r
131 #define key_Escape 0x1b
\r
132 #define key_Space 0x20
\r
133 #define key_BackSpace 0x08
\r
134 #define key_Tab 0x09
\r
135 #define key_Delete 0x7f
\r
137 #define key_LSuper 0x5b
138 #define key_RSuper 0x5c
139 #define key_Menu 0x5d
141 // Stuff for the mouse
\r
146 #define MouseInt 0x33
\r
149 demo_Off,demo_Record,demo_Playback,demo_PlayDone
\r
153 //ctrl_None, // MDM (GAMERS EDGE) - added
\r
155 ctrl_Keyboard1 = ctrl_Keyboard,ctrl_Keyboard2,
\r
157 ctrl_Joystick1 = ctrl_Joystick,ctrl_Joystick2,
\r
160 ctrl_Joypad1 = ctrl_Joypad,ctrl_Joypad2
\r
163 motion_Left = -1,motion_Up = -1,
\r
165 motion_Right = 1,motion_Down = 1
\r
168 dir_North,//dir_NorthEast,
\r
169 dir_East,//dir_SouthEast,
\r
170 dir_South,//dir_Soutinest,
\r
171 dir_West,//dir_Nortinest,
\r
175 boolean button0,button1,button2,button3;
\r
177 Motion xaxis,yaxis;
\r
182 ScanCode button0,button1,
\r
193 word joyMinX,joyMinY,
\r
194 threshMinX,threshMinY,
\r
195 threshMaxX,threshMaxY,
\r
197 joyMultXL,joyMultYL,
\r
198 joyMultXH,joyMultYH;
\r
208 ControlType Controls;
212 =============================================================================
\r
216 =============================================================================
\r
220 boolean MousePresent;
\r
221 boolean JoysPresent[MaxJoys];
\r
222 boolean JoyPadPresent[MaxPads];
223 boolean Keyboard[NumCodes];
\r
228 KeyboardDef KbdDefs[MaxKbds];
229 JoystickDef JoyDefs[MaxJoys];
230 JoypadDef JoypadDefs[MaxPads];
234 static Demo DemoMode = demo_Off;
\r
235 static byte /*_seg*/ *DemoBuffer;
\r
236 static word DemoOffset,DemoSize;
\r
239 //extern inconfig inpu;
240 extern dword far* clockdw;
\r
243 extern void interrupt INL_KeyService();
244 extern void Mouse(int x);
245 //static void INL_GetMouseDelta(int *x,int *y);
246 //static word INL_GetMouseButtons(void);
247 extern void IN_GetJoyAbs(word joy,word *xp,word *yp);
248 //static void INL_GetJoyDelta(word joy,int *dx,int *dy,boolean adaptive);
249 //static word INL_GetJoyButtons(word joy);
250 extern word IN_GetJoyButtonsDB(word joy);
251 //static void INL_StartKbd(void);
252 //static void INL_ShutKbd(void);
253 //static boolean INL_StartMouse(void);
254 //static void INL_ShutMouse(void);
255 //static void INL_SetJoyScale(word joy);
256 extern void IN_SetupJoy(word joy,word minx,word maxx,word miny,word maxy);
257 //static boolean INL_StartJoy(word joy);
258 //static void INL_ShutJoy(word joy);
259 extern void IN_Startup();
260 extern void IN_Default(boolean gotit,player_t *player,ControlType nt);
261 extern void IN_Shutdown();
262 extern void IN_SetKeyHook(void (*hook)());
263 extern void IN_ClearKeysDown();
264 //static void INL_AdjustCursor(CursorInfo *info,word buttons,int dx,int dy);
265 extern void IN_ReadCursor(CursorInfo *info);
266 extern void IN_ReadControl(int playnum,player_t *player);
267 extern void IN_SetControlType(word playnum,player_t *player,ControlType type);
269 extern boolean IN_StartDemoRecord(word bufsize);
270 extern void IN_StartDemoPlayback(byte /*__segment*/ *buffer,word bufsize);
271 extern void IN_StopDemo(void);
272 extern void IN_FreeDemoBuffer(void);
274 extern byte *IN_GetScanName(ScanCode scan);
275 extern ScanCode IN_WaitForKey();
276 extern char IN_WaitForASCII();
277 extern void IN_AckBack();
278 extern void IN_Ack();
279 extern boolean IN_IsUserInput();
280 extern boolean IN_UserInput(dword delay,boolean clear);
281 extern boolean IN_KeyDown(byte code);
282 extern void IN_ClearKey(byte code);
283 extern boolean IN_qb(byte kee);