X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=blobdiff_plain;f=frontend%2Fmenu.c;h=f2a24fd6c91fae63ccf3f76fd23f9e76ec8eab27;hp=b14f195ca7b081a7540387d1be02080b42b5b5de;hb=bce6b05695beb988b607eb1dd82c27c1ed841faa;hpb=e16a7e51ca7c72b01c0e93c8593cdc705873dec5 diff --git a/frontend/menu.c b/frontend/menu.c index b14f195c..f2a24fd6 100644 --- a/frontend/menu.c +++ b/frontend/menu.c @@ -68,7 +68,6 @@ int g_opts; // from softgpu plugin extern int iUseDither; extern int UseFrameSkip; -extern int UseFrameLimit; extern uint32_t dwActFixes; extern float fFrameRateHz; extern int dwFrameRateTicks; @@ -123,8 +122,16 @@ static int emu_save_load_game(int load, int sram) if (ret != 0) return 0; - if (load) + if (load) { ret = LoadState(fname); + + // reflect hle/bios mode from savestate + if (Config.HLE) + bios_sel = 0; + else if (bios_sel == 0 && bioses[1] != NULL) + // XXX: maybe find the right bios instead + bios_sel = 1; + } else ret = SaveState(fname); @@ -133,13 +140,13 @@ static int emu_save_load_game(int load, int sram) static void menu_set_defconfig(void) { + g_opts = 0; scaling = SCALE_4_3; Config.Xa = Config.Cdda = Config.Sio = Config.SpuIrq = Config.RCntFix = Config.VSyncWA = 0; iUseDither = UseFrameSkip = 0; - UseFrameLimit = 1; dwActFixes = 1<<7; iUseReverb = 2; @@ -192,7 +199,6 @@ static const struct { CE_INTVAL(g_opts), CE_INTVAL(iUseDither), CE_INTVAL(UseFrameSkip), - CE_INTVAL(UseFrameLimit), CE_INTVAL(dwActFixes), CE_INTVAL(iUseReverb), CE_INTVAL(iUseInterpolation), @@ -873,17 +879,20 @@ static const char h_cfg_sio[] = "This should be enabled for certain memcards/ static const char h_cfg_spuirq[] = "Compatibility tweak; should probably be left off"; static const char h_cfg_rcnt1[] = "Parasite Eve 2, Vandal Hearts 1/2 Fix"; static const char h_cfg_rcnt2[] = "InuYasha Sengoku Battle Fix"; +static const char h_cfg_nodrc[] = "Disable dynamic recompiler and use interpreter\n" + "Might be useful to overcome some dynarec bugs"; static menu_entry e_menu_adv_options[] = { mee_onoff_h ("Show CPU load", 0, g_opts, OPT_SHOWCPU, h_cfg_cpul), - mee_onoff_h ("Frame Limiter", 0, UseFrameLimit, 1, h_cfg_fl), + mee_onoff_h ("Disable Frame Limiter", 0, g_opts, OPT_NO_FRAMELIM, h_cfg_fl), mee_onoff_h ("Disable XA Decoding", 0, Config.Xa, 1, h_cfg_xa), mee_onoff_h ("Disable CD Audio", 0, Config.Cdda, 1, h_cfg_cdda), mee_onoff_h ("SIO IRQ Always Enabled", 0, Config.Sio, 1, h_cfg_sio), mee_onoff_h ("SPU IRQ Always Enabled", 0, Config.SpuIrq, 1, h_cfg_spuirq), mee_onoff_h ("Rootcounter hack", 0, Config.RCntFix, 1, h_cfg_rcnt1), mee_onoff_h ("Rootcounter hack 2", 0, Config.VSyncWA, 1, h_cfg_rcnt2), + mee_onoff_h ("Disable dynarec (slow!)",0, Config.Cpu, 1, h_cfg_nodrc), mee_end, }; @@ -1349,6 +1358,8 @@ static void menu_leave_emu(void) void menu_prepare_emu(void) { + R3000Acpu *prev_cpu = psxCpu; + plat_video_menu_leave(); switch (scaling) { @@ -1370,16 +1381,17 @@ void menu_prepare_emu(void) apply_cpu_clock(); stop = 0; + psxCpu = (Config.Cpu == CPU_INTERPRETER) ? &psxInt : &psxRec; + if (psxCpu != prev_cpu) + // note that this does not really reset, just clears drc caches + psxCpu->Reset(); + // core doesn't care about Config.Cdda changes, // so handle them manually here if (Config.Cdda) CDR_stop(); - // HACK to set up the frame limiter if softgpu is not used.. - if (gpu_plugsel != 0) { - fFrameRateHz = Config.PsxType ? 50.0f : 59.94f; - dwFrameRateTicks = (100000*100 / (unsigned long)(fFrameRateHz*100)); - } + pl_frame_interval = Config.PsxType ? 20000 : 16667; if (GPU_open != NULL) { int ret = GPU_open(&gpuDisp, "PCSX", NULL);