1 /* Catacomb Armageddon 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
\r
29 #include "lib_head.h"
\r
33 //#include "ID_Types.h"
\r
37 #define __DEBUG_InputMgr__
\r
40 #define KeyInt 9 // The keyboard ISR number
42 // Stuff for the joystick
43 #define JoyScaleMax 32768
44 #define JoyScaleShift 8
45 #define MaxJoyValue 5000
47 #define MaxPlayers 4
\r
50 #define NumCodes 128
\r
52 typedef byte ScanCode;
\r
55 #define sc_Return 0x1c
\r
56 #define sc_Enter sc_Return
\r
57 #define sc_Escape 0x01
\r
58 #define sc_Space 0x39
\r
59 #define sc_BackSpace 0x0e
\r
62 #define sc_Control 0x1d
\r
63 #define sc_CapsLock 0x3a
\r
64 #define sc_LShift 0x2a
\r
65 #define sc_RShift 0x36
\r
66 #define sc_UpArrow 0x48
\r
67 #define sc_DownArrow 0x50
\r
68 #define sc_LeftArrow 0x4b
\r
69 #define sc_RightArrow 0x4d
\r
70 #define sc_Insert 0x52
\r
71 #define sc_Delete 0x53
\r
72 #define sc_Home 0x47
\r
74 #define sc_PgUp 0x49
\r
75 #define sc_PgDn 0x51
\r
117 #define key_Return 0x0d
\r
118 #define key_Enter key_Return
\r
119 #define key_Escape 0x1b
\r
120 #define key_Space 0x20
\r
121 #define key_BackSpace 0x08
\r
122 #define key_Tab 0x09
\r
123 #define key_Delete 0x7f
\r
125 // Stuff for the mouse
\r
130 #define MouseInt 0x33
\r
133 demo_Off,demo_Record,demo_Playback,demo_PlayDone
\r
136 ctrl_None, // MDM (GAMERS EDGE) - added
\r
138 ctrl_Keyboard1 = ctrl_Keyboard,ctrl_Keyboard2,
\r
140 ctrl_Joystick1 = ctrl_Joystick,ctrl_Joystick2,
\r
144 motion_Left = -1,motion_Up = -1,
\r
146 motion_Right = 1,motion_Down = 1
\r
149 dir_North,dir_NorthEast,
\r
150 dir_East,dir_SouthEast,
\r
151 dir_South,dir_SouthWest,
\r
152 dir_West,dir_NorthWest,
\r
156 boolean button0,button1;
\r
158 Motion xaxis,yaxis;
\r
161 typedef CursorInfo ControlInfo;
\r
163 ScanCode button0,button1,
\r
164 upleft, up, upright,
\r
166 downleft, down, downright;
\r
169 word joyMinX,joyMinY,
\r
170 threshMinX,threshMinY,
\r
171 threshMaxX,threshMaxY,
\r
173 joyMultXL,joyMultYL,
\r
174 joyMultXH,joyMultYH;
\r
176 // Global variables
\r
177 extern boolean Keyboard[],
\r
180 extern boolean Paused;
\r
181 extern char LastASCII;
\r
182 extern ScanCode LastScan;
\r
183 extern KeyboardDef KbdDefs[];
\r
184 extern JoystickDef JoyDefs[];
\r
185 extern ControlType Controls[MaxPlayers];
\r
187 extern boolean JoystickCalibrated; // MDM (GAMERS EDGE) - added
\r
188 extern ControlType ControlTypeUsed; // MDM (GAMERS EDGE) - added
\r
191 extern Demo DemoMode;
\r
192 extern byte __segment *DemoBuffer;
\r
193 extern word DemoOffset,DemoSize;
\r
196 // Function prototypes
\r
197 #define IN_KeyDown(code) (Keyboard[(code)])
\r
198 #define IN_ClearKey(code) {Keyboard[code] = false;\
\r
199 if (code == LastScan) LastScan = sc_None;}
\r
201 // DEBUG - put names in prototypes
\r
202 extern void IN_Startup(void),IN_Shutdown(void),
\r
203 IN_Default(boolean gotit,ControlType in),
\r
204 IN_SetKeyHook(void (*)()),
\r
205 IN_ClearKeysDown(void),
\r
206 IN_ReadCursor(CursorInfo *),
\r
207 IN_ReadControl(int,ControlInfo *),
\r
208 IN_SetControlType(int,ControlType),
\r
209 IN_GetJoyAbs(word joy,word *xp,word *yp),
\r
210 IN_SetupJoy(word joy,word minx,word maxx,
\r
211 word miny,word maxy),
213 IN_StartDemoPlayback(byte __segment *buffer,word bufsize),
\r
214 IN_StopDemo(void),IN_FreeDemoBuffer(void),
216 IN_Ack(void),IN_AckBack(void);
\r
217 extern boolean IN_UserInput(dword delay,boolean clear),
\r
220 , IN_StartDemoRecord(word bufsize)
223 extern byte *IN_GetScanName(ScanCode);
\r
224 extern char IN_WaitForASCII(void);
\r
225 extern ScanCode IN_WaitForKey(void);
\r
226 extern word IN_GetJoyButtonsDB(word joy);
\r