From 211616e4f139d90870f5bcfb798485e493e5bd8d Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Mon, 8 Dec 2014 18:58:19 -0800 Subject: [PATCH] 3DS: 3DS-capable version of _vfdMap and _vfdUnmap --- src/util/vfs.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/util/vfs.c b/src/util/vfs.c index 3df861852..9fbc19a32 100644 --- a/src/util/vfs.c +++ b/src/util/vfs.c @@ -15,6 +15,7 @@ #include #define PATH_SEP '\\' #elif defined(_3DS) +#include "util/memory.h" #define PATH_SEP '/' #else #include @@ -143,6 +144,18 @@ static void _vfdUnmap(struct VFile* vf, void* memory, size_t size) { 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;