-/* Project 16 Source Code~
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669
- *
- * This file is part of Project 16.
- *
- * Project 16 is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * Project 16 is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>, or
- * write to the Free Software Foundation, Inc., 51 Franklin Street,
- * Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
-/*
- input test
-*/
-#include "src/lib/16_in.h"
-
-void
+/* Project 16 Source Code~\r
+ * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669\r
+ *\r
+ * This file is part of Project 16.\r
+ *\r
+ * Project 16 is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 3 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * Project 16 is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program. If not, see <http://www.gnu.org/licenses/>, or\r
+ * write to the Free Software Foundation, Inc., 51 Franklin Street,\r
+ * Fifth Floor, Boston, MA 02110-1301 USA.\r
+ *\r
+ */\r
+/*\r
+ input test\r
+*/\r
+#include "src/lib/16_in.h"\r
+\r
+void\r
main(int argc, char *argv[])\r
-{
-
-}
+{\r
+ ControlInfo control;\r
+ IN_Startup();\r
+ IN_Default(0,ctrl_Keyboard);\r
+ IN_ReadControl(0,&control);\r
+ IN_Shutdown();\r
+}\r
// INL_KeyService() - Handles a keyboard interrupt (key up/down)
//
///////////////////////////////////////////////////////////////////////////
-static void interrupt
+void interrupt
INL_KeyService(void)
{
static boolean special;
outp(0x20,0x20);
}
-static void
+void
Mouse(int x)
{
union REGS CPURegs;
}
}
+#ifndef DOMO
///////////////////////////////////////////////////////////////////////////
//
// IN_ReadControl() - Reads the device associated with the specified
type = ctrl_Keyboard1;
def = &KbdDefs[type - ctrl_Keyboard];
- if (Keyboard[def->upleft])
+/* if (Keyboard[def->upleft])
mx = motion_Left,my = motion_Up;
else if (Keyboard[def->upright])
mx = motion_Right,my = motion_Up;
else if (Keyboard[def->downleft])
mx = motion_Left,my = motion_Down;
else if (Keyboard[def->downright])
- mx = motion_Right,my = motion_Down;
+ mx = motion_Right,my = motion_Down;*/
if (Keyboard[def->up])
my = motion_Up;
#endif
}
-#if 0
+#else
///////////////////////////////////////////////////////////////////////////
//
// IN_ReadControl() - Reads the device associated with the specified
case ctrl_Keyboard2:
def = &KbdDefs[type - ctrl_Keyboard];
- if (Keyboard[def->upleft])
+/* if (Keyboard[def->upleft])
mx = motion_Left,my = motion_Up;
else if (Keyboard[def->upright])
mx = motion_Right,my = motion_Up;
else if (Keyboard[def->downleft])
mx = motion_Left,my = motion_Down;
else if (Keyboard[def->downright])
- mx = motion_Right,my = motion_Down;
+ mx = motion_Right,my = motion_Down;*/
if (Keyboard[def->up])
my = motion_Up;
\r
#ifndef __16_IN__\r
#define __16_IN__\r
-
+\r
#include "src/lib/lib_head.h"\r
-//#include "src/lib/16_us.h"
+//#include "src/lib/16_us.h"\r
\r
-#ifdef __DEBUG__\r
+//++++#ifdef __DEBUG__\r
#define __DEBUG_InputMgr__\r
-#endif\r
-
-#define KeyInt 9 // The keyboard ISR number
-
-// Stuff for the joystick
-#define JoyScaleMax 32768
-#define JoyScaleShift 8
-#define MaxJoyValue 5000
+//++++#endif\r
+\r
+#define DOMO\r
+\r
+#define KeyInt 9 // The keyboard ISR number\r
+\r
+// Stuff for the joystick\r
+#define JoyScaleMax 32768\r
+#define JoyScaleShift 8\r
+#define MaxJoyValue 5000\r
\r
#define MaxPlayers 4\r
#define MaxKbds 2\r
#ifdef DEMO0\r
typedef enum {\r
demo_Off,demo_Record,demo_Playback,demo_PlayDone\r
- } Demo;
+ } Demo;\r
#endif\r
typedef enum {\r
ctrl_None, // MDM (GAMERS EDGE) - added\r
motion_Right = 1,motion_Down = 1\r
} Motion;\r
typedef enum {\r
- dir_North,dir_NorthEast,\r
- dir_East,dir_SouthEast,\r
- dir_South,dir_SouthWest,\r
- dir_West,dir_NorthWest,\r
+ dir_North,//dir_NorthEast,\r
+ dir_East,//dir_SouthEast,\r
+ dir_South,//dir_SouthWest,\r
+ dir_West,//dir_NorthWest,\r
dir_None\r
} Direction;\r
typedef struct {\r
Direction dir;\r
} CursorInfo;\r
typedef CursorInfo ControlInfo;\r
+\r
typedef struct {\r
ScanCode button0,button1,\r
- upleft, up, upright,\r
+ //upleft,\r
+ up,\r
+ //upright,\r
left, right,\r
- downleft, down, downright;\r
+ //downleft,\r
+ down\r
+ //,downright\r
+ ;\r
} KeyboardDef;\r
typedef struct {\r
word joyMinX,joyMinY,\r
static boolean JoyPadPresent;\r
\r
\r
-// Global variables
- static boolean JoystickCalibrated=false; // MDM (GAMERS EDGE) - added
- static ControlType ControlTypeUsed; // MDM (GAMERS EDGE) - added
+// Global variables\r
+ static boolean JoystickCalibrated=false; // MDM (GAMERS EDGE) - added\r
+ static ControlType ControlTypeUsed; // MDM (GAMERS EDGE) - added\r
\r
static boolean Keyboard[NumCodes];\r
static boolean Paused;\r
static JoystickDef JoyDefs[MaxJoys];\r
static ControlType Controls[MaxPlayers];\r
\r
- static dword MouseDownCount;
+ static dword MouseDownCount;\r
\r
#ifdef DEMO0\r
static Demo DemoMode = demo_Off;\r
static byte /*_seg*/ *DemoBuffer;\r
- static word DemoOffset,DemoSize;
-#endif
-
-extern dword far* clockdw;
-
+ static word DemoOffset,DemoSize;\r
+#endif\r
+\r
+extern dword far* clockdw;\r
+\r
/*\r
=============================================================================\r
\r
\r
static Direction DirTable[] = // Quick lookup for total direction\r
{\r
- dir_NorthWest, dir_North, dir_NorthEast,\r
+ //dir_NorthWest,\r
+ dir_North,\r
+ //dir_NorthEast,\r
dir_West, dir_None, dir_East,\r
- dir_SouthWest, dir_South, dir_SouthEast\r
+ //dir_SouthWest,\r
+ dir_South//,dir_SouthEast\r
};\r
\r
static void (*INL_KeyHook)(void);\r
IN_SetControlType(int,ControlType),\r
IN_GetJoyAbs(word joy,word *xp,word *yp),\r
IN_SetupJoy(word joy,word minx,word maxx,\r
- word miny,word maxy),
+ word miny,word maxy),\r
+ Mouse(int x),\r
#ifdef DEMO0\r
IN_StartDemoPlayback(byte __segment *buffer,word bufsize),\r
- IN_StopDemo(void),IN_FreeDemoBuffer(void),
+ IN_StopDemo(void),IN_FreeDemoBuffer(void),\r
#endif\r
IN_Ack(void),IN_AckBack(void);\r
extern boolean IN_UserInput(dword delay,boolean clear),\r
- IN_IsUserInput(void)
+ IN_IsUserInput(void)\r
#ifdef DEMO0\r
- , IN_StartDemoRecord(word bufsize)
-#endif
+ , IN_StartDemoRecord(word bufsize)\r
+#endif\r
;\r
extern byte *IN_GetScanName(ScanCode);\r
extern char IN_WaitForASCII(void);\r
extern ScanCode IN_WaitForKey(void);\r
-extern word IN_GetJoyButtonsDB(word joy);
-
+extern word IN_GetJoyButtonsDB(word joy);\r
+\r
+\r
//static void interrupt INL_KeyService(void);\r
#endif\r