diff --git a/Core/CoreParameter.h b/Core/CoreParameter.h index 3ca526b46a..13deda4162 100644 --- a/Core/CoreParameter.h +++ b/Core/CoreParameter.h @@ -21,6 +21,7 @@ #include "Common/File/Path.h" #include "Core/Compatibility.h" +#include "Core/Loaders.h" enum GPUCore { GPUCORE_GLES, @@ -86,6 +87,7 @@ struct CoreParameter { bool frozen = false; FileLoader *mountIsoLoader = nullptr; + IdentifiedFileType fileType = IdentifiedFileType::UNKNOWN; Compatibility compat; }; diff --git a/Core/System.cpp b/Core/System.cpp index 2cf51d96c4..69e92f0fb2 100644 --- a/Core/System.cpp +++ b/Core/System.cpp @@ -254,6 +254,7 @@ bool CPU_Init(std::string *errorString, FileLoader *loadedFile) { if (!g_CoreParameter.mountIso.empty()) { g_CoreParameter.mountIsoLoader = ConstructFileLoader(g_CoreParameter.mountIso); } + g_CoreParameter.fileType = type; MIPSAnalyst::Reset(); Replacement_Init(); diff --git a/GPU/Debugger/Record.cpp b/GPU/Debugger/Record.cpp index 88ee8353ea..d9e17c7550 100644 --- a/GPU/Debugger/Record.cpp +++ b/GPU/Debugger/Record.cpp @@ -151,7 +151,12 @@ static void DirtyDrawnVRAM() { DirtyVRAM(gstate.getFrameBufAddress(), bytes, DirtyVRAMFlag::DRAWN); } -static void BeginRecording() { +static bool BeginRecording() { + if (PSP_CoreParameter().fileType == IdentifiedFileType::PPSSPP_GE_DUMP) { + // Can't record a GE dump. + return false; + } + active = true; nextFrame = false; lastTextures.clear(); @@ -178,6 +183,7 @@ static void BeginRecording() { } DirtyAllVRAM(DirtyVRAMFlag::DIRTY); + return true; } static void WriteCompressed(FILE *fp, const void *p, size_t sz) { @@ -619,6 +625,10 @@ void ClearCallback() { static void FinishRecording() { // We're done - this was just to write the result out. + if (!active) { + return; + } + Path filename = WriteRecording(); commands.clear(); pushbuf.clear(); @@ -785,7 +795,7 @@ void NotifyDisplay(u32 framebuf, int stride, int fmt) { } if (!active && nextFrame && (gstate_c.skipDrawReason & SKIPDRAW_SKIPFRAME) == 0) { NOTICE_LOG(Log::System, "Recording starting on display..."); - BeginRecording(); + BeginRecording(); // TODO: Handle return value. } if (!active) { return; diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index b396f2157f..8b30ccf01c 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -1398,7 +1398,7 @@ ScreenRenderFlags EmuScreen::render(ScreenRenderMode mode) { Draw::BackendState state = draw->GetCurrentBackendState(); if (state.valid) { - _dbg_assert_msg_(state.passes >= 1, "skipB: %d sw: %d mode: %d back: %d tag: %s", (int)skipBufferEffects, (int)g_Config.bSoftwareRendering, (int)mode, (int)g_Config.iGPUBackend, screenManager()->topScreen()->tag()); + _dbg_assert_msg_(state.passes >= 1, "skipB: %d sw: %d mode: %d back: %d tag: %s behi: %d", (int)skipBufferEffects, (int)g_Config.bSoftwareRendering, (int)mode, (int)g_Config.iGPUBackend, screenManager()->topScreen()->tag(), (int)g_Config.bRunBehindPauseMenu); // Workaround any remaining bugs like this. if (state.passes == 0) { draw->BindFramebufferAsRenderTarget(nullptr, { RPAction::CLEAR, RPAction::CLEAR, RPAction::CLEAR, }, "EmuScreen_SafeFallback");