From ec009bc299a14e738d0cd4bc203d231d8c44df19 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 31 Mar 2013 23:42:56 -0700 Subject: [PATCH] Cleanup a few GPU error codes. --- Core/HLE/sceCtrl.cpp | 3 +-- Core/HLE/sceKernel.h | 1 + Core/HLE/scePower.cpp | 5 ++--- GPU/GPUCommon.cpp | 11 ++++++++++- GPU/Null/NullGpu.cpp | 1 - 5 files changed, 14 insertions(+), 7 deletions(-) diff --git a/Core/HLE/sceCtrl.cpp b/Core/HLE/sceCtrl.cpp index b79c9733db..53623bfdce 100644 --- a/Core/HLE/sceCtrl.cpp +++ b/Core/HLE/sceCtrl.cpp @@ -32,7 +32,6 @@ #define CTRL_MODE_DIGITAL 0 #define CTRL_MODE_ANALOG 1 -const int PSP_CTRL_ERROR_INVALID_MODE = 0x80000107; const int PSP_CTRL_ERROR_INVALID_IDLE_PTR = 0x80000023; const u32 NUM_CTRL_BUFFERS = 64; @@ -351,7 +350,7 @@ u32 sceCtrlSetSamplingMode(u32 mode) DEBUG_LOG(HLE, "sceCtrlSetSamplingMode(%i)", mode); if (mode > 1) - return PSP_CTRL_ERROR_INVALID_MODE; + return SCE_KERNEL_ERROR_INVALID_MODE; retVal = analogEnabled == true ? CTRL_MODE_ANALOG : CTRL_MODE_DIGITAL; analogEnabled = mode == CTRL_MODE_ANALOG ? true : false; diff --git a/Core/HLE/sceKernel.h b/Core/HLE/sceKernel.h index c133b18f23..ffedb37e3f 100644 --- a/Core/HLE/sceKernel.h +++ b/Core/HLE/sceKernel.h @@ -30,6 +30,7 @@ enum SCE_KERNEL_ERROR_OUT_OF_MEMORY = 0x80000022, SCE_KERNEL_ERROR_INVALID_ID = 0x80000100, SCE_KERNEL_ERROR_INVALID_SIZE = 0x80000104, + SCE_KERNEL_ERROR_INVALID_MODE = 0x80000107, SCE_KERNEL_ERROR_INVALID_VALUE = 0x800001fe, SCE_KERNEL_ERROR_INVALID_ARGUMENT = 0x800001ff, SCE_KERNEL_ERROR_ERROR = 0x80020001, diff --git a/Core/HLE/scePower.cpp b/Core/HLE/scePower.cpp index d29b04c515..ead31b33c8 100644 --- a/Core/HLE/scePower.cpp +++ b/Core/HLE/scePower.cpp @@ -29,7 +29,6 @@ const int PSP_POWER_ERROR_PRIVATE_SLOT = 0x80000023; const int PSP_POWER_ERROR_EMPTY_SLOT = 0x80000025; const int PSP_POWER_ERROR_INVALID_CB = 0x80000100; const int PSP_POWER_ERROR_INVALID_SLOT = 0x80000102; -const int PSP_POWER_ERROR_INVALID_TYPE = 0x80000107; const int PSP_POWER_CB_AC_POWER = 0x00001000; const int PSP_POWER_CB_BATTERY_EXIST = 0x00000080; @@ -167,7 +166,7 @@ int sceKernelPowerLock(int lockType) { if (lockType == 0) { return 0; } else { - return PSP_POWER_ERROR_INVALID_TYPE; + return SCE_KERNEL_ERROR_INVALID_MODE; } } @@ -176,7 +175,7 @@ int sceKernelPowerUnlock(int lockType) { if (lockType == 0) { return 0; } else { - return PSP_POWER_ERROR_INVALID_TYPE; + return SCE_KERNEL_ERROR_INVALID_MODE; } } diff --git a/GPU/GPUCommon.cpp b/GPU/GPUCommon.cpp index 83888eda80..09c9f14b4c 100644 --- a/GPU/GPUCommon.cpp +++ b/GPU/GPUCommon.cpp @@ -16,13 +16,19 @@ void init() { } u32 GPUCommon::DrawSync(int mode) { + if (mode < 0 || mode > 1) + return SCE_KERNEL_ERROR_INVALID_MODE; + return 0; } int GPUCommon::ListSync(int listid, int mode) { + if (mode < 0 || mode > 1) + return SCE_KERNEL_ERROR_INVALID_MODE; + // TODO - if (mode != 1) + if (mode == 0) return 0; return 0; @@ -84,6 +90,9 @@ u32 GPUCommon::Continue() u32 GPUCommon::Break(int mode) { + if (mode < 0 || mode > 1) + return SCE_KERNEL_ERROR_INVALID_MODE; + // TODO return 0; } diff --git a/GPU/Null/NullGpu.cpp b/GPU/Null/NullGpu.cpp index a801ef7986..88aec51ed7 100644 --- a/GPU/Null/NullGpu.cpp +++ b/GPU/Null/NullGpu.cpp @@ -25,7 +25,6 @@ NullGPU::NullGPU() { - interruptsEnabled_ = true; } NullGPU::~NullGPU()