// DEBUG - there are more globals\r
//\r
\r
-//#include "ID_HEADS.H"
+//#include "ID_HEADS.H"\r
#include "16_in.h"\r
//#pragma hdrstop\r
\r
outp(0x20,0x20);\r
}\r
\r
+static void\r
+Mouse(int x)\r
+{\r
+ x = CPURegs.x.ax;\r
+ int86(MouseInt,&CPURegs,&CPURegs);\r
+}\r
+\r
///////////////////////////////////////////////////////////////////////////\r
//\r
// INL_GetMouseDelta() - Gets the amount that the mouse has moved from the\r
INL_GetMouseDelta(int *x,int *y)\r
{\r
Mouse(MDelta);\r
- *x = _CX;\r
- *y = _DX;\r
+ *x = CPURegs.x.cx;\r
+ *y = CPURegs.x.dx;\r
}\r
\r
///////////////////////////////////////////////////////////////////////////\r
word buttons;\r
\r
Mouse(MButtons);\r
- buttons = _BX;\r
+ buttons = CPURegs.x.bx;\r
return(buttons);\r
}\r
\r
ys = joy? 3 : 1; // Do the same for y axis\r
yb = 1 << ys;\r
\r
-// Read the absolute joystick values
- __asm
+// Read the absolute joystick values\r
+ __asm\r
{\r
pushf // Save some registers\r
push si\r
xor si,si // Clear count registers\r
xor di,di\r
xor bh,bh // Clear high byte of bx for later\r
-
+\r
push bp // Don't mess up stack frame\r
mov bp,MaxJoyValue\r
\r
\r
done:\r
pop bp\r
-
+\r
mov cl,[xs] // Get the number of bits to shift\r
shr si,cl // and shift the count that many times\r
\r
\r
mov [x],si // Store the values into the variables\r
mov [y],di\r
-
+\r
pop di\r
pop si\r
- popf // Restore the registers
+ popf // Restore the registers\r
}\r
\r
*xp = x;\r
{\r
result1 = INL_GetJoyButtons(joy);\r
lasttime = TimeCount;\r
- while (TimeCount == lasttime)\r
+ while(TimeCount == lasttime)\r
;\r
result2 = INL_GetJoyButtons(joy);\r
- } while (result1 != result2);\r
+ } while(result1 != result2);\r
return(result1);\r
}\r
\r
\r
IN_ClearKeysDown();\r
\r
- OldKeyVect = getvect(KeyInt);\r
- setvect(KeyInt,INL_KeyService);\r
+ OldKeyVect = _dos_getvect(KeyInt);\r
+ _dos_setvect(KeyInt,INL_KeyService);\r
}\r
\r
///////////////////////////////////////////////////////////////////////////\r
{\r
poke(0x40,0x17,peek(0x40,0x17) & 0xfaf0); // Clear ctrl/alt/shift flags\r
\r
- setvect(KeyInt,OldKeyVect);\r
+ _dos_setvect(KeyInt,OldKeyVect);\r
}\r
\r
///////////////////////////////////////////////////////////////////////////\r
static boolean\r
INL_StartMouse(void)\r
{\r
- if (getvect(MouseInt))\r
+ if(_dos_getvect(MouseInt))\r
{\r
Mouse(MReset);\r
- if (_AX == 0xffff)\r
+ if(CPURegs.x.ax == 0xffff)\r
return(true);\r
}\r
return(false);\r
// v1.0d1\r
// By Jason Blochowiak\r
//\r
-
-#include "lib_head.h"
+\r
+#ifndef __16_IN__\r
+#define __16_IN__\r
+\r
+#include "lib_head.h"\r
\r
#ifndef __TYPES__\r
//#include "ID_Types.h"\r
#endif\r
\r
-#ifndef __ID_IN__\r
-#define __ID_IN__\r
-\r
#ifdef __DEBUG__\r
#define __DEBUG_InputMgr__\r
#endif\r
#define MDelta 11\r
\r
#define MouseInt 0x33\r
-#define Mouse(x) _AX = x,_dos_geninterrupt(MouseInt)\r
\r
typedef enum {\r
demo_Off,demo_Record,demo_Playback,demo_PlayDone\r
-/*
- * 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.
- *
- */
+/*\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
* Just some handy typedefs that make it easier to think about the low\r
* level code\r
- */
-
-#ifndef _LIB_HEAD_H_
-#define _LIB_HEAD_H_
-
-#include <malloc.h>
-#include <dos.h>
-//#include ""
-//#include ""
-//#include "ID_CA.H"
-//#include "AUDIOARM.H"
+ */\r
+\r
+#ifndef _LIB_HEAD_H_\r
+#define _LIB_HEAD_H_\r
+#include <dos.h>\r
+#include <malloc.h>\r
+#include <conio.h>\r
+//#include ""\r
+//#include ""\r
+//#include "ID_CA.H"\r
+//#include "AUDIOARM.H"\r
#include "types.h"\r
-
-#endif/*_LIB_HEAD_H_*/
+\r
+#ifndef REGS\r
+struct REGS CPURegs;\r
+#endif\r
+\r
+#endif/*_LIB_HEAD_H_*/\r