From: Javier S. Pedro Date: Sun, 21 Mar 2010 15:42:34 +0000 (+0100) Subject: fixing zeemote without keyboard bug X-Git-Tag: drnoksnes_1_3_2~1 X-Git-Url: https://vcs.maemo.org/git/?p=drnoksnes;a=commitdiff_plain;h=4c8c4753e08868ddd3ebb2e8d4cfdb825103bd22 fixing zeemote without keyboard bug --- diff --git a/platform/sdli.cpp b/platform/sdli.cpp index 21adc45..a3c4745 100644 --- a/platform/sdli.cpp +++ b/platform/sdli.cpp @@ -245,6 +245,10 @@ void S9xInitInputDevices() mouse.enabled = false; mouse.pressed = false; +#if CONF_ZEEMOTE + ZeeInit(); +#endif + if (Config.joypad1Enabled) { joypads[0] = 0x80000000UL; } @@ -266,24 +270,20 @@ void S9xInitInputDevices() } printf("\n"); -#if CONF_ZEEMOTE - ZeeInit(); -#endif - - // TODO Non-awful mouse support, Superscope + // TODO Non-awful mouse & superscope support S9xInputScreenChanged(); } void S9xDeinitInputDevices() { +#if CONF_ZEEMOTE + ZeeQuit(); +#endif joypads[0] = 0; joypads[1] = 0; mouse.enabled = false; mouse.pressed = false; -#if CONF_ZEEMOTE - ZeeQuit(); -#endif } void S9xInputScreenChanged() diff --git a/platform/zeemote.cpp b/platform/zeemote.cpp index a6b85a7..ff4590d 100644 --- a/platform/zeemote.cpp +++ b/platform/zeemote.cpp @@ -81,14 +81,18 @@ void ZeeInit() if (enabled[0] && scan_result->number_of_devices > 0) { players[0].zeemote = zeemote_connect(&scan_result->device[0].bdaddr); - if (!players[0].zeemote) { + if (players[0].zeemote) { + Config.joypad1Enabled = true; + } else { fprintf(stderr, "Zeemote: Failed to connect for player %d", 1); } } if (enabled[1] && scan_result->number_of_devices > 1) { players[1].zeemote = zeemote_connect(&scan_result->device[1].bdaddr); - if (!players[1].zeemote) { + if (players[1].zeemote) { + Config.joypad2Enabled = true; + } else { fprintf(stderr, "Zeemote: Failed to connect for player %d", 2); } }