diff --git a/src/platform/psp2/sce-vfs.c b/src/platform/psp2/sce-vfs.c index 88cb12119..a694763cf 100644 --- a/src/platform/psp2/sce-vfs.c +++ b/src/platform/psp2/sce-vfs.c @@ -98,14 +98,18 @@ static void* _vfsceMap(struct VFile* vf, size_t size, int flags) { UNUSED(flags); void* buffer = anonymousMemoryMap(size); if (buffer) { + SceOff cur = sceIoLseek(vfsce->fd, 0, SEEK_CUR); sceIoRead(vfsce->fd, buffer, size); + sceIoLseek(vfsce->fd, cur, SEEK_SET); } return buffer; } static void _vfsceUnmap(struct VFile* vf, void* memory, size_t size) { struct VFileSce* vfsce = (struct VFileSce*) vf; + SceOff cur = sceIoLseek(vfsce->fd, 0, SEEK_CUR); sceIoWrite(vfsce->fd, memory, size); + sceIoLseek(vfsce->fd, cur, SEEK_SET); mappedMemoryFree(memory, size); }