X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Flib%2F16_in.h;h=9db0c1ede395297799acc727d617ffb9ed905e7c;hb=6021fc3f27b895d382fbd30488ead35657e39196;hp=ec9b56a2f424b25454f12fed1e8c3e5f77720d25;hpb=0279dd54ae3dfbaede4a10eb65cdacc9c24ba610;p=16.git
diff --git a/src/lib/16_in.h b/src/lib/16_in.h
index ec9b56a2..9db0c1ed 100755
--- a/src/lib/16_in.h
+++ b/src/lib/16_in.h
@@ -1,21 +1,24 @@
-/* Catacomb Apocalypse Source Code
- * Copyright (C) 1993-2014 Flat Rock Software
+/* Project 16 Source Code~
+ * Copyright (C) 2012-2018 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover
*
- * This program is free software; you can redistribute it and/or modify
+ * 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 2 of the License, or
+ * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
- * This program is distributed in the hope that it will be useful,
+ * 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, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see , or
+ * write to the Free Software Foundation, Inc., 51 Franklin Street,
+ * Fifth Floor, Boston, MA 02110-1301 USA.
+ *
*/
-
//
// ID Engine
// ID_IN.h - Header file for Input Manager
@@ -30,26 +33,12 @@
#include
#include "src/lib/16_head.h"
#include "src/lib/16_timer.h"
-#include "src/lib/bitmap.h"
-#include "src/lib/planar.h"
-
-#ifdef __DEBUG__
-//#define __DEBUG_InputMgr__
-#endif
-
-#ifdef __DEBUG_InputMgr__
-//#define TESTKEYIN
-//#define TESTCONTROLNOISY
+#include "src/lib/16_dbg.h"
+#ifdef __WATCOMC__ //borland C BCEXMM.EXE
+#include "src/lib/16_spri.h"
+#include "src/lib/16_enti.h"
#endif
-extern byte testkeyin,testcontrolnoisy,testctrltype;
-
-//if else for gfxtesting and direction
-//player[pn].d == 2 ||
-//player[pn].d != 2 ||
-#define DIRECTIONIFELSE (player[pn].info.dir == 2)
-//#define NDIRECTIONIFELSE (player[pn].info.dir != 2)
-
#define KeyInt 9 // The keyboard ISR number
// Stuff for the joystick
@@ -57,13 +46,12 @@ extern byte testkeyin,testcontrolnoisy,testctrltype;
#define JoyScaleShift 8
#define MaxJoyValue 5000
-#define MaxPlayers 4
+//#define MaxPlayers 2//future plans for multiple playable charaters and being able to alternate
#define MaxKbds 2
#define MaxJoys 2
-#define MaxPads 2
#define NumCodes 128
-typedef byte ScanCode;
+//typedef byte ScanCode;
#define sc_None 0
#define sc_Bad 0xff
#define sc_Return 0x1c
@@ -150,19 +138,27 @@ typedef byte ScanCode;
#define key_LSuper 0x5b
#define key_RSuper 0x5c
#define key_Menu 0x5d
+#define sc_LBrkt 0x1a // [
+#define sc_RBrkt 0x1b // ]
+#define sc_BackSlash 0x2b // |
+#define sc_ForeSlash 0x35 // / ?
// Stuff for the mouse
-#define MReset 0
+//moved to 16_tdef.h
+/*#define MReset 0
#define MButtons 3
#define MDelta 11
-#define MouseInt 0x33
+#define MouseInt 0x33*/
+#define Mouse(x) _AX = x,geninterrupt(MouseInt)
+
#ifdef DEMO0
typedef enum {
demo_Off,demo_Record,demo_Playback,demo_PlayDone
} Demo;
#endif
-typedef enum {
+//moved to 16_tdef.h
+/*typedef enum {
//ctrl_None, // MDM (GAMERS EDGE) - added
ctrl_Keyboard,
ctrl_Keyboard1 = ctrl_Keyboard,ctrl_Keyboard2,
@@ -208,32 +204,7 @@ typedef struct {
joyMaxX,joyMaxY,
joyMultXL,joyMultYL,
joyMultXH,joyMultYH;
- } JoystickDef;
-
-typedef struct
-{
- int x; //player exact position on the viewable map
- int y; //player exact position on the viewable map
- int tx; //player tile position on the viewable map
- int ty; //player tile position on the viewable map
- int triggerx; //player's trigger box tile position on the viewable map
- int triggery; //player's trigger box tile position on the viewable map
- int sheetsetx; //NOT USED YET! player sprite sheet set on the image x
- int sheetsety; //NOT USED YET! player sprite sheet set on the image y
- byte d; //direction to render sprite!! wwww
- byte q; //loop variable for anumation and locking the playing to compleate the animation cycle to prevent issues with misalignment www
- byte near pdir; //previous direction~
- //byte near kd[2]; //array of arrow key pressed
- word speed; //player speed!
-//0000 planar_buf_t huge *data; //supposively the sprite sheet data
-// planar_buf_t data; //supposively the sprite sheet data
-////0000----
- bitmap_t huge *data; //supposively the sprite sheet data
- sword hp; //hitpoints of the player
- int persist_aniframe; /* gonna be increased to 1 before being used, so 0 is ok for default */
- CursorInfo info;
- ControlType Controls;
-} player_t;
+ } JoystickDef;*/
/*
=============================================================================
@@ -242,19 +213,6 @@ typedef struct
=============================================================================
*/
-/*extern struct inconfig
-{
- boolean MousePresent;
- boolean JoysPresent[MaxJoys];
- boolean Keyboard[NumCodes];
- boolean Paused;
- char LastASCII;
- ScanCode LastScan;
-
- KeyboardDef KbdDefs[MaxKbds];
- JoystickDef JoyDefs[MaxJoys];
-} inpu;*/
-
#ifdef DEMO0
static Demo DemoMode = demo_Off;
static byte /*_seg*/ *DemoBuffer;
@@ -262,46 +220,46 @@ typedef struct
#endif
// Internal routines
-extern void interrupt INL_KeyService();
-extern void Mouse(int x);
-//static void INL_GetMouseDelta(int *x,int *y);
-//static word INL_GetMouseButtons(void);
-extern void IN_GetJoyAbs(word joy,word *xp,word *yp);
-//static void INL_GetJoyDelta(word joy,int *dx,int *dy,boolean adaptive);
-//static word INL_GetJoyButtons(word joy);
-extern word IN_GetJoyButtonsDB(word joy);
-//static void INL_StartKbd(void);
-//static void INL_ShutKbd(void);
-//static boolean INL_StartMouse(void);
-//static void INL_ShutMouse(void);
-//static void INL_SetJoyScale(word joy);
-extern void IN_SetupJoy(word joy,word minx,word maxx,word miny,word maxy);
-//static boolean INL_StartJoy(word joy);
-//static void INL_ShutJoy(word joy);
-extern void IN_Startup();
-extern void IN_Default(boolean gotit,player_t *player,ControlType nt);
-extern void IN_Shutdown();
-extern void IN_SetKeyHook(void (*hook)());
-extern void IN_ClearKeysDown();
-//static void INL_AdjustCursor(CursorInfo *info,word buttons,int dx,int dy);
-extern void IN_ReadCursor(CursorInfo *info);
-extern void near IN_ReadControl(int pn,player_t *player);
-extern void IN_SetControlType(word pn,player_t *player,ControlType type);
+extern void IN_Startup(global_game_variables_t *gvar),IN_Shutdown(global_game_variables_t *gvar),
+ IN_Default(boolean gotit,player_t *player,ControlType nt, global_game_variables_t *gvar),
+ IN_SetKeyHook(void (*)()),
+ IN_ClearKeysDown(void),
+ IN_ReadCursor(CursorInfo *, global_game_variables_t *gvar),
+ IN_ReadControl(player_t *player, global_game_variables_t *gvar),
+ IN_SetControlType(player_t *player,ControlType type),
+ IN_GetJoyAbs(word joy,word *xp,word *yp),
+ IN_SetupJoy(word joy,word minx,word maxx,
+ word miny,word maxy, global_game_variables_t *gvar),
#if DEMO0
-extern boolean IN_StartDemoRecord(word bufsize);
-extern void IN_StartDemoPlayback(byte /*__segment*/ *buffer,word bufsize);
-extern void IN_StopDemo(void);
-extern void IN_FreeDemoBuffer(void);
+ IN_StopDemo(void),IN_FreeDemoBuffer(void),
#endif
-extern byte *IN_GetScanName(ScanCode scan);
-extern ScanCode IN_WaitForKey();
-extern char IN_WaitForASCII();
-extern void IN_AckBack();
-extern void IN_Ack();
-extern boolean IN_IsUserInput();
-extern boolean IN_UserInput(dword delay,boolean clear);
-extern boolean IN_KeyDown(byte code);
-extern void IN_ClearKey(byte code);
-extern boolean IN_qb(byte kee);
+ IN_Ack(global_game_variables_t *gvar),IN_AckBack(void);
+extern boolean IN_UserInput(word delay, global_game_variables_t *gvar);
+extern char IN_WaitForASCII(void);
+extern ScanCode IN_WaitForKey(void);
+extern word IN_GetJoyButtonsDB(word joy);
+extern byte *IN_GetScanName(ScanCode);
+
+
+byte IN_MouseButtons (global_game_variables_t *gvar);
+byte IN_JoyButtons (void);
+
+void INL_GetJoyDelta(word joy,int *dx,int *dy/*,boolean adaptive*/, global_game_variables_t *gvar);
+void IN_StartAck(global_game_variables_t *gvar);
+boolean IN_CheckAck (global_game_variables_t *gvar);
+boolean IN_IsUserInput(global_game_variables_t *gvar);
+#if DEMO0
+boolean IN_StartDemoRecord(word bufsize);
+void IN_StartDemoPlayback(byte *buffer,word bufsize);
+void IN_StopDemo(void);
+void IN_FreeDemoBuffer(void);
+#endif
+
+//boolean IN_KeyDown(byte code),
+// IN_qb(byte kee);
+void IN_ClearKey(byte code),
+ IN_KbdLED();
+ScanCode IN_GetLastScan(),
+ IN_GetCurCode();
#endif