mmu: get rid of FullMMU option. Detect wince with string id in ram

ForceWindowsCE now just sets ExtraDepthScale
This commit is contained in:
Flyinghead 2023-02-16 16:10:25 +01:00
parent 5bfbcb210c
commit afcb3b7ad8
8 changed files with 23 additions and 20 deletions

View File

@ -33,7 +33,6 @@ Option<int> Cable("Dreamcast.Cable", 3); // TV Composite
Option<int> Region("Dreamcast.Region", 1); // USA
Option<int> Broadcast("Dreamcast.Broadcast", 0); // NTSC
Option<int> Language("Dreamcast.Language", 1); // English
Option<bool> FullMMU("Dreamcast.FullMMU");
Option<bool> ForceWindowsCE("Dreamcast.ForceWindowsCE");
Option<bool> AutoLoadState("Dreamcast.AutoLoadState");
Option<bool> AutoSaveState("Dreamcast.AutoSaveState");

View File

@ -365,7 +365,6 @@ extern Option<int> Cable; // 0 -> VGA, 1 -> VGA, 2 -> RGB, 3 -> TV Composite
extern Option<int> Region; // 0 -> JP, 1 -> USA, 2 -> EU, 3 -> default
extern Option<int> Broadcast; // 0 -> NTSC, 1 -> PAL, 2 -> PAL/M, 3 -> PAL/N, 4 -> default
extern Option<int> Language; // 0 -> JP, 1 -> EN, 2 -> DE, 3 -> FR, 4 -> SP, 5 -> IT, 6 -> default
extern Option<bool> FullMMU;
extern Option<bool> ForceWindowsCE;
extern Option<bool> AutoLoadState;
extern Option<bool> AutoSaveState;

View File

@ -53,14 +53,11 @@ static void loadSpecialSettings()
if (settings.platform.isConsole())
{
if (ip_meta.isWindowsCE() || config::ForceWindowsCE
|| prod_id == "T26702N") // PBA Tour Bowling 2001
if (ip_meta.isWindowsCE() || prod_id == "T26702N") // PBA Tour Bowling 2001
{
INFO_LOG(BOOT, "Enabling Full MMU and Extra depth scaling for Windows CE game");
INFO_LOG(BOOT, "Enabling Extra depth scaling for Windows CE game");
config::ExtraDepthScale.override(0.1f); // taxi 2 needs 0.01 for FMV (amd, per-tri)
config::FullMMU.override(true);
if (!config::ForceWindowsCE)
config::ForceWindowsCE.override(true);
config::ForceWindowsCE.override(true);
}
// Tony Hawk's Pro Skater 2
@ -731,10 +728,7 @@ void loadGameSpecificSettings()
config::Settings::instance().load(true);
if (config::ForceWindowsCE)
{
config::ExtraDepthScale.override(0.1f);
config::FullMMU.override(true);
}
}
void Emulator::step()

View File

@ -9,6 +9,7 @@
TLB_Entry UTLB[64];
TLB_Entry ITLB[4];
static u32 ITLB_LRU_USE[64];
bool mmuOn;
//SQ fast remap , mainly hackish , assumes 1MB pages
//max 64MB can be remapped on SQ
@ -432,8 +433,21 @@ retry_ITLB_Match:
void mmu_set_state()
{
if (CCN_MMUCR.AT == 1 && config::FullMMU)
NOTICE_LOG(SH4, "Enabling Full MMU support");
if (CCN_MMUCR.AT == 1)
{
// Detect if we're running Windows CE
static const char magic[] = { 'S', 0, 'H', 0, '-', 0, '4', 0, ' ', 0, 'K', 0, 'e', 0, 'r', 0, 'n', 0, 'e', 0, 'l', 0 };
if (memcmp(GetMemPtr(0x8c0110a8, 4), magic, sizeof(magic)) == 0
|| memcmp(GetMemPtr(0x8c011118, 4), magic, sizeof(magic)) == 0)
{
mmuOn = true;
NOTICE_LOG(SH4, "Enabling Full MMU support");
}
}
else
{
mmuOn = false;
}
SetMemoryHandlers();
setSqwHandler();
@ -536,7 +550,7 @@ template void mmu_WriteMem(u32 adr, u64 data);
void mmu_TranslateSQW(u32 adr, u32 *out)
{
if (!config::FullMMU)
if (!mmuOn)
{
//This will only work for 1 mb pages .. hopefully nothing else is used
//*FIXME* to work for all page sizes ?

View File

@ -36,6 +36,7 @@ struct TLB_Entry
extern TLB_Entry UTLB[64];
extern TLB_Entry ITLB[4];
extern u32 sq_remap[64];
extern bool mmuOn;
constexpr u32 fast_reg_lut[8] =
{
@ -64,7 +65,7 @@ void mmu_flush_table();
static inline bool mmu_enabled()
{
return config::FullMMU && CCN_MMUCR.AT == 1;
return mmuOn;
}
u32 mmu_full_lookup(u32 va, const TLB_Entry **entry, u32& rv);

View File

@ -106,8 +106,7 @@ struct SH4ThrownException
static inline void RaiseFPUDisableException()
{
if (config::FullMMU)
throw SH4ThrownException(next_pc - 2, Sh4Ex_FpuDisabled);
throw SH4ThrownException(next_pc - 2, Sh4Ex_FpuDisabled);
}
static inline void AdjustDelaySlotException(SH4ThrownException& ex)

View File

@ -129,7 +129,6 @@ CONFIG_ACCESSORS(Cable);
CONFIG_ACCESSORS(Region);
CONFIG_ACCESSORS(Broadcast);
CONFIG_ACCESSORS(Language);
CONFIG_ACCESSORS(FullMMU);
CONFIG_ACCESSORS(ForceWindowsCE);
CONFIG_ACCESSORS(AutoLoadState);
CONFIG_ACCESSORS(AutoSaveState);
@ -508,7 +507,6 @@ static void luaRegister(lua_State *L)
CONFIG_PROPERTY(UseReios, bool)
CONFIG_PROPERTY(FastGDRomLoad, bool)
CONFIG_PROPERTY(OpenGlChecks, bool)
CONFIG_PROPERTY(FullMMU, bool)
CONFIG_PROPERTY(ForceWindowsCE, bool)
.endNamespace()

View File

@ -32,7 +32,6 @@ Option<int> Cable("", 3); // TV Composite
Option<int> Region(CORE_OPTION_NAME "_region", 1); // USA
Option<int> Broadcast(CORE_OPTION_NAME "_broadcast", 0); // NTSC
Option<int> Language(CORE_OPTION_NAME "_language", 1); // English
Option<bool> FullMMU("");
Option<bool> ForceWindowsCE(CORE_OPTION_NAME "_force_wince");
Option<bool> AutoLoadState("");
Option<bool> AutoSaveState("");