diff --git a/src/emucore/Serializer.cxx b/src/emucore/Serializer.cxx index 57657712a..2a66be122 100644 --- a/src/emucore/Serializer.cxx +++ b/src/emucore/Serializer.cxx @@ -33,8 +33,9 @@ Serializer::Serializer(const string& filename, Mode m) if(str && str->is_open()) { myStream = std::move(str); - myStream->exceptions( ios_base::failbit | ios_base::badbit | ios_base::eofbit ); rewind(); + myStream->exceptions( ios_base::failbit | ios_base::badbit | + ios_base::eofbit ); } } } @@ -57,8 +58,9 @@ Serializer::Serializer(const string& filename, Mode m) if(str && str->is_open()) { myStream = std::move(str); - myStream->exceptions( ios_base::failbit | ios_base::badbit | ios_base::eofbit ); rewind(); + myStream->exceptions( ios_base::failbit | ios_base::badbit | + ios_base::eofbit ); } } } @@ -71,9 +73,9 @@ Serializer::Serializer() // the stream before it is used for the first time if(myStream) { - myStream->exceptions( ios_base::failbit | ios_base::badbit | ios_base::eofbit ); putBool(true); rewind(); + myStream->exceptions( ios_base::failbit | ios_base::badbit | ios_base::eofbit ); } } @@ -100,7 +102,7 @@ size_t Serializer::size() myStream->seekp(0, std::ios::end); size_t s = myStream->tellp(); - setPosition(oldPos); + myStream->seekp(oldPos); return s; } diff --git a/src/gui/PlusRomsSetupDialog.cxx b/src/gui/PlusRomsSetupDialog.cxx index 72355a04f..5da2e55df 100644 --- a/src/gui/PlusRomsSetupDialog.cxx +++ b/src/gui/PlusRomsSetupDialog.cxx @@ -76,4 +76,4 @@ void PlusRomsSetupDialog::handleCommand(CommandSender* sender, int cmd, InputTextDialog::handleCommand(sender, cmd, data, id); break; } -} \ No newline at end of file +} diff --git a/src/libretro/StellaLIBRETRO.cxx b/src/libretro/StellaLIBRETRO.cxx index 7514458c5..9faa674e8 100644 --- a/src/libretro/StellaLIBRETRO.cxx +++ b/src/libretro/StellaLIBRETRO.cxx @@ -187,25 +187,20 @@ void StellaLIBRETRO::updateAudio() // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool StellaLIBRETRO::loadState(const void* data, size_t size) { -#if 0 Serializer state; - state.putByteArray(reinterpret_cast(data), static_cast(size)); + state.putByteArray(reinterpret_cast(data), size); if(!myOSystem->state().loadState(state)) return false; memcpy(system_ram, myOSystem->console().system().m6532().getRAM(), 128); return true; -#else - return false; -#endif } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool StellaLIBRETRO::saveState(void* data, size_t size) const { -#if 0 Serializer state; if (!myOSystem->state().saveState(state)) @@ -214,11 +209,8 @@ bool StellaLIBRETRO::saveState(void* data, size_t size) const if (state.size() > size) return false; - state.getByteArray(reinterpret_cast(data), static_cast(state.size())); + state.getByteArray(reinterpret_cast(data), state.size()); return true; -#else - return false; -#endif } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -