3DS: 3DS-capable version of _vfdMap and _vfdUnmap

This commit is contained in:
Jeffrey Pfau 2014-12-08 18:58:19 -08:00
parent 461eb3bae0
commit 211616e4f1
1 changed files with 13 additions and 0 deletions

View File

@ -15,6 +15,7 @@
#include <windows.h> #include <windows.h>
#define PATH_SEP '\\' #define PATH_SEP '\\'
#elif defined(_3DS) #elif defined(_3DS)
#include "util/memory.h"
#define PATH_SEP '/' #define PATH_SEP '/'
#else #else
#include <sys/mman.h> #include <sys/mman.h>
@ -143,6 +144,18 @@ static void _vfdUnmap(struct VFile* vf, void* memory, size_t size) {
vfd->hMap = 0; vfd->hMap = 0;
} }
#elif defined(_3DS) #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 #else
static void* _vfdMap(struct VFile* vf, size_t size, int flags) { static void* _vfdMap(struct VFile* vf, size_t size, int flags) {
struct VFileFD* vfd = (struct VFileFD*) vf; struct VFileFD* vfd = (struct VFileFD*) vf;