From 17a4341bb337fc0ef7e949a1a6791e0e86536a33 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Fri, 20 Sep 2013 09:42:41 -0700 Subject: [PATCH] Don't allow save/restore ctx while list running. --- Core/HLE/sceGe.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Core/HLE/sceGe.cpp b/Core/HLE/sceGe.cpp index c55bd48ef5..f30f9ff558 100644 --- a/Core/HLE/sceGe.cpp +++ b/Core/HLE/sceGe.cpp @@ -470,10 +470,11 @@ u32 sceGeSaveContext(u32 ctxAddr) DEBUG_LOG(SCEGE, "sceGeSaveContext(%08x)", ctxAddr); gpu->SyncThread(); - if (sizeof(gstate) > 512 * 4) + if (gpu->DrawSync(1) != PSP_GE_LIST_COMPLETED) { - ERROR_LOG(SCEGE, "AARGH! sizeof(gstate) has grown too large!"); - return 0; + WARN_LOG(SCEGE, "sceGeSaveContext(%08x): lists in process, aborting", ctxAddr); + // Real error code. + return -1; } // Let's just dump gstate. @@ -492,10 +493,10 @@ u32 sceGeRestoreContext(u32 ctxAddr) DEBUG_LOG(SCEGE, "sceGeRestoreContext(%08x)", ctxAddr); gpu->SyncThread(); - if (sizeof(gstate) > 512 * 4) + if (gpu->DrawSync(1) != PSP_GE_LIST_COMPLETED) { - ERROR_LOG(SCEGE, "AARGH! sizeof(gstate) has grown too large!"); - return 0; + WARN_LOG(SCEGE, "sceGeRestoreContext(%08x): lists in process, aborting", ctxAddr); + return SCE_KERNEL_ERROR_BUSY; } if (Memory::IsValidAddress(ctxAddr))