diff --git a/Core/HW/Display.cpp b/Core/HW/Display.cpp index 6c4f725864..ba671dc82f 100644 --- a/Core/HW/Display.cpp +++ b/Core/HW/Display.cpp @@ -311,6 +311,8 @@ void DisplayHWReset() { fpsHistoryValid = 0; fpsHistoryPos = 0; + lastFpsTime = 0.0; + lastFpsFrame = 0; frameTimeHistoryValid = 0; frameTimeHistoryPos = 0; diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 6aeabcae4f..c1dfee3260 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -146,7 +146,14 @@ GameSettingsScreen::~GameSettingsScreen() { Reporting::Enable(enableReports_, "report.ppsspp.org"); Reporting::UpdateConfig(); if (!g_Config.Save("GameSettingsScreen::onFinish")) { - System_Toast("Failed to save settings!\nCheck permissions, or try to restart the device."); + std::string message = "Failed to save settings!\n"; +#ifdef MOBILE_DEVICE + message += "Check permissions, or try to restart the device."; +#else + message += "Make sure this folder isn't read-only:\n"; + message += g_Config.memStickDirectory.ToVisualString(); +#endif + System_Toast(message); } if (editGameSpecificThenRestore_) { diff --git a/UI/PauseScreen.cpp b/UI/PauseScreen.cpp index 837dfcd04d..c17e8748c9 100644 --- a/UI/PauseScreen.cpp +++ b/UI/PauseScreen.cpp @@ -711,13 +711,17 @@ void GamePauseScreen::ShowContextMenu(UI::View *menuButton, bool portrait) { std::string confirmMessage = GetConfirmExitMessage(); if (!confirmMessage.empty()) { auto di = GetI18NCategory(I18NCat::DIALOG); - screenManager()->push(new UI::MessagePopupScreen(di->T("Reset"), confirmMessage, di->T("Reset"), di->T("Cancel"), [](bool result) { + screenManager()->push(new UI::MessagePopupScreen(di->T("Reset"), confirmMessage, di->T("Reset"), di->T("Cancel"), [this](bool result) { if (result) { System_PostUIMessage(UIMessage::REQUEST_GAME_RESET); + finishNextFrameResult_ = DR_BACK; // resume + finishNextFrame_ = true; } })); } else { System_PostUIMessage(UIMessage::REQUEST_GAME_RESET); + finishNextFrameResult_ = DR_BACK; // resume + finishNextFrame_ = true; } }); diff --git a/libretro/libretro.cpp b/libretro/libretro.cpp index 1c506b5380..5a2f9104f1 100644 --- a/libretro/libretro.cpp +++ b/libretro/libretro.cpp @@ -1360,9 +1360,9 @@ namespace Libretro ctx->GetDrawContext()->BeginFrame(Draw::DebugFlags::NONE); } + const DisplayLayoutConfig &displayLayoutConfig = g_Config.GetDisplayLayoutConfig(g_display.GetDeviceOrientation()); if (gpu) { - const DisplayLayoutConfig &config = g_Config.GetDisplayLayoutConfig(g_display.GetDeviceOrientation()); - gpu->BeginHostFrame(config); + gpu->BeginHostFrame(displayLayoutConfig); } PSP_RunLoopWhileState(); @@ -1377,9 +1377,20 @@ namespace Libretro break; } - if (gpu) + if (gpu) { gpu->EndHostFrame(); + gpu->PrepareCopyDisplayToOutput(displayLayoutConfig); + } + + // gotta do the backbuffer bind somewhere. + using namespace Draw; + ctx->GetDrawContext()->BindFramebufferAsRenderTarget(nullptr, {RPAction::CLEAR, RPAction::CLEAR, RPAction::CLEAR}, "BackBuffer"); + + if (gpu) { + gpu->CopyDisplayToOutput(displayLayoutConfig); + } + if (ctx->GetDrawContext()) { ctx->GetDrawContext()->EndFrame(); ctx->GetDrawContext()->Present(Draw::PresentMode::FIFO);