(Win32) Some Win32 compatibility patches (courtesy of mudlord)
[picodrive.git] / platform / gp2x / plat.c
index d20fc22..2a3b079 100644 (file)
@@ -1,7 +1,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <stdarg.h>
 
 #include "plat_gp2x.h"
 #include "soc.h"
@@ -42,6 +41,29 @@ static const char * const caanoo_keys[KEY_MAX + 1] = {
        [BTN_BASE5]     = "Push",
 };
 
+struct in_default_bind in_evdev_defbinds[] =
+{
+       /* MXYZ SACB RLDU */
+       { KEY_UP,       IN_BINDTYPE_PLAYER12, 0 },
+       { KEY_DOWN,     IN_BINDTYPE_PLAYER12, 1 },
+       { KEY_LEFT,     IN_BINDTYPE_PLAYER12, 2 },
+       { KEY_RIGHT,    IN_BINDTYPE_PLAYER12, 3 },
+       { KEY_S,        IN_BINDTYPE_PLAYER12, 4 },      /* B */
+       { KEY_D,        IN_BINDTYPE_PLAYER12, 5 },      /* C */
+       { KEY_A,        IN_BINDTYPE_PLAYER12, 6 },      /* A */
+       { KEY_ENTER,    IN_BINDTYPE_PLAYER12, 7 },
+       { KEY_BACKSLASH, IN_BINDTYPE_EMU, PEVB_MENU },
+       /* Caanoo */
+       { BTN_THUMB,    IN_BINDTYPE_PLAYER12, 4 },      /* B */
+       { BTN_THUMB2,   IN_BINDTYPE_PLAYER12, 5 },      /* C */
+       { BTN_TRIGGER,  IN_BINDTYPE_PLAYER12, 6 },      /* A */
+       { BTN_BASE3,    IN_BINDTYPE_PLAYER12, 7 },
+       { BTN_TOP2,     IN_BINDTYPE_EMU, PEVB_STATE_SAVE },
+       { BTN_PINKIE,   IN_BINDTYPE_EMU, PEVB_STATE_LOAD },
+       { BTN_BASE,     IN_BINDTYPE_EMU, PEVB_MENU },
+       { 0, 0, 0 }
+};
+
 void gp2x_video_changemode(int bpp)
 {
        gp2x_video_changemode_ll(bpp);
@@ -176,13 +198,11 @@ void plat_init(void)
        // use buffer2 for menubg to save mem (using only buffers 0, 1 in menu)
        g_menubg_ptr = gp2x_screens[2];
 
-       // snd
-       sndout_oss_init();
-
        if (gp2x_dev_id == GP2X_DEV_CAANOO)
                in_set_config(in_name_to_id("evdev:pollux-analog"), IN_CFG_KEY_NAMES,
                                caanoo_keys, sizeof(caanoo_keys));
 
+       flip_after_sync = 1;
        gp2x_menu_init();
 }
 
@@ -205,16 +225,5 @@ void plat_finish(void)
                dummy_finish();
                break;
        }
-
-       sndout_oss_exit();
-}
-
-void lprintf(const char *fmt, ...)
-{
-       va_list vl;
-
-       va_start(vl, fmt);
-       vprintf(fmt, vl);
-       va_end(vl);
 }