Add setting to disable div32 matching (Pro Pinball Trilogy)

div32 matching doesn't handle division by zero and edge cases, which
causes crashes with some games.
Setting enabled by default for Pro Pinball Trilogy.
This commit is contained in:
Flyinghead 2018-07-06 09:49:39 +02:00
parent 517c225c39
commit 315205caa9
3 changed files with 12 additions and 1 deletions

View File

@ -694,6 +694,9 @@ u32 MatchDiv32(u32 pc , Sh4RegType &reg1,Sh4RegType &reg2 , Sh4RegType &reg3)
}
bool MatchDiv32u(u32 op,u32 pc)
{
if (settings.dynarec.DisableDivMatching)
return false;
div_som_reg1=NoReg;
div_som_reg2=NoReg;
div_som_reg3=NoReg;
@ -713,6 +716,9 @@ bool MatchDiv32u(u32 op,u32 pc)
bool MatchDiv32s(u32 op,u32 pc)
{
if (settings.dynarec.DisableDivMatching)
return false;
u32 n = GetN(op);
u32 m = GetM(op);
@ -1219,4 +1225,4 @@ _end:
blk=0;
}
#endif
#endif

View File

@ -178,6 +178,9 @@ void LoadSpecialSettings()
settings.aica.EGHack = 1;
break;
}
if (!strncmp("T30701D", reios_product_number, 7))
// Pro Pinball Trilogy
settings.dynarec.DisableDivMatching = true;
}
int dc_init(int argc,wchar* argv[])
@ -291,6 +294,7 @@ void LoadSettings()
settings.dynarec.Enable = cfgLoadInt("config","Dynarec.Enabled", 1)!=0;
settings.dynarec.idleskip = cfgLoadInt("config","Dynarec.idleskip",1)!=0;
settings.dynarec.unstable_opt = cfgLoadInt("config","Dynarec.unstable-opt",0);
settings.dynarec.DisableDivMatching = cfgLoadInt("config", "Dynarec.DisableDivMatching", 0);
//disable_nvmem can't be loaded, because nvmem init is before cfg load
settings.dreamcast.cable = cfgLoadInt("config","Dreamcast.Cable",3);
settings.dreamcast.RTC = cfgLoadInt("config","Dreamcast.RTC",GetRTC_now());

View File

@ -628,6 +628,7 @@ struct settings_t
bool idleskip;
bool unstable_opt;
bool disable_nvmem;
bool DisableDivMatching;
} dynarec;
struct