From fa4898757ccde26b04c99b3ce06d11e016ed41f4 Mon Sep 17 00:00:00 2001 From: Toad King Date: Mon, 30 Jul 2012 23:00:20 -0400 Subject: [PATCH] (Wii) testing code for core switching --- wii/frontend/main.c | 7 +++++++ wii/frontend/rgui.c | 20 ++++++++++++++++++++ wii/frontend/rgui.h | 1 + 3 files changed, 28 insertions(+) diff --git a/wii/frontend/main.c b/wii/frontend/main.c index 485eed98d8..458461be05 100644 --- a/wii/frontend/main.c +++ b/wii/frontend/main.c @@ -44,6 +44,9 @@ FILE * log_fp; static uint16_t menu_framebuf[RGUI_WIDTH * RGUI_HEIGHT]; +char app_dir[PATH_MAX]; +struct retro_system_info wii_core_info; + static const struct retro_keybind _wii_nav_binds[] = { { 0, 0, 0, WII_GC_UP | WII_GC_LSTICK_UP | WII_GC_RSTICK_UP | WII_CLASSIC_UP | WII_CLASSIC_LSTICK_UP | WII_CLASSIC_RSTICK_UP | WII_WIIMOTE_UP | WII_NUNCHUK_UP, 0 }, { 0, 0, 0, WII_GC_DOWN | WII_GC_LSTICK_DOWN | WII_GC_RSTICK_DOWN | WII_CLASSIC_DOWN | WII_CLASSIC_LSTICK_DOWN | WII_CLASSIC_RSTICK_DOWN | WII_WIIMOTE_DOWN | WII_NUNCHUK_DOWN, 0 }, @@ -214,6 +217,7 @@ int main(void) #endif fatInitDefault(); + getcwd(app_dir, sizeof(app_dir)); get_environment_settings(); @@ -228,6 +232,9 @@ int main(void) config_set_defaults(); + retro_get_system_info(&wii_core_info); + RARCH_LOG("Core: %s\n", wii_core_info.library_name); + g_settings.audio.rate_control = true; g_settings.audio.rate_control_delta = 0.006; g_console.block_config_read = true; diff --git a/wii/frontend/rgui.c b/wii/frontend/rgui.c index 6cbc25b8b9..12b0c3bb49 100644 --- a/wii/frontend/rgui.c +++ b/wii/frontend/rgui.c @@ -31,6 +31,8 @@ #define TERM_WIDTH (((RGUI_WIDTH - TERM_START_X - 15) / (FONT_WIDTH_STRIDE))) #define TERM_HEIGHT (((RGUI_HEIGHT - TERM_START_Y - 15) / (FONT_HEIGHT_STRIDE))) +extern char app_dir[PATH_MAX]; + struct rgui_handle { uint16_t *frame_buf; @@ -372,6 +374,23 @@ static void rgui_settings_toggle_setting(rgui_file_type_t setting, rgui_action_t rarch_settings_change(S_AUDIO_CONTROL_RATE_INCREMENT); break; + case RGUI_SETTINGS_CORE: + { + // !!JUST FOR TESTING!! + char boot_dol[PATH_MAX]; + char temp_dol[PATH_MAX]; + char temp2_dol[PATH_MAX]; + + snprintf(boot_dol, sizeof(boot_dol), "%s%s", app_dir, "boot.dol"); + snprintf(temp_dol, sizeof(temp_dol), "%s%s", app_dir, "temp.dol"); + snprintf(temp2_dol, sizeof(temp2_dol), "%s%s", app_dir, "temp2.dol"); + + rename(boot_dol, temp2_dol); + rename(temp_dol, boot_dol); + rename(temp2_dol, temp_dol); + break; + } + // controllers case RGUI_SETTINGS_BIND_DEVICE: g_settings.input.device[port] += RARCH_DEVICE_LAST; @@ -430,6 +449,7 @@ static void rgui_settings_populate_entries(rgui_handle_t *rgui) 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("Core", RGUI_SETTINGS_CORE); 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); diff --git a/wii/frontend/rgui.h b/wii/frontend/rgui.h index bf8c097557..5e74acce10 100644 --- a/wii/frontend/rgui.h +++ b/wii/frontend/rgui.h @@ -36,6 +36,7 @@ typedef enum RGUI_SETTINGS_VIDEO_FILTER, RGUI_SETTINGS_AUDIO_MUTE, RGUI_SETTINGS_AUDIO_CONTROL_RATE, + RGUI_SETTINGS_CORE, RGUI_SETTINGS_CONTROLLER_1, RGUI_SETTINGS_CONTROLLER_2, RGUI_SETTINGS_CONTROLLER_3,