This commit is contained in:
georgemoralis 2025-09-25 21:16:25 +03:00
parent a7a1ff8bd1
commit 6eb49ea575

View File

@ -230,7 +230,8 @@ s32 PS4_SYSV_ABI sceNpTrophyDestroyHandle(OrbisNpTrophyHandle handle) {
LOG_INFO(Lib_NpTrophy, "Handle {} destroyed", handle); LOG_INFO(Lib_NpTrophy, "Handle {} destroyed", handle);
return ORBIS_OK; return ORBIS_OK;
} }
size_t ReadFile(Common::FS::IOFile& file, void* buf, size_t nbytes) {
u64 ReadFile(Common::FS::IOFile& file, void* buf, u64 nbytes) {
const auto* memory = Core::Memory::Instance(); const auto* memory = Core::Memory::Instance();
// Invalidate up to the actual number of bytes that could be read. // Invalidate up to the actual number of bytes that could be read.
const auto remaining = file.GetSize() - file.Tell(); const auto remaining = file.GetSize() - file.Tell();
@ -240,7 +241,7 @@ size_t ReadFile(Common::FS::IOFile& file, void* buf, size_t nbytes) {
} }
int PS4_SYSV_ABI sceNpTrophyGetGameIcon(OrbisNpTrophyContext context, OrbisNpTrophyHandle handle, int PS4_SYSV_ABI sceNpTrophyGetGameIcon(OrbisNpTrophyContext context, OrbisNpTrophyHandle handle,
void* buffer, size_t* size) { void* buffer, u64* size) {
ASSERT(size != nullptr); ASSERT(size != nullptr);
const auto trophy_dir = const auto trophy_dir =
Common::FS::GetUserPath(Common::FS::PathType::MetaDataDir) / game_serial / "TrophyFiles"; Common::FS::GetUserPath(Common::FS::PathType::MetaDataDir) / game_serial / "TrophyFiles";
@ -251,7 +252,7 @@ int PS4_SYSV_ABI sceNpTrophyGetGameIcon(OrbisNpTrophyContext context, OrbisNpTro
LOG_ERROR(Lib_NpTrophy, "Failed to open trophy icon file: {}", icon_file.string()); LOG_ERROR(Lib_NpTrophy, "Failed to open trophy icon file: {}", icon_file.string());
return ORBIS_NP_TROPHY_ERROR_ICON_FILE_NOT_FOUND; return ORBIS_NP_TROPHY_ERROR_ICON_FILE_NOT_FOUND;
} }
size_t icon_size = icon.GetSize(); u64 icon_size = icon.GetSize();
if (buffer != nullptr) { if (buffer != nullptr) {
ReadFile(icon, buffer, *size); ReadFile(icon, buffer, *size);