3 // ID_IN.h - Header file for Input Manager
\r
5 // By Jason Blochowiak
\r
6 // Open Watcom port by sparky4
\r
13 #include "src/lib/16_head.h"
\r
14 #include "src/lib/16_timer.h"
\r
15 #ifdef __WATCOMC__ //borland C BCEXMM.EXE
\r
16 #include "src/lib/16_dbg.h"
\r
17 #include "src/lib/16_spri.h"
\r
18 #include "src/lib/16_enti.h"
\r
21 #define KeyInt 9 // The keyboard ISR number
\r
23 // Stuff for the joystick
\r
24 #define JoyScaleMax 32768
\r
25 #define JoyScaleShift 8
\r
26 #define MaxJoyValue 5000
\r
28 //#define MaxPlayers 2//future plans for multiple playable charaters and being able to alternate
\r
31 #define NumCodes 128
\r
33 //typedef byte ScanCode;
\r
36 #define sc_Return 0x1c
\r
37 #define sc_Enter sc_Return
\r
38 #define sc_Escape 0x01
\r
39 #define sc_Space 0x39
\r
40 #define sc_BackSpace 0x0e
\r
43 #define sc_Control 0x1d
\r
44 #define sc_CapsLock 0x3a
\r
45 #define sc_LShift 0x2a
\r
46 #define sc_RShift 0x36
\r
47 #define sc_UpArrow 0x48
\r
48 #define sc_DownArrow 0x50
\r
49 #define sc_LeftArrow 0x4b
\r
50 #define sc_RightArrow 0x4d
\r
51 #define sc_Insert 0x52
\r
52 #define sc_Delete 0x53
\r
53 #define sc_Home 0x47
\r
55 #define sc_PgUp 0x49
\r
56 #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 #define key_LSuper 0x5b
\r
118 #define key_RSuper 0x5c
\r
119 #define key_Menu 0x5d
\r
121 // Stuff for the mouse
\r
126 #define MouseInt 0x33
\r
129 demo_Off,demo_Record,demo_Playback,demo_PlayDone
\r
132 //moved to 16_tdef.h
\r
134 //ctrl_None, // MDM (GAMERS EDGE) - added
\r
136 ctrl_Keyboard1 = ctrl_Keyboard,ctrl_Keyboard2,
\r
138 ctrl_Joystick1 = ctrl_Joystick,ctrl_Joystick2,
\r
142 motion_Left = -1,motion_Up = -1,
\r
144 motion_Right = 1,motion_Down = 1
\r
147 dir_North,//dir_NorthEast,
\r
148 dir_West,//dir_Nortinest,
\r
150 dir_East,//,dir_SouthEast,
\r
151 dir_South,//dir_Soutinest,
\r
154 boolean near button0,button1,button2,button3;
\r
156 Motion near xaxis,yaxis;
\r
157 Direction near dir;
\r
161 ScanCode near button0,button1,
\r
173 word near joyMinX,joyMinY,
\r
174 threshMinX,threshMinY,
\r
175 threshMaxX,threshMaxY,
\r
177 joyMultXL,joyMultYL,
\r
178 joyMultXH,joyMultYH;
\r
182 =============================================================================
\r
186 =============================================================================
\r
189 static Demo DemoMode = demo_Off;
\r
190 static byte /*_seg*/ *DemoBuffer;
\r
191 static word DemoOffset,DemoSize;
\r
194 // Internal routines
\r
195 extern void IN_Startup(void),IN_Shutdown(void),
\r
196 IN_Default(boolean gotit,player_t *player,ControlType nt),
\r
197 IN_SetKeyHook(void (*)()),
\r
198 IN_ClearKeysDown(void),
\r
199 IN_ReadCursor(CursorInfo *),
\r
200 IN_ReadControl(player_t *player),
\r
201 IN_SetControlType(player_t *player,ControlType type),
\r
202 IN_GetJoyAbs(word joy,word *xp,word *yp),
\r
203 IN_SetupJoy(word joy,word minx,word maxx,
\r
204 word miny,word maxy),
\r
206 IN_StopDemo(void),IN_FreeDemoBuffer(void),
\r
208 IN_Ack(void),IN_AckBack(void);
\r
209 extern boolean IN_UserInput(word delay);
\r
210 extern char IN_WaitForASCII(void);
\r
211 extern ScanCode IN_WaitForKey(void);
\r
212 extern word IN_GetJoyButtonsDB(word joy);
\r
213 extern byte *IN_GetScanName(ScanCode);
\r
216 byte IN_MouseButtons (void);
\r
217 byte IN_JoyButtons (void);
\r
219 void INL_GetJoyDelta(word joy,int *dx,int *dy/*,boolean adaptive*/);
\r
220 void IN_StartAck(void);
\r
221 boolean IN_CheckAck (void);
\r
222 boolean IN_IsUserInput();
\r
223 #define Mouse(x) INL_Mouse(x)
\r
224 //void IN_SetKeyHook(void (*hook)());
\r
226 boolean IN_StartDemoRecord(word bufsize);
\r
227 void IN_StartDemoPlayback(byte *buffer,word bufsize);
\r
228 void IN_StopDemo(void);
\r
229 void IN_FreeDemoBuffer(void);
\r
232 boolean IN_KeyDown(byte code),
\r
234 void IN_ClearKey(byte code),
\r
236 ScanCode IN_GetLastScan(),
\r