diff --git a/Core/HLE/sceCtrl.cpp b/Core/HLE/sceCtrl.cpp index 58b80cd248..2a9e778ed4 100644 --- a/Core/HLE/sceCtrl.cpp +++ b/Core/HLE/sceCtrl.cpp @@ -37,8 +37,6 @@ #define CTRL_MODE_DIGITAL 0 #define CTRL_MODE_ANALOG 1 -const int PSP_CTRL_ERROR_INVALID_IDLE_PTR = 0x80000023; - const u32 NUM_CTRL_BUFFERS = 64; enum { @@ -433,9 +431,9 @@ int sceCtrlGetIdleCancelThreshold(u32 idleResetPtr, u32 idleBackPtr) DEBUG_LOG(SCECTRL, "sceCtrlSetIdleCancelThreshold(%08x, %08x)", idleResetPtr, idleBackPtr); if (idleResetPtr && !Memory::IsValidAddress(idleResetPtr)) - return PSP_CTRL_ERROR_INVALID_IDLE_PTR; + return SCE_KERNEL_ERROR_PRIV_REQUIRED; if (idleBackPtr && !Memory::IsValidAddress(idleBackPtr)) - return PSP_CTRL_ERROR_INVALID_IDLE_PTR; + return SCE_KERNEL_ERROR_PRIV_REQUIRED; if (idleResetPtr) Memory::Write_U32(ctrlIdleReset, idleResetPtr); diff --git a/Core/HLE/sceDmac.cpp b/Core/HLE/sceDmac.cpp index 5ae4c6abf4..d5d47124f9 100644 --- a/Core/HLE/sceDmac.cpp +++ b/Core/HLE/sceDmac.cpp @@ -78,7 +78,7 @@ u32 sceDmacMemcpy(u32 dst, u32 src, u32 size) { } if (dst + size >= 0x80000000 || src + size >= 0x80000000 || size >= 0x80000000) { ERROR_LOG(HLE, "sceDmacMemcpy(dest=%08x, src=%08x, size=%i): illegal size", dst, src, size); - return SCE_ERROR_PRIV_REQUIRED; + return SCE_KERNEL_ERROR_PRIV_REQUIRED; } if (dmacMemcpyDeadline > CoreTiming::GetTicks()) { @@ -103,7 +103,7 @@ u32 sceDmacTryMemcpy(u32 dst, u32 src, u32 size) { } if (dst + size >= 0x80000000 || src + size >= 0x80000000 || size >= 0x80000000) { ERROR_LOG(HLE, "sceDmacTryMemcpy(dest=%08x, src=%08x, size=%i): illegal size", dst, src, size); - return SCE_ERROR_PRIV_REQUIRED; + return SCE_KERNEL_ERROR_PRIV_REQUIRED; } if (dmacMemcpyDeadline > CoreTiming::GetTicks()) { diff --git a/Core/HLE/sceDmac.h b/Core/HLE/sceDmac.h index 690ba590f4..c2f9f498fd 100644 --- a/Core/HLE/sceDmac.h +++ b/Core/HLE/sceDmac.h @@ -19,10 +19,6 @@ class PointerWrap; -enum { - SCE_ERROR_PRIV_REQUIRED = 0x80000023, -}; - void __DmacInit(); void __DmacDoState(PointerWrap &p); diff --git a/Core/HLE/sceGe.cpp b/Core/HLE/sceGe.cpp index 5e549d4e8a..6d7c7efd6c 100644 --- a/Core/HLE/sceGe.cpp +++ b/Core/HLE/sceGe.cpp @@ -421,7 +421,7 @@ int sceGeBreak(u32 mode, u32 unknownPtr) if ((int)unknownPtr < 0 || (int)unknownPtr + 16 < 0) { WARN_LOG_REPORT(SCEGE, "sceGeBreak(mode=%d, unknown=%08x): invalid ptr", mode, unknownPtr); - return 0x80000023; + return SCE_KERNEL_ERROR_PRIV_REQUIRED; } else if (unknownPtr != 0) WARN_LOG_REPORT(SCEGE, "sceGeBreak(mode=%d, unknown=%08x): unknown ptr (%s)", mode, unknownPtr, Memory::IsValidAddress(unknownPtr) ? "valid" : "invalid"); diff --git a/Core/HLE/sceKernel.h b/Core/HLE/sceKernel.h index b0070488d5..f362b0e608 100644 --- a/Core/HLE/sceKernel.h +++ b/Core/HLE/sceKernel.h @@ -30,6 +30,7 @@ enum SCE_KERNEL_ERROR_ALREADY = 0x80000020, SCE_KERNEL_ERROR_BUSY = 0x80000021, SCE_KERNEL_ERROR_OUT_OF_MEMORY = 0x80000022, + SCE_KERNEL_ERROR_PRIV_REQUIRED = 0x80000023, SCE_KERNEL_ERROR_INVALID_ID = 0x80000100, SCE_KERNEL_ERROR_INVALID_NAME = 0x80000101, SCE_KERNEL_ERROR_INVALID_INDEX = 0x80000102, diff --git a/Core/HLE/scePower.cpp b/Core/HLE/scePower.cpp index 232b889142..3a434f25d2 100644 --- a/Core/HLE/scePower.cpp +++ b/Core/HLE/scePower.cpp @@ -36,7 +36,6 @@ struct VolatileWaitingThread { const int PSP_POWER_ERROR_TAKEN_SLOT = 0x80000020; const int PSP_POWER_ERROR_SLOTS_FULL = 0x80000022; -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; @@ -47,7 +46,10 @@ const int PSP_POWER_CB_BATTERY_FULL = 0x00000064; const int POWER_CB_AUTO = -1; +/* These are the callback slots for user mode applications. */ const int numberOfCBPowerSlots = 16; + +/* These are the callback slots for kernel mode applications. */ const int numberOfCBPowerSlotsPrivate = 32; static bool volatileMemLocked; @@ -132,7 +134,7 @@ int scePowerRegisterCallback(int slot, int cbId) { return PSP_POWER_ERROR_INVALID_SLOT; } if (slot >= numberOfCBPowerSlots) { - return PSP_POWER_ERROR_PRIVATE_SLOT; + return SCE_KERNEL_ERROR_PRIV_REQUIRED; } // TODO: If cbId is invalid return PSP_POWER_ERROR_INVALID_CB. if (cbId == 0) { @@ -173,7 +175,7 @@ int scePowerUnregisterCallback(int slotId) { return PSP_POWER_ERROR_INVALID_SLOT; } if (slotId >= numberOfCBPowerSlots) { - return PSP_POWER_ERROR_PRIVATE_SLOT; + return SCE_KERNEL_ERROR_PRIV_REQUIRED; } if (powerCbSlots[slotId] != 0) {