VGMSNDOBJ = vgmSnd.$(OBJ) 16_snd.$(OBJ)
#OLDLIBOBJS=bitmap.$(OBJ) 16render.$(OBJ)
GFXLIBOBJS = 16_vl.$(OBJ) 16_vlpal.$(OBJ) 16text.$(OBJ) bakapee.$(OBJ) scroll16.$(OBJ) 16_vrs.$(OBJ) 16_spri.$(OBJ) $(OLDLIBOBJS)
-16LIBOBJS = 16_mm.$(OBJ) 16_pm.$(OBJ) 16_ca.$(OBJ) 16_tail.$(OBJ) 16_in.$(OBJ) 16_head.$(OBJ) 16_dbg.$(OBJ) kitten.$(OBJ) 16_hc.$(OBJ) 16_wcpu.$(OBJ) 16_timer.$(OBJ) jsmn.$(OBJ) 16_map.$(OBJ) 16text.$(OBJ) 16_enti.$(OBJ)
+16LIBNOINOBJS = 16_mm.$(OBJ) 16_pm.$(OBJ) 16_ca.$(OBJ) 16_tail.$(OBJ) 16_head.$(OBJ) 16_dbg.$(OBJ) kitten.$(OBJ) 16_hc.$(OBJ) 16_wcpu.$(OBJ) 16_timer.$(OBJ) jsmn.$(OBJ) 16_map.$(OBJ) 16text.$(OBJ) 16_enti.$(OBJ)
+16LIBOBJS = $(16LIBNOINOBJS) 16_in.$(OBJ)
DOSLIBOBJ = adlib.$(OBJ) 8254.$(OBJ) 8259.$(OBJ) dos.$(OBJ) cpu.$(OBJ)
!ifeq DEBUGSERIAL 1
DOSLIBOBJ += 8250.$(OBJ)
#fonttes0.exe: fonttes0.$(OBJ) $(16LIB)
fontgfx.exe: fontgfx.$(OBJ) gfx.lib $(DOSLIB)
inputest.exe: inputest.$(OBJ) $(16LIB) $(DOSLIB) gfx.lib
+inntest.exe: inntest.$(OBJ) $(DOSLIB) $(16LIBNOINOBJS) 16_in_.$(OBJ)
#sountest.exe: sountest.$(OBJ) $(16LIB)
pcxtest.exe: pcxtest.$(OBJ) gfx.lib $(DOSLIB) $(16LIB)
vrstest.exe: vrstest.$(OBJ) $(16LIB) gfx.lib $(DOSLIB)
#fonttes0.$(OBJ): $(SRC)/fonttes0.c
fontgfx.$(OBJ):$(SRC)/fontgfx.c
inputest.$(OBJ):$(SRC)/inputest.c
+inntest.$(OBJ):$(SRC)/inntest.c
#sountest.$(OBJ): $(SRC)/sountest.c
#miditest.$(OBJ): $(SRC)/miditest.c
#testemm.$(OBJ):$(SRC)/testemm.c
16_map.$(OBJ):$(SRCLIB)/16_map.c $(SRCLIB)/16_map.h
16_timer.$(OBJ):$(SRCLIB)/16_timer.c $(SRCLIB)/16_timer.h
16_in.$(OBJ): $(SRCLIB)/16_in.c $(SRCLIB)/16_in.h
+16_in_.$(OBJ): $(SRCLIB)/16_in_.c $(SRCLIB)/16_in_.h
16_rf.$(OBJ): $(SRCLIB)/16_rf.c $(SRCLIB)/16_rf.h
16_mm.$(OBJ): $(SRCLIB)/16_mm.c $(SRCLIB)/16_mm.h
16_pm.$(OBJ): $(SRCLIB)/16_pm.c $(SRCLIB)/16_pm.h
--- /dev/null
+/* Project 16 Source Code~\r
+ * Copyright (C) 2012-2017 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover\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
+#include "src/lib/16_tail.h"\r
+\r
+void\r
+main(int argc, char *argv[])\r
+{\r
+ static global_game_variables_t gvar;\r
+ //extern struct inconfig inpu;\r
+ dbg_testkeyin=0;\r
+ dbg_testcontrolnoisy=1;\r
+ start_timer(&gvar);\r
+ //Startup16(&gvar);\r
+ IN_Startup();\r
+ //IN_Default(0,&gvar.player,ctrl_Joystick1);\r
+ //IN_SetControlType(0,&gvar.player,ctrl_Joystick1);\r
+ IN_Default(0,&gvar.player,ctrl_Keyboard1);\r
+ IN_SetControlType(0,&gvar.player,ctrl_Keyboard1);\r
+\r
+ gvar.player[0].enti.q=1;\r
+ gvar.player[0].enti.d=2;\r
+ gvar.player[0].enti.speed=4;\r
+\r
+//0000 nibbletest();\r
+//0000 booleantest();\r
+ //printf("dbg_testkeyin=%u dbg_testcontrolnoisy=%u dbg_nogvar.playerinpu=%u\nloop if this is not responsive then please KILL or reset machine sorry!!\n", dbg_testkeyin, dbg_testcontrolnoisy, dbg_nogvar.playerinpu);\r
+ while(!IN_KeyDown(sc_Escape))\r
+ {\r
+//0000 shinkutxt(&gvar);\r
+ IN_ReadControl(0, &gvar.player);\r
+ switch(gvar.player[0].enti.d)\r
+ {\r
+ //right movement\r
+ case 3:\r
+ if(gvar.player[0].enti.q<=(TILEWH/(gvar.player[0].enti.speed)))\r
+ {\r
+ gvar.player[0].enti.q++;\r
+ } else { gvar.player[0].enti.q = 1; gvar.player[0].enti.d = 2; }\r
+ break;\r
+\r
+ //left movement\r
+ case 1:\r
+ if(gvar.player[0].enti.q<=(TILEWH/(gvar.player[0].enti.speed)))\r
+ {\r
+ gvar.player[0].enti.q++;\r
+ } else { gvar.player[0].enti.q = 1; gvar.player[0].enti.d = 2; }\r
+ break;\r
+\r
+ //down movement\r
+ case 4:\r
+ if(gvar.player[0].enti.q<=(TILEWH/(gvar.player[0].enti.speed)))\r
+ {\r
+ gvar.player[0].enti.q++;\r
+ } else { gvar.player[0].enti.q = 1; gvar.player[0].enti.d = 2; }\r
+ break;\r
+\r
+ //up movement\r
+ case 0:\r
+ if(gvar.player[0].enti.q<=(TILEWH/(gvar.player[0].enti.speed)))\r
+ {\r
+ gvar.player[0].enti.q++;\r
+ } else { gvar.player[0].enti.q = 1; gvar.player[0].enti.d = 2; }\r
+ break;\r
+ }\r
+ //printf("%u\n", IN_KeyDown(sc_Escape));\r
+ //if(\r
+ IN_qb(sc_9);//>0) printf("IN_qb(sc_9)=%u\n", IN_qb(sc_9));\r
+ if(IN_KeyDown(88)) //speed\r
+ {\r
+ switch(gvar.kurokku.fpscap)\r
+ {\r
+ case 0:\r
+ gvar.kurokku.fpscap=1;\r
+ break;\r
+ case 1:\r
+ gvar.kurokku.fpscap=0;\r
+ break;\r
+ }\r
+ //IN_Ack();\r
+ }\r
+ }\r
+ IN_Shutdown();\r
+ //Shutdown16(&gvar);\r
+ //printf("%u\n", in.Keyboard[sc_Escape]);\r
+ printf("inputest.exe ");\r
+ printf("version %s\n", VERSION);\r
+ printf("testkeyin=%u\n", dbg_testkeyin);\r
+ printf("testcontrolnoisy=%u\n", dbg_testcontrolnoisy);\r
+}\r
//\r
\r
#include "src/lib/16_in.h"\r
+#pragma hdrstop\r
\r
static word far* clockw= (word far*) 0x046C; /* 18.2hz clock */\r
\r
for (i = 0;i < MaxJoys;i++)\r
inpu.JoysPresent[i] = checkjoys? INL_StartJoy(i) : false;\r
\r
- {{0x1d,0x38,0x47,0x48,0x49,0x4b,0x4d,0x4f,0x50,0x51}};\r
+ for (i = 0;i < MaxKbds;i++)\r
+ inpu.KbdDefs = {{0x1d,0x38,0x47,0x48,0x49,0x4b,0x4d,0x4f,0x50,0x51}};\r
+\r
inst.IN_Started = true;\r
\r
}\r
joyMultXH,joyMultYH;\r
} JoystickDef;\r
\r
-typedef struct\r
-{\r
- int x; //player exact position on the viewable map\r
- int y; //player exact position on the viewable map\r
- int tx; //player tile position on the viewable map\r
- int ty; //player tile position on the viewable map\r
- int triggerx; //player's trigger box tile position on the viewable map\r
- int triggery; //player's trigger box tile position on the viewable map\r
- int sheetsetx; //NOT USED YET! player sprite sheet set on the image x\r
- int sheetsety; //NOT USED YET! player sprite sheet set on the image y\r
- byte d; //direction to render sprite!! wwww\r
- byte q; //loop variable for anumation and locking the playing to compleate the animation cycle to prevent issues with misalignment www\r
- byte near pdir; //previous direction~\r
- word speed; //player speed!\r
- word spt; //speed per tile\r
-#ifdef __WATCOMC__\r
- struct sprite *spri; //supposively the sprite sheet data\r
- memptr gr;\r
- entity_t *ent;\r
-#endif\r
- bitmap_t *data; //supposively the sprite sheet data//old format\r
- bitmap_t bmp;\r
- sword hp; //hitpoints of the player\r
- int persist_aniframe; // gonna be increased to 1 before being used, so 0 is ok for default\r
- CursorInfo info;\r
- ControlType Controls;\r
-//newer vars\r
- int dx, dy, delta; //TODO: what is this? ^^\r
-} player_t;*/\r
-\r
/*\r
=============================================================================\r
\r
\r
=============================================================================\r
*/\r
-/*extern struct inconfig\r
-{\r
- boolean MousePresent;\r
- boolean JoysPresent[MaxJoys];\r
- boolean Keyboard[NumCodes];\r
- boolean Paused;\r
- char LastASCII;\r
- ScanCode LastScan;\r
-\r
- KeyboardDef KbdDefs[MaxKbds];\r
- JoystickDef JoyDefs[MaxJoys];\r
-} inpu;*/\r
-\r
#ifdef DEMO0\r
static Demo DemoMode = demo_Off;\r
static byte /*_seg*/ *DemoBuffer;\r
motion_None = 0,\r
motion_Right = 1,motion_Down = 1\r
} Motion;\r
-typedef enum {\r
- dir_North,//dir_NorthEast,\r
- dir_West,//dir_Nortinest,\r
- dir_None,\r
- dir_East,//,dir_SouthEast,\r
- dir_South,//dir_Soutinest,\r
+typedef enum { // Quick lookup for total direction\r
+ /*dir_NorthWest, */dir_North,/* dir_NorthEast,*/\r
+ dir_West, dir_None, dir_East,\r
+ /*dir_SouthWest, */dir_South/*, dir_SouthEast*/\r
} Direction;\r
typedef struct {\r
boolean near button0,button1,button2,button3;\r