X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=blobdiff_plain;f=frontend%2Fmain.c;h=cb37bd7d131d0844f037e69429aaeb18fb1853f2;hp=7b459832690d1f34d0d799cf79743cd3eff196db;hb=7c0f51de89955f60f5c7304ab8c4a8f8e9b7f185;hpb=c5061935e3f7b91d889d7546b06c4515c3004cb2 diff --git a/frontend/main.c b/frontend/main.c index 7b459832..cb37bd7d 100644 --- a/frontend/main.c +++ b/frontend/main.c @@ -16,6 +16,7 @@ #include "main.h" #include "plugin.h" +#include "plugin_lib.h" #include "pcnt.h" #include "menu.h" #include "../libpcsxcore/misc.h" @@ -61,15 +62,16 @@ static void CheckSubDir() { 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"); @@ -169,7 +171,7 @@ int main(int argc, char *argv[]) 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"); @@ -242,6 +244,8 @@ int main(int argc, char *argv[]) else menu_loop(); + pl_start_watchdog(); + while (1) { psxCpu->Execute(); @@ -274,11 +278,23 @@ void StartGui() { 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() {