Move two more error codes to the enum

This commit is contained in:
Henrik Rydgård committed 2026-01-08 22:02:08 +01:00
1 parent 21bd6174f5
commit a591fbff38
4 files changed
+13 -11

No files matched your search

+4
View File
@@ -648,4 +648,8 @@ enum PSPErrorCode : u32 {
SCE_NET_ADHOCCTL_ERROR_CHANNEL_NOT_MATCH = 0x80410b11,
SCE_NET_ADHOCCTL_ERROR_TOO_MANY_HANDLERS = 0x80410b12,
SCE_NET_ADHOCCTL_ERROR_STACKSIZE_TOO_SHORT = 0x80410B13,
// Error codes matching JPCSP
SCE_NPDRM_ERROR_NO_K_LICENSEE_SET = 0x80550901,
SCE_NPDRM_ERROR_INVALID_FILE = 0x80550902,
};
+1 -1
View File
@@ -2589,7 +2589,7 @@ int __IoIoctl(u32 id, u32 cmd, u32 indataPtr, u32 inlen, u32 outdataPtr, u32 out
key_ptr = nullptr;
}
DEBUG_LOG(Log::sceIo, "Decrypting PGD DRM files");
INFO_LOG(Log::sceIo, "ioctl: Decrypting PGD DRM files from '%s'", f->fullpath.c_str());
pspFileSystem.SeekFile(f->handle, (s32)f->pgd_offset, FILEMOVE_BEGIN);
pspFileSystem.ReadFile(f->handle, pgd_header, 0x90);
KirkState *kirk = __ChnnlsvKirkState();
+4
View File
@@ -1633,6 +1633,10 @@ const char *KernelErrorToString(u32 err) {
case SCE_NET_ADHOCCTL_ERROR_TOO_MANY_HANDLERS: return "SCE_NET_ADHOCCTL_ERROR_TOO_MANY_HANDLERS";
case SCE_NET_ADHOCCTL_ERROR_STACKSIZE_TOO_SHORT: return "SCE_NET_ADHOCCTL_ERROR_STACKSIZE_TOO_SHORT";
// NPDRM
case SCE_NPDRM_ERROR_NO_K_LICENSEE_SET: return "SCE_NPDRM_ERROR_NO_K_LICENSEE_SET";
case SCE_NPDRM_ERROR_INVALID_FILE: return "SCE_NPDRM_ERROR_INVALID_FILE";
default:
return nullptr;
}
+4 -10
View File
@@ -1,5 +1,4 @@
#include "scePspNpDrm_user.h"
#include "Core/HLE/scePspNpDrm_user.h"
#include "Core/MemMapHelpers.h"
#include "Core/HLE/HLE.h"
#include "Core/HLE/FunctionWrappers.h"
@@ -13,10 +12,6 @@ static const int PSP_NPDRM_LICENSEE_KEY_LENGTH = 0x10;
static u8 licenseeKey[PSP_NPDRM_LICENSEE_KEY_LENGTH];
static bool isLicenseeKeySet = false;
// Error codes matching JPCSP
static const int ERROR_NPDRM_NO_K_LICENSEE_SET = 0x80550901;
static const int ERROR_NPDRM_INVALID_FILE = 0x80550902;
// Check if the file is an encrypted EDAT file by reading the magic number
static bool isEncrypted(u32 edataFd) {
// Check for "\0PSPEDAT" magic number
@@ -67,7 +62,7 @@ static int sceNpDrmSetLicenseeKey(u32 npDrmKeyAddr) {
isLicenseeKeySet = true;
return hleLogInfo(Log::sceIo, 0);
}
return hleLogError(Log::sceIo, ERROR_NPDRM_INVALID_FILE, "Invalid address");
return hleLogError(Log::sceIo, SCE_NPDRM_ERROR_INVALID_FILE, "Invalid address");
}
static int sceNpDrmClearLicenseeKey() {
@@ -85,7 +80,7 @@ static int sceNpDrmEdataSetupKey(u32 edataFd) {
// Return an error if the key has not been set.
// Note: An empty key is valid, as long as it was set with sceNpDrmSetLicenseeKey.
if (!isLicenseeKeySet) {
return hleLogError(Log::sceIo, ERROR_NPDRM_NO_K_LICENSEE_SET, "Licensee key not set");
return hleLogError(Log::sceIo, SCE_NPDRM_ERROR_NO_K_LICENSEE_SET, "Licensee key not set");
}
// Get file info to validate the file descriptor
@@ -129,8 +124,7 @@ static int sceNpDrmEdataGetDataSize(u32 edataFd) {
}
static int sceNpDrmOpen() {
ERROR_LOG(Log::sceIo, "UNIMPL: sceNpDrmOpen()");
return 0;
return hleLogError(Log::sceIo, 0, "UNIMPL: sceNpDrmOpen()");
}
const HLEFunction sceNpDrm[] = {