diff options
Diffstat (limited to 'backends/platform/ds/arm9/source')
-rw-r--r-- | backends/platform/ds/arm9/source/ramsave.cpp | 10 | ||||
-rw-r--r-- | backends/platform/ds/arm9/source/ramsave.h | 2 |
2 files changed, 11 insertions, 1 deletions
diff --git a/backends/platform/ds/arm9/source/ramsave.cpp b/backends/platform/ds/arm9/source/ramsave.cpp index 8442fd6b88..30c3a06721 100644 --- a/backends/platform/ds/arm9/source/ramsave.cpp +++ b/backends/platform/ds/arm9/source/ramsave.cpp @@ -64,6 +64,7 @@ DSSaveFile::DSSaveFile(SCUMMSave* s, bool compressed, u8* data) { } isTempFile = false; + eosReached = false; } DSSaveFile::~DSSaveFile() { @@ -167,11 +168,13 @@ int DSSaveFile::saveToSaveRAM(vu8* address) { void DSSaveFile::reset() { ptr = 0; + eosReached = false; } uint32 DSSaveFile::read(void *buf, uint32 size) { if (ptr + size > save.size) { size = save.size - ptr; + eosReached = true; if (size < 0) size = 0; } memcpy(buf, saveData + ptr, size); @@ -204,11 +207,16 @@ bool DSSaveFile::seek(int32 pos, int whence) { break; } } + eosReached = false; return true; } bool DSSaveFile::eos() const { - return ptr >= (int) save.size; + return eosReached; +} + +void DSSaveFile::clearErr() { + eosReached = false; } bool DSSaveFile::skip(uint32 bytes) { diff --git a/backends/platform/ds/arm9/source/ramsave.h b/backends/platform/ds/arm9/source/ramsave.h index e276775b66..98430b9d11 100644 --- a/backends/platform/ds/arm9/source/ramsave.h +++ b/backends/platform/ds/arm9/source/ramsave.h @@ -52,6 +52,7 @@ class DSSaveFile : public Common::InSaveFile, public Common::OutSaveFile { SCUMMSave* origHeader; bool isOpenFlag; bool isTempFile; + bool eosReached; public: DSSaveFile(); @@ -62,6 +63,7 @@ public: bool isOpen() const { return isOpenFlag; } virtual bool eos() const; + virtual void clearErr(); virtual bool skip(uint32 size); virtual int32 pos() const; |