From b2e66d0b6ae57b4fa9588a79552f8da1af1cbac1 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Mon, 26 May 2014 23:39:53 -0700 Subject: [PATCH] Clear jit when changing "fast memory". This way it takes effect immediately. --- UI/GameSettingsScreen.cpp | 16 +++++++--------- UI/GameSettingsScreen.h | 2 +- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 795bb61b71..d05ec55fb0 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -57,7 +57,6 @@ void GameSettingsScreen::CreateViews() { GameInfo *info = g_gameInfoCache.GetInfo(gamePath_, true); cap60FPS_ = g_Config.iForceMaxEmulatedFPS == 60; - showDebugStats_ = g_Config.bShowDebugStats; iAlternateSpeedPercent_ = (g_Config.iFpsLimit * 100) / 60; @@ -205,7 +204,7 @@ void GameSettingsScreen::CreateViews() { #endif }; graphicsSettings->Add(new PopupMultiChoice(&g_Config.iShowFPSCounter, gs->T("Show FPS Counter"), fpsChoices, 0, ARRAY_SIZE(fpsChoices), gs, screenManager())); - graphicsSettings->Add(new CheckBox(&showDebugStats_, gs->T("Show Debug Statistics"))); + graphicsSettings->Add(new CheckBox(&g_Config.bShowDebugStats, gs->T("Show Debug Statistics")))->OnClick.Handle(this, &GameSettingsScreen::OnJitAffectingSetting); // Developer tools are not accessible ingame, so it goes here. graphicsSettings->Add(new ItemHeader(gs->T("Debugging"))); @@ -302,7 +301,7 @@ void GameSettingsScreen::CreateViews() { systemSettings->Add(new Choice(dev->T("Language", "Language")))->OnClick.Handle(this, &GameSettingsScreen::OnLanguage); systemSettings->Add(new ItemHeader(s->T("Emulation"))); - systemSettings->Add(new CheckBox(&g_Config.bFastMemory, s->T("Fast Memory", "Fast Memory (Unstable)"))); + systemSettings->Add(new CheckBox(&g_Config.bFastMemory, s->T("Fast Memory", "Fast Memory (Unstable)")))->OnClick.Handle(this, &GameSettingsScreen::OnJitAffectingSetting); systemSettings->Add(new CheckBox(&g_Config.bSeparateCPUThread, s->T("Multithreaded (experimental)")))->SetEnabled(!PSP_IsInited()); systemSettings->Add(new CheckBox(&g_Config.bSeparateIOThread, s->T("I/O on thread (experimental)")))->SetEnabled(!PSP_IsInited()); @@ -406,6 +405,11 @@ UI::EventReturn GameSettingsScreen::OnRenderingMode(UI::EventParams &e) { return UI::EVENT_DONE; } +UI::EventReturn GameSettingsScreen::OnJitAffectingSetting(UI::EventParams &e) { + NativeMessageReceived("clear jit", ""); + return UI::EVENT_DONE; +} + UI::EventReturn GameSettingsScreen::OnFrameSkipChange(UI::EventParams &e) { frameSkipAuto_->SetEnabled(g_Config.iFrameSkip != 0); @@ -461,12 +465,6 @@ void GameSettingsScreen::update(InputState &input) { g_Config.iForceMaxEmulatedFPS = cap60FPS_ ? 60 : 0; g_Config.iFpsLimit = (iAlternateSpeedPercent_ * 60) / 100; - - if (g_Config.bShowDebugStats != showDebugStats_) { - // This affects the jit. - NativeMessageReceived("clear jit", ""); - g_Config.bShowDebugStats = showDebugStats_; - } } void GameSettingsScreen::sendMessage(const char *message, const char *value) { diff --git a/UI/GameSettingsScreen.h b/UI/GameSettingsScreen.h index 01d6d5ef01..ebf9e053a3 100644 --- a/UI/GameSettingsScreen.h +++ b/UI/GameSettingsScreen.h @@ -73,6 +73,7 @@ private: UI::EventReturn OnShaderChange(UI::EventParams &e); UI::EventReturn OnRestoreDefaultSettings(UI::EventParams &e); UI::EventReturn OnRenderingMode(UI::EventParams &e); + UI::EventReturn OnJitAffectingSetting(UI::EventParams &e); UI::EventReturn OnScreenRotation(UI::EventParams &e); UI::EventReturn OnImmersiveModeChange(UI::EventParams &e); @@ -81,7 +82,6 @@ private: bool cap60FPS_; int iAlternateSpeedPercent_; bool enableReports_; - bool showDebugStats_; }; class DeveloperToolsScreen : public UIDialogScreenWithBackground {