\r
static Direction DirTable[] = // Quick lookup for total direction\r
{\r
- //dir_Nortinest,\r
- dir_North,\r
+ //dir_Nortinest,
+ dir_North,
+ dir_West,\r
+ dir_None, \r
+ dir_East,
+ dir_South
//dir_NorthEast,\r
- dir_West, dir_None, dir_East,\r
//dir_Soutinest,\r
- dir_South//,dir_SouthEast\r
+ //,dir_SouthEast\r
};\r
#ifdef __cplusplus\r
}\r
|| ((nt == ctrl_Joypad2) && !inpu.JoyPadPresent[1])\r
)\r
nt = ctrl_Keyboard1;\r
- inpu.KbdDefs[0].button0 = 0x1d;\r
+ inpu.KbdDefs[0].button0 = 0x1c;\r
inpu.KbdDefs[0].button1 = 0x38;\r
//in.KbdDefs[0].upleft = 0x47;\r
inpu.KbdDefs[0].up = 0x48;\r
word buttons;\r
int dx,dy;\r
Motion mx,my;\r
- ControlType type;\r
+ ControlType type;
+ sword conpee;\r
register KeyboardDef *def;\r
\r
dx = dy = 0;\r
else if (Keyboard[def->downright])\r
mx = motion_Right,my = motion_Down;*/\r
\r
- if(!inpu.Keyboard[def->left] && !inpu.Keyboard[def->right]){\r
- if (inpu.Keyboard[def->up])\r
+ if(!inpu.Keyboard[def->left] && !inpu.Keyboard[def->right]){
+ \r
+ if((inpu.Keyboard[def->up] && !inpu.Keyboard[def->down] && player[playnum].info.dir == 2))// || player[playnum].info.dir == 0)\r
my = motion_Up;\r
- else if (inpu.Keyboard[def->down])\r
+ if((inpu.Keyboard[def->down] && !inpu.Keyboard[def->up] && player[playnum].info.dir == 2))// || player[playnum].info.dir == 4)\r
my = motion_Down;\r
\r
}else if(!inpu.Keyboard[def->up] && !inpu.Keyboard[def->down]){\r
- if (inpu.Keyboard[def->left])\r
+ if((inpu.Keyboard[def->left] && !inpu.Keyboard[def->right] && player[playnum].info.dir == 2))// || player[playnum].info.dir == 1)\r
mx = motion_Left;\r
- else if (inpu.Keyboard[def->right])\r
+ if((inpu.Keyboard[def->right] && !inpu.Keyboard[def->left] && player[playnum].info.dir == 2))// || player[playnum].info.dir == 3)\r
mx = motion_Right;\r
}\r
if (inpu.Keyboard[def->button0])\r
player[playnum].info.button1 = buttons & (1 << 1);\r
player[playnum].info.button2 = buttons & (1 << 2);\r
player[playnum].info.button3 = buttons & (1 << 3);\r
- player[playnum].info.dir = DirTable[((my + 1) * 3) + (mx + 1)];\r
+// player[playnum].info.dir = DirTable[((my + 1) * 3) + (mx + 1)];
+ conpee=(((my + 1) * 2) + (mx + 1));
+ if(conpee) conpee--;
+ player[playnum].info.dir = DirTable[conpee];\r
\r
#if DEMO0\r
if (DemoMode == demo_Record)\r
}\r
}\r
#endif\r
-#ifdef TESTCONTROLNOISY\r
-printf("dir=%d\n", player[playnum].info.dir);\r
+#ifdef TESTCONTROLNOISY
+if((inpu.Keyboard[def->up] || inpu.Keyboard[def->down] || inpu.Keyboard[def->left] || inpu.Keyboard[def->right])&& player[playnum].info.dir!=2)
+{
+ printf("(mx)=%d ", mx);
+ printf("(my)=%d ", my);
+ printf("dir=%d\n", player[playnum].info.dir);
+}\r
#endif\r
}\r
\r
}\r
\r
boolean IN_qb(byte kee)\r
-{\r
- printf("%u\n", inpu.Keyboard[kee]);\r
+{
+ #ifdef TESTKEYIN\r
+ printf("%u\n", inpu.Keyboard[kee]);
+ #endif\r
if(inpu.Keyboard[kee]==true) return 1;\r
else return 0;\r
}\r