Merge branch 'port/psp' into port/crucible

This commit is contained in:
Jeffrey Pfau 2015-06-20 03:32:22 -07:00
commit ce7088e17d
3 changed files with 8 additions and 6 deletions

View File

@ -173,7 +173,7 @@ bool GBADeserialize(struct GBA* gba, const struct GBASerializedState* state) {
return true; return true;
} }
#if !defined(_3DS) && !defined(PSP) #ifndef _3DS
struct VFile* GBAGetState(struct GBA* gba, struct VDir* dir, int slot, bool write) { struct VFile* GBAGetState(struct GBA* gba, struct VDir* dir, int slot, bool write) {
char suffix[5] = { '\0' }; char suffix[5] = { '\0' };
snprintf(suffix, sizeof(suffix), ".ss%d", slot); snprintf(suffix, sizeof(suffix), ".ss%d", slot);
@ -251,7 +251,7 @@ static bool _loadPNGState(struct GBA* gba, struct VFile* vf) {
} }
#endif #endif
#if !defined(_3DS) && !defined(PSP) #ifndef _3DS
bool GBASaveState(struct GBAThread* threadContext, struct VDir* dir, int slot, bool screenshot) { bool GBASaveState(struct GBAThread* threadContext, struct VDir* dir, int slot, bool screenshot) {
struct VFile* vf = GBAGetState(threadContext->gba, dir, slot, true); struct VFile* vf = GBAGetState(threadContext->gba, dir, slot, true);
if (!vf) { if (!vf) {

View File

@ -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 void _vfsceTruncate(struct VFile* vf, size_t size);
static ssize_t _vfsceSize(struct VFile* vf); 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 VFile* VFileOpenSce(const char* path, int flags, SceMode mode) {
struct VFileSce* vfsce = malloc(sizeof(struct VFileSce)); struct VFileSce* vfsce = malloc(sizeof(struct VFileSce));
if (!vfsce) { if (!vfsce) {

View File

@ -5,6 +5,10 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "vfs.h" #include "vfs.h"
#ifdef PSP
#include "platform/psp/sce-vfs.h"
#endif
struct VFile* VFileOpen(const char* path, int flags) { struct VFile* VFileOpen(const char* path, int flags) {
#ifdef USE_VFS_FILE #ifdef USE_VFS_FILE
const char* chflags; const char* chflags;
@ -30,6 +34,8 @@ struct VFile* VFileOpen(const char* path, int flags) {
break; break;
} }
return VFileFOpen(path, chflags); return VFileFOpen(path, chflags);
#elif defined(PSP)
return VFileOpenSce(path, flags, 0666);
#else #else
return VFileOpenFD(path, flags); return VFileOpenFD(path, flags);
#endif #endif