mirror of
https://github.com/libretro/RetroArch
synced 2025-01-18 13:23:40 +00:00
(Wii) Big GUI settings cleanup, added initial controller settings support
*NOTE: Settings currently do not save*
This commit is contained in:
parent
091e91b945
commit
abcd2e50ac
@ -44,7 +44,6 @@ struct rgui_handle
|
||||
rgui_list_t *folder_buf;
|
||||
int directory_ptr;
|
||||
bool need_refresh;
|
||||
rgui_mode_t mode;
|
||||
|
||||
char path_buf[PATH_MAX];
|
||||
|
||||
@ -52,13 +51,37 @@ struct rgui_handle
|
||||
uint16_t font_green[256][FONT_HEIGHT][FONT_WIDTH];
|
||||
};
|
||||
|
||||
static char *rgui_device_lables[] = {
|
||||
static const char *rgui_device_lables[] = {
|
||||
"GameCube Controller",
|
||||
"Wiimote",
|
||||
"Wiimote + Nunchuk",
|
||||
"Classic Controller",
|
||||
"GameCube Controller"
|
||||
};
|
||||
|
||||
static const unsigned rgui_controller_lut[] = {
|
||||
RETRO_DEVICE_ID_JOYPAD_UP,
|
||||
RETRO_DEVICE_ID_JOYPAD_DOWN,
|
||||
RETRO_DEVICE_ID_JOYPAD_LEFT,
|
||||
RETRO_DEVICE_ID_JOYPAD_RIGHT,
|
||||
RETRO_DEVICE_ID_JOYPAD_A,
|
||||
RETRO_DEVICE_ID_JOYPAD_B,
|
||||
RETRO_DEVICE_ID_JOYPAD_X,
|
||||
RETRO_DEVICE_ID_JOYPAD_Y,
|
||||
RETRO_DEVICE_ID_JOYPAD_START,
|
||||
RETRO_DEVICE_ID_JOYPAD_SELECT,
|
||||
RETRO_DEVICE_ID_JOYPAD_L,
|
||||
RETRO_DEVICE_ID_JOYPAD_R,
|
||||
RETRO_DEVICE_ID_JOYPAD_L2,
|
||||
RETRO_DEVICE_ID_JOYPAD_R2,
|
||||
RETRO_DEVICE_ID_JOYPAD_L3,
|
||||
RETRO_DEVICE_ID_JOYPAD_R3,
|
||||
};
|
||||
|
||||
static inline bool rgui_is_controller_menu(rgui_file_type_t menu_type)
|
||||
{
|
||||
return (menu_type >= RGUI_SETTINGS_CONTROLLER_1 && menu_type <= RGUI_SETTINGS_CONTROLLER_4);
|
||||
}
|
||||
|
||||
static void copy_glyph(uint16_t glyph_white[FONT_HEIGHT][FONT_WIDTH],
|
||||
uint16_t glyph_green[FONT_HEIGHT][FONT_WIDTH],
|
||||
const uint8_t *buf)
|
||||
@ -194,15 +217,16 @@ static void render_text(rgui_handle_t *rgui, size_t begin, size_t end)
|
||||
render_background(rgui);
|
||||
|
||||
char title[TERM_WIDTH];
|
||||
if (rgui->mode == RGUI_FILEBROWSER)
|
||||
const char *dir;
|
||||
rgui_file_type_t menu_type;
|
||||
rgui_list_back(rgui->path_stack, &dir, &menu_type, NULL);
|
||||
if (!rgui_is_controller_menu(menu_type) && menu_type != RGUI_SETTINGS)
|
||||
{
|
||||
const char *dir;
|
||||
rgui_list_back(rgui->path_stack, &dir, NULL, NULL);
|
||||
snprintf(title, sizeof(title), "FILE BROWSER: %s", dir);
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf(title, sizeof(title), "SETTINGS");
|
||||
snprintf(title, sizeof(title), "SETTINGS: %s", dir);
|
||||
}
|
||||
blit_line(rgui, TERM_START_X + 15, 15, title, true);
|
||||
|
||||
@ -214,10 +238,10 @@ static void render_text(rgui_handle_t *rgui, size_t begin, size_t end)
|
||||
const char *path;
|
||||
rgui_file_type_t type;
|
||||
rgui_list_at(rgui->folder_buf, i, &path, &type, NULL);
|
||||
|
||||
char message[TERM_WIDTH + 1];
|
||||
char type_str[TERM_WIDTH + 1];
|
||||
int w = 19;
|
||||
int w = rgui_is_controller_menu(menu_type) ? 26 : 19;
|
||||
unsigned port = menu_type - RGUI_SETTINGS_CONTROLLER_1;
|
||||
switch (type)
|
||||
{
|
||||
case RGUI_FILE_PLAIN:
|
||||
@ -241,15 +265,34 @@ static void render_text(rgui_handle_t *rgui, size_t begin, size_t end)
|
||||
case RGUI_SETTINGS_AUDIO_CONTROL_RATE:
|
||||
snprintf(type_str, sizeof(type_str), "%.3f", g_settings.audio.rate_control_delta);
|
||||
break;
|
||||
case RGUI_SETTINGS_CONTROLLER_DEVICE_1:
|
||||
case RGUI_SETTINGS_CONTROLLER_DEVICE_2:
|
||||
case RGUI_SETTINGS_CONTROLLER_DEVICE_3:
|
||||
case RGUI_SETTINGS_CONTROLLER_DEVICE_4:
|
||||
{
|
||||
unsigned i = type - RGUI_SETTINGS_CONTROLLER_DEVICE_1;
|
||||
snprintf(type_str, sizeof(type_str), "%s", rgui_device_lables[g_settings.input.device[i]]);
|
||||
case RGUI_SETTINGS_CONTROLLER_1:
|
||||
case RGUI_SETTINGS_CONTROLLER_2:
|
||||
case RGUI_SETTINGS_CONTROLLER_3:
|
||||
case RGUI_SETTINGS_CONTROLLER_4:
|
||||
snprintf(type_str, sizeof(type_str), "...");
|
||||
break;
|
||||
case RGUI_SETTINGS_BIND_DEVICE:
|
||||
RARCH_LOG("%d\n", port);
|
||||
snprintf(type_str, sizeof(type_str), "%s", rgui_device_lables[g_settings.input.device[port]]);
|
||||
break;
|
||||
case RGUI_SETTINGS_BIND_UP:
|
||||
case RGUI_SETTINGS_BIND_DOWN:
|
||||
case RGUI_SETTINGS_BIND_LEFT:
|
||||
case RGUI_SETTINGS_BIND_RIGHT:
|
||||
case RGUI_SETTINGS_BIND_A:
|
||||
case RGUI_SETTINGS_BIND_B:
|
||||
case RGUI_SETTINGS_BIND_X:
|
||||
case RGUI_SETTINGS_BIND_Y:
|
||||
case RGUI_SETTINGS_BIND_START:
|
||||
case RGUI_SETTINGS_BIND_SELECT:
|
||||
case RGUI_SETTINGS_BIND_L:
|
||||
case RGUI_SETTINGS_BIND_R:
|
||||
case RGUI_SETTINGS_BIND_L2:
|
||||
case RGUI_SETTINGS_BIND_R2:
|
||||
case RGUI_SETTINGS_BIND_L3:
|
||||
case RGUI_SETTINGS_BIND_R3:
|
||||
snprintf(type_str, sizeof(type_str), "%s", rarch_input_find_platform_key_label(g_settings.input.binds[port][rgui_controller_lut[type - RGUI_SETTINGS_BIND_UP]].joykey));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
type_str[0] = 0;
|
||||
w = 0;
|
||||
@ -304,8 +347,9 @@ static void render_messagebox(rgui_handle_t *rgui, const char *message)
|
||||
free(msg);
|
||||
}
|
||||
|
||||
static void rgui_settings_toggle_setting(rgui_file_type_t setting, rgui_action_t action)
|
||||
static void rgui_settings_toggle_setting(rgui_file_type_t setting, rgui_action_t action, rgui_file_type_t menu_type)
|
||||
{
|
||||
unsigned port = menu_type - RGUI_SETTINGS_CONTROLLER_1;
|
||||
switch (setting)
|
||||
{
|
||||
case RGUI_SETTINGS_VIDEO_FILTER:
|
||||
@ -328,43 +372,100 @@ static void rgui_settings_toggle_setting(rgui_file_type_t setting, rgui_action_t
|
||||
else if (action == RGUI_ACTION_RIGHT)
|
||||
rarch_settings_change(S_AUDIO_CONTROL_RATE_INCREMENT);
|
||||
break;
|
||||
case RGUI_SETTINGS_CONTROLLER_DEVICE_1:
|
||||
case RGUI_SETTINGS_CONTROLLER_DEVICE_2:
|
||||
case RGUI_SETTINGS_CONTROLLER_DEVICE_3:
|
||||
case RGUI_SETTINGS_CONTROLLER_DEVICE_4:
|
||||
{
|
||||
unsigned i = setting - RGUI_SETTINGS_CONTROLLER_DEVICE_1;
|
||||
g_settings.input.device[i] += RARCH_DEVICE_LAST;
|
||||
if (action == RGUI_ACTION_START)
|
||||
g_settings.input.device[i] = 0;
|
||||
else if (action == RGUI_ACTION_LEFT)
|
||||
g_settings.input.device[i]--;
|
||||
else if (action == RGUI_ACTION_RIGHT)
|
||||
g_settings.input.device[i]++;
|
||||
|
||||
g_settings.input.device[i] %= RARCH_DEVICE_LAST;
|
||||
// controllers
|
||||
case RGUI_SETTINGS_BIND_DEVICE:
|
||||
g_settings.input.device[port] += RARCH_DEVICE_LAST;
|
||||
if (action == RGUI_ACTION_START)
|
||||
g_settings.input.device[port] = 0;
|
||||
else if (action == RGUI_ACTION_LEFT)
|
||||
g_settings.input.device[port]--;
|
||||
else if (action == RGUI_ACTION_RIGHT)
|
||||
g_settings.input.device[port]++;
|
||||
g_settings.input.device[port] %= RARCH_DEVICE_LAST;
|
||||
input_wii.set_default_keybind_lut(g_settings.input.device[port], port);
|
||||
rarch_input_set_default_keybinds(port);
|
||||
break;
|
||||
case RGUI_SETTINGS_BIND_UP:
|
||||
case RGUI_SETTINGS_BIND_DOWN:
|
||||
case RGUI_SETTINGS_BIND_LEFT:
|
||||
case RGUI_SETTINGS_BIND_RIGHT:
|
||||
case RGUI_SETTINGS_BIND_A:
|
||||
case RGUI_SETTINGS_BIND_B:
|
||||
case RGUI_SETTINGS_BIND_X:
|
||||
case RGUI_SETTINGS_BIND_Y:
|
||||
case RGUI_SETTINGS_BIND_START:
|
||||
case RGUI_SETTINGS_BIND_SELECT:
|
||||
case RGUI_SETTINGS_BIND_L:
|
||||
case RGUI_SETTINGS_BIND_R:
|
||||
case RGUI_SETTINGS_BIND_L2:
|
||||
case RGUI_SETTINGS_BIND_R2:
|
||||
case RGUI_SETTINGS_BIND_L3:
|
||||
case RGUI_SETTINGS_BIND_R3:
|
||||
{
|
||||
unsigned keybind_action;
|
||||
|
||||
if (action == RGUI_ACTION_START)
|
||||
keybind_action = KEYBIND_DEFAULT;
|
||||
else if (action == RGUI_ACTION_LEFT)
|
||||
keybind_action = KEYBIND_DECREMENT;
|
||||
else if (action == RGUI_ACTION_RIGHT)
|
||||
keybind_action = KEYBIND_INCREMENT;
|
||||
else
|
||||
break;
|
||||
|
||||
rarch_input_set_keybind(port, keybind_action, rgui_controller_lut[setting - RGUI_SETTINGS_BIND_UP]);
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#define RGUI_MENU_ITEM(x, y) rgui_list_push(rgui->folder_buf, x, y, 0)
|
||||
|
||||
static void rgui_settings_populate_entries(rgui_handle_t *rgui)
|
||||
{
|
||||
rgui_list_clear(rgui->folder_buf);
|
||||
|
||||
#define RGUI_MENU_ITEM(x, y) rgui_list_push(rgui->folder_buf, x, y, 0)
|
||||
RGUI_MENU_ITEM("Hardware filtering", RGUI_SETTINGS_VIDEO_FILTER);
|
||||
RGUI_MENU_ITEM("Mute Audio", RGUI_SETTINGS_AUDIO_MUTE);
|
||||
RGUI_MENU_ITEM("Audio Control Rate", RGUI_SETTINGS_AUDIO_CONTROL_RATE);
|
||||
RGUI_MENU_ITEM("Controller #1 Device", RGUI_SETTINGS_CONTROLLER_DEVICE_1);
|
||||
RGUI_MENU_ITEM("Controller #2 Device", RGUI_SETTINGS_CONTROLLER_DEVICE_2);
|
||||
RGUI_MENU_ITEM("Controller #3 Device", RGUI_SETTINGS_CONTROLLER_DEVICE_3);
|
||||
RGUI_MENU_ITEM("Controller #4 Device", RGUI_SETTINGS_CONTROLLER_DEVICE_4);
|
||||
RGUI_MENU_ITEM("Controller #1 Config", RGUI_SETTINGS_CONTROLLER_1);
|
||||
RGUI_MENU_ITEM("Controller #2 Config", RGUI_SETTINGS_CONTROLLER_2);
|
||||
RGUI_MENU_ITEM("Controller #3 Config", RGUI_SETTINGS_CONTROLLER_3);
|
||||
RGUI_MENU_ITEM("Controller #4 Config", RGUI_SETTINGS_CONTROLLER_4);
|
||||
}
|
||||
|
||||
static bool rgui_settings_iterate(rgui_handle_t *rgui, rgui_action_t action)
|
||||
static void rgui_settings_controller_populate_entries(rgui_handle_t *rgui)
|
||||
{
|
||||
rgui_list_clear(rgui->folder_buf);
|
||||
|
||||
RGUI_MENU_ITEM("Device", RGUI_SETTINGS_BIND_DEVICE);
|
||||
RGUI_MENU_ITEM("Up", RGUI_SETTINGS_BIND_UP);
|
||||
RGUI_MENU_ITEM("Down", RGUI_SETTINGS_BIND_DOWN);
|
||||
RGUI_MENU_ITEM("Left", RGUI_SETTINGS_BIND_LEFT);
|
||||
RGUI_MENU_ITEM("Right", RGUI_SETTINGS_BIND_RIGHT);
|
||||
RGUI_MENU_ITEM("A", RGUI_SETTINGS_BIND_A);
|
||||
RGUI_MENU_ITEM("B", RGUI_SETTINGS_BIND_B);
|
||||
RGUI_MENU_ITEM("X", RGUI_SETTINGS_BIND_X);
|
||||
RGUI_MENU_ITEM("Y", RGUI_SETTINGS_BIND_Y);
|
||||
RGUI_MENU_ITEM("Start", RGUI_SETTINGS_BIND_START);
|
||||
RGUI_MENU_ITEM("Select", RGUI_SETTINGS_BIND_SELECT);
|
||||
RGUI_MENU_ITEM("L", RGUI_SETTINGS_BIND_L);
|
||||
RGUI_MENU_ITEM("R", RGUI_SETTINGS_BIND_R);
|
||||
RGUI_MENU_ITEM("L2", RGUI_SETTINGS_BIND_L2);
|
||||
RGUI_MENU_ITEM("R2", RGUI_SETTINGS_BIND_R2);
|
||||
RGUI_MENU_ITEM("L3", RGUI_SETTINGS_BIND_L3);
|
||||
RGUI_MENU_ITEM("R3", RGUI_SETTINGS_BIND_R3);
|
||||
}
|
||||
|
||||
static const char *rgui_settings_iterate(rgui_handle_t *rgui, rgui_action_t action)
|
||||
{
|
||||
rgui_file_type_t type;
|
||||
const char *label;
|
||||
rgui_list_at(rgui->folder_buf, rgui->directory_ptr, &label, &type, NULL);
|
||||
rgui_file_type_t menu_type;
|
||||
rgui_list_back(rgui->path_stack, NULL, &menu_type, NULL);
|
||||
switch (action)
|
||||
{
|
||||
case RGUI_ACTION_UP:
|
||||
@ -383,30 +484,51 @@ static bool rgui_settings_iterate(rgui_handle_t *rgui, rgui_action_t action)
|
||||
|
||||
case RGUI_ACTION_CANCEL:
|
||||
case RGUI_ACTION_SETTINGS:
|
||||
rgui->mode = RGUI_FILEBROWSER;
|
||||
return true;
|
||||
{
|
||||
size_t directory_ptr;
|
||||
rgui_list_back(rgui->path_stack, NULL, NULL, &directory_ptr);
|
||||
rgui_list_pop(rgui->path_stack);
|
||||
rgui->directory_ptr = directory_ptr;
|
||||
rgui->need_refresh = true;
|
||||
rgui_list_back(rgui->path_stack, NULL, &menu_type, NULL);
|
||||
if (menu_type != RGUI_SETTINGS && !rgui_is_controller_menu(menu_type))
|
||||
return NULL;
|
||||
break;
|
||||
}
|
||||
|
||||
case RGUI_ACTION_LEFT:
|
||||
case RGUI_ACTION_RIGHT:
|
||||
case RGUI_ACTION_OK:
|
||||
case RGUI_ACTION_START:
|
||||
{
|
||||
rgui_file_type_t type;
|
||||
rgui_list_at(rgui->folder_buf, rgui->directory_ptr, NULL, &type, NULL);
|
||||
rgui_settings_toggle_setting(type, action);
|
||||
if (rgui_is_controller_menu(type) && action == RGUI_ACTION_OK)
|
||||
{
|
||||
rgui_list_push(rgui->path_stack, label, type, rgui->directory_ptr);
|
||||
rgui->directory_ptr = 0;
|
||||
rgui->need_refresh = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
rgui_settings_toggle_setting(type, action, menu_type);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case RGUI_ACTION_REFRESH:
|
||||
rgui_settings_populate_entries(rgui);
|
||||
rgui->directory_ptr = 0;
|
||||
rgui->need_refresh = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (rgui->need_refresh)
|
||||
{
|
||||
if (rgui_is_controller_menu(menu_type))
|
||||
rgui_settings_controller_populate_entries(rgui);
|
||||
else
|
||||
rgui_settings_populate_entries(rgui);
|
||||
}
|
||||
|
||||
size_t begin = rgui->directory_ptr >= TERM_HEIGHT / 2 ?
|
||||
rgui->directory_ptr - TERM_HEIGHT / 2 : 0;
|
||||
size_t end = rgui->directory_ptr + TERM_HEIGHT <= rgui_list_size(rgui->folder_buf) ?
|
||||
@ -417,23 +539,17 @@ static bool rgui_settings_iterate(rgui_handle_t *rgui, rgui_action_t action)
|
||||
|
||||
render_text(rgui, begin, end);
|
||||
|
||||
return false;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const char *rgui_iterate(rgui_handle_t *rgui, rgui_action_t action)
|
||||
{
|
||||
start:
|
||||
if (rgui->mode == RGUI_SETTINGS)
|
||||
rgui_file_type_t menu_type;
|
||||
rgui_list_back(rgui->path_stack, NULL, &menu_type, NULL);
|
||||
|
||||
if (menu_type == RGUI_SETTINGS || rgui_is_controller_menu(menu_type))
|
||||
{
|
||||
if (rgui_settings_iterate(rgui, action))
|
||||
{
|
||||
action = RGUI_ACTION_REFRESH;
|
||||
goto start;
|
||||
}
|
||||
else
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
return rgui_settings_iterate(rgui, action);
|
||||
}
|
||||
|
||||
bool found = false;
|
||||
@ -529,9 +645,9 @@ const char *rgui_iterate(rgui_handle_t *rgui, rgui_action_t action)
|
||||
break;
|
||||
|
||||
case RGUI_ACTION_SETTINGS:
|
||||
rgui->mode = RGUI_SETTINGS;
|
||||
action = RGUI_ACTION_REFRESH;
|
||||
goto start;
|
||||
rgui_list_push(rgui->path_stack, "", RGUI_SETTINGS, rgui->directory_ptr);
|
||||
rgui->directory_ptr = 0;
|
||||
return rgui_settings_iterate(rgui, RGUI_ACTION_REFRESH);
|
||||
|
||||
default:
|
||||
break;
|
||||
|
@ -30,15 +30,34 @@ typedef enum
|
||||
RGUI_FILE_PLAIN,
|
||||
RGUI_FILE_DIRECTORY,
|
||||
RGUI_FILE_DEVICE,
|
||||
RGUI_SETTINGS,
|
||||
|
||||
// settings options are done here too
|
||||
RGUI_SETTINGS_VIDEO_FILTER,
|
||||
RGUI_SETTINGS_AUDIO_MUTE,
|
||||
RGUI_SETTINGS_AUDIO_CONTROL_RATE,
|
||||
RGUI_SETTINGS_CONTROLLER_DEVICE_1,
|
||||
RGUI_SETTINGS_CONTROLLER_DEVICE_2,
|
||||
RGUI_SETTINGS_CONTROLLER_DEVICE_3,
|
||||
RGUI_SETTINGS_CONTROLLER_DEVICE_4,
|
||||
RGUI_SETTINGS_CONTROLLER_1,
|
||||
RGUI_SETTINGS_CONTROLLER_2,
|
||||
RGUI_SETTINGS_CONTROLLER_3,
|
||||
RGUI_SETTINGS_CONTROLLER_4,
|
||||
|
||||
RGUI_SETTINGS_BIND_DEVICE,
|
||||
RGUI_SETTINGS_BIND_UP,
|
||||
RGUI_SETTINGS_BIND_DOWN,
|
||||
RGUI_SETTINGS_BIND_LEFT,
|
||||
RGUI_SETTINGS_BIND_RIGHT,
|
||||
RGUI_SETTINGS_BIND_A,
|
||||
RGUI_SETTINGS_BIND_B,
|
||||
RGUI_SETTINGS_BIND_X,
|
||||
RGUI_SETTINGS_BIND_Y,
|
||||
RGUI_SETTINGS_BIND_START,
|
||||
RGUI_SETTINGS_BIND_SELECT,
|
||||
RGUI_SETTINGS_BIND_L,
|
||||
RGUI_SETTINGS_BIND_R,
|
||||
RGUI_SETTINGS_BIND_L2,
|
||||
RGUI_SETTINGS_BIND_R2,
|
||||
RGUI_SETTINGS_BIND_L3,
|
||||
RGUI_SETTINGS_BIND_R3,
|
||||
} rgui_file_type_t;
|
||||
|
||||
typedef enum
|
||||
@ -57,12 +76,6 @@ typedef enum
|
||||
|
||||
typedef struct rgui_handle rgui_handle_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
RGUI_FILEBROWSER = 0,
|
||||
RGUI_SETTINGS
|
||||
} rgui_mode_t;
|
||||
|
||||
typedef void (*rgui_file_enum_cb_t)(void *ctx,
|
||||
const char *path, rgui_file_type_t file_type, size_t directory_ptr);
|
||||
typedef bool (*rgui_folder_enum_cb_t)(const char *directory,
|
||||
|
278
wii/gx_input.c
278
wii/gx_input.c
@ -161,82 +161,79 @@ static void reset_callback(void)
|
||||
|
||||
static void wii_input_set_analog_dpad_mapping(unsigned device, unsigned map_dpad_enum, unsigned controller_id)
|
||||
{
|
||||
(void)device; //TODO: Remove when you start using it in this function
|
||||
|
||||
#if defined(CLASSIC_PAD)
|
||||
switch(map_dpad_enum)
|
||||
switch (device)
|
||||
{
|
||||
case DPAD_EMULATION_NONE:
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_UP].joykey = platform_keys[WII_DEVICE_CLASSIC_ID_JOYPAD_UP].joykey;
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_DOWN].joykey = platform_keys[WII_DEVICE_CLASSIC_ID_JOYPAD_DOWN].joykey;
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_LEFT].joykey = platform_keys[WII_DEVICE_CLASSIC_ID_JOYPAD_LEFT].joykey;
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_RIGHT].joykey = platform_keys[WII_DEVICE_CLASSIC_ID_JOYPAD_RIGHT].joykey;
|
||||
break;
|
||||
case DPAD_EMULATION_LSTICK:
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_UP].joykey = platform_keys[WII_DEVICE_CLASSIC_ID_LSTICK_UP_DPAD].joykey;
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_DOWN].joykey = platform_keys[WII_DEVICE_CLASSIC_ID_LSTICK_DOWN_DPAD].joykey;
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_LEFT].joykey = platform_keys[WII_DEVICE_CLASSIC_ID_LSTICK_LEFT_DPAD].joykey;
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_RIGHT].joykey = platform_keys[WII_DEVICE_CLASSIC_ID_LSTICK_RIGHT_DPAD].joykey;
|
||||
break;
|
||||
case DPAD_EMULATION_RSTICK:
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_UP].joykey = platform_keys[WII_DEVICE_CLASSIC_ID_RSTICK_UP_DPAD].joykey;
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_DOWN].joykey = platform_keys[WII_DEVICE_CLASSIC_ID_RSTICK_DOWN_DPAD].joykey;
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_LEFT].joykey = platform_keys[WII_DEVICE_CLASSIC_ID_RSTICK_LEFT_DPAD].joykey;
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_RIGHT].joykey = platform_keys[WII_DEVICE_CLASSIC_ID_RSTICK_RIGHT_DPAD].joykey;
|
||||
break;
|
||||
}
|
||||
#elif defined(WIIMOTE_PAD)
|
||||
switch(map_dpad_enum)
|
||||
{
|
||||
case DPAD_EMULATION_LSTICK:
|
||||
case DPAD_EMULATION_RSTICK:
|
||||
case DPAD_EMULATION_NONE:
|
||||
case WII_DEVICE_WIIMOTE:
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_UP].joykey = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_UP].joykey;
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_DOWN].joykey = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_DOWN].joykey;
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_LEFT].joykey = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_LEFT].joykey;
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_RIGHT].joykey = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_RIGHT].joykey;
|
||||
break;
|
||||
}
|
||||
#elif defined(NUNCHUK_PAD)
|
||||
switch(map_dpad_enum)
|
||||
{
|
||||
case DPAD_EMULATION_LSTICK:
|
||||
case DPAD_EMULATION_RSTICK:
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_UP].joykey = platform_keys[WII_DEVICE_WIIMOTE_ID_LSTICK_UP_DPAD].joykey;
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_DOWN].joykey = platform_keys[WII_DEVICE_WIIMOTE_ID_LSTICK_DOWN_DPAD].joykey;
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_LEFT].joykey = platform_keys[WII_DEVICE_WIIMOTE_ID_LSTICK_LEFT_DPAD].joykey;
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_RIGHT].joykey = platform_keys[WII_DEVICE_WIIMOTE_ID_LSTICK_RIGHT_DPAD].joykey;
|
||||
case WII_DEVICE_NUNCHUK:
|
||||
if (map_dpad_enum == DPAD_EMULATION_NONE)
|
||||
{
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_UP].joykey = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_UP].joykey;
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_DOWN].joykey = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_DOWN].joykey;
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_LEFT].joykey = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_LEFT].joykey;
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_RIGHT].joykey = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_RIGHT].joykey;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_UP].joykey = platform_keys[WII_DEVICE_WIIMOTE_ID_LSTICK_UP_DPAD].joykey;
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_DOWN].joykey = platform_keys[WII_DEVICE_WIIMOTE_ID_LSTICK_DOWN_DPAD].joykey;
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_LEFT].joykey = platform_keys[WII_DEVICE_WIIMOTE_ID_LSTICK_LEFT_DPAD].joykey;
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_RIGHT].joykey = platform_keys[WII_DEVICE_WIIMOTE_ID_LSTICK_RIGHT_DPAD].joykey;
|
||||
}
|
||||
break;
|
||||
case DPAD_EMULATION_NONE:
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_UP].joykey = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_UP].joykey;
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_DOWN].joykey = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_DOWN].joykey;
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_LEFT].joykey = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_LEFT].joykey;
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_RIGHT].joykey = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_RIGHT].joykey;
|
||||
case WII_DEVICE_CLASSIC:
|
||||
if (map_dpad_enum == DPAD_EMULATION_NONE)
|
||||
{
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_UP].joykey = platform_keys[WII_DEVICE_CLASSIC_ID_JOYPAD_UP].joykey;
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_DOWN].joykey = platform_keys[WII_DEVICE_CLASSIC_ID_JOYPAD_DOWN].joykey;
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_LEFT].joykey = platform_keys[WII_DEVICE_CLASSIC_ID_JOYPAD_LEFT].joykey;
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_RIGHT].joykey = platform_keys[WII_DEVICE_CLASSIC_ID_JOYPAD_RIGHT].joykey;
|
||||
}
|
||||
else if (map_dpad_enum == DPAD_EMULATION_LSTICK)
|
||||
{
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_UP].joykey = platform_keys[WII_DEVICE_CLASSIC_ID_LSTICK_UP_DPAD].joykey;
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_DOWN].joykey = platform_keys[WII_DEVICE_CLASSIC_ID_LSTICK_DOWN_DPAD].joykey;
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_LEFT].joykey = platform_keys[WII_DEVICE_CLASSIC_ID_LSTICK_LEFT_DPAD].joykey;
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_RIGHT].joykey = platform_keys[WII_DEVICE_CLASSIC_ID_LSTICK_RIGHT_DPAD].joykey;
|
||||
}
|
||||
else if (map_dpad_enum == DPAD_EMULATION_RSTICK)
|
||||
{
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_UP].joykey = platform_keys[WII_DEVICE_CLASSIC_ID_RSTICK_UP_DPAD].joykey;
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_DOWN].joykey = platform_keys[WII_DEVICE_CLASSIC_ID_RSTICK_DOWN_DPAD].joykey;
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_LEFT].joykey = platform_keys[WII_DEVICE_CLASSIC_ID_RSTICK_LEFT_DPAD].joykey;
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_RIGHT].joykey = platform_keys[WII_DEVICE_CLASSIC_ID_RSTICK_RIGHT_DPAD].joykey;
|
||||
}
|
||||
break;
|
||||
case WII_DEVICE_GAMECUBE:
|
||||
if (map_dpad_enum == DPAD_EMULATION_NONE)
|
||||
{
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_UP].joykey = platform_keys[WII_DEVICE_GC_ID_JOYPAD_UP].joykey;
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_DOWN].joykey = platform_keys[WII_DEVICE_GC_ID_JOYPAD_DOWN].joykey;
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_LEFT].joykey = platform_keys[WII_DEVICE_GC_ID_JOYPAD_LEFT].joykey;
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_RIGHT].joykey = platform_keys[WII_DEVICE_GC_ID_JOYPAD_RIGHT].joykey;
|
||||
}
|
||||
else if (map_dpad_enum == DPAD_EMULATION_LSTICK)
|
||||
{
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_UP].joykey = platform_keys[WII_DEVICE_GC_ID_LSTICK_UP_DPAD].joykey;
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_DOWN].joykey = platform_keys[WII_DEVICE_GC_ID_LSTICK_DOWN_DPAD].joykey;
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_LEFT].joykey = platform_keys[WII_DEVICE_GC_ID_LSTICK_LEFT_DPAD].joykey;
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_RIGHT].joykey = platform_keys[WII_DEVICE_GC_ID_LSTICK_RIGHT_DPAD].joykey;
|
||||
}
|
||||
else if (map_dpad_enum == DPAD_EMULATION_RSTICK)
|
||||
{
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_UP].joykey = platform_keys[WII_DEVICE_GC_ID_RSTICK_UP_DPAD].joykey;
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_DOWN].joykey = platform_keys[WII_DEVICE_GC_ID_RSTICK_DOWN_DPAD].joykey;
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_LEFT].joykey = platform_keys[WII_DEVICE_GC_ID_RSTICK_LEFT_DPAD].joykey;
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_RIGHT].joykey = platform_keys[WII_DEVICE_GC_ID_RSTICK_RIGHT_DPAD].joykey;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
#elif defined(GAMECUBE_PAD)
|
||||
switch(map_dpad_enum)
|
||||
{
|
||||
case DPAD_EMULATION_NONE:
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_UP].joykey = platform_keys[WII_DEVICE_GC_ID_JOYPAD_UP].joykey;
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_DOWN].joykey = platform_keys[WII_DEVICE_GC_ID_JOYPAD_DOWN].joykey;
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_LEFT].joykey = platform_keys[WII_DEVICE_GC_ID_JOYPAD_LEFT].joykey;
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_RIGHT].joykey = platform_keys[WII_DEVICE_GC_ID_JOYPAD_RIGHT].joykey;
|
||||
break;
|
||||
case DPAD_EMULATION_LSTICK:
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_UP].joykey = platform_keys[WII_DEVICE_GC_ID_LSTICK_UP_DPAD].joykey;
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_DOWN].joykey = platform_keys[WII_DEVICE_GC_ID_LSTICK_DOWN_DPAD].joykey;
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_LEFT].joykey = platform_keys[WII_DEVICE_GC_ID_LSTICK_LEFT_DPAD].joykey;
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_RIGHT].joykey = platform_keys[WII_DEVICE_GC_ID_LSTICK_RIGHT_DPAD].joykey;
|
||||
break;
|
||||
case DPAD_EMULATION_RSTICK:
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_UP].joykey = platform_keys[WII_DEVICE_GC_ID_RSTICK_UP_DPAD].joykey;
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_DOWN].joykey = platform_keys[WII_DEVICE_GC_ID_RSTICK_DOWN_DPAD].joykey;
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_LEFT].joykey = platform_keys[WII_DEVICE_GC_ID_RSTICK_LEFT_DPAD].joykey;
|
||||
g_settings.input.binds[controller_id][RETRO_DEVICE_ID_JOYPAD_RIGHT].joykey = platform_keys[WII_DEVICE_GC_ID_RSTICK_RIGHT_DPAD].joykey;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static void *wii_input_initialize(void)
|
||||
@ -437,78 +434,85 @@ static bool wii_key_pressed(void *data, int key)
|
||||
|
||||
static void wii_set_default_keybind_lut(unsigned device, unsigned port)
|
||||
{
|
||||
(void)device; //TODO: Remove when you start using it in this function
|
||||
(void)port;
|
||||
|
||||
#if defined(CLASSIC_PAD)
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_B] = platform_keys[WII_DEVICE_CLASSIC_ID_JOYPAD_B].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_Y] = platform_keys[WII_DEVICE_CLASSIC_ID_JOYPAD_Y].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_SELECT] = platform_keys[WII_DEVICE_CLASSIC_ID_JOYPAD_MINUS].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_START] = platform_keys[WII_DEVICE_CLASSIC_ID_JOYPAD_PLUS].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_UP] = platform_keys[WII_DEVICE_CLASSIC_ID_JOYPAD_UP].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_DOWN] = platform_keys[WII_DEVICE_CLASSIC_ID_JOYPAD_DOWN].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_LEFT] = platform_keys[WII_DEVICE_CLASSIC_ID_JOYPAD_LEFT].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_RIGHT] = platform_keys[WII_DEVICE_CLASSIC_ID_JOYPAD_RIGHT].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_A] = platform_keys[WII_DEVICE_CLASSIC_ID_JOYPAD_A].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_X] = platform_keys[WII_DEVICE_CLASSIC_ID_JOYPAD_X].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_L] = platform_keys[WII_DEVICE_CLASSIC_ID_JOYPAD_L_TRIGGER].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_R] = platform_keys[WII_DEVICE_CLASSIC_ID_JOYPAD_R_TRIGGER].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_L2] = platform_keys[WII_DEVICE_CLASSIC_ID_JOYPAD_ZL_TRIGGER].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_R2] = platform_keys[WII_DEVICE_CLASSIC_ID_JOYPAD_ZR_TRIGGER].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_L3] = 0;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_R3] = 0;
|
||||
#elif defined(WIIMOTE_PAD)
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_B] = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_B].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_Y] = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_A].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_SELECT] = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_MINUS].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_START] = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_PLUS].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_UP] = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_UP].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_DOWN] = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_DOWN].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_LEFT] = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_LEFT].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_RIGHT] = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_RIGHT].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_A] = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_1].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_X] = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_2].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_L] = 0;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_R] = 0;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_L2] = 0;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_R2] = 0;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_L3] = 0;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_R3] = 0;
|
||||
#elif defined(NUNCHUK_PAD)
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_B] = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_B].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_Y] = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_2].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_SELECT] = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_MINUS].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_START] = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_PLUS].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_UP] = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_UP].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_DOWN] = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_DOWN].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_LEFT] = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_LEFT].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_RIGHT] = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_RIGHT].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_A] = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_A].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_X] = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_1].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_L] = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_Z].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_R] = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_C].joykey;;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_L2] = 0;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_R2] = 0;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_L3] = 0;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_R3] = 0;
|
||||
#elif defined(GAMECUBE_PAD)
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_B] = platform_keys[WII_DEVICE_GC_ID_JOYPAD_B].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_Y] = platform_keys[WII_DEVICE_GC_ID_JOYPAD_Y].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_SELECT] = platform_keys[WII_DEVICE_GC_ID_JOYPAD_Z_TRIGGER].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_START] = platform_keys[WII_DEVICE_GC_ID_JOYPAD_START].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_UP] = platform_keys[WII_DEVICE_GC_ID_JOYPAD_UP].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_DOWN] = platform_keys[WII_DEVICE_GC_ID_JOYPAD_DOWN].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_LEFT] = platform_keys[WII_DEVICE_GC_ID_JOYPAD_LEFT].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_RIGHT] = platform_keys[WII_DEVICE_GC_ID_JOYPAD_RIGHT].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_A] = platform_keys[WII_DEVICE_GC_ID_JOYPAD_A].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_X] = platform_keys[WII_DEVICE_GC_ID_JOYPAD_X].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_L] = platform_keys[WII_DEVICE_GC_ID_JOYPAD_L_TRIGGER].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_R] = platform_keys[WII_DEVICE_GC_ID_JOYPAD_R_TRIGGER].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_L2] = 0;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_R2] = 0;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_L3] = 0;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_R3] = 0;
|
||||
#endif
|
||||
switch (device)
|
||||
{
|
||||
case WII_DEVICE_WIIMOTE:
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_B] = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_B].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_Y] = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_A].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_SELECT] = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_MINUS].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_START] = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_PLUS].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_UP] = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_UP].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_DOWN] = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_DOWN].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_LEFT] = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_LEFT].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_RIGHT] = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_RIGHT].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_A] = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_1].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_X] = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_2].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_L] = 0;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_R] = 0;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_L2] = 0;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_R2] = 0;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_L3] = 0;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_R3] = 0;
|
||||
break;
|
||||
case WII_DEVICE_NUNCHUK:
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_B] = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_B].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_Y] = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_2].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_SELECT] = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_MINUS].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_START] = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_PLUS].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_UP] = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_UP].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_DOWN] = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_DOWN].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_LEFT] = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_LEFT].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_RIGHT] = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_RIGHT].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_A] = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_A].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_X] = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_1].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_L] = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_Z].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_R] = platform_keys[WII_DEVICE_WIIMOTE_ID_JOYPAD_C].joykey;;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_L2] = 0;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_R2] = 0;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_L3] = 0;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_R3] = 0;
|
||||
break;
|
||||
case WII_DEVICE_CLASSIC:
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_B] = platform_keys[WII_DEVICE_CLASSIC_ID_JOYPAD_B].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_Y] = platform_keys[WII_DEVICE_CLASSIC_ID_JOYPAD_Y].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_SELECT] = platform_keys[WII_DEVICE_CLASSIC_ID_JOYPAD_MINUS].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_START] = platform_keys[WII_DEVICE_CLASSIC_ID_JOYPAD_PLUS].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_UP] = platform_keys[WII_DEVICE_CLASSIC_ID_JOYPAD_UP].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_DOWN] = platform_keys[WII_DEVICE_CLASSIC_ID_JOYPAD_DOWN].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_LEFT] = platform_keys[WII_DEVICE_CLASSIC_ID_JOYPAD_LEFT].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_RIGHT] = platform_keys[WII_DEVICE_CLASSIC_ID_JOYPAD_RIGHT].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_A] = platform_keys[WII_DEVICE_CLASSIC_ID_JOYPAD_A].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_X] = platform_keys[WII_DEVICE_CLASSIC_ID_JOYPAD_X].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_L] = platform_keys[WII_DEVICE_CLASSIC_ID_JOYPAD_L_TRIGGER].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_R] = platform_keys[WII_DEVICE_CLASSIC_ID_JOYPAD_R_TRIGGER].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_L2] = platform_keys[WII_DEVICE_CLASSIC_ID_JOYPAD_ZL_TRIGGER].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_R2] = platform_keys[WII_DEVICE_CLASSIC_ID_JOYPAD_ZR_TRIGGER].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_L3] = 0;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_R3] = 0;
|
||||
break;
|
||||
case WII_DEVICE_GAMECUBE:
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_B] = platform_keys[WII_DEVICE_GC_ID_JOYPAD_B].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_Y] = platform_keys[WII_DEVICE_GC_ID_JOYPAD_Y].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_SELECT] = platform_keys[WII_DEVICE_GC_ID_JOYPAD_Z_TRIGGER].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_START] = platform_keys[WII_DEVICE_GC_ID_JOYPAD_START].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_UP] = platform_keys[WII_DEVICE_GC_ID_JOYPAD_UP].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_DOWN] = platform_keys[WII_DEVICE_GC_ID_JOYPAD_DOWN].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_LEFT] = platform_keys[WII_DEVICE_GC_ID_JOYPAD_LEFT].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_RIGHT] = platform_keys[WII_DEVICE_GC_ID_JOYPAD_RIGHT].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_A] = platform_keys[WII_DEVICE_GC_ID_JOYPAD_A].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_X] = platform_keys[WII_DEVICE_GC_ID_JOYPAD_X].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_L] = platform_keys[WII_DEVICE_GC_ID_JOYPAD_L_TRIGGER].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_R] = platform_keys[WII_DEVICE_GC_ID_JOYPAD_R_TRIGGER].joykey;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_L2] = 0;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_R2] = 0;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_L3] = 0;
|
||||
rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_R3] = 0;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
const input_driver_t input_wii = {
|
||||
|
@ -176,10 +176,10 @@ enum wii_device_id
|
||||
|
||||
enum
|
||||
{
|
||||
WII_DEVICE_WIIMOTE = 0,
|
||||
WII_DEVICE_GAMECUBE = 0,
|
||||
WII_DEVICE_WIIMOTE,
|
||||
WII_DEVICE_NUNCHUK,
|
||||
WII_DEVICE_CLASSIC,
|
||||
WII_DEVICE_GAMECUBE,
|
||||
|
||||
RARCH_DEVICE_LAST
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user