From d014a47167b28b19f87546bca0b0c53f08b1daff Mon Sep 17 00:00:00 2001 From: notaz Date: Sat, 1 Oct 2022 22:32:01 +0300 Subject: [PATCH] remove all the hack options They just confuse users, like: libretro/pcsx_rearmed#693 For Parasite Eve 2 and others, adjust "PSX CPU clock" instead if needed. --- frontend/main.c | 4 ++-- frontend/menu.c | 25 ++----------------------- libpcsxcore/misc.c | 18 ++++++++++++------ libpcsxcore/new_dynarec/pcsxmem.c | 4 ---- libpcsxcore/psxcommon.h | 4 ---- libpcsxcore/psxcounters.c | 16 ++-------------- libpcsxcore/psxhw.c | 7 ------- libpcsxcore/r3000a.c | 2 +- libpcsxcore/sio.c | 10 ++++------ maemo/main.c | 4 ---- 10 files changed, 23 insertions(+), 71 deletions(-) diff --git a/frontend/main.c b/frontend/main.c index 144ce490..d8121090 100644 --- a/frontend/main.c +++ b/frontend/main.c @@ -129,8 +129,8 @@ static void set_default_paths(void) void emu_set_default_config(void) { // try to set sane config on which most games work - Config.Xa = Config.Cdda = Config.Sio = - Config.icache_emulation = Config.SpuIrq = Config.RCntFix = Config.VSyncWA = 0; + Config.Xa = Config.Cdda = 0; + Config.icache_emulation = 0; Config.PsxAuto = 1; pl_rearmed_cbs.gpu_neon.allow_interlace = 2; // auto diff --git a/frontend/menu.c b/frontend/menu.c index 4816ecea..a494c00d 100644 --- a/frontend/menu.c +++ b/frontend/menu.c @@ -390,14 +390,10 @@ static const struct { CE_CONFIG_STR(Spu), // CE_CONFIG_STR(Cdr), CE_CONFIG_VAL(Xa), -// CE_CONFIG_VAL(Sio), CE_CONFIG_VAL(Mdec), CE_CONFIG_VAL(Cdda), CE_CONFIG_VAL(Debug), CE_CONFIG_VAL(PsxOut), - CE_CONFIG_VAL(SpuIrq), - CE_CONFIG_VAL(RCntFix), - CE_CONFIG_VAL(VSyncWA), CE_CONFIG_VAL(icache_emulation), CE_CONFIG_VAL(DisableStalls), CE_CONFIG_VAL(Cpu), @@ -1592,21 +1588,14 @@ static const char h_cfg_fl[] = "Frame Limiter keeps the game from running to static const char h_cfg_xa[] = "Disables XA sound, which can sometimes improve performance"; static const char h_cfg_cdda[] = "Disable CD Audio for a performance boost\n" "(proper .cue/.bin dump is needed otherwise)"; -//static const char h_cfg_sio[] = "You should not need this, breaks games"; -static const char h_cfg_spuirq[] = "Compatibility tweak; should be left off"; -static const char h_cfg_rcnt2[] = "InuYasha Sengoku Battle Fix\n" - "(timing hack, breaks other games)"; -#ifdef DRC_DISABLE -static const char h_cfg_rcnt1[] = "Parasite Eve 2, Vandal Hearts 1/2 Fix\n" - "(timing hack, breaks other games)"; -#else +#ifndef DRC_DISABLE static const char h_cfg_nodrc[] = "Disable dynamic recompiler and use interpreter\n" "Might be useful to overcome some dynarec bugs"; #endif static const char h_cfg_shacks[] = "Breaks games but may give better performance"; static const char h_cfg_icache[] = "Support F1 games (only when dynarec is off)"; -enum { AMO_XA, AMO_CDDA, AMO_SIO, AMO_SPUI, AMO_IC, AMO_RCNT, AMO_WA, AMO_CPU }; +enum { AMO_XA, AMO_CDDA, AMO_IC, AMO_CPU }; static menu_entry e_menu_adv_options[] = { @@ -1615,13 +1604,7 @@ static menu_entry e_menu_adv_options[] = mee_onoff_h ("Disable Frame Limiter", 0, g_opts, OPT_NO_FRAMELIM, h_cfg_fl), mee_onoff_h ("Disable XA Decoding", 0, menu_iopts[AMO_XA], 1, h_cfg_xa), mee_onoff_h ("Disable CD Audio", 0, menu_iopts[AMO_CDDA], 1, h_cfg_cdda), - //mee_onoff_h ("SIO IRQ Always Enabled", 0, menu_iopts[AMO_SIO], 1, h_cfg_sio), - mee_onoff_h ("SPU IRQ Always Enabled", 0, menu_iopts[AMO_SPUI], 1, h_cfg_spuirq), mee_onoff_h ("ICache emulation", 0, menu_iopts[AMO_IC], 1, h_cfg_icache), -#ifdef DRC_DISABLE - mee_onoff_h ("Rootcounter hack", 0, menu_iopts[AMO_RCNT], 1, h_cfg_rcnt1), -#endif - mee_onoff_h ("Rootcounter hack 2", 0, menu_iopts[AMO_WA], 1, h_cfg_rcnt2), #if !defined(DRC_DISABLE) || defined(LIGHTREC) mee_onoff_h ("Disable dynarec (slow!)",0, menu_iopts[AMO_CPU], 1, h_cfg_nodrc), #endif @@ -1638,11 +1621,7 @@ static int menu_loop_adv_options(int id, int keys) } opts[] = { { &Config.Xa, &menu_iopts[AMO_XA] }, { &Config.Cdda, &menu_iopts[AMO_CDDA] }, - { &Config.Sio, &menu_iopts[AMO_SIO] }, - { &Config.SpuIrq, &menu_iopts[AMO_SPUI] }, { &Config.icache_emulation, &menu_iopts[AMO_IC] }, - { &Config.RCntFix, &menu_iopts[AMO_RCNT] }, - { &Config.VSyncWA, &menu_iopts[AMO_WA] }, { &Config.Cpu, &menu_iopts[AMO_CPU] }, }; int i; diff --git a/libpcsxcore/misc.c b/libpcsxcore/misc.c index b3dfdf53..d83ee194 100644 --- a/libpcsxcore/misc.c +++ b/libpcsxcore/misc.c @@ -722,10 +722,13 @@ int SendPcsxInfo() { if (NET_recvData == NULL || NET_sendData == NULL) return 0; + boolean Sio_old = 0; + boolean SpuIrq_old = 0; + boolean RCntFix_old = 0; NET_sendData(&Config.Xa, sizeof(Config.Xa), PSE_NET_BLOCKING); - NET_sendData(&Config.Sio, sizeof(Config.Sio), PSE_NET_BLOCKING); - NET_sendData(&Config.SpuIrq, sizeof(Config.SpuIrq), PSE_NET_BLOCKING); - NET_sendData(&Config.RCntFix, sizeof(Config.RCntFix), PSE_NET_BLOCKING); + NET_sendData(&Sio_old, sizeof(Sio_old), PSE_NET_BLOCKING); + NET_sendData(&SpuIrq_old, sizeof(SpuIrq_old), PSE_NET_BLOCKING); + NET_sendData(&RCntFix_old, sizeof(RCntFix_old), PSE_NET_BLOCKING); NET_sendData(&Config.PsxType, sizeof(Config.PsxType), PSE_NET_BLOCKING); NET_sendData(&Config.Cpu, sizeof(Config.Cpu), PSE_NET_BLOCKING); @@ -738,10 +741,13 @@ int RecvPcsxInfo() { if (NET_recvData == NULL || NET_sendData == NULL) return 0; + boolean Sio_old = 0; + boolean SpuIrq_old = 0; + boolean RCntFix_old = 0; NET_recvData(&Config.Xa, sizeof(Config.Xa), PSE_NET_BLOCKING); - NET_recvData(&Config.Sio, sizeof(Config.Sio), PSE_NET_BLOCKING); - NET_recvData(&Config.SpuIrq, sizeof(Config.SpuIrq), PSE_NET_BLOCKING); - NET_recvData(&Config.RCntFix, sizeof(Config.RCntFix), PSE_NET_BLOCKING); + NET_recvData(&Sio_old, sizeof(Sio_old), PSE_NET_BLOCKING); + NET_recvData(&SpuIrq_old, sizeof(SpuIrq_old), PSE_NET_BLOCKING); + NET_recvData(&RCntFix_old, sizeof(RCntFix_old), PSE_NET_BLOCKING); NET_recvData(&Config.PsxType, sizeof(Config.PsxType), PSE_NET_BLOCKING); SysUpdate(); diff --git a/libpcsxcore/new_dynarec/pcsxmem.c b/libpcsxcore/new_dynarec/pcsxmem.c index bb471b6a..69a4c99d 100644 --- a/libpcsxcore/new_dynarec/pcsxmem.c +++ b/libpcsxcore/new_dynarec/pcsxmem.c @@ -152,8 +152,6 @@ make_rcnt_funcs(2) static void io_write_ireg16(u32 value) { - //if (Config.Sio) psxHu16ref(0x1070) |= 0x80; - if (Config.SpuIrq) psxHu16ref(0x1070) |= 0x200; psxHu16ref(0x1070) &= value; } @@ -166,8 +164,6 @@ static void io_write_imask16(u32 value) static void io_write_ireg32(u32 value) { - //if (Config.Sio) psxHu32ref(0x1070) |= 0x80; - if (Config.SpuIrq) psxHu32ref(0x1070) |= 0x200; psxHu32ref(0x1070) &= value; } diff --git a/libpcsxcore/psxcommon.h b/libpcsxcore/psxcommon.h index c0c2c9fb..a549eb67 100644 --- a/libpcsxcore/psxcommon.h +++ b/libpcsxcore/psxcommon.h @@ -125,7 +125,6 @@ typedef struct { char PluginsDir[MAXPATHLEN]; char PatchesDir[MAXPATHLEN]; boolean Xa; - boolean Sio; boolean Mdec; boolean PsxAuto; boolean Cdda; @@ -133,10 +132,7 @@ typedef struct { boolean HLE; boolean Debug; boolean PsxOut; - boolean SpuIrq; - boolean RCntFix; boolean UseNet; - boolean VSyncWA; boolean icache_emulation; boolean DisableStalls; u8 Cpu; // CPU_DYNAREC or CPU_INTERPRETER diff --git a/libpcsxcore/psxcounters.c b/libpcsxcore/psxcounters.c index fba2f5c9..32a18475 100644 --- a/libpcsxcore/psxcounters.c +++ b/libpcsxcore/psxcounters.c @@ -358,8 +358,8 @@ void psxRcntUpdate() } } - // Update lace. (with InuYasha fix) - if( hSyncCount >= (Config.VSyncWA ? HSyncTotal[Config.PsxType] / BIAS : HSyncTotal[Config.PsxType]) ) + // Update lace. + if( hSyncCount >= HSyncTotal[Config.PsxType] ) { rcnts[3].cycleStart += Config.PsxType ? PSXCLK / 50 : PSXCLK / 60; hSyncCount = 0; @@ -420,18 +420,6 @@ u32 psxRcntRcount( u32 index ) count = _psxRcntRcount( index ); - // Parasite Eve 2 fix. - if( Config.RCntFix ) - { - if( index == 2 ) - { - if( rcnts[index].counterState == CountToTarget ) - { - count /= BIAS; - } - } - } - verboseLog( 2, "[RCNT %i] rcount: %x\n", index, count ); return count; diff --git a/libpcsxcore/psxhw.c b/libpcsxcore/psxhw.c index b7540dfc..483f4962 100644 --- a/libpcsxcore/psxhw.c +++ b/libpcsxcore/psxhw.c @@ -30,9 +30,6 @@ //#define PSXHW_LOG printf void psxHwReset() { - if (Config.Sio) psxHu32ref(0x1070) |= SWAP32(0x80); - if (Config.SpuIrq) psxHu32ref(0x1070) |= SWAP32(0x200); - memset(psxH, 0, 0x10000); mdecInit(); // initialize mdec decoder @@ -443,8 +440,6 @@ void psxHwWrite16(u32 add, u16 value) { #ifdef PSXHW_LOG PSXHW_LOG("IREG 16bit write %x\n", value); #endif - if (Config.Sio) psxHu16ref(0x1070) |= SWAPu16(0x80); - if (Config.SpuIrq) psxHu16ref(0x1070) |= SWAPu16(0x200); psxHu16ref(0x1070) &= SWAPu16(value); return; @@ -558,8 +553,6 @@ void psxHwWrite32(u32 add, u32 value) { #ifdef PSXHW_LOG PSXHW_LOG("IREG 32bit write %x\n", value); #endif - if (Config.Sio) psxHu32ref(0x1070) |= SWAPu32(0x80); - if (Config.SpuIrq) psxHu32ref(0x1070) |= SWAPu32(0x200); psxHu32ref(0x1070) &= SWAPu32(value); return; case 0x1f801074: diff --git a/libpcsxcore/r3000a.c b/libpcsxcore/r3000a.c index 818cc91a..e7557a74 100644 --- a/libpcsxcore/r3000a.c +++ b/libpcsxcore/r3000a.c @@ -123,7 +123,7 @@ void psxBranchTest() { psxRcntUpdate(); if (psxRegs.interrupt) { - if ((psxRegs.interrupt & (1 << PSXINT_SIO)) && !Config.Sio) { // sio + if ((psxRegs.interrupt & (1 << PSXINT_SIO))) { // sio if ((psxRegs.cycle - psxRegs.intCycle[PSXINT_SIO].sCycle) >= psxRegs.intCycle[PSXINT_SIO].cycle) { psxRegs.interrupt &= ~(1 << PSXINT_SIO); sioInterrupt(); diff --git a/libpcsxcore/sio.c b/libpcsxcore/sio.c index b3732d29..329bc36b 100644 --- a/libpcsxcore/sio.c +++ b/libpcsxcore/sio.c @@ -68,12 +68,10 @@ char Mcd1Data[MCD_SIZE], Mcd2Data[MCD_SIZE]; char McdDisable[2]; #define SIO_INT(eCycle) { \ - if (!Config.Sio) { \ - psxRegs.interrupt |= (1 << PSXINT_SIO); \ - psxRegs.intCycle[PSXINT_SIO].cycle = eCycle; \ - psxRegs.intCycle[PSXINT_SIO].sCycle = psxRegs.cycle; \ - new_dyna_set_event(PSXINT_SIO, eCycle); \ - } \ + psxRegs.interrupt |= (1 << PSXINT_SIO); \ + psxRegs.intCycle[PSXINT_SIO].cycle = eCycle; \ + psxRegs.intCycle[PSXINT_SIO].sCycle = psxRegs.cycle; \ + new_dyna_set_event(PSXINT_SIO, eCycle); \ } // clk cycle byte diff --git a/maemo/main.c b/maemo/main.c index 564e8ed5..91aa2e78 100644 --- a/maemo/main.c +++ b/maemo/main.c @@ -251,10 +251,6 @@ int main(int argc, char **argv) else if (!strcmp(argv[i], "-unai")) strcpy(Config.Gpu, "gpu_unai.so"); else if (!strcmp(argv[i], "-cdda")) Config.Cdda = 1; else if (!strcmp(argv[i], "-xa")) Config.Xa = 1; - else if (!strcmp(argv[i], "-rcnt")) Config.RCntFix = 1 ; - else if (!strcmp(argv[i], "-sio")) Config.Sio = 1; - else if (!strcmp(argv[i], "-spuirq")) Config.SpuIrq = 1; - else if (!strcmp(argv[i], "-vsync")) Config.VSyncWA = 1; else if (!strcmp(argv[i], "-fps")) g_opts |=OPT_SHOWFPS; else if (!strcmp(argv[i], "-cpu")) g_opts |=OPT_SHOWCPU; else if (!strcmp(argv[i], "-spu")) g_opts |=OPT_SHOWSPU; -- 2.39.5