From c5e11c63c0437b1819145950fa1cef109aa1951e Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Wed, 22 Jan 2014 22:24:30 -0800 Subject: [PATCH] Now umd0: size is in sectors, not bytes. So we have to check based on that correctly. Darn it. --- Core/HLE/sceIo.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/HLE/sceIo.cpp b/Core/HLE/sceIo.cpp index 0cda9f1d5c..27b4d601a6 100644 --- a/Core/HLE/sceIo.cpp +++ b/Core/HLE/sceIo.cpp @@ -1261,7 +1261,7 @@ u32 sceIoDevctl(const char *name, int cmd, u32 argAddr, int argLen, u32 outPtr, case 0x01F20003: if (Memory::IsValidAddress(argAddr) && argLen >= 4) { PSPFileInfo info = pspFileSystem.GetFileInfo("umd1:"); - Memory::Write_U32((u32) (info.size / 2048) - 1, outPtr); + Memory::Write_U32((u32) (info.size) - 1, outPtr); return 0; } else { return ERROR_MEMSTICK_DEVCTL_BAD_PARAMS; @@ -2128,7 +2128,7 @@ int __IoIoctl(u32 id, u32 cmd, u32 indataPtr, u32 inlen, u32 outdataPtr, u32 out FileMove seek; s64 newPos = __IoLseekDest(f, seekInfo->offset, seekInfo->whence, seek); // Position is in sectors, don't forget. - if (newPos < 0 || newPos > f->info.size / 0x800) { + if (newPos < 0 || newPos > f->info.size) { // Not allowed to seek past the end of the file with this API. return SCE_KERNEL_ERROR_ERRNO_INVALID_FILE_SIZE; }