mirror of
https://github.com/libretro/RetroArch
synced 2025-03-13 07:14:43 +00:00
(Console) Attempt to trap ROM loading errors
This commit is contained in:
parent
f0026384d3
commit
32383f168b
@ -203,6 +203,9 @@ void rarch_settings_msg(unsigned setting, unsigned delay)
|
||||
fill_pathname_base(tmp, g_console.rom_path, sizeof(tmp));
|
||||
snprintf(str, sizeof(str), "INFO - Loading %.38s...", tmp);
|
||||
break;
|
||||
case S_MSG_ROM_LOADING_ERROR:
|
||||
snprintf(str, sizeof(str), "ERROR - An error occurred during ROM loading.");
|
||||
break;
|
||||
case S_MSG_NOT_IMPLEMENTED:
|
||||
snprintf(str, sizeof(str), "TODO - Not yet implemented.");
|
||||
break;
|
||||
|
@ -74,6 +74,7 @@ enum
|
||||
S_MSG_CHANGE_CONTROLS,
|
||||
S_MSG_EXTRACTED_ZIPFILE,
|
||||
S_MSG_LOADING_ROM,
|
||||
S_MSG_ROM_LOADING_ERROR,
|
||||
S_MSG_NOT_IMPLEMENTED,
|
||||
S_MSG_RESIZE_SCREEN,
|
||||
S_MSG_RESTART_RARCH,
|
||||
|
@ -334,22 +334,6 @@ static const struct platform_bind platform_keys[] = {
|
||||
{ PAD_BUTTON_START, "(NGC) Start button" },
|
||||
{ PAD_TRIGGER_L, "(NGC) Left Trigger" },
|
||||
{ PAD_TRIGGER_R, "(NGC) Right Trigger" },
|
||||
//{ XINPUT_GAMEPAD_LSTICK_LEFT_MASK, "LStick Left" },
|
||||
//{ XINPUT_GAMEPAD_LSTICK_RIGHT_MASK, "LStick Right" },
|
||||
//{ XINPUT_GAMEPAD_LSTICK_UP_MASK, "LStick Up" },
|
||||
//{ XINPUT_GAMEPAD_LSTICK_DOWN_MASK, "LStick Down" },
|
||||
//{ XINPUT_GAMEPAD_DPAD_LEFT | XINPUT_GAMEPAD_LSTICK_LEFT_MASK, "LStick D-Pad Left" },
|
||||
//{ XINPUT_GAMEPAD_DPAD_RIGHT | XINPUT_GAMEPAD_LSTICK_RIGHT_MASK, "LStick D-Pad Right" },
|
||||
//{ XINPUT_GAMEPAD_DPAD_UP | XINPUT_GAMEPAD_LSTICK_UP_MASK, "LStick D-Pad Up" },
|
||||
//{ XINPUT_GAMEPAD_DPAD_DOWN | XINPUT_GAMEPAD_LSTICK_DOWN_MASK, "LStick D-Pad Down" },
|
||||
//{ XINPUT_GAMEPAD_RSTICK_LEFT_MASK, "RStick Left" },
|
||||
//{ XINPUT_GAMEPAD_RSTICK_RIGHT_MASK, "RStick Right" },
|
||||
//{ XINPUT_GAMEPAD_RSTICK_UP_MASK, "RStick Up" },
|
||||
//{ XINPUT_GAMEPAD_RSTICK_DOWN_MASK, "RStick Down" },
|
||||
//{ XINPUT_GAMEPAD_DPAD_LEFT | XINPUT_GAMEPAD_RSTICK_LEFT_MASK, "RStick D-Pad Left" },
|
||||
//{ XINPUT_GAMEPAD_DPAD_RIGHT | XINPUT_GAMEPAD_RSTICK_RIGHT_MASK, "RStick D-Pad Right" },
|
||||
//{ XINPUT_GAMEPAD_DPAD_UP | XINPUT_GAMEPAD_RSTICK_UP_MASK, "RStick D-Pad Up" },
|
||||
//{ XINPUT_GAMEPAD_DPAD_DOWN | XINPUT_GAMEPAD_RSTICK_DOWN_MASK, "RStick D-Pad Down" },
|
||||
#ifdef HW_RVL
|
||||
{ WPAD_CLASSIC_BUTTON_B, "(Wii Classici) B button" },
|
||||
{ WPAD_CLASSIC_BUTTON_A, "(Wii Classic) A button" },
|
||||
@ -634,8 +618,19 @@ void rarch_startup (const char * config_path)
|
||||
|
||||
int init_ret = rarch_main_init_wrap(&args);
|
||||
(void)init_ret;
|
||||
g_console.emulator_initialized = 1;
|
||||
g_console.initialize_rarch_enable = 0;
|
||||
|
||||
if(init_ret == 0)
|
||||
{
|
||||
g_console.emulator_initialized = 1;
|
||||
g_console.initialize_rarch_enable = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
//failed to load the ROM for whatever reason
|
||||
g_console.emulator_initialized = 0;
|
||||
g_console.mode_switch = MODE_MENU;
|
||||
rarch_settings_msg(S_MSG_ROM_LOADING_ERROR, S_DELAY_180);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1736,7 +1736,7 @@ static void menu_romselect_iterate(filebrowser_t *filebrowser, menu_romselect_ac
|
||||
else
|
||||
filebrowser_iterate(filebrowser, FILEBROWSER_ACTION_OK);
|
||||
}
|
||||
else if (path_file_exists(filebrowser_get_current_path(&browser)))
|
||||
else
|
||||
{
|
||||
char rom_path_temp[PATH_MAX];
|
||||
struct retro_system_info info;
|
||||
|
Loading…
x
Reference in New Issue
Block a user