Core/HLE/sceKernel.h: Added name for PSP error code 0x80000023 and replaced the used if its error number with its error code name.

This commit is contained in:
Felix-Dev 2014-04-03 18:42:10 +02:00
commit d434435340
6 changed files with 11 additions and 14 deletions

View File

@ -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);

View File

@ -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()) {

View File

@ -19,10 +19,6 @@
class PointerWrap;
enum {
SCE_ERROR_PRIV_REQUIRED = 0x80000023,
};
void __DmacInit();
void __DmacDoState(PointerWrap &p);

View File

@ -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");

View File

@ -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,

View File

@ -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) {