From: sparky4 Date: Mon, 29 Jun 2015 17:39:26 +0000 (-0500) Subject: input perfected and ready for graphical system! X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=dcc1bead76a272cba47fdb238e25bc123047b888;p=16.git input perfected and ready for graphical system! deleted: 16.LIB deleted: GFX.LIB modified: inputest.exe modified: src/lib/16_in.c modified: src/lib/16_in.h modified: src/lib/lib_head.h --- diff --git a/16.LIB b/16.LIB deleted file mode 100644 index f2152fb3..00000000 Binary files a/16.LIB and /dev/null differ diff --git a/GFX.LIB b/GFX.LIB deleted file mode 100644 index 2dc73f5f..00000000 Binary files a/GFX.LIB and /dev/null differ diff --git a/inputest.exe b/inputest.exe index 43c45e3a..30685259 100644 Binary files a/inputest.exe and b/inputest.exe differ diff --git a/src/lib/16_in.c b/src/lib/16_in.c index b19702d0..539c8c3c 100644 --- a/src/lib/16_in.c +++ b/src/lib/16_in.c @@ -149,12 +149,15 @@ static byte far ASCIINames[] = // Unshifted ASCII for scan codes static Direction DirTable[] = // Quick lookup for total direction { - //dir_Nortinest, - dir_North, + //dir_Nortinest, + dir_North, + dir_West, + dir_None, + dir_East, + dir_South //dir_NorthEast, - dir_West, dir_None, dir_East, //dir_Soutinest, - dir_South//,dir_SouthEast + //,dir_SouthEast }; #ifdef __cplusplus } @@ -674,7 +677,7 @@ IN_Default(boolean gotit,player_t *player,ControlType nt) || ((nt == ctrl_Joypad2) && !inpu.JoyPadPresent[1]) ) nt = ctrl_Keyboard1; - inpu.KbdDefs[0].button0 = 0x1d; + inpu.KbdDefs[0].button0 = 0x1c; inpu.KbdDefs[0].button1 = 0x38; //in.KbdDefs[0].upleft = 0x47; inpu.KbdDefs[0].up = 0x48; @@ -846,18 +849,18 @@ register KeyboardDef *def; else if (Keyboard[def->downright]) mx = motion_Right,my = motion_Down;*/ - if(!inpu.Keyboard[def->left] && !inpu.Keyboard[def->right]){ + //if(!inpu.Keyboard[def->left] && !inpu.Keyboard[def->right]){ if (inpu.Keyboard[def->up]) my = motion_Up; else if (inpu.Keyboard[def->down]) my = motion_Down; - }else if(!inpu.Keyboard[def->up] && !inpu.Keyboard[def->down]){ + //}else if(!inpu.Keyboard[def->up] && !inpu.Keyboard[def->down]){ if (inpu.Keyboard[def->left]) mx = motion_Left; else if (inpu.Keyboard[def->right]) mx = motion_Right; - } + //} if (inpu.Keyboard[def->button0]) buttons += 1 << 0; if (inpu.Keyboard[def->button1]) @@ -903,7 +906,8 @@ register KeyboardDef *def; player[playnum].info.button1 = buttons & (1 << 1); player[playnum].info.button2 = buttons & (1 << 2); player[playnum].info.button3 = buttons & (1 << 3); - player[playnum].info.dir = DirTable[((my + 1) * 3) + (mx + 1)]; +// player[playnum].info.dir = DirTable[((my + 1) * 3) + (mx + 1)]; + player[playnum].info.dir = DirTable[(((my + 1) * 2) + (mx + 1))-1]; #if DEMO0 if (DemoMode == demo_Record) @@ -930,8 +934,13 @@ register KeyboardDef *def; } } #endif -#ifdef TESTCONTROLNOISY -printf("dir=%d\n", player[playnum].info.dir); +#ifdef TESTCONTROLNOISY +if(inpu.Keyboard[def->up] || inpu.Keyboard[def->down] || inpu.Keyboard[def->left] || inpu.Keyboard[def->right]) +{ + printf("(mx)=%d ", mx); + printf("(my)=%d ", my); + printf("dir=%d\n", player[playnum].info.dir); +} #endif } diff --git a/src/lib/16_in.h b/src/lib/16_in.h index efe70039..5aeecc07 100644 --- a/src/lib/16_in.h +++ b/src/lib/16_in.h @@ -30,12 +30,14 @@ #include #include "src/lib/lib_head.h" -//++++#ifdef __DEBUG__ +#ifdef __DEBUG__ #define __DEBUG_InputMgr__ -//++++#endif +#endif +#ifdef __DEBUG_InputMgr__ #define TESTKEYIN -//#define TESTCONTROLNOISY +#define TESTCONTROLNOISY +#endif #define KeyInt 9 // The keyboard ISR number @@ -164,12 +166,12 @@ typedef enum { motion_None = 0, motion_Right = 1,motion_Down = 1 } Motion; -typedef enum { - dir_North,//dir_NorthEast, - dir_East,//dir_SouthEast, - dir_South,//dir_Soutinest, - dir_West,//dir_Nortinest, - dir_None +typedef enum { + dir_North,//dir_NorthEast, + dir_West,//dir_Nortinest, + dir_None, + dir_East,//,dir_SouthEast, + dir_South,//dir_Soutinest, } Direction; typedef struct { boolean button0,button1,button2,button3; @@ -181,11 +183,12 @@ typedef struct { typedef struct { ScanCode button0,button1, //upleft, - up, + up, + down, + left, + right //upright, - left, right, //downleft, - down //,downright ; } KeyboardDef; diff --git a/src/lib/lib_head.h b/src/lib/lib_head.h index cf50054d..225af5d3 100644 --- a/src/lib/lib_head.h +++ b/src/lib/lib_head.h @@ -127,6 +127,8 @@ static dword far* clockdw= (dword far*) 0x046C; /* 18.2hz clock */ #define nil ((void *)0) +#define __DEBUG__ + #define peekb(segm,ofs) (*(byte far*)MK_FP((segm),(ofs))) #define peekw(segm,ofs) (*(word far*)MK_FP((segm),(ofs))) #define pokeb(segm,ofs,value) (peekb((segm),(ofs)) = (byte)(value))