#include "../common/input_pico.h"
#include "../common/plat_sdl.h"
-const struct in_default_bind in_sdl_defbinds[] = {
+const struct in_default_bind _in_sdl_defbinds[] = {
{ SDLK_UP, IN_BINDTYPE_PLAYER12, GBTN_UP },
{ SDLK_DOWN, IN_BINDTYPE_PLAYER12, GBTN_DOWN },
{ SDLK_LEFT, IN_BINDTYPE_PLAYER12, GBTN_LEFT },
{ SDLK_BACKSPACE, IN_BINDTYPE_EMU, PEVB_FF },
{ 0, 0, 0 }
};
+const struct in_default_bind *in_sdl_defbinds = _in_sdl_defbinds;
const struct menu_keymap _in_sdl_key_map[] = {
{ SDLK_UP, PBTN_UP },
static int shadow_size;
static struct area { int w, h; } area;
-static struct in_pdata in_sdl_platform_data = {
- .defbinds = in_sdl_defbinds,
-};
+static struct in_pdata in_sdl_platform_data;
static int sound_rates[] = { 8000, 11025, 16000, 22050, 32000, 44100, 53000, -1 };
struct plat_target plat_target = { .sound_rates = sound_rates };
g_screen_ptr = shadow_fb;
plat_target_setup_input();
+ in_sdl_platform_data.defbinds = in_sdl_defbinds,
in_sdl_platform_data.kmap_size = in_sdl_key_map_sz,
in_sdl_platform_data.key_map = in_sdl_key_map,
in_sdl_platform_data.jmap_size = in_sdl_joy_map_sz,
-extern const struct in_default_bind in_sdl_defbinds[];
+extern const struct in_default_bind *in_sdl_defbinds;
extern const struct menu_keymap *in_sdl_key_map;
extern const int in_sdl_key_map_sz;
extern const struct menu_keymap *in_sdl_joy_map;
#include "../common/plat_sdl.h"
#include "../common/emu.h"
-const struct in_default_bind in_sdl_defbinds[] = {
+struct in_default_bind _in_sdl_defbinds[] = {
{ SDLK_UP, IN_BINDTYPE_PLAYER12, GBTN_UP },
{ SDLK_DOWN, IN_BINDTYPE_PLAYER12, GBTN_DOWN },
{ SDLK_LEFT, IN_BINDTYPE_PLAYER12, GBTN_LEFT },
{ SDLK_SPACE, IN_BINDTYPE_EMU, PEVB_FF },
{ 0, 0, 0 }
};
+const struct in_default_bind *in_sdl_defbinds = _in_sdl_defbinds;
struct menu_keymap _in_sdl_key_map[] = {
{ SDLK_UP, PBTN_UP },
}
}
+static void bindswap(int k1, int k2)
+{
+ int i;
+
+ for (i = 0; _in_sdl_defbinds[i].code; i++)
+ if (_in_sdl_defbinds[i].code == k1)
+ _in_sdl_defbinds[i].code = k2;
+}
+
void plat_target_setup_input(void)
{
if (strcmp(plat_device, "miyoo") == 0) {
keyswap(SDLK_LALT, SDLK_LCTRL);
nameswap(SDLK_LALT, SDLK_LCTRL);
nameswap(SDLK_SPACE, SDLK_LSHIFT);
+ bindswap(SDLK_ESCAPE, SDLK_RCTRL);
} else if (strcmp(plat_device, "gcw0") == 0) {
/* swapped X/Y keys, single L/R keys */
nameswap(SDLK_SPACE, SDLK_LSHIFT);