3DS: Ensure writes update file modification time (fixes #2444)

This commit is contained in:
Vicki Pfau 2022-02-14 20:31:03 -08:00
parent 9cfa7120b1
commit e15911891c
2 changed files with 4 additions and 3 deletions

View File

@ -33,6 +33,7 @@ Emulation fixes:
- GBA Video: Fix Hblank timing (fixes mgba.io/i/2131, mgba.io/i/2310)
- GBA Video: Fix rare crash in modes 3-5
Other fixes:
- 3DS: Ensure writes update file modification time (fixes mgba.io/i/2444)
- Core: Don't attempt to restore rewind diffs past start of rewind
- FFmpeg: Fix crash when encoding audio with some containers
- FFmpeg: Fix GIF recording (fixes mgba.io/i/2393)

View File

@ -126,7 +126,7 @@ ssize_t _vf3dRead(struct VFile* vf, void* buffer, size_t size) {
ssize_t _vf3dWrite(struct VFile* vf, const void* buffer, size_t size) {
struct VFile3DS* vf3d = (struct VFile3DS*) vf;
u32 sizeWritten;
Result res = FSFILE_Write(vf3d->handle, &sizeWritten, vf3d->offset, buffer, size, FS_WRITE_FLUSH);
Result res = FSFILE_Write(vf3d->handle, &sizeWritten, vf3d->offset, buffer, size, FS_WRITE_FLUSH | FS_WRITE_UPDATE_TIME);
if (res) {
return -1;
}
@ -148,7 +148,7 @@ static void* _vf3dMap(struct VFile* vf, size_t size, int flags) {
static void _vf3dUnmap(struct VFile* vf, void* memory, size_t size) {
struct VFile3DS* vf3d = (struct VFile3DS*) vf;
u32 sizeWritten;
FSFILE_Write(vf3d->handle, &sizeWritten, 0, memory, size, FS_WRITE_FLUSH);
FSFILE_Write(vf3d->handle, &sizeWritten, 0, memory, size, FS_WRITE_FLUSH | FS_WRITE_UPDATE_TIME);
mappedMemoryFree(memory, size);
}
@ -168,7 +168,7 @@ static bool _vf3dSync(struct VFile* vf, void* buffer, size_t size) {
struct VFile3DS* vf3d = (struct VFile3DS*) vf;
if (buffer) {
u32 sizeWritten;
Result res = FSFILE_Write(vf3d->handle, &sizeWritten, 0, buffer, size, FS_WRITE_FLUSH);
Result res = FSFILE_Write(vf3d->handle, &sizeWritten, 0, buffer, size, FS_WRITE_FLUSH | FS_WRITE_UPDATE_TIME);
return R_SUCCEEDED(res);
}
FSFILE_Flush(vf3d->handle);