MemoryCard: Save FLAG to state

This commit is contained in:
Connor McLaughlin 2020-04-25 14:58:19 +10:00
parent 92255c8ddd
commit 25af5ef9d9
3 changed files with 4 additions and 3 deletions

View file

@ -26,6 +26,7 @@ void MemoryCard::Reset()
{
ResetTransferState();
SaveIfChanged(true);
m_FLAG.no_write_yet = true;
}
bool MemoryCard::DoState(StateWrapper& sw)
@ -34,6 +35,7 @@ bool MemoryCard::DoState(StateWrapper& sw)
SaveIfChanged(true);
sw.Do(&m_state);
sw.Do(&m_FLAG.bits);
sw.Do(&m_address);
sw.Do(&m_sector_offset);
sw.Do(&m_checksum);

View file

@ -49,8 +49,6 @@ private:
BitField<u8, bool, 2, 1> write_error;
};
FLAG m_FLAG = {};
enum class State : u8
{
Idle,
@ -91,6 +89,7 @@ private:
std::unique_ptr<TimingEvent> m_save_event;
State m_state = State::Idle;
FLAG m_FLAG = {};
u16 m_address = 0;
u8 m_sector_offset = 0;
u8 m_checksum = 0;

View file

@ -2,7 +2,7 @@
#include "types.h"
static constexpr u32 SAVE_STATE_MAGIC = 0x43435544;
static constexpr u32 SAVE_STATE_VERSION = 25;
static constexpr u32 SAVE_STATE_VERSION = 26;
#pragma pack(push, 4)
struct SAVE_STATE_HEADER