NPDRM: Logging cleanup, remove assert (turn into debug assert)

This commit is contained in:
Henrik Rydgård 2024-11-01 20:10:10 +01:00
parent 6f9a6b0d6e
commit 2e53d2f9f9
2 changed files with 18 additions and 24 deletions

View File

@ -428,10 +428,12 @@ NPDRMDemoBlockDevice::NPDRMDemoBlockDevice(FileLoader *fileLoader)
memcpy(psarStr, &psar_id, 4); memcpy(psarStr, &psar_id, 4);
// Protect against a badly decrypted header, and send information through the assert about what's being played (implicitly). // Protect against a badly decrypted header, and send information through the assert about what's being played (implicitly).
_assert_msg_(blockLBAs_ <= 4096, "Bad blockLBAs in header: %08x (%s) psar: %s", blockLBAs_, fileLoader->GetPath().ToVisualString().c_str(), psarStr); _dbg_assert_msg_(blockLBAs_ <= 4096, "Bad blockLBAs in header: %08x (%s) psar: %s", blockLBAs_, fileLoader->GetPath().ToVisualString().c_str(), psarStr);
// When we remove the above assert, let's just try to survive. // When we remove the above assert, let's just try to survive.
if (blockLBAs_ > 4096) { if (blockLBAs_ > 4096) {
ERROR_LOG(Log::Loader, "Bad blockLBAs in header: %08x (%s) psar: %s", blockLBAs_, fileLoader->GetPath().ToVisualString().c_str(), psarStr);
// We'll end up displaying an error message since ReadBlock will fail.
return; return;
} }
@ -447,7 +449,7 @@ NPDRMDemoBlockDevice::NPDRMDemoBlockDevice(FileLoader *fileLoader)
table_ = new table_info[numBlocks_]; table_ = new table_info[numBlocks_];
readSize = fileLoader_->ReadAt(psarOffset + tableOffset_, 1, tableSize_, table_); readSize = fileLoader_->ReadAt(psarOffset + tableOffset_, 1, tableSize_, table_);
if (readSize!=tableSize_){ if (readSize != tableSize_){
ERROR_LOG(Log::Loader, "Invalid NPUMDIMG table!"); ERROR_LOG(Log::Loader, "Invalid NPUMDIMG table!");
} }

View File

@ -4,27 +4,23 @@
#include "Core/HLE/FunctionWrappers.h" #include "Core/HLE/FunctionWrappers.h"
#include "Core/HLE/sceIo.h" #include "Core/HLE/sceIo.h"
static int sceNpDrmSetLicenseeKey(u32 npDrmKeyAddr) static int sceNpDrmSetLicenseeKey(u32 npDrmKeyAddr) {
{ WARN_LOG(Log::HLE, "UNIMPL: sceNpDrmSetLicenseeKey(%08x)", npDrmKeyAddr);
INFO_LOG(Log::HLE, "call sceNpDrmSetLicenseeKey(%08x)", npDrmKeyAddr);
return 0; return 0;
} }
static int sceNpDrmClearLicenseeKey() static int sceNpDrmClearLicenseeKey() {
{ WARN_LOG(Log::HLE, "UNIMPL: sceNpDrmClearLicenseeKey()");
INFO_LOG(Log::HLE, "call sceNpDrmClearLicenseeKey()");
return 0; return 0;
} }
static int sceNpDrmRenameCheck(const char *filename) static int sceNpDrmRenameCheck(const char *filename) {
{ WARN_LOG(Log::HLE, "UNIMPL: sceNpDrmRenameCheck(%s)", filename);
INFO_LOG(Log::HLE, "call sceNpDrmRenameCheck(%s)", filename);
return 0; return 0;
} }
static int sceNpDrmEdataSetupKey(u32 edataFd) static int sceNpDrmEdataSetupKey(u32 edataFd) {
{ INFO_LOG(Log::HLE, "sceNpDrmEdataSetupKey(%x)", edataFd);
INFO_LOG(Log::HLE, "call sceNpDrmEdataSetupKey %x", edataFd);
int usec = 0; int usec = 0;
// set PGD offset // set PGD offset
int retval = __IoIoctl(edataFd, 0x04100002, 0x90, 0, 0, 0, usec); int retval = __IoIoctl(edataFd, 0x04100002, 0x90, 0, 0, 0, usec);
@ -37,20 +33,17 @@ static int sceNpDrmEdataSetupKey(u32 edataFd)
return hleDelayResult(retval, "io ctrl command", usec); return hleDelayResult(retval, "io ctrl command", usec);
} }
static int sceNpDrmEdataGetDataSize(u32 edataFd) static int sceNpDrmEdataGetDataSize(u32 edataFd) {
{ INFO_LOG(Log::HLE, "sceNpDrmEdataGetDataSize %x", edataFd);
INFO_LOG(Log::HLE, "call sceNpDrmEdataGetDataSize %x", edataFd);
return sceIoIoctl(edataFd, 0x04100010, 0, 0, 0, 0); return sceIoIoctl(edataFd, 0x04100010, 0, 0, 0, 0);
} }
static int sceNpDrmOpen() static int sceNpDrmOpen() {
{ ERROR_LOG(Log::HLE, "UNIMPL: sceNpDrmOpen()");
ERROR_LOG(Log::HLE, "UNIMPL sceNpDrmOpen");
return 0; return 0;
} }
const HLEFunction sceNpDrm[] = const HLEFunction sceNpDrm[] = {
{
{0XA1336091, &WrapI_U<sceNpDrmSetLicenseeKey>, "sceNpDrmSetLicenseeKey", 'i', "x"}, {0XA1336091, &WrapI_U<sceNpDrmSetLicenseeKey>, "sceNpDrmSetLicenseeKey", 'i', "x"},
{0X9B745542, &WrapI_V<sceNpDrmClearLicenseeKey>, "sceNpDrmClearLicenseeKey", 'i', "" }, {0X9B745542, &WrapI_V<sceNpDrmClearLicenseeKey>, "sceNpDrmClearLicenseeKey", 'i', "" },
{0X275987D1, &WrapI_C<sceNpDrmRenameCheck>, "sceNpDrmRenameCheck", 'i', "s"}, {0X275987D1, &WrapI_C<sceNpDrmRenameCheck>, "sceNpDrmRenameCheck", 'i', "s"},
@ -59,8 +52,7 @@ const HLEFunction sceNpDrm[] =
{0X2BAA4294, &WrapI_V<sceNpDrmOpen>, "sceNpDrmOpen", 'i', "" }, {0X2BAA4294, &WrapI_V<sceNpDrmOpen>, "sceNpDrmOpen", 'i', "" },
}; };
void Register_sceNpDrm() void Register_sceNpDrm() {
{
RegisterModule("sceNpDrm", ARRAY_SIZE(sceNpDrm), sceNpDrm); RegisterModule("sceNpDrm", ARRAY_SIZE(sceNpDrm), sceNpDrm);
RegisterModule("scePspNpDrm_user", ARRAY_SIZE(sceNpDrm), sceNpDrm); RegisterModule("scePspNpDrm_user", ARRAY_SIZE(sceNpDrm), sceNpDrm);
} }