Merge pull request #11760 from hrydgard/jit-disable-ui

Add simple UI for JIT feature disable flags
This commit is contained in:
Henrik Rydgård 2019-02-04 13:40:38 +01:00 committed by GitHub
commit 57e9073ae4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 84 additions and 0 deletions

View File

@ -198,6 +198,8 @@ namespace MIPSComp {
POINTERIFY = 0x00400000,
STATIC_ALLOC = 0x00800000,
CACHE_POINTERS = 0x01000000,
ALL_FLAGS = 0x01FFFFFF,
};
struct JitOptions {

View File

@ -37,6 +37,7 @@
#include "Core/MIPS/MIPSTables.h"
#include "Core/MIPS/JitCommon/JitBlockCache.h"
#include "Core/MIPS/JitCommon/JitCommon.h"
#include "Core/MIPS/JitCommon/JitState.h"
#include "GPU/GPUInterface.h"
#include "GPU/GPUState.h"
#include "UI/MiscScreens.h"
@ -318,6 +319,70 @@ void LogLevelScreen::OnCompleted(DialogResult result) {
}
}
struct JitDisableFlag {
MIPSComp::JitDisable flag;
const char *name;
};
// Please do not try to translate these :)
static const JitDisableFlag jitDisableFlags[] = {
{ MIPSComp::JitDisable::ALU, "ALU" },
{ MIPSComp::JitDisable::ALU_IMM, "ALU_IMM" },
{ MIPSComp::JitDisable::ALU_BIT, "ALU_BIT" },
{ MIPSComp::JitDisable::MULDIV, "MULDIV" },
{ MIPSComp::JitDisable::FPU, "FPU" },
{ MIPSComp::JitDisable::FPU_COMP, "FPU_COMP" },
{ MIPSComp::JitDisable::FPU_XFER, "FPU_XFER" },
{ MIPSComp::JitDisable::VFPU_VEC, "VFPU_VEC" },
{ MIPSComp::JitDisable::VFPU_MTX, "VFPU_MTX" },
{ MIPSComp::JitDisable::VFPU_COMP, "VFPU_COMP" },
{ MIPSComp::JitDisable::VFPU_XFER, "VFPU_XFER" },
{ MIPSComp::JitDisable::LSU, "LSU" },
{ MIPSComp::JitDisable::LSU_UNALIGNED, "LSU_UNALIGNED" },
{ MIPSComp::JitDisable::LSU_FPU, "LSU_FPU" },
{ MIPSComp::JitDisable::LSU_VFPU, "LSU_VFPU" },
{ MIPSComp::JitDisable::SIMD, "SIMD" },
{ MIPSComp::JitDisable::BLOCKLINK, "Block Linking" },
{ MIPSComp::JitDisable::POINTERIFY, "Pointerify" },
{ MIPSComp::JitDisable::STATIC_ALLOC, "Static regalloc" },
{ MIPSComp::JitDisable::CACHE_POINTERS, "Cached pointers" },
};
void JitDebugScreen::CreateViews() {
using namespace UI;
I18NCategory *di = GetI18NCategory("Dialog");
I18NCategory *dev = GetI18NCategory("Developer");
root_ = new ScrollView(ORIENT_VERTICAL);
LinearLayout *vert = root_->Add(new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT)));
vert->SetSpacing(0);
LinearLayout *topbar = new LinearLayout(ORIENT_HORIZONTAL);
topbar->Add(new Choice(di->T("Back")))->OnClick.Handle<UIScreen>(this, &UIScreen::OnBack);
topbar->Add(new Choice(di->T("Disable All")))->OnClick.Handle(this, &JitDebugScreen::OnDisableAll);
topbar->Add(new Choice(di->T("Enable All")))->OnClick.Handle(this, &JitDebugScreen::OnEnableAll);
vert->Add(topbar);
vert->Add(new ItemHeader(dev->T("Disabled JIT functionality")));
for (auto flag : jitDisableFlags) {
// Do not add translation of these.
vert->Add(new BitCheckBox(&g_Config.uJitDisableFlags, (uint32_t)flag.flag, flag.name));
}
}
UI::EventReturn JitDebugScreen::OnEnableAll(UI::EventParams &e) {
g_Config.uJitDisableFlags &= ~(uint32_t)MIPSComp::JitDisable::ALL_FLAGS;
return UI::EVENT_DONE;
}
UI::EventReturn JitDebugScreen::OnDisableAll(UI::EventParams &e) {
g_Config.uJitDisableFlags |= (uint32_t)MIPSComp::JitDisable::ALL_FLAGS;
return UI::EVENT_DONE;
}
const char *GetCompilerABI() {
#if PPSSPP_ARCH(ARMV7)
return "armeabi-v7a";

View File

@ -47,6 +47,16 @@ protected:
UI::EventReturn OnToggleAudioDebug(UI::EventParams &e);
};
class JitDebugScreen : public UIDialogScreenWithBackground {
public:
JitDebugScreen() {}
virtual void CreateViews() override;
private:
UI::EventReturn OnEnableAll(UI::EventParams &e);
UI::EventReturn OnDisableAll(UI::EventParams &e);
};
class LogConfigScreen : public UIDialogScreenWithBackground {
public:
LogConfigScreen() {}

View File

@ -1283,6 +1283,7 @@ void DeveloperToolsScreen::CreateViews() {
core->HideChoice(1);
}
list->Add(new Choice(dev->T("JIT debug tools")))->OnClick.Handle(this, &DeveloperToolsScreen::OnJitDebugTools);
list->Add(new CheckBox(&g_Config.bShowDeveloperMenu, dev->T("Show Developer Menu")));
list->Add(new CheckBox(&g_Config.bDumpDecryptedEboot, dev->T("Dump Decrypted Eboot", "Dump Decrypted EBOOT.BIN (If Encrypted) When Booting Game")));
@ -1388,6 +1389,11 @@ UI::EventReturn DeveloperToolsScreen::OnLogConfig(UI::EventParams &e) {
return UI::EVENT_DONE;
}
UI::EventReturn DeveloperToolsScreen::OnJitDebugTools(UI::EventParams &e) {
screenManager()->push(new JitDebugScreen());
return UI::EVENT_DONE;
}
UI::EventReturn DeveloperToolsScreen::OnGPUDriverTest(UI::EventParams &e) {
screenManager()->push(new GPUDriverTestScreen());
return UI::EVENT_DONE;

View File

@ -157,6 +157,7 @@ private:
UI::EventReturn OnOpenTexturesIniFile(UI::EventParams &e);
UI::EventReturn OnLogConfig(UI::EventParams &e);
UI::EventReturn OnJitAffectingSetting(UI::EventParams &e);
UI::EventReturn OnJitDebugTools(UI::EventParams &e);
UI::EventReturn OnRemoteDebugger(UI::EventParams &e);
UI::EventReturn OnGPUDriverTest(UI::EventParams &e);