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 "ID_Types.h"
\r
36 #define __DEBUG_InputMgr__
\r
39 #define MaxPlayers 4
\r
42 #define NumCodes 128
\r
44 typedef byte ScanCode;
\r
47 #define sc_Return 0x1c
\r
48 #define sc_Enter sc_Return
\r
49 #define sc_Escape 0x01
\r
50 #define sc_Space 0x39
\r
51 #define sc_BackSpace 0x0e
\r
54 #define sc_Control 0x1d
\r
55 #define sc_CapsLock 0x3a
\r
56 #define sc_LShift 0x2a
\r
57 #define sc_RShift 0x36
\r
58 #define sc_UpArrow 0x48
\r
59 #define sc_DownArrow 0x50
\r
60 #define sc_LeftArrow 0x4b
\r
61 #define sc_RightArrow 0x4d
\r
62 #define sc_Insert 0x52
\r
63 #define sc_Delete 0x53
\r
64 #define sc_Home 0x47
\r
66 #define sc_PgUp 0x49
\r
67 #define sc_PgDn 0x51
\r
109 #define key_Return 0x0d
\r
110 #define key_Enter key_Return
\r
111 #define key_Escape 0x1b
\r
112 #define key_Space 0x20
\r
113 #define key_BackSpace 0x08
\r
114 #define key_Tab 0x09
\r
115 #define key_Delete 0x7f
\r
117 // Stuff for the mouse
\r
122 #define MouseInt 0x33
\r
123 #define Mouse(x) _AX = x,geninterrupt(MouseInt)
\r
126 demo_Off,demo_Record,demo_Playback,demo_PlayDone
\r
129 ctrl_None, // MDM (GAMERS EDGE) - added
\r
131 ctrl_Keyboard1 = ctrl_Keyboard,ctrl_Keyboard2,
\r
133 ctrl_Joystick1 = ctrl_Joystick,ctrl_Joystick2,
\r
137 motion_Left = -1,motion_Up = -1,
\r
139 motion_Right = 1,motion_Down = 1
\r
142 dir_North,dir_NorthEast,
\r
143 dir_East,dir_SouthEast,
\r
144 dir_South,dir_SouthWest,
\r
145 dir_West,dir_NorthWest,
\r
149 boolean button0,button1;
\r
151 Motion xaxis,yaxis;
\r
154 typedef CursorInfo ControlInfo;
\r
156 ScanCode button0,button1,
\r
157 upleft, up, upright,
\r
159 downleft, down, downright;
\r
162 word joyMinX,joyMinY,
\r
163 threshMinX,threshMinY,
\r
164 threshMaxX,threshMaxY,
\r
166 joyMultXL,joyMultYL,
\r
167 joyMultXH,joyMultYH;
\r
169 // Global variables
\r
170 extern boolean Keyboard[],
\r
173 extern boolean Paused;
\r
174 extern char LastASCII;
\r
175 extern ScanCode LastScan;
\r
176 extern KeyboardDef KbdDefs[];
\r
177 extern JoystickDef JoyDefs[];
\r
178 extern ControlType Controls[MaxPlayers];
\r
180 extern boolean JoystickCalibrated; // MDM (GAMERS EDGE) - added
\r
181 extern ControlType ControlTypeUsed; // MDM (GAMERS EDGE) - added
\r
183 extern Demo DemoMode;
\r
184 extern byte _seg *DemoBuffer;
\r
185 extern word DemoOffset,DemoSize;
\r
187 // Function prototypes
\r
188 #define IN_KeyDown(code) (Keyboard[(code)])
\r
189 #define IN_ClearKey(code) {Keyboard[code] = false;\
\r
190 if (code == LastScan) LastScan = sc_None;}
\r
192 // DEBUG - put names in prototypes
\r
193 extern void IN_Startup(void),IN_Shutdown(void),
\r
194 IN_Default(boolean gotit,ControlType in),
\r
195 IN_SetKeyHook(void (*)()),
\r
196 IN_ClearKeysDown(void),
\r
197 IN_ReadCursor(CursorInfo *),
\r
198 IN_ReadControl(int,ControlInfo *),
\r
199 IN_SetControlType(int,ControlType),
\r
200 IN_GetJoyAbs(word joy,word *xp,word *yp),
\r
201 IN_SetupJoy(word joy,word minx,word maxx,
\r
202 word miny,word maxy),
\r
203 IN_StartDemoPlayback(byte _seg *buffer,word bufsize),
\r
204 IN_StopDemo(void),IN_FreeDemoBuffer(void),
\r
205 IN_Ack(void),IN_AckBack(void);
\r
206 extern boolean IN_UserInput(longword delay,boolean clear),
\r
207 IN_IsUserInput(void),
\r
208 IN_StartDemoRecord(word bufsize);
\r
209 extern byte *IN_GetScanName(ScanCode);
\r
210 extern char IN_WaitForASCII(void);
\r
211 extern ScanCode IN_WaitForKey(void);
\r
212 extern word IN_GetJoyButtonsDB(word joy);
\r