diff --git a/src/gba/serialize.c b/src/gba/serialize.c index a904b9699..4db0c8588 100644 --- a/src/gba/serialize.c +++ b/src/gba/serialize.c @@ -173,7 +173,7 @@ bool GBADeserialize(struct GBA* gba, const struct GBASerializedState* state) { return true; } -#if !defined(_3DS) && !defined(PSP) +#ifndef _3DS struct VFile* GBAGetState(struct GBA* gba, struct VDir* dir, int slot, bool write) { char suffix[5] = { '\0' }; snprintf(suffix, sizeof(suffix), ".ss%d", slot); @@ -251,7 +251,7 @@ static bool _loadPNGState(struct GBA* gba, struct VFile* vf) { } #endif -#if !defined(_3DS) && !defined(PSP) +#ifndef _3DS bool GBASaveState(struct GBAThread* threadContext, struct VDir* dir, int slot, bool screenshot) { struct VFile* vf = GBAGetState(threadContext->gba, dir, slot, true); if (!vf) { diff --git a/src/platform/psp/sce-vfs.c b/src/platform/psp/sce-vfs.c index 989e60218..59d31257b 100644 --- a/src/platform/psp/sce-vfs.c +++ b/src/platform/psp/sce-vfs.c @@ -23,10 +23,6 @@ static void _vfsceUnmap(struct VFile* vf, void* memory, size_t size); static void _vfsceTruncate(struct VFile* vf, size_t size); static ssize_t _vfsceSize(struct VFile* vf); -struct VFile* VFileOpen(const char* path, int flags) { - return VFileOpenSce(path, flags, 0666); -} - struct VFile* VFileOpenSce(const char* path, int flags, SceMode mode) { struct VFileSce* vfsce = malloc(sizeof(struct VFileSce)); if (!vfsce) { diff --git a/src/util/vfs.c b/src/util/vfs.c index e56f8bfb9..4cf207e34 100644 --- a/src/util/vfs.c +++ b/src/util/vfs.c @@ -5,6 +5,10 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "vfs.h" +#ifdef PSP +#include "platform/psp/sce-vfs.h" +#endif + struct VFile* VFileOpen(const char* path, int flags) { #ifdef USE_VFS_FILE const char* chflags; @@ -30,6 +34,8 @@ struct VFile* VFileOpen(const char* path, int flags) { break; } return VFileFOpen(path, chflags); +#elif defined(PSP) + return VFileOpenSce(path, flags, 0666); #else return VFileOpenFD(path, flags); #endif