void set_cd_image(const char *fname)
{
- const char *ext;
- int len;
+ const char *ext = NULL;
- len = strlen(fname);
- ext = fname;
- if (len > 2)
- ext = fname + len - 2;
+ if (fname != NULL) {
+ int len = strlen(fname);
+ ext = fname;
+ if (len > 2)
+ ext = fname + len - 2;
+ }
- if (strcasecmp(ext, ".z") == 0) {
+ if (ext && strcasecmp(ext, ".z") == 0) {
SetIsoFile(NULL);
cdrcimg_set_fname(fname);
strcpy(Config.Cdr, "builtin_cdrcimg");
MAKE_PATH(Config.Mcd1, MEMCARD_DIR, "card1.mcd");
MAKE_PATH(Config.Mcd2, MEMCARD_DIR, "card2.mcd");
strcpy(Config.Bios, "HLE");
- strcpy(Config.BiosDir, "./");
+ strcpy(Config.BiosDir, "bios");
strcpy(Config.PluginsDir, "plugins");
strcpy(Config.Gpu, "builtin_gpu");
printf("StartGui\n");
}
+static void dummy_lace()
+{
+}
+
void SysReset() {
+ // rearmed hack: EmuReset() runs some code when real BIOS is used,
+ // but we usually do reset from menu while GPU is not open yet,
+ // so we need to prevent updateLace() call..
+ void *real_lace = GPU_updateLace;
+ GPU_updateLace = dummy_lace;
+
EmuReset();
// hmh core forgets this
CDR_stop();
+
+ GPU_updateLace = real_lace;
}
void SysClose() {