mirror of https://github.com/stella-emu/stella.git
Fixed bug with SaveKey and AtariVox not properly closing their
memory files before starting another instance of the same ROM.
This commit is contained in:
parent
b3c0993dcc
commit
f7e712386b
|
@ -142,6 +142,13 @@ void AtariVox::clockDataIn(bool value)
|
|||
myLastDataWriteCycle = cycle;
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void AtariVox::close()
|
||||
{
|
||||
// Force the EEPROM object to cleanup
|
||||
myEEPROM.reset();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void AtariVox::systemCyclesReset()
|
||||
{
|
||||
|
|
|
@ -82,6 +82,13 @@ class AtariVox : public Controller
|
|||
*/
|
||||
void update() override { }
|
||||
|
||||
/**
|
||||
Notification method invoked by the system indicating that the
|
||||
console is about to be destroyed. It may be necessary to override
|
||||
this method for controllers that need cleanup before exiting.
|
||||
*/
|
||||
void close() override;
|
||||
|
||||
/**
|
||||
Notification method invoked by the system right before the
|
||||
system resets its cycle counter to zero. It may be necessary
|
||||
|
|
|
@ -172,6 +172,9 @@ Console::Console(OSystem& osystem, unique_ptr<Cartridge>& cart,
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
Console::~Console()
|
||||
{
|
||||
// Some smart controllers need to be informed that the console is going away
|
||||
myLeftControl->close();
|
||||
myRightControl->close();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
|
|
@ -167,6 +167,13 @@ class Controller : public Serializable
|
|||
*/
|
||||
virtual void update() = 0;
|
||||
|
||||
/**
|
||||
Notification method invoked by the system indicating that the
|
||||
console is about to be destroyed. It may be necessary to override
|
||||
this method for controllers that need cleanup before exiting.
|
||||
*/
|
||||
virtual void close() { };
|
||||
|
||||
/**
|
||||
Notification method invoked by the system right before the
|
||||
system resets its cycle counter to zero. It may be necessary
|
||||
|
|
|
@ -554,6 +554,7 @@ void OSystem::closeConsole()
|
|||
// If a previous console existed, save cheats before creating a new one
|
||||
myCheatManager->saveCheats(myConsole->properties().get(Cartridge_MD5));
|
||||
#endif
|
||||
myConsole.reset();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -75,6 +75,13 @@ void SaveKey::write(DigitalPin pin, bool value)
|
|||
}
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void SaveKey::close()
|
||||
{
|
||||
// Force the EEPROM object to cleanup
|
||||
myEEPROM.reset();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void SaveKey::systemCyclesReset()
|
||||
{
|
||||
|
|
|
@ -77,6 +77,13 @@ class SaveKey : public Controller
|
|||
*/
|
||||
void update() override { }
|
||||
|
||||
/**
|
||||
Notification method invoked by the system indicating that the
|
||||
console is about to be destroyed. It may be necessary to override
|
||||
this method for controllers that need cleanup before exiting.
|
||||
*/
|
||||
void close() override;
|
||||
|
||||
/**
|
||||
Notification method invoked by the system right before the
|
||||
system resets its cycle counter to zero. It may be necessary
|
||||
|
|
Loading…
Reference in New Issue