diff options
-rw-r--r-- | src/DMA.cpp | 20 | ||||
-rw-r--r-- | src/NDS.cpp | 30 | ||||
-rw-r--r-- | src/Savestate.cpp | 6 |
3 files changed, 44 insertions, 12 deletions
diff --git a/src/DMA.cpp b/src/DMA.cpp index 694e90a..9989f73 100644 --- a/src/DMA.cpp +++ b/src/DMA.cpp @@ -120,7 +120,25 @@ void DMA::Reset() void DMA::Savestate(Savestate* file) { - // + char* magic = "DMAx"; + magic[3] = '0' + Num + (CPU*4); + file->Section(magic); + + file->Var32(&SrcAddr); + file->Var32(&DstAddr); + file->Var32(&Cnt); + + file->Var32(&StartMode); + file->Var32(&CurSrcAddr); + file->Var32(&CurDstAddr); + file->Var32(&RemCount); + file->Var32(&IterCount); + file->Var32(&SrcAddrInc); + file->Var32(&DstAddrInc); + + file->Var32(&(u32)Running); + file->Var32(&(u32)InProgress); + file->Var32(&(u32)IsGXFIFODMA); } void DMA::WriteCnt(u32 val) diff --git a/src/NDS.cpp b/src/NDS.cpp index ee6dd10..d82db55 100644 --- a/src/NDS.cpp +++ b/src/NDS.cpp @@ -392,23 +392,33 @@ void Savestate(Savestate* file) file->Var16(&DivCnt); file->Var16(&SqrtCnt); - // MapSharedWRAM - // powcnt shito - - - ARM9->Savestate(file); - ARM7->Savestate(file); - CP15::Savestate(file); - file->Var32(&CPUStop); file->VarArray(Timers, 8*sizeof(Timer)); file->VarArray(TimerCheckMask, 2*sizeof(u8)); - // DMA file->VarArray(DMA9Fill, 4*sizeof(u32)); - // sched etc + file->VarArray(SchedList, sizeof(SchedList)); + file->Var32(&SchedListMask); + file->Var32(&(u32)CurIterationCycles); + file->Var32(&(u32)ARM7Offset); + + // TODO: save KeyInput???? + file->Var16(&KeyCnt); + file->Var16(&RCnt); + + + for (int i = 0; i < 8; i++) + DMAs[i]->Savestate(i); + + // MapSharedWRAM + // powcnt shito + + + ARM9->Savestate(file); + ARM7->Savestate(file); + CP15::Savestate(file); // NDSCart // GPU diff --git a/src/Savestate.cpp b/src/Savestate.cpp index 0d7b266..fbb882b 100644 --- a/src/Savestate.cpp +++ b/src/Savestate.cpp @@ -26,7 +26,11 @@ 04 - version major 06 - version minor 08 - length - 0C - reserved + 0C - game serial + 10 - ARM9 binary checksum + 14 - ARM7 binary checksum + 18 - reserved + 1C - reserved section header: 00 - section magic |