now able to start from a snapshot

This commit is contained in:
julien2512 2017-12-17 01:13:07 +01:00
parent b7a2486ace
commit 51c25d070d
3 changed files with 16 additions and 1 deletions

View File

@ -105,7 +105,7 @@ main (int argc, char *argv[])
if (rom_filename)
{
if (S9xOpenROM (rom_filename) && gui_config->full_screen_on_open)
if ((rom_opened=S9xOpenROM (rom_filename)) && gui_config->full_screen_on_open)
gtk_window_unfullscreen (top_level->get_window());
}
@ -128,6 +128,9 @@ main (int argc, char *argv[])
gtk_window_present (top_level->get_window ());
if (rom_filename && Settings.InitialSnapshotFilename)
S9xUnfreezeGame(Settings.InitialSnapshotFilename);
gtk_main ();
gdk_threads_leave ();
return 0;

View File

@ -757,6 +757,17 @@ char * S9xParseArgs (char **argv, int argc)
if (!strcasecmp(argv[i], "-bsxbootup"))
Settings.BSXBootup = TRUE;
else
if (!strcasecmp(argv[i], "-snapshot"))
{
if (i + 1 < argc)
{
strncpy(Settings.InitialSnapshotFilename, argv[++i], PATH_MAX);
Settings.InitialSnapshotFilename[PATH_MAX] = 0;
}
else
S9xUsage();
}
else
// PATCH/CHEAT OPTIONS

View File

@ -457,6 +457,7 @@ struct SSettings
bool8 TakeScreenshot;
int8 StretchScreenshots;
bool8 SnapshotScreenshots;
char InitialSnapshotFilename[PATH_MAX + 1];
bool8 ApplyCheats;
bool8 NoPatch;