3DS: Better implementation of VFile3DS.map
Jeffrey Pfau jeffrey@endrift.com
Wed, 10 Dec 2014 01:43:56 -0800
1 files changed,
5 insertions(+),
3 deletions(-)
jump to
M
src/platform/3ds/3ds-vfs.c
→
src/platform/3ds/3ds-vfs.c
@@ -102,12 +102,14 @@ vf3d->offset += sizeWritten;
return sizeWritten; } -// TODO: Move these to a generic implementation static void* _vf3dMap(struct VFile* vf, size_t size, int flags) { + struct VFile3DS* vf3d = (struct VFile3DS*) vf; UNUSED(flags); void* buffer = anonymousMemoryMap(size); - vf->read(vf, buffer, size); - vf->seek(vf, -(off_t) size, SEEK_CUR); + if (buffer) { + u32 sizeRead; + FSFILE_Read(vf3d->handle, &sizeRead, 0, buffer, size); + } return buffer; }