RTC done. misc shito.

This commit is contained in:
StapleButter
2018-10-18 03:04:39 +02:00
parent cbe5780837
commit 3a54b9178b
3 changed files with 39 additions and 3 deletions

View File

@ -501,9 +501,14 @@ bool DoSavestate(Savestate* file)
for (int i = 0; i < 8; i++) for (int i = 0; i < 8; i++)
DMAs[i]->DoSavestate(file); DMAs[i]->DoSavestate(file);
// MapSharedWRAM file->Var8(&WRAMCnt);
// powcnt shito
if (!file->Saving)
{
// 'dept of redundancy dept'
// but we do need to update the mappings
MapSharedWRAM(WRAMCnt);
}
ARM9->DoSavestate(file); ARM9->DoSavestate(file);
ARM7->DoSavestate(file); ARM7->DoSavestate(file);
@ -513,9 +518,14 @@ bool DoSavestate(Savestate* file)
GPU::DoSavestate(file); GPU::DoSavestate(file);
SPU::DoSavestate(file); SPU::DoSavestate(file);
SPI::DoSavestate(file); SPI::DoSavestate(file);
// RTC RTC::DoSavestate(file);
// wifi // wifi
if (!file->Saving)
{
GPU::DisplaySwap(PowerControl9>>15);
}
return true; return true;
} }

View File

@ -73,6 +73,30 @@ void Reset()
FreeReg = 0; FreeReg = 0;
} }
void DoSavestate(Savestate* file)
{
file->Section("RTC.");
file->Var16(&IO);
file->Var8(&Input);
file->Var32(&InputBit);
file->Var32(&InputPos);
file->VarArray(Output, sizeof(Output));
file->Var32(&OutputBit);
file->Var32(&OutputPos);
file->Var8(&CurCmd);
file->Var8(&StatusReg1);
file->Var8(&StatusReg2);
file->VarArray(Alarm1, sizeof(Alarm1));
file->VarArray(Alarm2, sizeof(Alarm2));
file->Var8(&ClockAdjust);
file->Var8(&FreeReg);
}
u8 BCD(u8 val) u8 BCD(u8 val)
{ {

View File

@ -20,6 +20,7 @@
#define RTC_H #define RTC_H
#include "types.h" #include "types.h"
#include "Savestate.h"
namespace RTC namespace RTC
{ {
@ -27,6 +28,7 @@ namespace RTC
bool Init(); bool Init();
void DeInit(); void DeInit();
void Reset(); void Reset();
void DoSavestate(Savestate* file);
u16 Read(); u16 Read();
void Write(u16 val, bool byte); void Write(u16 val, bool byte);