From 694e92dc82c3deb92bce8f639b59aadc5aecc8a5 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Mon, 6 Sep 2021 19:39:34 -0700 Subject: [PATCH 1/2] Core: Use FileBlockDevice for PBPs without an ISO. --- Core/FileSystems/BlockDevices.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Core/FileSystems/BlockDevices.cpp b/Core/FileSystems/BlockDevices.cpp index 0cbd59bb9a..abe6a042dc 100644 --- a/Core/FileSystems/BlockDevices.cpp +++ b/Core/FileSystems/BlockDevices.cpp @@ -44,10 +44,13 @@ BlockDevice *constructBlockDevice(FileLoader *fileLoader) { size_t size = fileLoader->ReadAt(0, 1, 4, buffer); if (size == 4 && !memcmp(buffer, "CISO", 4)) return new CISOFileBlockDevice(fileLoader); - else if (size == 4 && !memcmp(buffer, "\x00PBP", 4)) - return new NPDRMDemoBlockDevice(fileLoader); - else - return new FileBlockDevice(fileLoader); + if (size == 4 && !memcmp(buffer, "\x00PBP", 4)) { + uint32_t psarOffset = 0; + size = fileLoader->ReadAt(0x24, 1, 4, &psarOffset); + if (size == 4 && psarOffset < fileLoader->FileSize()) + return new NPDRMDemoBlockDevice(fileLoader); + } + return new FileBlockDevice(fileLoader); } u32 BlockDevice::CalculateCRC(volatile bool *cancel) { From 825d9a8d2b63354e9dd39686ca3cc30a6e68bb70 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Mon, 6 Sep 2021 19:40:40 -0700 Subject: [PATCH 2/2] Reporting: Calculate CRC for PSN games. --- Core/Reporting.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Core/Reporting.cpp b/Core/Reporting.cpp index 9f4d7317b6..fc02b27f31 100644 --- a/Core/Reporting.cpp +++ b/Core/Reporting.cpp @@ -107,8 +107,7 @@ namespace Reporting static int CalculateCRCThread() { SetCurrentThreadName("ReportCRC"); - // TODO: Use the blockDevice from pspFileSystem? - FileLoader *fileLoader = ConstructFileLoader(crcFilename); + FileLoader *fileLoader = ResolveFileLoaderTarget(ConstructFileLoader(crcFilename)); BlockDevice *blockDevice = constructBlockDevice(fileLoader); u32 crc = 0;