all repos — mgba @ 28218b24655fa2aeaaecf87525d349f87924ad66

mGBA Game Boy Advance Emulator

Fix .log -> .dat for the first chunk, and make sure it bails if the load fails
Jeffrey Pfau jeffrey@endrift.com
Wed, 30 Jul 2014 00:03:19 -0700
commit

28218b24655fa2aeaaecf87525d349f87924ad66

parent

9cc97410d3804f85390d08313c92d089dec6d3b0

1 files changed, 6 insertions(+), 2 deletions(-)

jump to
M src/gba/gba-rr.csrc/gba/gba-rr.c

@@ -94,8 +94,12 @@ return false;

} char buffer[14]; - snprintf(buffer, sizeof(buffer), "%u.log", rr->streamId); + snprintf(buffer, sizeof(buffer), "%u" BINEXT, rr->streamId); rr->movieStream = rr->streamDir->openFile(rr->streamDir, buffer, O_RDONLY); + if (!rr->movieStream) { + return false; + } + rr->autorecord = autorecord; rr->peekedTag = TAG_INVALID; _readTag(rr, rr->movieStream); // Discard the buffer

@@ -127,7 +131,7 @@ return false;

} char buffer[14]; - snprintf(buffer, sizeof(buffer), "%u.log", rr->streamId); + snprintf(buffer, sizeof(buffer), "%u" BINEXT, rr->streamId); rr->movieStream = rr->streamDir->openFile(rr->streamDir, buffer, O_TRUNC | O_CREAT | O_WRONLY); if (!_emitTag(rr, rr->movieStream, TAG_BEGIN)) { rr->movieStream->close(rr->movieStream);