all repos — mgba @ 3d5e0f29fa3050e11dfe9db6411c88ca85f9ab5a

mGBA Game Boy Advance Emulator

3DS: Better implementation of VFile3DS.map
Jeffrey Pfau jeffrey@endrift.com
Wed, 10 Dec 2014 01:43:56 -0800
commit

3d5e0f29fa3050e11dfe9db6411c88ca85f9ab5a

parent

82cccd74eb2115bbfd475291f41e261473937bf5

1 files changed, 5 insertions(+), 3 deletions(-)

jump to
M src/platform/3ds/3ds-vfs.csrc/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; }