MMC3: Fixed potential issues with save states

This commit is contained in:
Souryo 2016-11-12 09:47:52 -05:00
parent e3dfa2766b
commit 2a9c1d8dd0
3 changed files with 8 additions and 0 deletions

View file

@ -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; }

View file

@ -93,6 +93,8 @@ void Snapshotable::LoadSnapshot(istream* file)
file->read((char*)_stream, _streamSize);
StreamState(_saving);
AfterLoadState();
delete[] _stream;
if(_blockBuffer) {

View file

@ -144,6 +144,7 @@ private:
protected:
virtual void StreamState(bool saving) = 0;
virtual void AfterLoadState() { }
void Stream(Snapshotable* snapshotable);