This commit is contained in:
StapleButter 2018-09-15 03:41:09 +02:00
parent 60f24a7432
commit 7cbcc6c230
3 changed files with 44 additions and 12 deletions

View File

@ -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)

View File

@ -392,6 +392,26 @@ void Savestate(Savestate* file)
file->Var16(&DivCnt);
file->Var16(&SqrtCnt);
file->Var32(&CPUStop);
file->VarArray(Timers, 8*sizeof(Timer));
file->VarArray(TimerCheckMask, 2*sizeof(u8));
file->VarArray(DMA9Fill, 4*sizeof(u32));
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
@ -400,16 +420,6 @@ void Savestate(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
// NDSCart
// GPU
// SPU

View File

@ -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