diff --git a/console/rarch_console_exec.c b/console/rarch_console_exec.c index 29b94fdbbe..491b756b25 100644 --- a/console/rarch_console_exec.c +++ b/console/rarch_console_exec.c @@ -30,6 +30,10 @@ #include #include #include +#ifdef HW_RVL +#include +#include +#endif #include "exec/dol.h" #endif @@ -88,6 +92,10 @@ void rarch_console_exec(const char *path) #endif fatUnmount("carda:"); fatUnmount("cardb:"); +#ifdef HW_RVL + __io_wiisd.shutdown(); + __io_usbstorage.shutdown(); +#endif uint32_t *ep = load_dol_image(mem); if (ep[1] == ARGV_MAGIC) diff --git a/gx/frontend/main.c b/gx/frontend/main.c index 9110cafe97..e8421b422a 100644 --- a/gx/frontend/main.c +++ b/gx/frontend/main.c @@ -37,7 +37,7 @@ #include #ifdef HW_RVL -#include +#include #endif #include #include @@ -313,8 +313,10 @@ int rarch_main(int argc, char **argv); static void get_environment_settings(void) { - snprintf(default_paths.port_dir, sizeof(default_paths.port_dir), "/retroarch"); getcwd(default_paths.core_dir, MAXPATHLEN); + *(strrchr(default_paths.core_dir, '/')) = 0; + char *device_end = strchr(default_paths.core_dir, '/'); + snprintf(default_paths.port_dir, sizeof(default_paths.port_dir), "%.*s/retroarch", device_end - default_paths.core_dir, default_paths.core_dir); snprintf(default_paths.config_file, sizeof(default_paths.config_file), "%s/retroarch.cfg", default_paths.port_dir); snprintf(default_paths.system_dir, sizeof(default_paths.system_dir), "%s/system", default_paths.port_dir); snprintf(default_paths.savestate_dir, sizeof(default_paths.savestate_dir), "%s/savestates", default_paths.port_dir); @@ -364,6 +366,7 @@ static void make_directories(void) int main(void) { #ifdef HW_RVL + IOS_ReloadIOS(IOS_GetVersion()); L2Enhance(); #endif diff --git a/gx/salamander/main.c b/gx/salamander/main.c index b6b40ca24b..761ed4e97f 100644 --- a/gx/salamander/main.c +++ b/gx/salamander/main.c @@ -18,6 +18,7 @@ #include "../../boolean.h" #include #include +#include #include #include @@ -67,7 +68,7 @@ static void find_and_set_first_file(void) static void init_settings(void) { - char tmp_str[512]; + char tmp_str[512] = {0}; bool config_file_exists; if(!path_file_exists(default_paths.config_file)) @@ -108,21 +109,15 @@ static void init_settings(void) { RARCH_LOG("Start [%s] found in retroarch.cfg.\n", libretro_path); } - - if (!config_file_exists) - { - config_file_t *new_conf = config_file_new(NULL); - config_set_string(new_conf, "libretro_path", libretro_path); - config_file_write(new_conf, default_paths.config_file); - config_file_free(new_conf); - } } } static void get_environment_settings(void) { - snprintf(default_paths.port_dir, sizeof(default_paths.port_dir), "/retroarch"); getcwd(default_paths.core_dir, MAXPATHLEN); + *(strrchr(default_paths.core_dir, '/')) = 0; + char *device_end = strchr(default_paths.core_dir, '/'); + snprintf(default_paths.port_dir, sizeof(default_paths.port_dir), "%.*s/retroarch", device_end - default_paths.core_dir, default_paths.core_dir); snprintf(default_paths.config_file, sizeof(default_paths.config_file), "%s/retroarch.cfg", default_paths.port_dir); snprintf(default_paths.system_dir, sizeof(default_paths.system_dir), "%s/system", default_paths.port_dir); snprintf(default_paths.savestate_dir, sizeof(default_paths.savestate_dir), "%s/savestates", default_paths.port_dir); @@ -137,6 +132,7 @@ static void get_environment_settings(void) int main(int argc, char *argv[]) { #ifdef HW_RVL + IOS_ReloadIOS(IOS_GetVersion()); L2Enhance(); #endif