Add error message when content loading failed

This commit is contained in:
twinaphex
2016-07-19 19:06:09 +02:00
parent 368f2e6f4f
commit 72e74d6fcc
2 changed files with 12 additions and 1 deletions

View File

@@ -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);

View File

@@ -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;