diff --git a/Core/Config.cpp b/Core/Config.cpp index af2fe695f1..33fb842ef2 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -408,6 +408,7 @@ static ConfigSetting generalSettings[] = { ConfigSetting("ScreenshotsAsPNG", &g_Config.bScreenshotsAsPNG, false, true, true), ConfigSetting("ScreenshotsAtRenderRes", &g_Config.bScreenshotsAtRenderRes, false, true, true), + ConfigSetting("SavestateScreenshotResLimit", &g_Config.bSavestateScreenshotResLimit, false, false, false), ConfigSetting("UseFFV1", &g_Config.bUseFFV1, false), ConfigSetting("DumpFrames", &g_Config.bDumpFrames, false), ConfigSetting("DumpAudio", &g_Config.bDumpAudio, false), diff --git a/Core/Config.h b/Core/Config.h index a69768a98e..97143e08e1 100644 --- a/Core/Config.h +++ b/Core/Config.h @@ -24,6 +24,7 @@ #include "Common/CommonTypes.h" extern const char *PPSSPP_GIT_VERSION; +const int MAX_CONFIG_VOLUME = 8; namespace http { class Download; @@ -59,6 +60,7 @@ public: int iNumWorkerThreads; bool bScreenshotsAsPNG; bool bScreenshotsAtRenderRes; + bool bSavestateScreenshotResLimit; bool bUseFFV1; bool bDumpFrames; bool bDumpAudio; diff --git a/Core/SaveState.cpp b/Core/SaveState.cpp index 3f14e7dc4e..6177f4a961 100644 --- a/Core/SaveState.cpp +++ b/Core/SaveState.cpp @@ -853,8 +853,12 @@ namespace SaveState case SAVESTATE_SAVE_SCREENSHOT: { - int maxRes = g_Config.iInternalResolution > 2 ? 2 : -1; - tempResult = TakeGameScreenshot(op.filename.c_str(), ScreenshotFormat::JPG, SCREENSHOT_DISPLAY, nullptr, nullptr, maxRes); + if (g_Config.bSavestateScreenshotResLimit) { + int maxRes = g_Config.iInternalResolution > 2 ? 2 : -1; + tempResult = TakeGameScreenshot(op.filename.c_str(), ScreenshotFormat::JPG, SCREENSHOT_DISPLAY, nullptr, nullptr, maxRes); + } else { + tempResult = TakeGameScreenshot(op.filename.c_str(), ScreenshotFormat::JPG, SCREENSHOT_DISPLAY); + } callbackResult = tempResult ? Status::SUCCESS : Status::FAILURE; if (!tempResult) { ERROR_LOG(SAVESTATE, "Failed to take a screenshot for the savestate! %s", op.filename.c_str()); diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 756f3ebc59..b81091e469 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -202,42 +202,30 @@ void GameSettingsScreen::CreateViews() { #ifndef IOS vulkanAvailable = VulkanMayBeAvailable(); #endif - if (!vulkanAvailable) { - renderingBackendChoice->HideChoice(3); - } -#endif - Draw::DrawContext *draw = screenManager()->getDrawContext(); - - // Backends that don't allow a device choice will only expose one device. - if (draw->GetDeviceList().size() > 1) { - std::string *deviceNameSetting = nullptr; - if (g_Config.iGPUBackend == (int)GPUBackend::VULKAN) { - deviceNameSetting = &g_Config.sVulkanDevice; + if (!vulkanAvailable) { + renderingBackendChoice->HideChoice(3); } +#endif + Draw::DrawContext *draw = screenManager()->getDrawContext(); + + // Backends that don't allow a device choice will only expose one device. + if (draw->GetDeviceList().size() > 1) { + std::string *deviceNameSetting = nullptr; + if (g_Config.iGPUBackend == (int)GPUBackend::VULKAN) { + deviceNameSetting = &g_Config.sVulkanDevice; + } #ifdef _WIN32 - if (g_Config.iGPUBackend == (int)GPUBackend::DIRECT3D11) { - deviceNameSetting = &g_Config.sD3D11Device; - } + if (g_Config.iGPUBackend == (int)GPUBackend::DIRECT3D11) { + deviceNameSetting = &g_Config.sD3D11Device; + } #endif - if (deviceNameSetting) { - PopupMultiChoiceDynamic *deviceChoice = graphicsSettings->Add(new PopupMultiChoiceDynamic(deviceNameSetting, gr->T("Device"), draw->GetDeviceList(), nullptr, screenManager())); - deviceChoice->OnChoice.Handle(this, &GameSettingsScreen::OnRenderingBackend); + if (deviceNameSetting) { + PopupMultiChoiceDynamic *deviceChoice = graphicsSettings->Add(new PopupMultiChoiceDynamic(deviceNameSetting, gr->T("Device"), draw->GetDeviceList(), nullptr, screenManager())); + deviceChoice->OnChoice.Handle(this, &GameSettingsScreen::OnRenderingBackend); + } } - } - static const char *renderingMode[] = { "Non-Buffered Rendering", "Buffered Rendering"}; - PopupMultiChoice *renderingModeChoice = graphicsSettings->Add(new PopupMultiChoice(&g_Config.iRenderingMode, gr->T("Mode"), renderingMode, 0, ARRAY_SIZE(renderingMode), gr->GetName(), screenManager())); - renderingModeChoice->OnChoice.Add([=](EventParams &e) { - switch (g_Config.iRenderingMode) { - case FB_NON_BUFFERED_MODE: - settingInfo_->Show(gr->T("RenderingMode NonBuffered Tip", "Faster, but graphics may be missing in some games"), e.v); - break; - case FB_BUFFERED_MODE: - break; - } -#endif - - static const char *renderingMode[] = { "Non-Buffered Rendering", "Buffered Rendering"}; + static const char *renderingMode[] = { "Non-Buffered Rendering", "Buffered Rendering" }; PopupMultiChoice *renderingModeChoice = graphicsSettings->Add(new PopupMultiChoice(&g_Config.iRenderingMode, gr->T("Mode"), renderingMode, 0, ARRAY_SIZE(renderingMode), gr->GetName(), screenManager())); renderingModeChoice->OnChoice.Add([=](EventParams &e) { switch (g_Config.iRenderingMode) { @@ -276,14 +264,16 @@ void GameSettingsScreen::CreateViews() { if (PSP_IsInited()) softwareGPU->SetEnabled(false); } - + graphicsSettings->Add(new ItemHeader(gr->T("Frame Rate Control"))); - static const char *frameSkip[] = {"Off", "1", "2", "3", "4", "5", "6", "7", "8"}; + static const char *frameSkip[] = { "Off", "1", "2", "3", "4", "5", "6", "7", "8" }; graphicsSettings->Add(new PopupMultiChoice(&g_Config.iFrameSkip, gr->T("Frame Skipping"), frameSkip, 0, ARRAY_SIZE(frameSkip), gr->GetName(), screenManager())); frameSkipAuto_ = graphicsSettings->Add(new CheckBox(&g_Config.bAutoFrameSkip, gr->T("Auto FrameSkip"))); frameSkipAuto_->OnClick.Handle(this, &GameSettingsScreen::OnAutoFrameskip); graphicsSettings->Add(new CheckBox(&cap60FPS_, gr->T("Force max 60 FPS (helps GoW)"))); + } + PopupSliderChoice *altSpeed1 = graphicsSettings->Add(new PopupSliderChoice(&iAlternateSpeedPercent1_, 0, 1000, gr->T("Alternative Speed", "Alternative speed"), 5, screenManager(), gr->T("%, 0:unlimited"))); altSpeed1->SetFormat("%i%%"); altSpeed1->SetZeroLabel(gr->T("Unlimited")); @@ -1392,6 +1382,7 @@ void OtherSettingsScreen::CreateViews() { list->Add(new CheckBox(&g_Config.bShowFrameProfiler, gr->T("Display frame profiler(heavy!)"))); list->Add(new CheckBox(&g_Config.bSimpleFrameStats, gr->T("Display simple frame stats(heavy!)"))); list->Add(new CheckBox(&g_Config.bRefreshAt60Hz, gr->T("Refresh at 60Hz(gamebreaking, but might be needed for NVidia stutter)"))); + list->Add(new CheckBox(&g_Config.bSavestateScreenshotResLimit, gr->T("Limit resolution of savestates screenshots"))); } void OtherSettingsScreen::onFinish(DialogResult result) { diff --git a/UI/GameSettingsScreen.h b/UI/GameSettingsScreen.h index 384d23ee2e..52f37eedeb 100644 --- a/UI/GameSettingsScreen.h +++ b/UI/GameSettingsScreen.h @@ -109,7 +109,6 @@ private: bool cap60FPS_; int iAlternateSpeedPercent1_; int iAlternateSpeedPercent2_; - int iAlternateSpeedPercent2_; bool enableReports_; //edit the game-specific settings and restore the global settings after exiting