fixing zeemote without keyboard bug
authorJavier S. Pedro <maemo@javispedro.com>
Sun, 21 Mar 2010 15:42:34 +0000 (16:42 +0100)
committerJavier S. Pedro <maemo@javispedro.com>
Sun, 21 Mar 2010 15:42:34 +0000 (16:42 +0100)
platform/sdli.cpp
platform/zeemote.cpp

index 21adc45..a3c4745 100644 (file)
@@ -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()
index a6b85a7..ff4590d 100644 (file)
@@ -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);
                }
        }