Added command line option to specify floppy disc images.
This commit is contained in:
parent
7915a72604
commit
98a9c975f4
1 changed files with 36 additions and 6 deletions
42
src/pc.c
42
src/pc.c
|
|
@ -64,6 +64,8 @@ int window_w, window_h, window_x, window_y, window_remember;
|
||||||
|
|
||||||
int start_in_fullscreen = 0;
|
int start_in_fullscreen = 0;
|
||||||
|
|
||||||
|
static int override_drive_a = 0, override_drive_b = 0;
|
||||||
|
|
||||||
int CPUID;
|
int CPUID;
|
||||||
int vid_resize, vid_api;
|
int vid_resize, vid_api;
|
||||||
|
|
||||||
|
|
@ -241,6 +243,8 @@ void initpc(int argc, char *argv[])
|
||||||
printf("PCem command line options :\n\n");
|
printf("PCem command line options :\n\n");
|
||||||
printf("--config file.cfg - use given config file as initial configuration\n");
|
printf("--config file.cfg - use given config file as initial configuration\n");
|
||||||
printf("--fullscreen - start in fullscreen mode\n");
|
printf("--fullscreen - start in fullscreen mode\n");
|
||||||
|
printf("--load_drive_a file.img - load drive A: with the given disc image\n");
|
||||||
|
printf("--load_drive_b file.img - load drive B: with the given disc image\n");
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
else if (!strcasecmp(argv[c], "--fullscreen"))
|
else if (!strcasecmp(argv[c], "--fullscreen"))
|
||||||
|
|
@ -266,6 +270,24 @@ void initpc(int argc, char *argv[])
|
||||||
config_override = 1;
|
config_override = 1;
|
||||||
c++;
|
c++;
|
||||||
}
|
}
|
||||||
|
else if (!strcasecmp(argv[c], "--load_drive_a"))
|
||||||
|
{
|
||||||
|
if ((c+1) == argc)
|
||||||
|
break;
|
||||||
|
|
||||||
|
strncpy(discfns[0], argv[c+1], 260);
|
||||||
|
c++;
|
||||||
|
override_drive_a = 1;
|
||||||
|
}
|
||||||
|
else if (!strcasecmp(argv[c], "--load_drive_b"))
|
||||||
|
{
|
||||||
|
if ((c+1) == argc)
|
||||||
|
break;
|
||||||
|
|
||||||
|
strncpy(discfns[1], argv[c+1], 260);
|
||||||
|
c++;
|
||||||
|
override_drive_b = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// append_filename(config_file_default, pcempath, "pcem.cfg", 511);
|
// append_filename(config_file_default, pcempath, "pcem.cfg", 511);
|
||||||
|
|
@ -494,6 +516,8 @@ void runpc()
|
||||||
int done=0;
|
int done=0;
|
||||||
int cycles_to_run = cpu_get_speed() / 100;
|
int cycles_to_run = cpu_get_speed() / 100;
|
||||||
|
|
||||||
|
override_drive_a = override_drive_b = 0;
|
||||||
|
|
||||||
startblit();
|
startblit();
|
||||||
|
|
||||||
if (is386)
|
if (is386)
|
||||||
|
|
@ -708,13 +732,19 @@ void loadconfig(char *fn)
|
||||||
else
|
else
|
||||||
sound_card_current = 0;
|
sound_card_current = 0;
|
||||||
|
|
||||||
p = (char *)config_get_string(CFG_MACHINE, NULL, "disc_a", "");
|
if (!override_drive_a)
|
||||||
if (p) strcpy(discfns[0], p);
|
{
|
||||||
else strcpy(discfns[0], "");
|
p = (char *)config_get_string(CFG_MACHINE, NULL, "disc_a", "");
|
||||||
|
if (p) strcpy(discfns[0], p);
|
||||||
|
else strcpy(discfns[0], "");
|
||||||
|
}
|
||||||
|
|
||||||
p = (char *)config_get_string(CFG_MACHINE, NULL, "disc_b", "");
|
if (!override_drive_b)
|
||||||
if (p) strcpy(discfns[1], p);
|
{
|
||||||
else strcpy(discfns[1], "");
|
p = (char *)config_get_string(CFG_MACHINE, NULL, "disc_b", "");
|
||||||
|
if (p) strcpy(discfns[1], p);
|
||||||
|
else strcpy(discfns[1], "");
|
||||||
|
}
|
||||||
|
|
||||||
p = (char *)config_get_string(CFG_MACHINE, NULL, "hdd_controller", "");
|
p = (char *)config_get_string(CFG_MACHINE, NULL, "hdd_controller", "");
|
||||||
if (p)
|
if (p)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue