"\t-cdfile FILE\tRuns a CD image file\n"
"\t-cfg FILE\tLoads desired configuration file (default: ~/.pcsx/pcsx.cfg)\n"
"\t-psxout\t\tEnable PSX output\n"
- "\t-load STATENUM\tLoads savestate STATENUM (1-5)\n"
+ "\t-load STATENUM\tLoads savestate STATENUM (1-9)\n"
+ "\t-loadf FILE\tLoads savestate from FILE\n"
"\t-h -help\tDisplay this message\n"
"\tfile\t\tLoads a PSX EXE file\n"));
return 0;
if (Load(file) != -1)
ready_to_go = 1;
} else {
- if (cdfile) {
- if (LoadCdrom() == -1) {
- ClosePlugins();
- SysPrintf(_("Could not load CD-ROM!\n"));
- return -1;
- }
- emu_on_new_cd(!loadst);
- ready_to_go = 1;
- }
+ if (cdfile)
+ ready_to_go = menu_load_cd_image(cdfile) == 0;
}
if (loadst_f) {
}
if (ready_to_go) {
- if (menu_load_config(1) != 0)
- menu_load_config(0);
menu_prepare_emu();
- // If a state has been specified, then load that
- if (loadst) {
+ // If a state slot has been specified, then load that
+ if (cdfile && loadst) {
int ret = emu_load_state(loadst - 1);
- SysPrintf("%s state %d\n",
+ SysPrintf("%s state slot %d\n",
ret ? "failed to load" : "loaded", loadst);
}
}
SysReset();
if (Load(fname) != 0) {
menu_update_msg("exe load failed, bad file?");
- printf("meh\n");
return -1;
}
return 0;
}
-static int romsel_run(void)
+int menu_load_cd_image(const char *fname)
{
int prev_gpu, prev_spu;
- const char *fname;
-
- fname = menu_loop_romsel(last_selected_fname,
- sizeof(last_selected_fname), filter_exts,
- optional_cdimg_filter);
- if (fname == NULL)
- return -1;
-
- printf("selected file: %s\n", fname);
-
- ndrc_clear_full();
if (run_cd_image(fname) != 0)
return -1;
// check for plugin changes, have to repeat
// loading if game config changed plugins to reload them
if (prev_gpu != gpu_plugsel || prev_spu != spu_plugsel) {
- printf("plugin change detected, reloading plugins..\n");
+ printf("plugin change detected, reloading plugins...\n");
if (run_cd_image(fname) != 0)
return -1;
}
return 0;
}
+static int romsel_run(void)
+{
+ const char *fname;
+
+ fname = menu_loop_romsel(last_selected_fname,
+ sizeof(last_selected_fname), filter_exts,
+ optional_cdimg_filter);
+ if (fname == NULL)
+ return -1;
+
+ printf("selected file: %s\n", fname);
+
+ ndrc_clear_full();
+
+ return menu_load_cd_image(fname);
+}
+
static int swap_cd_image(void)
{
const char *fname;