3DS: 3DS-capable version of _vfdMap and _vfdUnmap
Jeffrey Pfau jeffrey@endrift.com
Mon, 08 Dec 2014 18:58:19 -0800
1 files changed,
13 insertions(+),
0 deletions(-)
jump to
M
src/util/vfs.c
→
src/util/vfs.c
@@ -15,6 +15,7 @@ #include <io.h>
#include <windows.h> #define PATH_SEP '\\' #elif defined(_3DS) +#include "util/memory.h" #define PATH_SEP '/' #else #include <sys/mman.h>@@ -143,6 +144,18 @@ CloseHandle(vfd->hMap);
vfd->hMap = 0; } #elif defined(_3DS) +static void* _vfdMap(struct VFile* vf, size_t size, int flags) { + UNUSED(flags); + void* buffer = anonymousMemoryMap(size); + vf->read(vf, buffer, size); + vf->seek(vf, -(off_t) size, SEEK_CUR); + return buffer; +} + +static void _vfdUnmap(struct VFile* vf, void* memory, size_t size) { + UNUSED(vf); + mappedMemoryFree(memory, size); +} #else static void* _vfdMap(struct VFile* vf, size_t size, int flags) { struct VFileFD* vfd = (struct VFileFD*) vf;