From b10c4f7fae0b10d52eaf93ae564559628d350b7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 22 Oct 2024 14:15:47 +0200 Subject: [PATCH] Crashfix, warning fix, cleanup --- Core/Dialog/SavedataParam.cpp | 11 ++++------- GPU/Software/SoftGpu.cpp | 4 +++- UI/EmuScreen.cpp | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Core/Dialog/SavedataParam.cpp b/Core/Dialog/SavedataParam.cpp index 12a2eec522..82a7fa532e 100644 --- a/Core/Dialog/SavedataParam.cpp +++ b/Core/Dialog/SavedataParam.cpp @@ -209,12 +209,9 @@ void SaveFileInfo::DoState(PointerWrap &p) SavedataParam::SavedataParam() { } -void SavedataParam::Init() -{ - if (!pspFileSystem.GetFileInfo(savePath).exists) - { - pspFileSystem.MkDir(savePath); - } +void SavedataParam::Init() { + // If the folder already exists, this is a no-op. + pspFileSystem.MkDir(savePath); // Create a nomedia file to hide save icons form Android image viewer #if PPSSPP_PLATFORM(ANDROID) int handle = pspFileSystem.OpenFile(savePath + ".nomedia", (FileAccess)(FILEACCESS_CREATE | FILEACCESS_WRITE), 0); @@ -459,7 +456,7 @@ int SavedataParam::Save(SceUtilitySavedataParam* param, const std::string &saveD } } - u8* cryptedData = 0; + u8* cryptedData = nullptr; int cryptedSize = 0; u8 cryptedHash[0x10]{}; // Encrypt save. diff --git a/GPU/Software/SoftGpu.cpp b/GPU/Software/SoftGpu.cpp index e2513a8462..d0b0b8d035 100644 --- a/GPU/Software/SoftGpu.cpp +++ b/GPU/Software/SoftGpu.cpp @@ -659,7 +659,9 @@ void SoftGPU::CopyDisplayToOutput(bool reallyDirty) { void SoftGPU::BeginHostFrame() { GPUCommon::BeginHostFrame(); - presentation_->BeginFrame(); + if (presentation_) { + presentation_->BeginFrame(); + } } bool SoftGPU::PresentedThisFrame() const { diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index 62d1059a2b..ccdd67a737 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -1521,7 +1521,7 @@ ScreenRenderFlags EmuScreen::render(ScreenRenderMode mode) { Draw::BackendState state = draw->GetCurrentBackendState(); // We allow if !state.valid, that means it's not the Vulkan backend. - _assert_msg_(!state.valid || state.passes >= 1, "skipB: %d sw: %d mode: %d back: %d", (int)skipBufferEffects, (int)g_Config.bSoftwareRendering, mode, (int)g_Config.iGPUBackend); + _assert_msg_(!state.valid || state.passes >= 1, "skipB: %d sw: %d mode: %d back: %d", (int)skipBufferEffects, (int)g_Config.bSoftwareRendering, (int)mode, (int)g_Config.iGPUBackend); screenManager()->getUIContext()->BeginFrame();