diff --git a/Core/HLE/sceGe.cpp b/Core/HLE/sceGe.cpp index b7310ac11f..a0d7f00df6 100644 --- a/Core/HLE/sceGe.cpp +++ b/Core/HLE/sceGe.cpp @@ -403,10 +403,24 @@ int sceGeContinue() return gpu->Continue(); } -int sceGeBreak(u32 mode) +int sceGeBreak(u32 mode, u32 unknownPtr) { + if (mode > 1) + { + WARN_LOG(SCEGE, "sceGeBreak(mode=%d, unknown=%08x): invalid mode", mode, unknownPtr); + return SCE_KERNEL_ERROR_INVALID_MODE; + } + // Not sure what this is supposed to be for... + if ((int)unknownPtr < 0 || (int)unknownPtr + 16 < 0) + { + WARN_LOG_REPORT(SCEGE, "sceGeBreak(mode=%d, unknown=%08x): invalid ptr", mode, unknownPtr); + return 0x80000023; + } + else if (unknownPtr != 0) + WARN_LOG_REPORT(SCEGE, "sceGeBreak(mode=%d, unknown=%08x): unknown ptr (%s)", mode, unknownPtr, Memory::IsValidAddress(unknownPtr) ? "valid" : "invalid"); + //mode => 0 : current dlist 1: all drawing - DEBUG_LOG(SCEGE, "sceGeBreak(mode=%d)", mode); + DEBUG_LOG(SCEGE, "sceGeBreak(mode=%d, unknown=%08x)", mode, unknownPtr); return gpu->Break(mode); } @@ -601,7 +615,7 @@ const HLEFunction sceGe_user[] = {0xE0D68148, WrapI_UU, "sceGeListUpdateStallAddr"}, {0x03444EB4, WrapI_UU, "sceGeListSync"}, {0xB287BD61, WrapU_U, "sceGeDrawSync"}, - {0xB448EC0D, WrapI_U, "sceGeBreak"}, + {0xB448EC0D, WrapI_UU, "sceGeBreak"}, {0x4C06E472, WrapI_V, "sceGeContinue"}, {0xA4FC06A4, WrapU_U, "sceGeSetCallback"}, {0x05DB22CE, WrapI_U, "sceGeUnsetCallback"}, diff --git a/GPU/GPUCommon.cpp b/GPU/GPUCommon.cpp index 2e465ee6b3..48cd04c288 100644 --- a/GPU/GPUCommon.cpp +++ b/GPU/GPUCommon.cpp @@ -377,7 +377,7 @@ u32 GPUCommon::Break(int mode) { return SCE_KERNEL_ERROR_INVALID_MODE; if (!currentList) - return 0x80000020; + return SCE_KERNEL_ERROR_ALREADY; if (mode == 1) { @@ -410,9 +410,9 @@ u32 GPUCommon::Break(int mode) { ERROR_LOG_REPORT(G3D, "sceGeBreak: can't break signal-pausing list"); } else - return 0x80000020; + return SCE_KERNEL_ERROR_ALREADY; } - return 0x80000021; + return SCE_KERNEL_ERROR_BUSY; } if (currentList->state == PSP_GE_DL_STATE_QUEUED)