Add icache emulation core option, as per simias's guidance.

Currently only disables icache emulation when reading instructions.
This commit is contained in:
rz5 2020-01-05 17:01:03 +00:00
parent 18a9de19f3
commit f1188c2c45
5 changed files with 24 additions and 1 deletions

View File

@ -9,3 +9,4 @@ int filter_mode;
bool opaque_check;
bool semitrans_check;
bool crop_overscan = false;
bool icache_emulation = true;

View File

@ -22,6 +22,7 @@ extern int filter_mode;
extern bool opaque_check;
extern bool semitrans_check;
extern bool crop_overscan;
extern bool icache_emulation;
#ifdef __cplusplus
}

View File

@ -2738,6 +2738,15 @@ static void check_variables(bool startup)
else
psx_gpu_overclock_shift = 0;
var.key = BEETLE_OPT(icache_emulation);
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
{
if (strcmp(var.value, "enabled") == 0)
icache_emulation = true;
else
icache_emulation = false;
}
var.key = BEETLE_OPT(skip_bios);
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
{

View File

@ -356,6 +356,17 @@ struct retro_core_option_definition option_defs_us[] = {
},
"1x(native)"
},
{
BEETLE_OPT(icache_emulation),
"Enable I-cache emulation",
"Enables emulation of instruction cache behavior like tag tests, validity bits and cache miss effects. Disabling this will result in a speed increase at the cost of reducing game compatibility.",
{
{ "enabled", NULL },
{ "disabled", NULL },
{ NULL, NULL },
},
"enabled"
},
{
BEETLE_OPT(skip_bios),
"Skip BIOS",

View File

@ -35,6 +35,7 @@
extern bool psx_gte_overclock;
#include "beetle_psx_globals.h"
#if 0
#define EXP_ILL_CHECK(n) {n;}
@ -504,7 +505,7 @@ INLINE uint32 PS_CPU::ReadInstruction(pscpu_timestamp_t &timestamp, uint32 addre
ReadAbsorb[ReadAbsorbWhich] = 0;
ReadAbsorbWhich = 0;
if(address >= 0xA0000000 || !(BIU & 0x800))
if(!icache_emulation || address >= 0xA0000000 || !(BIU & 0x800))
{
instr = MDFN_de32lsb<true>((uint8*)(FastMap[address >> FAST_MAP_SHIFT] + address));