X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Fjoystick.cpp;h=2de43cecfabd054952d95b013381141a014acf98;hb=f0e50fb1d23805881b72d51ea603be78b645ec97;hp=057d059bf7ef756aa09dd20f68373a4837d99442;hpb=94e1e961b57f253b760298ab0bae96a7de6d20fa;p=virtualjaguar diff --git a/src/joystick.cpp b/src/joystick.cpp index 057d059..2de43ce 100644 --- a/src/joystick.cpp +++ b/src/joystick.cpp @@ -52,6 +52,9 @@ static uint8 joystick_ram[4]; static uint8 joypad_0_buttons[21]; static uint8 joypad_1_buttons[21]; + +bool keyBuffer[21]; + //extern bool finished; ////extern bool showGUI; bool GUIKeyHeld = false; @@ -95,6 +98,7 @@ void JoystickExec(void) // Keybindings in order of U, D, L, R, C, B, A, Op, Pa, 0-9, #, * // vjs.p1KeyBindings[0] = sdlemu_getval_int("p1k_up", SDLK_UP); +#if 0 if (keystate[vjs.p1KeyBindings[0]]) joypad_0_buttons[BUTTON_U] = 0x01; if (keystate[vjs.p1KeyBindings[1]]) @@ -110,6 +114,23 @@ void JoystickExec(void) joypad_0_buttons[BUTTON_B] = 0x01; if (keystate[vjs.p1KeyBindings[6]]) joypad_0_buttons[BUTTON_A] = 0x01; +#else + if (keyBuffer[0]) + joypad_0_buttons[BUTTON_U] = 0x01; + if (keyBuffer[1]) + joypad_0_buttons[BUTTON_D] = 0x01; + if (keyBuffer[2]) + joypad_0_buttons[BUTTON_L] = 0x01; + if (keyBuffer[3]) + joypad_0_buttons[BUTTON_R] = 0x01; + // The buttons are labelled C,B,A on the controller (going from left to right) + if (keyBuffer[4]) + joypad_0_buttons[BUTTON_C] = 0x01; + if (keyBuffer[5]) + joypad_0_buttons[BUTTON_B] = 0x01; + if (keyBuffer[6]) + joypad_0_buttons[BUTTON_A] = 0x01; +#endif //I may yet move these to O and P... if (keystate[vjs.p1KeyBindings[7]]) joypad_0_buttons[BUTTON_OPTION] = 0x01;