mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-22 21:09:52 +00:00
Don't crash on trying to re-record a GE dump
This commit is contained in:
parent
2e53d2f9f9
commit
dd8f9b682f
@ -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;
|
||||
};
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
|
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user