Add fastmem arena setting

Just for debugging.
This commit is contained in:
JosJuice 2023-10-01 22:54:09 +02:00
parent 8686536d7d
commit d04e67be3d
11 changed files with 31 additions and 4 deletions

View File

@ -14,6 +14,7 @@ enum class BooleanSetting(
MAIN_SKIP_IPL(Settings.FILE_DOLPHIN, Settings.SECTION_INI_CORE, "SkipIPL", true), MAIN_SKIP_IPL(Settings.FILE_DOLPHIN, Settings.SECTION_INI_CORE, "SkipIPL", true),
MAIN_DSP_HLE(Settings.FILE_DOLPHIN, Settings.SECTION_INI_CORE, "DSPHLE", true), MAIN_DSP_HLE(Settings.FILE_DOLPHIN, Settings.SECTION_INI_CORE, "DSPHLE", true),
MAIN_FASTMEM(Settings.FILE_DOLPHIN, Settings.SECTION_INI_CORE, "Fastmem", true), MAIN_FASTMEM(Settings.FILE_DOLPHIN, Settings.SECTION_INI_CORE, "Fastmem", true),
MAIN_FASTMEM_ARENA(Settings.FILE_DOLPHIN, Settings.SECTION_INI_CORE, "FastmemArena", true),
MAIN_CPU_THREAD(Settings.FILE_DOLPHIN, Settings.SECTION_INI_CORE, "CPUThread", true), MAIN_CPU_THREAD(Settings.FILE_DOLPHIN, Settings.SECTION_INI_CORE, "CPUThread", true),
MAIN_SYNC_ON_SKIP_IDLE( MAIN_SYNC_ON_SKIP_IDLE(
Settings.FILE_DOLPHIN, Settings.FILE_DOLPHIN,
@ -897,6 +898,7 @@ enum class BooleanSetting(
companion object { companion object {
private val NOT_RUNTIME_EDITABLE_ARRAY = arrayOf( private val NOT_RUNTIME_EDITABLE_ARRAY = arrayOf(
MAIN_DSP_HLE, MAIN_DSP_HLE,
MAIN_FASTMEM_ARENA,
MAIN_CPU_THREAD, MAIN_CPU_THREAD,
MAIN_ENABLE_CHEATS, MAIN_ENABLE_CHEATS,
MAIN_OVERRIDE_REGION_SETTINGS, MAIN_OVERRIDE_REGION_SETTINGS,

View File

@ -1941,6 +1941,14 @@ class SettingsFragmentPresenter(
0 0
) )
) )
sl.add(
InvertedSwitchSetting(
context,
BooleanSetting.MAIN_FASTMEM_ARENA,
R.string.debug_fastmem_arena,
0
)
)
sl.add(HeaderSetting(context, R.string.debug_jit_header, 0)) sl.add(HeaderSetting(context, R.string.debug_jit_header, 0))
sl.add( sl.add(

View File

@ -399,6 +399,7 @@
<string name="debug_submenu">Debug</string> <string name="debug_submenu">Debug</string>
<string name="debug_warning">Warning: Debug settings will slow emulation</string> <string name="debug_warning">Warning: Debug settings will slow emulation</string>
<string name="debug_fastmem">Disable Fastmem</string> <string name="debug_fastmem">Disable Fastmem</string>
<string name="debug_fastmem_arena">Disable Fastmem Arena</string>
<string name="debug_jit_header">Jit</string> <string name="debug_jit_header">Jit</string>
<string name="debug_jitoff">Jit Disabled</string> <string name="debug_jitoff">Jit Disabled</string>
<string name="debug_jitloadstoreoff">Jit Load Store Disabled</string> <string name="debug_jitloadstoreoff">Jit Load Store Disabled</string>

View File

@ -38,6 +38,7 @@ const Info<PowerPC::CPUCore> MAIN_CPU_CORE{{System::Main, "Core", "CPUCore"},
PowerPC::DefaultCPUCore()}; PowerPC::DefaultCPUCore()};
const Info<bool> MAIN_JIT_FOLLOW_BRANCH{{System::Main, "Core", "JITFollowBranch"}, true}; const Info<bool> MAIN_JIT_FOLLOW_BRANCH{{System::Main, "Core", "JITFollowBranch"}, true};
const Info<bool> MAIN_FASTMEM{{System::Main, "Core", "Fastmem"}, true}; const Info<bool> MAIN_FASTMEM{{System::Main, "Core", "Fastmem"}, true};
const Info<bool> MAIN_FASTMEM_ARENA{{System::Main, "Core", "FastmemArena"}, true};
const Info<bool> MAIN_ACCURATE_CPU_CACHE{{System::Main, "Core", "AccurateCPUCache"}, false}; const Info<bool> MAIN_ACCURATE_CPU_CACHE{{System::Main, "Core", "AccurateCPUCache"}, false};
const Info<bool> MAIN_DSP_HLE{{System::Main, "Core", "DSPHLE"}, true}; const Info<bool> MAIN_DSP_HLE{{System::Main, "Core", "DSPHLE"}, true};
const Info<int> MAIN_MAX_FALLBACK{{System::Main, "Core", "MaxFallback"}, 100}; const Info<int> MAIN_MAX_FALLBACK{{System::Main, "Core", "MaxFallback"}, 100};

View File

@ -56,6 +56,7 @@ extern const Info<bool> MAIN_SKIP_IPL;
extern const Info<PowerPC::CPUCore> MAIN_CPU_CORE; extern const Info<PowerPC::CPUCore> MAIN_CPU_CORE;
extern const Info<bool> MAIN_JIT_FOLLOW_BRANCH; extern const Info<bool> MAIN_JIT_FOLLOW_BRANCH;
extern const Info<bool> MAIN_FASTMEM; extern const Info<bool> MAIN_FASTMEM;
extern const Info<bool> MAIN_FASTMEM_ARENA;
extern const Info<bool> MAIN_ACCURATE_CPU_CACHE; extern const Info<bool> MAIN_ACCURATE_CPU_CACHE;
// Should really be in the DSP section, but we're kind of stuck with bad decisions made in the past. // Should really be in the DSP section, but we're kind of stuck with bad decisions made in the past.
extern const Info<bool> MAIN_DSP_HLE; extern const Info<bool> MAIN_DSP_HLE;

View File

@ -251,8 +251,7 @@ bool Jit64::BackPatch(SContext* ctx)
void Jit64::Init() void Jit64::Init()
{ {
auto& memory = m_system.GetMemory(); InitFastmemArena();
jo.fastmem_arena = memory.InitFastmemArena();
RefreshConfig(); RefreshConfig();

View File

@ -47,8 +47,7 @@ JitArm64::~JitArm64() = default;
void JitArm64::Init() void JitArm64::Init()
{ {
auto& memory = m_system.GetMemory(); InitFastmemArena();
jo.fastmem_arena = memory.InitFastmemArena();
RefreshConfig(); RefreshConfig();

View File

@ -140,6 +140,12 @@ void JitBase::RefreshConfig()
jo.div_by_zero_exceptions = m_enable_div_by_zero_exceptions; jo.div_by_zero_exceptions = m_enable_div_by_zero_exceptions;
} }
void JitBase::InitFastmemArena()
{
auto& memory = m_system.GetMemory();
jo.fastmem_arena = Config::Get(Config::MAIN_FASTMEM_ARENA) && memory.InitFastmemArena();
}
void JitBase::InitBLROptimization() void JitBase::InitBLROptimization()
{ {
m_enable_blr_optimization = m_enable_blr_optimization =

View File

@ -166,6 +166,8 @@ protected:
bool DoesConfigNeedRefresh(); bool DoesConfigNeedRefresh();
void RefreshConfig(); void RefreshConfig();
void InitFastmemArena();
void InitBLROptimization(); void InitBLROptimization();
void ProtectStack(); void ProtectStack();
void UnprotectStack(); void UnprotectStack();

View File

@ -139,6 +139,7 @@ void MenuBar::OnEmulationStateChanged(Core::State state)
m_jit_interpreter_core->setEnabled(running); m_jit_interpreter_core->setEnabled(running);
m_jit_block_linking->setEnabled(!running); m_jit_block_linking->setEnabled(!running);
m_jit_disable_cache->setEnabled(!running); m_jit_disable_cache->setEnabled(!running);
m_jit_disable_fastmem_arena->setEnabled(!running);
m_jit_clear_cache->setEnabled(running); m_jit_clear_cache->setEnabled(running);
m_jit_log_coverage->setEnabled(!running); m_jit_log_coverage->setEnabled(!running);
m_jit_search_instruction->setEnabled(running); m_jit_search_instruction->setEnabled(running);
@ -847,6 +848,12 @@ void MenuBar::AddJITMenu()
connect(m_jit_disable_fastmem, &QAction::toggled, connect(m_jit_disable_fastmem, &QAction::toggled,
[](bool enabled) { Config::SetBaseOrCurrent(Config::MAIN_FASTMEM, !enabled); }); [](bool enabled) { Config::SetBaseOrCurrent(Config::MAIN_FASTMEM, !enabled); });
m_jit_disable_fastmem_arena = m_jit->addAction(tr("Disable Fastmem Arena"));
m_jit_disable_fastmem_arena->setCheckable(true);
m_jit_disable_fastmem_arena->setChecked(!Config::Get(Config::MAIN_FASTMEM_ARENA));
connect(m_jit_disable_fastmem_arena, &QAction::toggled,
[](bool enabled) { Config::SetBaseOrCurrent(Config::MAIN_FASTMEM_ARENA, !enabled); });
m_jit_clear_cache = m_jit->addAction(tr("Clear Cache"), this, &MenuBar::ClearCache); m_jit_clear_cache = m_jit->addAction(tr("Clear Cache"), this, &MenuBar::ClearCache);
m_jit->addSeparator(); m_jit->addSeparator();

View File

@ -264,6 +264,7 @@ private:
QAction* m_jit_block_linking; QAction* m_jit_block_linking;
QAction* m_jit_disable_cache; QAction* m_jit_disable_cache;
QAction* m_jit_disable_fastmem; QAction* m_jit_disable_fastmem;
QAction* m_jit_disable_fastmem_arena;
QAction* m_jit_clear_cache; QAction* m_jit_clear_cache;
QAction* m_jit_log_coverage; QAction* m_jit_log_coverage;
QAction* m_jit_search_instruction; QAction* m_jit_search_instruction;