Add error message when content loading failed
This commit is contained in:
@@ -1403,7 +1403,18 @@ bool retro_load_game(const struct retro_game_info *game)
|
||||
|
||||
GameInfo = (FCEUGI*)FCEUI_LoadGame(game->path, (uint8_t*)game->data, game->size);
|
||||
if (!GameInfo)
|
||||
{
|
||||
struct retro_message msg;
|
||||
char msg_local[256];
|
||||
|
||||
snprintf(msg_local, sizeof(msg_local),
|
||||
"ROM loading failed...");
|
||||
msg.msg = msg_local;
|
||||
msg.frames = 360;
|
||||
if (environ_cb)
|
||||
environ_cb(RETRO_ENVIRONMENT_SET_MESSAGE, (void*)&msg);
|
||||
return false;
|
||||
}
|
||||
|
||||
FCEUI_SetInput(0, SI_GAMEPAD, &JSReturn[0], 0);
|
||||
FCEUI_SetInput(1, SI_GAMEPAD, &JSReturn[0], 0);
|
||||
|
||||
@@ -266,7 +266,7 @@ FCEUGI *FCEUI_LoadGame(const char *name, uint8_t *databuf, size_t databufsize)
|
||||
if (FDSLoad(name, fp))
|
||||
goto endlseq;
|
||||
|
||||
FCEU_PrintError("An error occurred while loading the file.");
|
||||
FCEU_PrintError("An error occurred while loading the file.\n");
|
||||
FCEU_fclose(fp);
|
||||
return 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user