[Save State] Add Disk Registers to Save State file

This commit is contained in:
LuigiBlood 2020-06-09 22:22:25 +02:00
parent 366c0c69ae
commit 9dc121ffbb
1 changed files with 4 additions and 0 deletions

View File

@ -1767,6 +1767,7 @@ bool CN64System::SaveState()
zipWriteInFileInZip(file, m_Reg.m_Peripheral_Interface, sizeof(uint32_t) * 13);
zipWriteInFileInZip(file, m_Reg.m_RDRAM_Interface, sizeof(uint32_t) * 8);
zipWriteInFileInZip(file, m_Reg.m_SerialInterface, sizeof(uint32_t) * 4);
zipWriteInFileInZip(file, m_Reg.m_DiskInterface, sizeof(uint32_t) * 22);
zipWriteInFileInZip(file, (void *const)&m_TLB.TlbEntry(0), sizeof(CTLB::TLB_ENTRY) * 32);
zipWriteInFileInZip(file, m_MMU_VM.PifRam(), 0x40);
zipWriteInFileInZip(file, m_MMU_VM.Rdram(), RdramSize);
@ -1820,6 +1821,7 @@ bool CN64System::SaveState()
hSaveFile.Write(m_Reg.m_Peripheral_Interface, sizeof(uint32_t) * 13);
hSaveFile.Write(m_Reg.m_RDRAM_Interface, sizeof(uint32_t) * 8);
hSaveFile.Write(m_Reg.m_SerialInterface, sizeof(uint32_t) * 4);
hSaveFile.Write(m_Reg.m_DiskInterface, sizeof(uint32_t) * 22);
hSaveFile.Write(&m_TLB.TlbEntry(0), sizeof(CTLB::TLB_ENTRY) * 32);
hSaveFile.Write(g_MMU->PifRam(), 0x40);
hSaveFile.Write(g_MMU->Rdram(), RdramSize);
@ -2000,6 +2002,7 @@ bool CN64System::LoadState(const char * FileName)
unzReadCurrentFile(file, m_Reg.m_Peripheral_Interface, sizeof(uint32_t) * 13);
unzReadCurrentFile(file, m_Reg.m_RDRAM_Interface, sizeof(uint32_t) * 8);
unzReadCurrentFile(file, m_Reg.m_SerialInterface, sizeof(uint32_t) * 4);
unzReadCurrentFile(file, m_Reg.m_DiskInterface, sizeof(uint32_t) * 22);
unzReadCurrentFile(file, (void *const)&m_TLB.TlbEntry(0), sizeof(CTLB::TLB_ENTRY) * 32);
unzReadCurrentFile(file, m_MMU_VM.PifRam(), 0x40);
unzReadCurrentFile(file, m_MMU_VM.Rdram(), SaveRDRAMSize);
@ -2067,6 +2070,7 @@ bool CN64System::LoadState(const char * FileName)
hSaveFile.Read(m_Reg.m_Peripheral_Interface, sizeof(uint32_t) * 13);
hSaveFile.Read(m_Reg.m_RDRAM_Interface, sizeof(uint32_t) * 8);
hSaveFile.Read(m_Reg.m_SerialInterface, sizeof(uint32_t) * 4);
hSaveFile.Read(m_Reg.m_DiskInterface, sizeof(uint32_t) * 22);
hSaveFile.Read((void *const)&m_TLB.TlbEntry(0), sizeof(CTLB::TLB_ENTRY) * 32);
hSaveFile.Read(m_MMU_VM.PifRam(), 0x40);
hSaveFile.Read(m_MMU_VM.Rdram(), SaveRDRAMSize);