mirror of
https://github.com/SourMesen/Mesen.git
synced 2025-04-02 10:52:48 -04:00
MMC3: Fixed potential issues with save states
This commit is contained in:
parent
e3dfa2766b
commit
2a9c1d8dd0
3 changed files with 8 additions and 0 deletions
|
@ -185,6 +185,11 @@ class MMC3 : public BaseMapper
|
|||
_wramEnabled, _wramWriteProtected, registers, _needIrq);
|
||||
}
|
||||
|
||||
void AfterLoadState() override
|
||||
{
|
||||
UpdateState();
|
||||
}
|
||||
|
||||
virtual uint16_t GetPRGPageSize() { return 0x2000; }
|
||||
virtual uint16_t GetCHRPageSize() { return 0x0400; }
|
||||
virtual uint32_t GetSaveRamPageSize() { return _subMapperID == 1 ? 0x200 : 0x2000; }
|
||||
|
|
|
@ -93,6 +93,8 @@ void Snapshotable::LoadSnapshot(istream* file)
|
|||
file->read((char*)_stream, _streamSize);
|
||||
StreamState(_saving);
|
||||
|
||||
AfterLoadState();
|
||||
|
||||
delete[] _stream;
|
||||
|
||||
if(_blockBuffer) {
|
||||
|
|
|
@ -144,6 +144,7 @@ private:
|
|||
|
||||
protected:
|
||||
virtual void StreamState(bool saving) = 0;
|
||||
virtual void AfterLoadState() { }
|
||||
|
||||
void Stream(Snapshotable* snapshotable);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue