diff --git a/src/common/SoundSDL.cxx b/src/common/SoundSDL.cxx index 6f466633f..6314b23eb 100644 --- a/src/common/SoundSDL.cxx +++ b/src/common/SoundSDL.cxx @@ -406,11 +406,9 @@ bool SoundSDL::save(Serializer& out) const out.putInt(myLastRegisterSetCycle); } - catch(const char* msg) + catch(...) { - ostringstream buf; - buf << "ERROR: SoundSDL::save" << endl << " " << msg << endl; - myOSystem->logMessage(buf.str(), 0); + myOSystem->logMessage("ERROR: SoundSDL::save", 0); return false; } @@ -449,11 +447,9 @@ bool SoundSDL::load(Serializer& in) if(!myIsMuted) SDL_PauseAudio(0); } } - catch(const char* msg) + catch(...) { - ostringstream buf; - buf << "ERROR: SoundSDL::load" << endl << " " << msg << endl; - myOSystem->logMessage(buf.str(), 0); + myOSystem->logMessage("ERROR: SoundSDL::load", 0); return false; } diff --git a/src/emucore/Cart0840.cxx b/src/emucore/Cart0840.cxx index c398b771e..0609c4a1c 100644 --- a/src/emucore/Cart0840.cxx +++ b/src/emucore/Cart0840.cxx @@ -200,9 +200,9 @@ bool Cartridge0840::save(Serializer& out) const out.putString(name()); out.putShort(myCurrentBank); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: Cartridge0840::save" << endl << " " << msg << endl; + cerr << "ERROR: Cartridge0840::save" << endl; return false; } @@ -219,9 +219,9 @@ bool Cartridge0840::load(Serializer& in) myCurrentBank = in.getShort(); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: Cartridge0840::load" << endl << " " << msg << endl; + cerr << "ERROR: Cartridge0840::load" << endl; return false; } diff --git a/src/emucore/Cart2K.cxx b/src/emucore/Cart2K.cxx index 08a349816..38f49bfd0 100644 --- a/src/emucore/Cart2K.cxx +++ b/src/emucore/Cart2K.cxx @@ -141,9 +141,9 @@ bool Cartridge2K::save(Serializer& out) const { out.putString(name()); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: Cartridge2K::save" << endl << " " << msg << endl; + cerr << "ERROR: Cartridge2K::save" << endl; return false; } @@ -158,9 +158,9 @@ bool Cartridge2K::load(Serializer& in) if(in.getString() != name()) return false; } - catch(const char* msg) + catch(...) { - cerr << "ERROR: Cartridge2K::load" << endl << " " << msg << endl; + cerr << "ERROR: Cartridge2K::load" << endl; return false; } diff --git a/src/emucore/Cart3E.cxx b/src/emucore/Cart3E.cxx index 2085e2df6..e589643e0 100644 --- a/src/emucore/Cart3E.cxx +++ b/src/emucore/Cart3E.cxx @@ -277,9 +277,9 @@ bool Cartridge3E::save(Serializer& out) const out.putShort(myCurrentBank); out.putByteArray(myRAM, 32768); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: Cartridge3E::save" << endl << " " << msg << endl; + cerr << "ERROR: Cartridge3E::save" << endl; return false; } @@ -297,9 +297,9 @@ bool Cartridge3E::load(Serializer& in) myCurrentBank = in.getShort(); in.getByteArray(myRAM, 32768); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: Cartridge3E::load" << endl << " " << msg << endl; + cerr << "ERROR: Cartridge3E::load" << endl; return false; } diff --git a/src/emucore/Cart3F.cxx b/src/emucore/Cart3F.cxx index c3ea2e020..245f409ea 100644 --- a/src/emucore/Cart3F.cxx +++ b/src/emucore/Cart3F.cxx @@ -194,9 +194,9 @@ bool Cartridge3F::save(Serializer& out) const out.putString(name()); out.putShort(myCurrentBank); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: Cartridge3F::save" << endl << " " << msg << endl; + cerr << "ERROR: Cartridge3F::save" << endl; return false; } @@ -213,9 +213,9 @@ bool Cartridge3F::load(Serializer& in) myCurrentBank = in.getShort(); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: Cartridge3F::load" << endl << " " << msg << endl; + cerr << "ERROR: Cartridge3F::load" << endl; return false; } diff --git a/src/emucore/Cart4A50.cxx b/src/emucore/Cart4A50.cxx index c0076d49c..edcae7ef6 100644 --- a/src/emucore/Cart4A50.cxx +++ b/src/emucore/Cart4A50.cxx @@ -468,9 +468,9 @@ bool Cartridge4A50::save(Serializer& out) const out.putByte(myLastData); out.putShort(myLastAddress); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: Cartridge4A40::save" << endl << " " << msg << endl; + cerr << "ERROR: Cartridge4A40::save" << endl; return false; } @@ -501,9 +501,9 @@ bool Cartridge4A50::load(Serializer& in) myLastData = in.getByte(); myLastAddress = in.getShort(); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: Cartridge4A50::load" << endl << " " << msg << endl; + cerr << "ERROR: Cartridge4A50::load" << endl; return false; } diff --git a/src/emucore/Cart4K.cxx b/src/emucore/Cart4K.cxx index 600eaa125..9de7a81d8 100644 --- a/src/emucore/Cart4K.cxx +++ b/src/emucore/Cart4K.cxx @@ -118,9 +118,9 @@ bool Cartridge4K::save(Serializer& out) const { out.putString(name()); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: Cartridge4K::save" << endl << " " << msg << endl; + cerr << "ERROR: Cartridge4K::save" << endl; return false; } @@ -135,9 +135,9 @@ bool Cartridge4K::load(Serializer& in) if(in.getString() != name()) return false; } - catch(const char* msg) + catch(...) { - cerr << "ERROR: Cartridge4K::load" << endl << " " << msg << endl; + cerr << "ERROR: Cartridge4K::load" << endl; return false; } diff --git a/src/emucore/CartAR.cxx b/src/emucore/CartAR.cxx index 7e18e1aec..23dbbdd4e 100644 --- a/src/emucore/CartAR.cxx +++ b/src/emucore/CartAR.cxx @@ -503,9 +503,9 @@ bool CartridgeAR::save(Serializer& out) const // Indicates if a write is pending or not out.putBool(myWritePending); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: CartridgeAR::save" << endl << " " << msg << endl; + cerr << "ERROR: CartridgeAR::save" << endl; return false; } @@ -554,9 +554,9 @@ bool CartridgeAR::load(Serializer& in) // Indicates if a write is pending or not myWritePending = in.getBool(); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: CartridgeAR::load" << endl << " " << msg << endl; + cerr << "ERROR: CartridgeAR::load" << endl; return false; } diff --git a/src/emucore/CartCM.cxx b/src/emucore/CartCM.cxx index 591ddd94a..5b6b587a5 100644 --- a/src/emucore/CartCM.cxx +++ b/src/emucore/CartCM.cxx @@ -207,9 +207,9 @@ bool CartridgeCM::save(Serializer& out) const out.putByte(myColumn); out.putByteArray(myRAM, 2048); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: CartridgeCM::save" << endl << " " << msg << endl; + cerr << "ERROR: CartridgeCM::save" << endl; return false; } @@ -229,9 +229,9 @@ bool CartridgeCM::load(Serializer& in) myColumn = in.getByte(); in.getByteArray(myRAM, 2048); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: CartridgeCM::load" << endl << " " << msg << endl; + cerr << "ERROR: CartridgeCM::load" << endl; return false; } diff --git a/src/emucore/CartCTY.cxx b/src/emucore/CartCTY.cxx index 7a1b1bfa9..2f9d75b29 100644 --- a/src/emucore/CartCTY.cxx +++ b/src/emucore/CartCTY.cxx @@ -321,9 +321,9 @@ bool CartridgeCTY::save(Serializer& out) const out.putInt((uInt32)(myFractionalClocks * 100000000.0)); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: CartridgeCTY::save" << endl << " " << msg << endl; + cerr << "ERROR: CartridgeCTY::save" << endl; return false; } @@ -349,9 +349,9 @@ bool CartridgeCTY::load(Serializer& in) mySystemCycles = (Int32)in.getInt(); myFractionalClocks = (double)in.getInt() / 100000000.0; } - catch(const char* msg) + catch(...) { - cerr << "ERROR: CartridgeCTY::load" << endl << " " << msg << endl; + cerr << "ERROR: CartridgeCTY::load" << endl; return false; } return true; @@ -522,7 +522,7 @@ void CartridgeCTY::wipeAllScores() { serializer.putByteArray(scoreRAM, 256); } - catch(const char* msg) + catch(...) { // Maybe add logging here that save failed? cerr << name() << ": ERROR wiping score tables" << endl; diff --git a/src/emucore/CartCV.cxx b/src/emucore/CartCV.cxx index 0b4852249..dc596a53d 100644 --- a/src/emucore/CartCV.cxx +++ b/src/emucore/CartCV.cxx @@ -206,9 +206,9 @@ bool CartridgeCV::save(Serializer& out) const out.putString(name()); out.putByteArray(myRAM, 1024); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: CartridgeCV::save" << endl << " " << msg << endl; + cerr << "ERROR: CartridgeCV::save" << endl; return false; } @@ -225,9 +225,9 @@ bool CartridgeCV::load(Serializer& in) in.getByteArray(myRAM, 1024); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: CartridgeCV::load" << endl << " " << msg << endl; + cerr << "ERROR: CartridgeCV::load" << endl; return false; } diff --git a/src/emucore/CartDPC.cxx b/src/emucore/CartDPC.cxx index fd34cc7c2..ed5f4e3eb 100644 --- a/src/emucore/CartDPC.cxx +++ b/src/emucore/CartDPC.cxx @@ -504,9 +504,9 @@ bool CartridgeDPC::save(Serializer& out) const out.putInt(mySystemCycles); out.putInt((uInt32)(myFractionalClocks * 100000000.0)); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: CartridgeDPC::save" << endl << " " << msg << endl; + cerr << "ERROR: CartridgeDPC::save" << endl; return false; } @@ -547,9 +547,9 @@ bool CartridgeDPC::load(Serializer& in) mySystemCycles = (Int32)in.getInt(); myFractionalClocks = (double)in.getInt() / 100000000.0; } - catch(const char* msg) + catch(...) { - cerr << "ERROR: CartridgeDPC::load" << endl << " " << msg << endl; + cerr << "ERROR: CartridgeDPC::load" << endl; return false; } diff --git a/src/emucore/CartDPCPlus.cxx b/src/emucore/CartDPCPlus.cxx index c19042896..7c8b65cf3 100644 --- a/src/emucore/CartDPCPlus.cxx +++ b/src/emucore/CartDPCPlus.cxx @@ -698,9 +698,9 @@ bool CartridgeDPCPlus::save(Serializer& out) const out.putInt(mySystemCycles); out.putInt((uInt32)(myFractionalClocks * 100000000.0)); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: CartridgeDPCPlus::save" << endl << " " << msg << endl; + cerr << "ERROR: CartridgeDPCPlus::save" << endl; return false; } @@ -756,9 +756,9 @@ bool CartridgeDPCPlus::load(Serializer& in) mySystemCycles = (Int32)in.getInt(); myFractionalClocks = (double)in.getInt() / 100000000.0; } - catch(const char* msg) + catch(...) { - cerr << "ERROR: CartridgeDPCPlus::load" << endl << " " << msg << endl; + cerr << "ERROR: CartridgeDPCPlus::load" << endl; return false; } diff --git a/src/emucore/CartE0.cxx b/src/emucore/CartE0.cxx index 2c755a1a9..0c18e0513 100644 --- a/src/emucore/CartE0.cxx +++ b/src/emucore/CartE0.cxx @@ -237,9 +237,9 @@ bool CartridgeE0::save(Serializer& out) const out.putString(name()); out.putShortArray(myCurrentSlice, 4); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: CartridgeE0::save" << endl << " " << msg << endl; + cerr << "ERROR: CartridgeE0::save" << endl; return false; } @@ -256,9 +256,9 @@ bool CartridgeE0::load(Serializer& in) in.getShortArray(myCurrentSlice, 4); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: CartridgeE0::load" << endl << " " << msg << endl; + cerr << "ERROR: CartridgeE0::load" << endl; return false; } diff --git a/src/emucore/CartE7.cxx b/src/emucore/CartE7.cxx index f06329a2c..3e5fa2ff3 100644 --- a/src/emucore/CartE7.cxx +++ b/src/emucore/CartE7.cxx @@ -305,9 +305,9 @@ bool CartridgeE7::save(Serializer& out) const out.putShort(myCurrentRAM); out.putByteArray(myRAM, 2048); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: CartridgeE7::save" << endl << " " << msg << endl; + cerr << "ERROR: CartridgeE7::save" << endl; return false; } @@ -326,9 +326,9 @@ bool CartridgeE7::load(Serializer& in) myCurrentRAM = in.getShort(); in.getByteArray(myRAM, 2048); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: CartridgeE7::load" << endl << " " << msg << endl; + cerr << "ERROR: CartridgeE7::load" << endl; return false; } diff --git a/src/emucore/CartEF.cxx b/src/emucore/CartEF.cxx index e4abc3e2b..2847b42c8 100644 --- a/src/emucore/CartEF.cxx +++ b/src/emucore/CartEF.cxx @@ -148,9 +148,9 @@ bool CartridgeEF::save(Serializer& out) const out.putString(name()); out.putShort(myCurrentBank); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: CartridgeEF::save" << endl << " " << msg << endl; + cerr << "ERROR: CartridgeEF::save" << endl; return false; } @@ -167,9 +167,9 @@ bool CartridgeEF::load(Serializer& in) myCurrentBank = in.getShort(); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: CartridgeEF::load" << endl << " " << msg << endl; + cerr << "ERROR: CartridgeEF::load" << endl; return false; } diff --git a/src/emucore/CartEFSC.cxx b/src/emucore/CartEFSC.cxx index da0f98cb1..ee9f5e77c 100644 --- a/src/emucore/CartEFSC.cxx +++ b/src/emucore/CartEFSC.cxx @@ -211,9 +211,9 @@ bool CartridgeEFSC::save(Serializer& out) const out.putShort(myCurrentBank); out.putByteArray(myRAM, 128); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: CartridgeEFSC::save" << endl << " " << msg << endl; + cerr << "ERROR: CartridgeEFSC::save" << endl; return false; } @@ -231,9 +231,9 @@ bool CartridgeEFSC::load(Serializer& in) myCurrentBank = in.getShort(); in.getByteArray(myRAM, 128); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: CartridgeEFSC::load" << endl << " " << msg << endl; + cerr << "ERROR: CartridgeEFSC::load" << endl; return false; } diff --git a/src/emucore/CartF0.cxx b/src/emucore/CartF0.cxx index 01d861605..ccee8ea7a 100644 --- a/src/emucore/CartF0.cxx +++ b/src/emucore/CartF0.cxx @@ -162,9 +162,9 @@ bool CartridgeF0::save(Serializer& out) const out.putString(name()); out.putShort(myCurrentBank); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: CartridgeF0::save" << endl << " " << msg << endl; + cerr << "ERROR: CartridgeF0::save" << endl; return false; } @@ -181,9 +181,9 @@ bool CartridgeF0::load(Serializer& in) myCurrentBank = in.getShort(); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: CartridgeF0::load" << endl << " " << msg << endl; + cerr << "ERROR: CartridgeF0::load" << endl; return false; } diff --git a/src/emucore/CartF4.cxx b/src/emucore/CartF4.cxx index 664b05320..f51cf951a 100644 --- a/src/emucore/CartF4.cxx +++ b/src/emucore/CartF4.cxx @@ -153,9 +153,9 @@ bool CartridgeF4::save(Serializer& out) const out.putString(name()); out.putShort(myCurrentBank); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: CartridgeF4::save" << endl << " " << msg << endl; + cerr << "ERROR: CartridgeF4::save" << endl; return false; } @@ -172,9 +172,9 @@ bool CartridgeF4::load(Serializer& in) myCurrentBank = in.getShort(); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: CartridgeF4::load" << endl << " " << msg << endl; + cerr << "ERROR: CartridgeF4::load" << endl; return false; } diff --git a/src/emucore/CartF4SC.cxx b/src/emucore/CartF4SC.cxx index b5bea3c45..349eb5feb 100644 --- a/src/emucore/CartF4SC.cxx +++ b/src/emucore/CartF4SC.cxx @@ -214,9 +214,9 @@ bool CartridgeF4SC::save(Serializer& out) const out.putShort(myCurrentBank); out.putByteArray(myRAM, 128); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: CartridgeF4SC::save" << endl << " " << msg << endl; + cerr << "ERROR: CartridgeF4SC::save" << endl; return false; } @@ -234,9 +234,9 @@ bool CartridgeF4SC::load(Serializer& in) myCurrentBank = in.getShort(); in.getByteArray(myRAM, 128); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: CartridgeF4SC::load" << endl << " " << msg << endl; + cerr << "ERROR: CartridgeF4SC::load" << endl; return false; } diff --git a/src/emucore/CartF6.cxx b/src/emucore/CartF6.cxx index 71a211bda..8cbd0a186 100644 --- a/src/emucore/CartF6.cxx +++ b/src/emucore/CartF6.cxx @@ -193,9 +193,9 @@ bool CartridgeF6::save(Serializer& out) const out.putString(name()); out.putShort(myCurrentBank); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: CartridgeF6::save" << endl << " " << msg << endl; + cerr << "ERROR: CartridgeF6::save" << endl; return false; } @@ -212,9 +212,9 @@ bool CartridgeF6::load(Serializer& in) myCurrentBank = in.getShort(); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: CartridgeF6::load" << endl << " " << msg << endl; + cerr << "ERROR: CartridgeF6::load" << endl; return false; } diff --git a/src/emucore/CartF6SC.cxx b/src/emucore/CartF6SC.cxx index a4c522f8a..023914325 100644 --- a/src/emucore/CartF6SC.cxx +++ b/src/emucore/CartF6SC.cxx @@ -257,9 +257,9 @@ bool CartridgeF6SC::save(Serializer& out) const out.putShort(myCurrentBank); out.putByteArray(myRAM, 128); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: CartridgeF6SC::save" << endl << " " << msg << endl; + cerr << "ERROR: CartridgeF6SC::save" << endl; return false; } @@ -277,9 +277,9 @@ bool CartridgeF6SC::load(Serializer& in) myCurrentBank = in.getShort(); in.getByteArray(myRAM, 128); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: CartridgeF6SC::load" << endl << " " << msg << endl; + cerr << "ERROR: CartridgeF6SC::load" << endl; return false; } diff --git a/src/emucore/CartF8.cxx b/src/emucore/CartF8.cxx index 059319ac7..9881180e9 100644 --- a/src/emucore/CartF8.cxx +++ b/src/emucore/CartF8.cxx @@ -180,9 +180,9 @@ bool CartridgeF8::save(Serializer& out) const out.putString(name()); out.putShort(myCurrentBank); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: CartridgeF8::save" << endl << " " << msg << endl; + cerr << "ERROR: CartridgeF8::save" << endl; return false; } @@ -199,9 +199,9 @@ bool CartridgeF8::load(Serializer& in) myCurrentBank = in.getShort(); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: CartridgeF8SC::load" << endl << " " << msg << endl; + cerr << "ERROR: CartridgeF8SC::load" << endl; return false; } diff --git a/src/emucore/CartF8SC.cxx b/src/emucore/CartF8SC.cxx index 0689bdaa3..9d2a4aa3a 100644 --- a/src/emucore/CartF8SC.cxx +++ b/src/emucore/CartF8SC.cxx @@ -237,9 +237,9 @@ bool CartridgeF8SC::save(Serializer& out) const out.putShort(myCurrentBank); out.putByteArray(myRAM, 128); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: CartridgeF8SC::save" << endl << " " << msg << endl; + cerr << "ERROR: CartridgeF8SC::save" << endl; return false; } @@ -257,9 +257,9 @@ bool CartridgeF8SC::load(Serializer& in) myCurrentBank = in.getShort(); in.getByteArray(myRAM, 128); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: CartridgeF8SC::load" << endl << " " << msg << endl; + cerr << "ERROR: CartridgeF8SC::load" << endl; return false; } diff --git a/src/emucore/CartFA.cxx b/src/emucore/CartFA.cxx index 72d486ba6..a6759dbdd 100644 --- a/src/emucore/CartFA.cxx +++ b/src/emucore/CartFA.cxx @@ -247,9 +247,9 @@ bool CartridgeFA::save(Serializer& out) const out.putShort(myCurrentBank); out.putByteArray(myRAM, 256); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: CartridgeFA::save" << endl << " " << msg << endl; + cerr << "ERROR: CartridgeFA::save" << endl; return false; } @@ -267,9 +267,9 @@ bool CartridgeFA::load(Serializer& in) myCurrentBank = in.getShort(); in.getByteArray(myRAM, 256); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: CartridgeFA::load" << endl << " " << msg << endl; + cerr << "ERROR: CartridgeFA::load" << endl; return false; } diff --git a/src/emucore/CartFA2.cxx b/src/emucore/CartFA2.cxx index c32d5eeef..f838a87ea 100644 --- a/src/emucore/CartFA2.cxx +++ b/src/emucore/CartFA2.cxx @@ -310,9 +310,9 @@ bool CartridgeFA2::save(Serializer& out) const out.putShort(myCurrentBank); out.putByteArray(myRAM, 256); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: CartridgeFA2::save" << endl << " " << msg << endl; + cerr << "ERROR: CartridgeFA2::save" << endl; return false; } @@ -330,9 +330,9 @@ bool CartridgeFA2::load(Serializer& in) myCurrentBank = in.getShort(); in.getByteArray(myRAM, 256); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: CartridgeFA2::load" << endl << " " << msg << endl; + cerr << "ERROR: CartridgeFA2::load" << endl; return false; } @@ -386,7 +386,7 @@ uInt8 CartridgeFA2::ramReadWrite() { serializer.getByteArray(myRAM, 256); } - catch(const char* msg) + catch(...) { memset(myRAM, 0, 256); } @@ -398,9 +398,10 @@ uInt8 CartridgeFA2::ramReadWrite() { serializer.putByteArray(myRAM, 256); } - catch(const char* msg) + catch(...) { // Maybe add logging here that save failed? + cerr << name() << ": ERROR saving score table" << endl; } myRamAccessTimeout += 101000; // Add 101 ms delay for write } diff --git a/src/emucore/CartFE.cxx b/src/emucore/CartFE.cxx index 24c9fa901..66bd2e278 100644 --- a/src/emucore/CartFE.cxx +++ b/src/emucore/CartFE.cxx @@ -167,9 +167,9 @@ bool CartridgeFE::save(Serializer& out) const out.putShort(myLastAddress1); out.putShort(myLastAddress2); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: CartridgeFE::save" << endl << " " << msg << endl; + cerr << "ERROR: CartridgeFE::save" << endl; return false; } @@ -187,9 +187,9 @@ bool CartridgeFE::load(Serializer& in) myLastAddress1 = in.getShort(); myLastAddress2 = in.getShort(); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: CartridgeF8SC::load" << endl << " " << msg << endl; + cerr << "ERROR: CartridgeF8SC::load" << endl; return false; } diff --git a/src/emucore/CartMC.cxx b/src/emucore/CartMC.cxx index 25ddf1bdb..6ab57182d 100644 --- a/src/emucore/CartMC.cxx +++ b/src/emucore/CartMC.cxx @@ -257,9 +257,9 @@ bool CartridgeMC::save(Serializer& out) const // The 32K of RAM out.putByteArray(myRAM, 32 * 1024); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: CartridgeMC::save" << endl << " " << msg << endl; + cerr << "ERROR: CartridgeMC::save" << endl; return false; } @@ -280,9 +280,9 @@ bool CartridgeMC::load(Serializer& in) // The 32K of RAM in.getByteArray(myRAM, 32 * 1024); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: CartridgeMC::load" << endl << " " << msg << endl; + cerr << "ERROR: CartridgeMC::load" << endl; return false; } diff --git a/src/emucore/CartSB.cxx b/src/emucore/CartSB.cxx index 148018831..bbe592f7b 100644 --- a/src/emucore/CartSB.cxx +++ b/src/emucore/CartSB.cxx @@ -180,9 +180,9 @@ bool CartridgeSB::save(Serializer& out) const out.putString(name()); out.putShort(myCurrentBank); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: CartridgeSB::save" << endl << " " << msg << endl; + cerr << "ERROR: CartridgeSB::save" << endl; return false; } @@ -199,9 +199,9 @@ bool CartridgeSB::load(Serializer& in) myCurrentBank = in.getShort(); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: CartridgeSB::load" << endl << " " << msg << endl; + cerr << "ERROR: CartridgeSB::load" << endl; return false; } diff --git a/src/emucore/CartUA.cxx b/src/emucore/CartUA.cxx index 3badc409d..8ef2ff9b2 100644 --- a/src/emucore/CartUA.cxx +++ b/src/emucore/CartUA.cxx @@ -188,9 +188,9 @@ bool CartridgeUA::save(Serializer& out) const out.putString(name()); out.putShort(myCurrentBank); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: CartridgeUA::save" << endl << " " << msg << endl; + cerr << "ERROR: CartridgeUA::save" << endl; return false; } @@ -207,9 +207,9 @@ bool CartridgeUA::load(Serializer& in) myCurrentBank = in.getShort(); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: CartridgeUA::load" << endl << " " << msg << endl; + cerr << "ERROR: CartridgeUA::load" << endl; return false; } diff --git a/src/emucore/CartX07.cxx b/src/emucore/CartX07.cxx index fa33b039f..88b209947 100644 --- a/src/emucore/CartX07.cxx +++ b/src/emucore/CartX07.cxx @@ -172,9 +172,9 @@ bool CartridgeX07::save(Serializer& out) const out.putString(name()); out.putShort(myCurrentBank); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: CartridgeX07::save" << endl << " " << msg << endl; + cerr << "ERROR: CartridgeX07::save" << endl; return false; } @@ -191,9 +191,9 @@ bool CartridgeX07::load(Serializer& in) myCurrentBank = in.getShort(); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: CartridgeX07::load" << endl << " " << msg << endl; + cerr << "ERROR: CartridgeX07::load" << endl; return false; } diff --git a/src/emucore/Console.cxx b/src/emucore/Console.cxx index e00d7b7aa..36edeb58d 100644 --- a/src/emucore/Console.cxx +++ b/src/emucore/Console.cxx @@ -242,9 +242,9 @@ bool Console::save(Serializer& out) const mySwitches->save(out))) return false; } - catch(const char* msg) + catch(...) { - cerr << "ERROR: Console::save" << endl << " " << msg << endl; + cerr << "ERROR: Console::save" << endl; return false; } @@ -265,9 +265,9 @@ bool Console::load(Serializer& in) mySwitches->load(in))) return false; } - catch(const char* msg) + catch(...) { - cerr << "ERROR: Console::load" << endl << " " << msg << endl; + cerr << "ERROR: Console::load" << endl; return false; } diff --git a/src/emucore/M6502.cxx b/src/emucore/M6502.cxx index 276c9bd67..c7f131a8a 100644 --- a/src/emucore/M6502.cxx +++ b/src/emucore/M6502.cxx @@ -405,9 +405,9 @@ bool M6502::save(Serializer& out) const out.putShort(myLastSrcAddressY); out.putShort(myDataAddressForPoke); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: M6502::save" << endl << " " << msg << endl; + cerr << "ERROR: M6502::save" << endl; return false; } @@ -453,9 +453,9 @@ bool M6502::load(Serializer& in) myLastSrcAddressY = in.getShort(); myDataAddressForPoke = in.getShort(); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: M6502::laod" << endl << " " << msg << endl; + cerr << "ERROR: M6502::laod" << endl; return false; } diff --git a/src/emucore/M6532.cxx b/src/emucore/M6532.cxx index 0d40916ec..a09943063 100644 --- a/src/emucore/M6532.cxx +++ b/src/emucore/M6532.cxx @@ -315,9 +315,9 @@ bool M6532::save(Serializer& out) const out.putByte(myOutB); out.putByteArray(myOutTimer, 4); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: M6532::save" << endl << " " << msg << endl; + cerr << "ERROR: M6532::save" << endl; return false; } @@ -347,9 +347,9 @@ bool M6532::load(Serializer& in) myOutB = in.getByte(); in.getByteArray(myOutTimer, 4); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: M6532::load" << endl << " " << msg << endl; + cerr << "ERROR: M6532::load" << endl; return false; } diff --git a/src/emucore/StateManager.cxx b/src/emucore/StateManager.cxx index 856fc1a3f..dfbab3ae0 100644 --- a/src/emucore/StateManager.cxx +++ b/src/emucore/StateManager.cxx @@ -314,9 +314,9 @@ bool StateManager::saveState(Serializer& out) } } } - catch(const char* msg) + catch(...) { - cerr << "ERROR: StateManager::saveState(Serializer&)" << endl << " " << msg << endl; + cerr << "ERROR: StateManager::saveState(Serializer&)" << endl; } return false; } diff --git a/src/emucore/System.cxx b/src/emucore/System.cxx index 7a6f2fe7b..a2966f6de 100644 --- a/src/emucore/System.cxx +++ b/src/emucore/System.cxx @@ -321,9 +321,9 @@ bool System::save(Serializer& out) const if(!myDevices[i]->save(out)) return false; } - catch(const char* msg) + catch(...) { - cerr << "ERROR: System::save" << endl << " " << msg << endl; + cerr << "ERROR: System::save" << endl; return false; } @@ -350,9 +350,9 @@ bool System::load(Serializer& in) if(!myDevices[i]->load(in)) return false; } - catch(const char* msg) + catch(...) { - cerr << "ERROR: System::load" << endl << " " << msg << endl; + cerr << "ERROR: System::load" << endl; return false; } diff --git a/src/emucore/TIA.cxx b/src/emucore/TIA.cxx index ec6e616e0..839976e1e 100644 --- a/src/emucore/TIA.cxx +++ b/src/emucore/TIA.cxx @@ -356,9 +356,9 @@ bool TIA::save(Serializer& out) const // Save the sound sample stuff ... mySound.save(out); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: TIA::save" << endl << " " << msg << endl; + cerr << "ERROR: TIA::save" << endl; return false; } @@ -464,9 +464,9 @@ bool TIA::load(Serializer& in) toggleFixedColors(0); myAllowHMOVEBlanks = true; } - catch(const char* msg) + catch(...) { - cerr << "ERROR: TIA::load" << endl << " " << msg << endl; + cerr << "ERROR: TIA::load" << endl; return false; } @@ -482,9 +482,9 @@ bool TIA::saveDisplay(Serializer& out) const out.putInt(myFramePointerClocks); out.putByteArray(myCurrentFrameBuffer, 160*320); } - catch(const char* msg) + catch(...) { - cerr << "ERROR: TIA::saveDisplay" << endl << " " << msg << endl; + cerr << "ERROR: TIA::saveDisplay" << endl; return false; } @@ -510,9 +510,9 @@ bool TIA::loadDisplay(Serializer& in) if(myPartialFrameFlag) myFramePointer += myFramePointerClocks; } - catch(const char* msg) + catch(...) { - cerr << "ERROR: TIA::loadDisplay" << endl << " " << msg << endl; + cerr << "ERROR: TIA::loadDisplay" << endl; return false; }