From: sparky4 Date: Sun, 13 Mar 2016 05:17:26 +0000 (-0600) Subject: pdir printf(%c%d %c%d %c%d %c%dn, dirchar(0), inpu.Keyboard[def->up], dirchar(4)... X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=5cae3e118cd55278d286cac524d30e36f9df88a4;p=16.git pdir printf(%c%d %c%d %c%d %c%dn, dirchar(0), inpu.Keyboard[def->up], dirchar(4), inpu.Keyboard[def->down], dirchar(1), inpu.Keyboard[def->left], dirchar(3), inpu.Keyboard[def->right]); --- diff --git a/src/lib/16_head.c b/src/lib/16_head.c index 2d26ca3b..3b2d8a8a 100755 --- a/src/lib/16_head.c +++ b/src/lib/16_head.c @@ -157,3 +157,27 @@ US_CheckParm(char *parm,char **strings) exit(exit_code); }*/ + +byte dirchar(byte in) +{ + byte out; + switch(in) + { + case 0: //up + out = 0x1E; + break; + case 4: //down + out = 0x1F; + break; + case 1: //left + out = 0x11; + break; + case 3: //right + out = 0x10; + break; + default: //null + out = 0xB3; + break; + } + return out; +} diff --git a/src/lib/16_head.h b/src/lib/16_head.h index 5db7e3f4..d48f48f1 100755 --- a/src/lib/16_head.h +++ b/src/lib/16_head.h @@ -178,5 +178,6 @@ void wait(clock_t wait); long int filesize(FILE *fp); void printmeminfoline(byte *strc, const byte *pee, size_t h_total, size_t h_used, size_t h_free); int US_CheckParm(char *parm,char **strings); +byte dirchar(byte in); #endif/*_LIBHEAD_H_*/ diff --git a/src/lib/16_in.c b/src/lib/16_in.c index f93fad39..7d4b32d9 100755 --- a/src/lib/16_in.c +++ b/src/lib/16_in.c @@ -919,7 +919,7 @@ register KeyboardDef *def; player[pn].info.dir = DirTable[conpee]; //TODO: overwriting direction must be added - if(DIRECTIONIFELSEGFXTEST) player[pn].pdir=DirTable[conpee]; + if(player[pn].d==2) player[pn].pdir=DirTable[conpee]; if(player[pn].q==1 && (mx!=motion_None || my!=motion_None)) { player[pn].d = player[pn].info.dir; @@ -952,13 +952,14 @@ register KeyboardDef *def; #endif //#ifdef TESTCONTROLNOISY if(testcontrolnoisy > 0) -//if((inpu.Keyboard[def->up] || inpu.Keyboard[def->down] || inpu.Keyboard[def->left] || inpu.Keyboard[def->right]) && NDIRECTIONIFELSEGFXTEST) +if((inpu.Keyboard[def->up] || inpu.Keyboard[def->down] || inpu.Keyboard[def->left] || inpu.Keyboard[def->right]) || player[pn].q>1) { printf("q=%d ", player[pn].q); - printf("cpee=%d ", conpee); - printf("(mx)=%d ", mx); - printf("(my)=%d ", my); - printf("pdir=%d d=%d dir=%d\n", player[pn].pdir, player[pn].d, player[pn].info.dir); + printf("cpee=%c ", dirchar(conpee)); + //printf("(mx)=%d ", mx); + //printf("(my)=%d ", my); + printf("pdir=%c d=%c dir=%c", dirchar(player[pn].pdir), dirchar(player[pn].d), dirchar(player[pn].info.dir)); + 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]); } //#endif } diff --git a/src/lib/16_in.h b/src/lib/16_in.h index 9f900aa5..760b5bb2 100755 --- a/src/lib/16_in.h +++ b/src/lib/16_in.h @@ -46,8 +46,9 @@ extern byte testkeyin,testcontrolnoisy; //if else for gfxtesting and direction //player[pn].d == 2 || +//player[pn].d != 2 || #define DIRECTIONIFELSEGFXTEST (player[pn].info.dir == 2) -//#define NDIRECTIONIFELSEGFXTEST (player[pn].d != 2 || player[pn].info.dir != 2) +#define NDIRECTIONIFELSEGFXTEST (player[pn].info.dir != 2) #define KeyInt 9 // The keyboard ISR number