]> 4ch.mooo.com Git - 16.git/commitdiff
pdir printf(%c%d %c%d %c%d %c%dn, dirchar(0), inpu.Keyboard[def->up], dirchar(4)...
authorsparky4 <sparky4@cock.li>
Sun, 13 Mar 2016 05:17:26 +0000 (23:17 -0600)
committersparky4 <sparky4@cock.li>
Sun, 13 Mar 2016 05:17:26 +0000 (23:17 -0600)
src/lib/16_head.c
src/lib/16_head.h
src/lib/16_in.c
src/lib/16_in.h

index 2d26ca3b379b236f1e1a6f8104a0f1a4b9b0dd0d..3b2d8a8ab53233e82738bbb8343747f0e361c856 100755 (executable)
@@ -157,3 +157,27 @@ US_CheckParm(char *parm,char **strings)
 \r
        exit(exit_code);\r
 }*/\r
+\r
+byte dirchar(byte in)\r
+{\r
+       byte out;\r
+       switch(in)\r
+       {\r
+               case 0: //up\r
+                       out = 0x1E;\r
+               break;\r
+               case 4: //down\r
+                       out = 0x1F;\r
+               break;\r
+               case 1: //left\r
+                       out = 0x11;\r
+               break;\r
+               case 3: //right\r
+                       out = 0x10;\r
+               break;\r
+               default: //null\r
+                       out = 0xB3;\r
+               break;\r
+       }\r
+       return out;\r
+}\r
index 5db7e3f4e2619a414da03aefc76d9fa1cecae647..d48f48f1a3c316325e9237263ccf3179bc6b66ba 100755 (executable)
@@ -178,5 +178,6 @@ void wait(clock_t wait);
 long int filesize(FILE *fp);\r
 void printmeminfoline(byte *strc, const byte *pee, size_t h_total, size_t h_used, size_t h_free);\r
 int US_CheckParm(char *parm,char **strings);\r
+byte dirchar(byte in);\r
 \r
 #endif/*_LIBHEAD_H_*/\r
index f93fad3943f37da70263296aec483abef75e5e64..7d4b32d909026780879b554102d8765ad6795b91 100755 (executable)
@@ -919,7 +919,7 @@ register    KeyboardDef     *def;
        player[pn].info.dir = DirTable[conpee];\r
 \r
        //TODO: overwriting direction must be added\r
-       if(DIRECTIONIFELSEGFXTEST) player[pn].pdir=DirTable[conpee];\r
+       if(player[pn].d==2) player[pn].pdir=DirTable[conpee];\r
        if(player[pn].q==1 && (mx!=motion_None || my!=motion_None))\r
        {\r
                player[pn].d = player[pn].info.dir;\r
@@ -952,13 +952,14 @@ register  KeyboardDef     *def;
 #endif\r
 //#ifdef TESTCONTROLNOISY\r
 if(testcontrolnoisy > 0)\r
-//if((inpu.Keyboard[def->up] || inpu.Keyboard[def->down] || inpu.Keyboard[def->left] || inpu.Keyboard[def->right]) && NDIRECTIONIFELSEGFXTEST)\r
+if((inpu.Keyboard[def->up] || inpu.Keyboard[def->down] || inpu.Keyboard[def->left] || inpu.Keyboard[def->right]) || player[pn].q>1)\r
 {\r
        printf("q=%d ", player[pn].q);\r
-       printf("cpee=%d ", conpee);\r
-       printf("(mx)=%d ", mx);\r
-       printf("(my)=%d ", my);\r
-       printf("pdir=%d d=%d dir=%d\n", player[pn].pdir, player[pn].d, player[pn].info.dir);\r
+       printf("cpee=%c ", dirchar(conpee));\r
+       //printf("(mx)=%d       ", mx);\r
+       //printf("(my)=%d       ", my);\r
+       printf("pdir=%c d=%c dir=%c", dirchar(player[pn].pdir), dirchar(player[pn].d), dirchar(player[pn].info.dir));\r
+       printf("%c%d %c%d %c%d %c%d\n", dirchar(0), inpu.Keyboard[def->up], dirchar(4), inpu.Keyboard[def->down], dirchar(1), inpu.Keyboard[def->left], dirchar(3), inpu.Keyboard[def->right]);\r
 }\r
 //#endif\r
 }\r
index 9f900aa5d5ac7b23be6bbaf4a993d3c2d5747eaa..760b5bb26bb5300b857023973655f11046e483cc 100755 (executable)
@@ -46,8 +46,9 @@ extern byte testkeyin,testcontrolnoisy;
 \r
 //if else for gfxtesting and direction\r
 //player[pn].d == 2 ||\r
+//player[pn].d != 2 ||\r
 #define DIRECTIONIFELSEGFXTEST (player[pn].info.dir == 2)\r
-//#define NDIRECTIONIFELSEGFXTEST      (player[pn].d != 2 || player[pn].info.dir != 2)\r
+#define NDIRECTIONIFELSEGFXTEST        (player[pn].info.dir != 2)\r
 \r
 #define        KeyInt  9       // The keyboard ISR number\r
 \r