From de91eabf71437ff6973154131353d2a83a892380 Mon Sep 17 00:00:00 2001 From: StapleButter Date: Thu, 18 Oct 2018 00:27:55 +0200 Subject: [PATCH] savestate shito: fix compile errors. still far from being finished, so avoid using unless you want to spawn blackholes or some pretty bad shit. --- src/ARM.cpp | 8 ++++---- src/ARM.h | 2 +- src/CP15.cpp | 2 +- src/CP15.h | 2 +- src/DMA.cpp | 8 ++++---- src/DMA.h | 2 +- src/NDS.cpp | 14 +++++++------- src/NDS.h | 2 +- 8 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/ARM.cpp b/src/ARM.cpp index fbf4be2b..2368a1ba 100644 --- a/src/ARM.cpp +++ b/src/ARM.cpp @@ -161,12 +161,12 @@ void ARM::Reset() JumpTo(ExceptionBase); } -void ARM::Savestate(Savestate* file) +void ARM::DoSavestate(Savestate* file) { - file->Section(Num ? "ARM7" : "ARM9"); + file->Section((char*)(Num ? "ARM7" : "ARM9")); - file->Var32(&(u32)Cycles); - file->Var32(&(u32)CyclesToRun); + file->Var32((u32*)&Cycles); + file->Var32((u32*)&CyclesToRun); file->Var32(&Halted); file->VarArray(R, 16*sizeof(u32)); diff --git a/src/ARM.h b/src/ARM.h index 85ddfc04..92d47bbc 100644 --- a/src/ARM.h +++ b/src/ARM.h @@ -38,7 +38,7 @@ public: void Reset(); - void Savestate(Savestate* file); + void DoSavestate(Savestate* file); void JumpTo(u32 addr, bool restorecpsr = false); void RestoreCPSR(); diff --git a/src/CP15.cpp b/src/CP15.cpp index 97414db0..e3f0bae7 100644 --- a/src/CP15.cpp +++ b/src/CP15.cpp @@ -57,7 +57,7 @@ void Reset() DTCMSize = 0; } -void Savestate(Savestate* file) +void DoSavestate(Savestate* file) { file->Section("CP15"); diff --git a/src/CP15.h b/src/CP15.h index 2e7f5f01..1b921912 100644 --- a/src/CP15.h +++ b/src/CP15.h @@ -24,7 +24,7 @@ namespace CP15 void Reset(); -void Savestate(Savestate* file); +void DoSavestate(Savestate* file); void UpdateDTCMSetting(); void UpdateITCMSetting(); diff --git a/src/DMA.cpp b/src/DMA.cpp index 9989f739..ba8cc41d 100644 --- a/src/DMA.cpp +++ b/src/DMA.cpp @@ -118,7 +118,7 @@ void DMA::Reset() InProgress = false; } -void DMA::Savestate(Savestate* file) +void DMA::DoSavestate(Savestate* file) { char* magic = "DMAx"; magic[3] = '0' + Num + (CPU*4); @@ -136,9 +136,9 @@ void DMA::Savestate(Savestate* file) file->Var32(&SrcAddrInc); file->Var32(&DstAddrInc); - file->Var32(&(u32)Running); - file->Var32(&(u32)InProgress); - file->Var32(&(u32)IsGXFIFODMA); + file->Var32((u32*)&Running); + file->Var32((u32*)&InProgress); + file->Var32((u32*)&IsGXFIFODMA); } void DMA::WriteCnt(u32 val) diff --git a/src/DMA.h b/src/DMA.h index 0bc5ed18..61574312 100644 --- a/src/DMA.h +++ b/src/DMA.h @@ -29,7 +29,7 @@ public: void Reset(); - void Savestate(Savestate* file); + void DoSavestate(Savestate* file); void WriteCnt(u32 val); void Start(); diff --git a/src/NDS.cpp b/src/NDS.cpp index d82db553..b0bd392b 100644 --- a/src/NDS.cpp +++ b/src/NDS.cpp @@ -356,7 +356,7 @@ void Stop() SPU::Stop(); } -void Savestate(Savestate* file) +void DoSavestate(Savestate* file) { file->Section("NDSG"); @@ -401,8 +401,8 @@ void Savestate(Savestate* file) file->VarArray(SchedList, sizeof(SchedList)); file->Var32(&SchedListMask); - file->Var32(&(u32)CurIterationCycles); - file->Var32(&(u32)ARM7Offset); + file->Var32((u32*)&CurIterationCycles); + file->Var32((u32*)&ARM7Offset); // TODO: save KeyInput???? file->Var16(&KeyCnt); @@ -410,15 +410,15 @@ void Savestate(Savestate* file) for (int i = 0; i < 8; i++) - DMAs[i]->Savestate(i); + DMAs[i]->DoSavestate(file); // MapSharedWRAM // powcnt shito - ARM9->Savestate(file); - ARM7->Savestate(file); - CP15::Savestate(file); + ARM9->DoSavestate(file); + ARM7->DoSavestate(file); + CP15::DoSavestate(file); // NDSCart // GPU diff --git a/src/NDS.h b/src/NDS.h index 9887323f..27dc8205 100644 --- a/src/NDS.h +++ b/src/NDS.h @@ -109,7 +109,7 @@ void DeInit(); void Reset(); void Stop(); -void Savestate(Savestate* file); +void DoSavestate(Savestate* file); bool LoadROM(const char* path, bool direct); void LoadBIOS();