]> 4ch.mooo.com Git - 16.git/commitdiff
__seguse.txt added to show _seg usage also OpenVGMFile needs to be ported to 16_snd...
authorsparky4 <sparky4@cock.li>
Fri, 10 Mar 2017 16:24:48 +0000 (10:24 -0600)
committersparky4 <sparky4@cock.li>
Fri, 10 Mar 2017 16:24:48 +0000 (10:24 -0600)
makefile
src/inntest.c [new file with mode: 0755]
src/lib/16_in.c
src/lib/16_in_.c
src/lib/16_in_.h
src/lib/16_tdef.h

index cc491802f4666d34729be447ec9b8114345db4e7..c396e4c6c41ff014c5294423adf1b90a6f652c77 100755 (executable)
--- a/makefile
+++ b/makefile
@@ -125,7 +125,8 @@ LIBFLAGS=$(WLIBQ) -b -n
 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)
@@ -242,6 +243,7 @@ fonttest.exe:        fonttest.$(OBJ) gfx.lib
 #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)
@@ -282,6 +284,7 @@ fonttest.$(OBJ):$(SRC)/fonttest.c
 #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
@@ -336,6 +339,7 @@ mapread.$(OBJ):$(SRCLIB)/mapread.c $(SRCLIB)/mapread.h
 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
diff --git a/src/inntest.c b/src/inntest.c
new file mode 100755 (executable)
index 0000000..1ba8b22
--- /dev/null
@@ -0,0 +1,112 @@
+/* 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
index a6b43dfbb22784e1a6b2c9358b38a1b699027c8d..a2b280466c5a03ef39e7a5a89ea75a9f79951c18 100755 (executable)
@@ -37,6 +37,7 @@
 //\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
index 8ae2a327164e4717c750f1c6381e7c61788491a6..6a2602e4aa6f01cf81b0b6db861cfc38d37ec956 100755 (executable)
@@ -661,7 +661,9 @@ IN_Startup()
        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
index 39519c203762e2c71006a2e3ed61c917f7169ee0..969fdb7e07f0d2eefbefdca531a2b79051a0c1ce 100755 (executable)
@@ -204,36 +204,6 @@ typedef    struct          {
                                                                        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
@@ -241,19 +211,6 @@ typedef    struct
 \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
index 9cb36102b122a2087b8a9b1be0b1129995c4edae..be166c7e4fb77aaf3845b51355febf10faa7d8dc 100755 (executable)
@@ -228,12 +228,10 @@ typedef   enum            {
                                                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