diff options
author | StapleButter <thetotalworm@gmail.com> | 2018-10-18 03:04:39 +0200 |
---|---|---|
committer | StapleButter <thetotalworm@gmail.com> | 2018-10-18 03:04:39 +0200 |
commit | 3a54b9178b761800cd8cfe0a51b073b893f59e79 (patch) | |
tree | e617fae25c4356c6cb5b0f5598d9f44bbfcfc975 /src | |
parent | cbe5780837c63d46a0fc83d50102625bf5009959 (diff) |
RTC done. misc shito.
Diffstat (limited to 'src')
-rw-r--r-- | src/NDS.cpp | 16 | ||||
-rw-r--r-- | src/RTC.cpp | 24 | ||||
-rw-r--r-- | src/RTC.h | 2 |
3 files changed, 39 insertions, 3 deletions
diff --git a/src/NDS.cpp b/src/NDS.cpp index d2551dc..525c925 100644 --- a/src/NDS.cpp +++ b/src/NDS.cpp @@ -501,9 +501,14 @@ bool DoSavestate(Savestate* file) for (int i = 0; i < 8; i++) DMAs[i]->DoSavestate(file); - // MapSharedWRAM - // powcnt shito + file->Var8(&WRAMCnt); + if (!file->Saving) + { + // 'dept of redundancy dept' + // but we do need to update the mappings + MapSharedWRAM(WRAMCnt); + } ARM9->DoSavestate(file); ARM7->DoSavestate(file); @@ -513,9 +518,14 @@ bool DoSavestate(Savestate* file) GPU::DoSavestate(file); SPU::DoSavestate(file); SPI::DoSavestate(file); - // RTC + RTC::DoSavestate(file); // wifi + if (!file->Saving) + { + GPU::DisplaySwap(PowerControl9>>15); + } + return true; } diff --git a/src/RTC.cpp b/src/RTC.cpp index fd60eaf..cd35643 100644 --- a/src/RTC.cpp +++ b/src/RTC.cpp @@ -73,6 +73,30 @@ void Reset() 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) { @@ -20,6 +20,7 @@ #define RTC_H #include "types.h" +#include "Savestate.h" namespace RTC { @@ -27,6 +28,7 @@ namespace RTC bool Init(); void DeInit(); void Reset(); +void DoSavestate(Savestate* file); u16 Read(); void Write(u16 val, bool byte); |