mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-18 23:07:07 -05:00
Until Dawn (CUSA02636) bundles a libSceFios2.prx that imports two libSceDiscMap functions, sceDiscMapIsRequestOnHDD (lbQKqsERhtE) and ioKMruft1ek, and no host library exported them. Both now return SCE_DISC_MAP_ERROR_NO_BITMAP_INFO (0x81100004) and write nothing, as shadPS4 and fpPS4 do. That is the error the console library returns while it has no disc bitmap loaded. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
37 lines
1.3 KiB
C++
37 lines
1.3 KiB
C++
#include "prx/libc/include/general/VabiMacros.hpp"
|
|
|
|
#include <cstdint>
|
|
#include <cstdio>
|
|
#include <cstdlib>
|
|
|
|
extern "C" {
|
|
std::int32_t APS5_VABI sceDiscMapIsRequestOnHDD(const char* path, std::int64_t offset, std::int64_t size, std::int32_t* result);
|
|
std::int32_t APS5_VABI sceDiscMapUnknown_ioKMruft1ek(const char* path, std::int64_t offset, std::int64_t size, void* flags, void* out1, void* out2);
|
|
}
|
|
|
|
namespace {
|
|
|
|
constexpr std::int32_t noBitmapInfo = static_cast<std::int32_t>(0x81100004);
|
|
|
|
void Require(bool condition, const char* message) {
|
|
if (!condition) {
|
|
std::fprintf(stderr, "DiscMap: %s\n", message);
|
|
std::abort();
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
int main() {
|
|
std::int32_t result = 0x5a5a5a5a;
|
|
Require(sceDiscMapIsRequestOnHDD("/app0/data.bin", 0, 0x10000, &result) == noBitmapInfo, "sceDiscMapIsRequestOnHDD did not report the missing bitmap");
|
|
Require(result == 0x5a5a5a5a, "sceDiscMapIsRequestOnHDD wrote its result");
|
|
std::uint64_t flags = ~0ull;
|
|
std::uint64_t out1 = ~0ull;
|
|
std::uint64_t out2 = ~0ull;
|
|
Require(sceDiscMapUnknown_ioKMruft1ek("/app0/data.bin", 0x8000, 0x10000, &flags, &out1, &out2) == noBitmapInfo, "ioKMruft1ek did not report the missing bitmap");
|
|
Require(flags == ~0ull && out1 == ~0ull && out2 == ~0ull, "ioKMruft1ek wrote an output");
|
|
std::puts("DiscMap tests passed");
|
|
return 0;
|
|
}
|