From b38e6dd02deb42c3e9f6089912bcc3c639ab8583 Mon Sep 17 00:00:00 2001 From: mattweb28 Date: Mon, 8 Jul 2013 15:11:58 +0800 Subject: [PATCH] fix ioctl cmd=0x01020004 --- Core/HLE/sceIo.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Core/HLE/sceIo.cpp b/Core/HLE/sceIo.cpp index e5e35c4e6..cd01b9720 100644 --- a/Core/HLE/sceIo.cpp +++ b/Core/HLE/sceIo.cpp @@ -1607,11 +1607,14 @@ int __IoIoctl(u32 id, u32 cmd, u32 indataPtr, u32 inlen, u32 outdataPtr, u32 out } break; - // Get UMD file pointer + // Get UMD file offset case 0x01020004: - INFO_LOG(HLE, "sceIoIoCtl: Asked for fpointer of file %i", id); - if (Memory::IsValidAddress(outdataPtr) && outlen >= 4) { - Memory::Write_U32(f->info.fpointer, outdataPtr); + { + s32 offset = pspFileSystem.GetSeekPos(f->handle); + INFO_LOG(HLE, "sceIoIoCtl: Asked for file offset of file %i", id); + if (Memory::IsValidAddress(outdataPtr) && outlen >= 4) { + Memory::Write_U32(offset, outdataPtr); + } } break;