in atari_py/ale_interface/src/emucore/CartDPC.cxx [491:552]
bool CartridgeDPC::load(Deserializer& in)
{
string cart = name();
try
{
if(in.getString() != cart)
return false;
uInt32 i, limit;
// Indicates which bank is currently active
myCurrentBank = (uInt16) in.getInt();
// The top registers for the data fetchers
limit = (uInt32) in.getInt();
for(i = 0; i < limit; ++i)
myTops[i] = (uInt8) in.getInt();
// The bottom registers for the data fetchers
limit = (uInt32) in.getInt();
for(i = 0; i < limit; ++i)
myBottoms[i] = (uInt8) in.getInt();
// The counter registers for the data fetchers
limit = (uInt32) in.getInt();
for(i = 0; i < limit; ++i)
myCounters[i] = (uInt16) in.getInt();
// The flag registers for the data fetchers
limit = (uInt32) in.getInt();
for(i = 0; i < limit; ++i)
myFlags[i] = (uInt8) in.getInt();
// The music mode flags for the data fetchers
limit = (uInt32) in.getInt();
for(i = 0; i < limit; ++i)
myMusicMode[i] = in.getBool();
// The random number generator register
myRandomNumber = (uInt8) in.getInt();
// Get system cycles and fractional clocks
mySystemCycles = in.getInt();
myFractionalClocks = (double)in.getInt() / 100000000.0;
}
catch(const char* msg)
{
ale::Logger::Error << msg << endl;
return false;
}
catch(...)
{
ale::Logger::Error << "Unknown error in load state for " << cart << endl;
return false;
}
// Now, go to the current bank
bank(myCurrentBank);
return true;
}