PSP2: Fix mapping/unmapping from not at 0

This commit is contained in:
Jeffrey Pfau 2016-08-15 22:11:53 -07:00
parent 7212854cdd
commit 39d9c7efd1
2 changed files with 3 additions and 0 deletions

View File

@ -23,6 +23,7 @@ Bugfixes:
- Qt: Fix hanging key press after disabling autofire
- PSP2: Delete threads after they return
- GBA Video: WIN0/1 take priority over OBJWIN
- PSP2: Fix mapping/unmapping from not at 0
Misc:
- 3DS: Use blip_add_delta_fast for a small speed improvement
- OpenGL: Log shader compilation failure

View File

@ -101,6 +101,7 @@ static void* _vfsceMap(struct VFile* vf, size_t size, int flags) {
void* buffer = anonymousMemoryMap(size);
if (buffer) {
SceOff cur = sceIoLseek(vfsce->fd, 0, SEEK_CUR);
sceIoLseek(vfsce->fd, 0, SEEK_SET);
sceIoRead(vfsce->fd, buffer, size);
sceIoLseek(vfsce->fd, cur, SEEK_SET);
}
@ -110,6 +111,7 @@ static void* _vfsceMap(struct VFile* vf, size_t size, int flags) {
static void _vfsceUnmap(struct VFile* vf, void* memory, size_t size) {
struct VFileSce* vfsce = (struct VFileSce*) vf;
SceOff cur = sceIoLseek(vfsce->fd, 0, SEEK_CUR);
sceIoLseek(vfsce->fd, 0, SEEK_SET);
sceIoWrite(vfsce->fd, memory, size);
sceIoLseek(vfsce->fd, cur, SEEK_SET);
sceIoSyncByFd(vfsce->fd);