PSP2: Sync files per descriptor

This commit is contained in:
Jeffrey Pfau 2016-08-13 19:44:26 -07:00
parent ac4ae6d4e6
commit 8774530707
2 changed files with 4 additions and 3 deletions

View File

@ -52,6 +52,7 @@ Misc:
- GBA Video: Remove old slow path fallback - GBA Video: Remove old slow path fallback
- GBA Video: Optimize sprite drawing - GBA Video: Optimize sprite drawing
- GBA BIOS: Use custom ArcTan, not relying on OS - GBA BIOS: Use custom ArcTan, not relying on OS
- PSP2: Sync files per descriptor
0.4.1: (2016-07-11) 0.4.1: (2016-07-11)
Bugfixes: Bugfixes:

View File

@ -76,7 +76,7 @@ struct VFile* VFileOpenSce(const char* path, int flags, SceMode mode) {
bool _vfsceClose(struct VFile* vf) { bool _vfsceClose(struct VFile* vf) {
struct VFileSce* vfsce = (struct VFileSce*) vf; struct VFileSce* vfsce = (struct VFileSce*) vf;
sceIoSyncByFd(vfsce->fd);
return sceIoClose(vfsce->fd) >= 0; return sceIoClose(vfsce->fd) >= 0;
} }
@ -112,6 +112,7 @@ static void _vfsceUnmap(struct VFile* vf, void* memory, size_t size) {
SceOff cur = sceIoLseek(vfsce->fd, 0, SEEK_CUR); SceOff cur = sceIoLseek(vfsce->fd, 0, SEEK_CUR);
sceIoWrite(vfsce->fd, memory, size); sceIoWrite(vfsce->fd, memory, size);
sceIoLseek(vfsce->fd, cur, SEEK_SET); sceIoLseek(vfsce->fd, cur, SEEK_SET);
sceIoSyncByFd(vfsce->fd);
mappedMemoryFree(memory, size); mappedMemoryFree(memory, size);
} }
@ -136,8 +137,7 @@ bool _vfsceSync(struct VFile* vf, const void* buffer, size_t size) {
sceIoWrite(vfsce->fd, buffer, size); sceIoWrite(vfsce->fd, buffer, size);
sceIoLseek(vfsce->fd, cur, SEEK_SET); sceIoLseek(vfsce->fd, cur, SEEK_SET);
} }
// TODO: Get the right device return sceIoSyncByFd(vfsce->fd) >= 0;
return sceIoSync("ux0:", 0) >= 0;
} }
struct VDir* VDirOpen(const char* path) { struct VDir* VDirOpen(const char* path) {