Check version in each DoState() func.

They bail on PointerWrap error or bad version.
This commit is contained in:
Unknown W. Brackets 2013-09-14 20:23:03 -07:00
parent d2f2f8d7ad
commit 50e9e45d65
66 changed files with 527 additions and 167 deletions

View file

@ -613,6 +613,10 @@ void DoState(PointerWrap &p)
{
std::lock_guard<std::recursive_mutex> lk(externalEventSection);
auto s = p.Section("CoreTiming", 1);
if (!s)
return;
int n = (int) event_types.size();
p.Do(n);
// These (should) be filled in later by the modules.
@ -625,7 +629,6 @@ void DoState(PointerWrap &p)
p.Do(slicelength);
p.Do(globalTimer);
p.Do(idledCycles);
p.DoMarker("CoreTiming");
}
} // namespace

View file

@ -105,6 +105,10 @@ int PSPDialog::Update()
void PSPDialog::DoState(PointerWrap &p)
{
auto s = p.Section("PSPDialog", 1);
if (!s)
return;
p.Do(status);
p.Do(lastButtons);
p.Do(buttons);
@ -116,7 +120,6 @@ void PSPDialog::DoState(PointerWrap &p)
p.Do(cancelButtonImg);
p.Do(okButtonFlag);
p.Do(cancelButtonFlag);
p.DoMarker("PSPDialog");
}
pspUtilityDialogCommon *PSPDialog::GetCommonParam()

View file

@ -296,12 +296,16 @@ int PSPMsgDialog::Shutdown(bool force)
void PSPMsgDialog::DoState(PointerWrap &p)
{
PSPDialog::DoState(p);
auto s = p.Section("PSPMsgDialog", 1);
if (!s)
return;
p.Do(flag);
p.Do(messageDialog);
p.Do(messageDialogAddr);
p.DoArray(msgText, sizeof(msgText));
p.Do(yesnoChoice);
p.DoMarker("PSPMsgDialog");
}
pspUtilityDialogCommon *PSPMsgDialog::GetCommonParam()

View file

@ -971,13 +971,17 @@ int PSPOskDialog::Shutdown(bool force)
void PSPOskDialog::DoState(PointerWrap &p)
{
PSPDialog::DoState(p);
auto s = p.Section("PSPOskDialog", 1);
if (!s)
return;
p.Do(oskParams);
p.Do(oskDesc);
p.Do(oskIntext);
p.Do(oskOuttext);
p.Do(selectedChar);
p.Do(inputChars);
p.DoMarker("PSPOskDialog");
}
pspUtilityDialogCommon *PSPOskDialog::GetCommonParam()

View file

@ -996,6 +996,11 @@ int PSPSaveDialog::Shutdown(bool force)
void PSPSaveDialog::DoState(PointerWrap &p)
{
PSPDialog::DoState(p);
auto s = p.Section("PSPSaveDialog", 1);
if (!s)
return;
p.Do(display);
param.DoState(p);
p.Do(request);
@ -1007,7 +1012,6 @@ void PSPSaveDialog::DoState(PointerWrap &p)
p.Do(requestAddr);
p.Do(currentSelectedSave);
p.Do(yesnoChoice);
p.DoMarker("PSPSaveDialog");
}
pspUtilityDialogCommon *PSPSaveDialog::GetCommonParam()

View file

@ -1372,6 +1372,10 @@ int SavedataParam::GetLastEmptySave()
void SavedataParam::DoState(PointerWrap &p)
{
auto s = p.Section("SavedataParam", 1);
if (!s)
return;
// pspParam is handled in PSPSaveDialog.
p.Do(selectedSave);
p.Do(saveDataListCount);
@ -1390,7 +1394,6 @@ void SavedataParam::DoState(PointerWrap &p)
}
else
p.DoArray(saveDataList, saveDataListCount);
p.DoMarker("SavedataParam");
}
bool SavedataParam::IsSaveEncrypted(SceUtilitySavedataParam* param, const std::string &saveDirName)

View file

@ -256,6 +256,10 @@ struct SaveFileInfo
void DoState(PointerWrap &p)
{
auto s = p.Section("SaveFileInfo", 1);
if (!s)
return;
p.Do(size);
p.Do(saveName);
p.Do(idx);

View file

@ -66,6 +66,10 @@ struct PSPFileInfo
void DoState(PointerWrap &p)
{
auto s = p.Section("PSPFileInfo", 1);
if (!s)
return;
p.Do(name);
p.Do(size);
p.Do(access);
@ -78,7 +82,6 @@ struct PSPFileInfo
p.Do(startSector);
p.Do(numSectors);
p.Do(sectorSize);
p.DoMarker("PSPFileInfo");
}
std::string name;

View file

@ -654,6 +654,10 @@ std::string ISOFileSystem::EntryFullPath(TreeEntry *e)
void ISOFileSystem::DoState(PointerWrap &p)
{
auto s = p.Section("ISOFileSystem", 1);
if (!s)
return;
int n = (int) entries.size();
p.Do(n);
@ -706,5 +710,4 @@ void ISOFileSystem::DoState(PointerWrap &p)
}
}
}
p.DoMarker("ISOFileSystem");
}

View file

@ -491,6 +491,11 @@ size_t MetaFileSystem::SeekFile(u32 handle, s32 position, FileMove type)
void MetaFileSystem::DoState(PointerWrap &p)
{
lock_guard guard(lock);
auto s = p.Section("MetaFileSystem", 1);
if (!s)
return;
p.Do(current);
// Save/load per-thread current directory map
@ -507,7 +512,5 @@ void MetaFileSystem::DoState(PointerWrap &p)
for (u32 i = 0; i < n; ++i)
fileSystems[i].system->DoState(p);
p.DoMarker("MetaFileSystem");
}

View file

@ -146,6 +146,10 @@ void VirtualDiscFileSystem::LoadFileListIndex() {
void VirtualDiscFileSystem::DoState(PointerWrap &p)
{
auto s = p.Section("VirtualDiscFileSystem", 1);
if (!s)
return;
int fileListSize = (int)fileList.size();
int entryCount = (int)entries.size();
@ -214,8 +218,6 @@ void VirtualDiscFileSystem::DoState(PointerWrap &p)
}
// We don't savestate handlers (loaded on fs load), but if they change, it may not load properly.
p.DoMarker("VirtualDiscFileSystem");
}
std::string VirtualDiscFileSystem::GetLocalPath(std::string localpath) {

View file

@ -66,6 +66,10 @@ PGF::~PGF() {
}
void PGF::DoState(PointerWrap &p) {
auto s = p.Section("PGF", 1);
if (!s)
return;
p.Do(header);
p.Do(rev3extra);
@ -98,8 +102,6 @@ void PGF::DoState(PointerWrap &p) {
p.Do(glyphs);
p.Do(shadowGlyphs);
p.Do(firstGlyph);
p.DoMarker("PGF");
}
void PGF::ReadPtr(const u8 *ptr, size_t dataSize) {

View file

@ -85,9 +85,12 @@ void HLEInit()
void HLEDoState(PointerWrap &p)
{
auto s = p.Section("HLE", 1);
if (!s)
return;
p.Do(delayedResultEvent);
CoreTiming::RestoreRegisterEvent(delayedResultEvent, "HLEDelayedResult", hleDelayResultFinish);
p.DoMarker("HLE");
}
void HLEShutdown()

View file

@ -111,6 +111,10 @@ void __AudioInit() {
}
void __AudioDoState(PointerWrap &p) {
auto s = p.Section("sceAudio", 1);
if (!s)
return;
p.Do(eventAudioUpdate);
CoreTiming::RestoreRegisterEvent(eventAudioUpdate, "AudioUpdate", &hleAudioUpdate);
p.Do(eventHostAudioUpdate);
@ -132,8 +136,6 @@ void __AudioDoState(PointerWrap &p) {
}
for (int i = 0; i < chanCount; ++i)
chans[i].DoState(p);
p.DoMarker("sceAudio");
}
void __AudioShutdown() {

View file

@ -150,6 +150,10 @@ struct Atrac {
}
void DoState(PointerWrap &p) {
auto s = p.Section("Atrac", 1);
if (!s)
return;
p.Do(atracChannels);
p.Do(atracOutputChannels);
@ -189,8 +193,6 @@ struct Atrac {
p.Do(loopNum);
p.Do(atracContext);
p.DoMarker("Atrac");
}
int Analyze();
@ -311,6 +313,10 @@ void __AtracInit() {
}
void __AtracDoState(PointerWrap &p) {
auto s = p.Section("sceAtrac", 1);
if (!s)
return;
p.Do(atracInited);
for (int i = 0; i < PSP_NUM_ATRAC_IDS; ++i) {
bool valid = atracIDs[i] != NULL;
@ -323,8 +329,6 @@ void __AtracDoState(PointerWrap &p) {
}
}
p.DoArray(atracIDTypes, PSP_NUM_ATRAC_IDS);
p.DoMarker("sceAtrac");
}
void __AtracShutdown() {

View file

@ -29,6 +29,10 @@ const int PSP_AUDIO_ERROR_SRC_FORMAT_4 = 0x80000003;
void AudioChannel::DoState(PointerWrap &p)
{
auto s = p.Section("AudioChannel", 1);
if (!s)
return;
p.Do(reserved);
p.Do(sampleAddress);
p.Do(sampleCount);
@ -37,7 +41,6 @@ void AudioChannel::DoState(PointerWrap &p)
p.Do(format);
p.Do(waitingThreads);
sampleQueue.DoState(p);
p.DoMarker("AudioChannel");
}
void AudioChannel::reset()

View file

@ -44,12 +44,15 @@ void __CccInit()
void __CccDoState(PointerWrap &p)
{
auto s = p.Section("sceCcc", 1);
if (!s)
return;
p.Do(errorUTF8);
p.Do(errorUTF16);
p.Do(errorSJIS);
p.Do(ucs2jisTable);
p.Do(jis2ucsTable);
p.DoMarker("sceCcc");
}
u32 __CccUCStoJIS(u32 c, u32 alt)

View file

@ -320,6 +320,10 @@ void __CtrlInit()
void __CtrlDoState(PointerWrap &p)
{
std::lock_guard<std::recursive_mutex> guard(ctrlMutex);
auto s = p.Section("sceCtrl", 1);
if (!s)
return;
p.Do(analogEnabled);
p.Do(ctrlLatchBufs);
@ -341,7 +345,6 @@ void __CtrlDoState(PointerWrap &p)
p.Do(ctrlTimer);
CoreTiming::RestoreRegisterEvent(ctrlTimer, "CtrlSampleTimer", __CtrlTimerUpdate);
p.DoMarker("sceCtrl");
}
void __CtrlShutdown()

View file

@ -56,6 +56,10 @@ struct WaitVBlankInfo
void DoState(PointerWrap &p)
{
auto s = p.Section("WaitVBlankInfo", 1);
if (!s)
return;
p.Do(threadID);
p.Do(vcountUnblock);
}
@ -175,6 +179,10 @@ void __DisplayInit() {
}
void __DisplayDoState(PointerWrap &p) {
auto s = p.Section("sceDisplay", 1);
if (!s)
return;
p.Do(framebuf);
p.Do(latchedFramebuf);
p.Do(framebufIsLatched);
@ -212,8 +220,6 @@ void __DisplayDoState(PointerWrap &p) {
}
gpu->SetDisplayFramebuffer(framebuf.topaddr, framebuf.pspFramebufLinesize, framebuf.pspFramebufFormat);
}
p.DoMarker("sceDisplay");
}
void __DisplayShutdown() {

View file

@ -200,9 +200,12 @@ public:
PGF *GetPGF() { return &pgf_; }
void DoState(PointerWrap &p) {
auto s = p.Section("Font", 1);
if (!s)
return;
p.Do(pgf_);
p.Do(style_);
p.DoMarker("Font");
}
private:
@ -233,6 +236,10 @@ public:
}
void DoState(PointerWrap &p) {
auto s = p.Section("LoadedFont", 1);
if (!s)
return;
int numInternalFonts = (int)internalFonts.size();
p.Do(numInternalFonts);
if (numInternalFonts != (int)internalFonts.size()) {
@ -249,7 +256,6 @@ public:
font_ = internalFonts[internalFont];
}
p.Do(handle_);
p.DoMarker("LoadedFont");
}
private:
@ -263,7 +269,13 @@ class PostAllocCallback : public Action {
public:
PostAllocCallback() {}
static Action *Create() { return new PostAllocCallback(); }
void DoState(PointerWrap &p) { p.Do(fontLibID_); p.DoMarker("PostAllocCallback"); }
void DoState(PointerWrap &p) {
auto s = p.Section("PostAllocCallback", 1);
if (!s)
return;
p.Do(fontLibID_);
}
void run(MipsCall &call);
void SetFontLib(u32 fontLibID) { fontLibID_ = fontLibID; }
@ -275,7 +287,13 @@ class PostOpenCallback : public Action {
public:
PostOpenCallback() {}
static Action *Create() { return new PostOpenCallback(); }
void DoState(PointerWrap &p) { p.Do(fontLibID_); p.DoMarker("PostOpenCallback"); }
void DoState(PointerWrap &p) {
auto s = p.Section("PostOpenCallback", 1);
if (!s)
return;
p.Do(fontLibID_);
}
void run(MipsCall &call);
void SetFontLib(u32 fontLibID) { fontLibID_ = fontLibID; }
@ -381,6 +399,10 @@ public:
}
void DoState(PointerWrap &p) {
auto s = p.Section("FontLib", 1);
if (!s)
return;
p.Do(fonts_);
p.Do(isfontopen_);
p.Do(params_);
@ -389,7 +411,6 @@ public:
p.Do(fileFontHandle_);
p.Do(handle_);
p.Do(altCharCode_);
p.DoMarker("FontLib");
}
void SetFileFontHandle(u32 handle) {
@ -552,6 +573,10 @@ void __FontShutdown() {
}
void __FontDoState(PointerWrap &p) {
auto s = p.Section("sceFont", 1);
if (!s)
return;
__LoadInternalFonts();
p.Do(fontLibList);
@ -562,7 +587,6 @@ void __FontDoState(PointerWrap &p) {
__KernelRestoreActionType(actionPostAllocCallback, PostAllocCallback::Create);
p.Do(actionPostOpenCallback);
__KernelRestoreActionType(actionPostOpenCallback, PostOpenCallback::Create);
p.DoMarker("sceFont");
}
u32 sceFontNewLib(u32 paramPtr, u32 errorCodePtr) {

View file

@ -221,6 +221,10 @@ void __GeInit()
void __GeDoState(PointerWrap &p)
{
auto s = p.Section("sceGe", 1);
if (!s)
return;
p.DoArray(ge_callback_data, ARRAY_SIZE(ge_callback_data));
p.DoArray(ge_used_callbacks, ARRAY_SIZE(ge_used_callbacks));
p.Do(ge_pending_cb);
@ -236,7 +240,6 @@ void __GeDoState(PointerWrap &p)
p.Do(drawWaitingThreads);
// Everything else is done in sceDisplay.
p.DoMarker("sceGe");
}
void __GeShutdown()

View file

@ -20,7 +20,9 @@
#include "Core/HLE/sceHeap.h"
void __HeapDoState(PointerWrap &p) {
p.DoMarker("sceHeap");
auto s = p.Section("sceHeap", 1);
if (!s)
return;
}
int sceHeapReallocHeapMemory(u32 heapPtr, u32 memPtr, int memSize) {

View file

@ -44,11 +44,14 @@ void __ImposeInit()
void __ImposeDoState(PointerWrap &p)
{
auto s = p.Section("sceImpose", 1);
if (!s)
return;
p.Do(language);
p.Do(buttonValue);
p.Do(umdPopup);
p.Do(backlightOffTime);
p.DoMarker("sceImpose");
}
u32 sceImposeGetBatteryIconStatus(u32 chargingPtr, u32 iconStatusPtr)

View file

@ -176,6 +176,10 @@ public:
int GetIDType() const { return PPSSPP_KERNEL_TMID_File; }
virtual void DoState(PointerWrap &p) {
auto s = p.Section("FileNode", 1);
if (!s)
return;
p.Do(fullpath);
p.Do(handle);
p.Do(callbackID);
@ -204,8 +208,6 @@ public:
p.Do(waitingThreads);
p.Do(pausedWaits);
p.DoMarker("File");
}
std::string fullpath;
@ -463,6 +465,10 @@ void __IoInit() {
}
void __IoDoState(PointerWrap &p) {
auto s = p.Section("sceIo", 1);
if (!s)
return;
ioManager.DoState(p);
p.DoArray(fds, ARRAY_SIZE(fds));
p.Do(asyncNotifyEvent);
@ -471,7 +477,6 @@ void __IoDoState(PointerWrap &p) {
CoreTiming::RestoreRegisterEvent(syncNotifyEvent, "IoSyncNotify", __IoSyncNotify);
p.Do(memStickCallbacks);
p.Do(memStickFatCallbacks);
p.DoMarker("sceIo");
}
void __IoShutdown() {
@ -1753,6 +1758,10 @@ public:
int GetIDType() const { return PPSSPP_KERNEL_TMID_DirList; }
virtual void DoState(PointerWrap &p) {
auto s = p.Section("DirListing", 1);
if (!s)
return;
p.Do(name);
p.Do(index);
@ -1763,7 +1772,6 @@ public:
for (int i = 0; i < count; ++i) {
listing[i].DoState(p);
}
p.DoMarker("DirListing");
}
std::string name;

View file

@ -29,9 +29,12 @@ void __JpegInit() {
}
void __JpegDoState(PointerWrap &p) {
auto s = p.Section("sceJpeg", 1);
if (!s)
return;
p.Do(mjpegWidth);
p.Do(mjpegHeight);
p.DoMarker("sceJpeg");
}
//Uncomment if you want to dump JPEGs loaded through sceJpeg to a file

View file

@ -184,53 +184,76 @@ void __KernelShutdown()
void __KernelDoState(PointerWrap &p)
{
p.Do(kernelRunning);
kernelObjects.DoState(p);
p.DoMarker("KernelObjects");
{
auto s = p.Section("Kernel", 1);
if (!s)
return;
__InterruptsDoState(p);
// Memory needs to be after kernel objects, which may free kernel memory.
__KernelMemoryDoState(p);
__KernelThreadingDoState(p);
__KernelAlarmDoState(p);
__KernelVTimerDoState(p);
__KernelEventFlagDoState(p);
__KernelMbxDoState(p);
__KernelModuleDoState(p);
__KernelMsgPipeDoState(p);
__KernelMutexDoState(p);
__KernelSemaDoState(p);
__KernelTimeDoState(p);
p.Do(kernelRunning);
kernelObjects.DoState(p);
}
__AtracDoState(p);
__AudioDoState(p);
__CccDoState(p);
__CtrlDoState(p);
__DisplayDoState(p);
__FontDoState(p);
__GeDoState(p);
__ImposeDoState(p);
__IoDoState(p);
__JpegDoState(p);
__MpegDoState(p);
__NetDoState(p);
__NetAdhocDoState(p);
__PowerDoState(p);
__PsmfDoState(p);
__PsmfPlayerDoState(p);
__RtcDoState(p);
__SasDoState(p);
__SslDoState(p);
__UmdDoState(p);
__UtilityDoState(p);
__UsbDoState(p);
__VaudioDoState(p);
__HeapDoState(p);
{
auto s = p.Section("Kernel Modules", 1);
if (!s)
return;
__PPGeDoState(p);
__InterruptsDoState(p);
// Memory needs to be after kernel objects, which may free kernel memory.
__KernelMemoryDoState(p);
__KernelThreadingDoState(p);
__KernelAlarmDoState(p);
__KernelVTimerDoState(p);
__KernelEventFlagDoState(p);
__KernelMbxDoState(p);
__KernelModuleDoState(p);
__KernelMsgPipeDoState(p);
__KernelMutexDoState(p);
__KernelSemaDoState(p);
__KernelTimeDoState(p);
}
__InterruptsDoStateLate(p);
__KernelThreadingDoStateLate(p);
{
auto s = p.Section("HLE Modules", 1);
if (!s)
return;
__AtracDoState(p);
__AudioDoState(p);
__CccDoState(p);
__CtrlDoState(p);
__DisplayDoState(p);
__FontDoState(p);
__GeDoState(p);
__ImposeDoState(p);
__IoDoState(p);
__JpegDoState(p);
__MpegDoState(p);
__NetDoState(p);
__NetAdhocDoState(p);
__PowerDoState(p);
__PsmfDoState(p);
__PsmfPlayerDoState(p);
__RtcDoState(p);
__SasDoState(p);
__SslDoState(p);
__UmdDoState(p);
__UtilityDoState(p);
__UsbDoState(p);
__VaudioDoState(p);
__HeapDoState(p);
__PPGeDoState(p);
}
{
auto s = p.Section("Kernel Cleanup", 1);
if (!s)
return;
__InterruptsDoStateLate(p);
__KernelThreadingDoStateLate(p);
}
}
bool __KernelIsRunning() {
@ -488,6 +511,10 @@ int KernelObjectPool::GetCount()
void KernelObjectPool::DoState(PointerWrap &p)
{
auto s = p.Section("KernelObjectPool", 1);
if (!s)
return;
int _maxCount = maxCount;
p.Do(_maxCount);
@ -530,7 +557,6 @@ void KernelObjectPool::DoState(PointerWrap &p)
}
pool[i]->DoState(p);
}
p.DoMarker("KernelObjectPool");
}
KernelObject *KernelObjectPool::CreateByIDType(int type)

View file

@ -45,8 +45,11 @@ struct Alarm : public KernelObject
virtual void DoState(PointerWrap &p)
{
auto s = p.Section("Alarm", 1);
if (!s)
return;
p.Do(alm);
p.DoMarker("Alarm");
}
NativeAlarm alm;
@ -130,10 +133,13 @@ void __KernelAlarmInit()
void __KernelAlarmDoState(PointerWrap &p)
{
auto s = p.Section("sceKernelAlarm", 1);
if (!s)
return;
p.Do(alarmTimer);
p.Do(triggeredAlarm);
CoreTiming::RestoreRegisterEvent(alarmTimer, "Alarm", __KernelTriggerAlarm);
p.DoMarker("sceKernelAlarm");
}
KernelObject *__KernelAlarmObject()

View file

@ -75,11 +75,14 @@ public:
virtual void DoState(PointerWrap &p)
{
auto s = p.Section("EventFlag", 1);
if (!s)
return;
p.Do(nef);
EventFlagTh eft = {0};
p.Do(waitingThreads, eft);
p.Do(pausedWaits);
p.DoMarker("EventFlag");
}
NativeEventFlag nef;
@ -124,9 +127,12 @@ void __KernelEventFlagInit()
void __KernelEventFlagDoState(PointerWrap &p)
{
auto s = p.Section("sceKernelEventFlag", 1);
if (!s)
return;
p.Do(eventFlagWaitTimer);
CoreTiming::RestoreRegisterEvent(eventFlagWaitTimer, "EventFlagTimeout", __KernelEventFlagTimeout);
p.DoMarker("sceKernelEventFlag");
}
KernelObject *__KernelEventFlagObject()

View file

@ -47,8 +47,11 @@ public:
void DoState(PointerWrap &p)
{
auto s = p.Section("InterruptState", 1);
if (!s)
return;
p.Do(savedCpu);
p.DoMarker("InterruptState");
}
ThreadContext savedCpu;
@ -200,16 +203,22 @@ void IntrHandler::queueUp(int subintr)
void IntrHandler::DoState(PointerWrap &p)
{
auto s = p.Section("IntrHandler", 1);
if (!s)
return;
p.Do(intrNumber);
p.Do<int, SubIntrHandler>(subIntrHandlers);
p.DoMarker("IntrHandler");
}
void PendingInterrupt::DoState(PointerWrap &p)
{
auto s = p.Section("PendingInterrupt", 1);
if (!s)
return;
p.Do(intr);
p.Do(subintr);
p.DoMarker("PendingInterrupt");
}
void __InterruptsInit()
@ -224,6 +233,10 @@ void __InterruptsInit()
void __InterruptsDoState(PointerWrap &p)
{
auto s = p.Section("sceKernelInterrupt", 1);
if (!s)
return;
int numInterrupts = PSP_NUMBER_INTERRUPTS;
p.Do(numInterrupts);
if (numInterrupts != PSP_NUMBER_INTERRUPTS)
@ -239,7 +252,6 @@ void __InterruptsDoState(PointerWrap &p)
p.Do(interruptsEnabled);
p.Do(inInterrupt);
p.Do(threadBeforeInterrupt);
p.DoMarker("sceKernelInterrupt");
}
void __InterruptsDoStateLate(PointerWrap &p)

View file

@ -175,11 +175,14 @@ struct Mbx : public KernelObject
virtual void DoState(PointerWrap &p)
{
auto s = p.Section("Mbx", 1);
if (!s)
return;
p.Do(nmb);
MbxWaitingThread mwt = {0};
p.Do(waitingThreads, mwt);
p.Do(pausedWaits);
p.DoMarker("Mbx");
}
NativeMbx nmb;
@ -200,9 +203,12 @@ void __KernelMbxInit()
void __KernelMbxDoState(PointerWrap &p)
{
auto s = p.Section("sceKernelMbx", 1);
if (!s)
return;
p.Do(mbxWaitTimer);
CoreTiming::RestoreRegisterEvent(mbxWaitTimer, "MbxTimeout", __KernelMbxTimeout);
p.DoMarker("sceKernelMbx");
}
KernelObject *__KernelMbxObject()

View file

@ -118,6 +118,10 @@ struct FPL : public KernelObject
virtual void DoState(PointerWrap &p)
{
auto s = p.Section("FPL", 1);
if (!s)
return;
p.Do(nf);
if (p.mode == p.MODE_READ)
blocks = new bool[nf.numBlocks];
@ -128,7 +132,6 @@ struct FPL : public KernelObject
FplWaitingThread dv = {0};
p.Do(waitingThreads, dv);
p.Do(pausedWaits);
p.DoMarker("FPL");
}
NativeFPL nf;
@ -175,13 +178,16 @@ struct VPL : public KernelObject
virtual void DoState(PointerWrap &p)
{
auto s = p.Section("VPL", 1);
if (!s)
return;
p.Do(nv);
p.Do(address);
VplWaitingThread dv = {0};
p.Do(waitingThreads, dv);
alloc.DoState(p);
p.Do(pausedWaits);
p.DoMarker("VPL");
}
SceKernelVplInfo nv;
@ -220,6 +226,10 @@ void __KernelMemoryInit()
void __KernelMemoryDoState(PointerWrap &p)
{
auto s = p.Section("sceKernelMemory", 1);
if (!s)
return;
kernelMemory.DoState(p);
userMemory.DoState(p);
@ -231,7 +241,6 @@ void __KernelMemoryDoState(PointerWrap &p)
p.Do(sdkVersion_);
p.Do(compilerVersion_);
p.DoArray(tlsUsedIndexes, ARRAY_SIZE(tlsUsedIndexes));
p.DoMarker("sceKernelMemory");
}
void __KernelMemoryShutdown()
@ -708,9 +717,12 @@ public:
virtual void DoState(PointerWrap &p)
{
auto s = p.Section("PMB", 1);
if (!s)
return;
p.Do(address);
p.DoArray(name, sizeof(name));
p.DoMarker("PMB");
}
u32 address;
@ -1597,12 +1609,15 @@ struct TLS : public KernelObject
virtual void DoState(PointerWrap &p)
{
auto s = p.Section("TLS", 1);
if (!s)
return;
p.Do(ntls);
p.Do(address);
p.Do(waitingThreads);
p.Do(next);
p.Do(usage);
p.DoMarker("TLS");
}
NativeTls ntls;

View file

@ -221,6 +221,10 @@ public:
virtual void DoState(PointerWrap &p)
{
auto s = p.Section("Module", 1);
if (!s)
return;
p.Do(nm);
p.Do(memoryBlockAddr);
p.Do(memoryBlockSize);
@ -237,7 +241,6 @@ public:
VarSymbolImport vsi = {0};
p.Do(importedVars, vsi);
RebuildImpExpModuleNames();
p.DoMarker("Module");
}
// We don't do this in the destructor to avoid annoying messages on game shutdown.
@ -328,9 +331,12 @@ public:
u32 retValAddr;
virtual void run(MipsCall &call);
virtual void DoState(PointerWrap &p) {
auto s = p.Section("AfterModuleEntryCall", 1);
if (!s)
return;
p.Do(moduleID_);
p.Do(retValAddr);
p.DoMarker("AfterModuleEntryCall");
}
static Action *Create() {
return new AfterModuleEntryCall;
@ -386,9 +392,12 @@ void __KernelModuleInit()
void __KernelModuleDoState(PointerWrap &p)
{
auto s = p.Section("sceKernelModule", 1);
if (!s)
return;
p.Do(actionAfterModule);
__KernelRestoreActionType(actionAfterModule, AfterModuleEntryCall::Create);
p.DoMarker("sceKernelModule");
}
void __KernelModuleShutdown()

View file

@ -271,6 +271,10 @@ struct MsgPipe : public KernelObject
virtual void DoState(PointerWrap &p)
{
auto s = p.Section("MsgPipe", 1);
if (!s)
return;
p.Do(nmp);
MsgPipeWaitingThread mpwt1 = {0}, mpwt2 = {0};
p.Do(sendWaitingThreads, mpwt1);
@ -278,7 +282,6 @@ struct MsgPipe : public KernelObject
p.Do(pausedSendWaits);
p.Do(pausedReceiveWaits);
p.Do(buffer);
p.DoMarker("MsgPipe");
}
NativeMsgPipe nmp;
@ -651,9 +654,12 @@ void __KernelMsgPipeInit()
void __KernelMsgPipeDoState(PointerWrap &p)
{
auto s = p.Section("sceKernelMsgPipe", 1);
if (!s)
return;
p.Do(waitTimer);
CoreTiming::RestoreRegisterEvent(waitTimer, "MsgPipeTimeout", __KernelMsgPipeTimeout);
p.DoMarker("sceKernelMsgPipe");
}
int sceKernelCreateMsgPipe(const char *name, int partition, u32 attr, u32 size, u32 optionsPtr)

View file

@ -70,11 +70,14 @@ struct Mutex : public KernelObject
virtual void DoState(PointerWrap &p)
{
auto s = p.Section("Mutex", 1);
if (!s)
return;
p.Do(nm);
SceUID dv = 0;
p.Do(waitingThreads, dv);
p.Do(pausedWaits);
p.DoMarker("Mutex");
}
NativeMutex nm;
@ -132,11 +135,14 @@ struct LwMutex : public KernelObject
virtual void DoState(PointerWrap &p)
{
auto s = p.Section("LwMutex", 1);
if (!s)
return;
p.Do(nm);
SceUID dv = 0;
p.Do(waitingThreads, dv);
p.Do(pausedWaits);
p.DoMarker("LwMutex");
}
NativeLwMutex nm;
@ -168,12 +174,15 @@ void __KernelMutexInit()
void __KernelMutexDoState(PointerWrap &p)
{
auto s = p.Section("sceKernelMutex", 1);
if (!s)
return;
p.Do(mutexWaitTimer);
CoreTiming::RestoreRegisterEvent(mutexWaitTimer, "MutexTimeout", __KernelMutexTimeout);
p.Do(lwMutexWaitTimer);
CoreTiming::RestoreRegisterEvent(lwMutexWaitTimer, "LwMutexTimeout", __KernelLwMutexTimeout);
p.Do(mutexHeldLocks);
p.DoMarker("sceKernelMutex");
}
KernelObject *__KernelMutexObject()

View file

@ -63,11 +63,14 @@ struct Semaphore : public KernelObject
virtual void DoState(PointerWrap &p)
{
auto s = p.Section("Semaphore", 1);
if (!s)
return;
p.Do(ns);
SceUID dv = 0;
p.Do(waitingThreads, dv);
p.Do(pausedWaits);
p.DoMarker("Semaphore");
}
NativeSemaphore ns;
@ -89,9 +92,12 @@ void __KernelSemaInit()
void __KernelSemaDoState(PointerWrap &p)
{
auto s = p.Section("sceKernelSema", 1);
if (!s)
return;
p.Do(semaWaitTimer);
CoreTiming::RestoreRegisterEvent(semaWaitTimer, "SemaphoreTimeout", __KernelSemaTimeout);
p.DoMarker("sceKernelSema");
}
KernelObject *__KernelSemaphoreObject()

View file

@ -141,13 +141,16 @@ public:
virtual void DoState(PointerWrap &p)
{
auto s = p.Section("Callback", 1);
if (!s)
return;
p.Do(nc);
p.Do(savedPC);
p.Do(savedRA);
p.Do(savedV0);
p.Do(savedV1);
p.Do(savedIdRegister);
p.DoMarker("Callback");
}
NativeCallback nc;
@ -260,9 +263,12 @@ public:
}
void DoState(PointerWrap &p) {
auto s = p.Section("MipsCallManager", 1);
if (!s)
return;
p.Do(calls_);
p.Do(idGen_);
p.DoMarker("MipsCallManager");
}
private:
@ -289,6 +295,10 @@ public:
virtual void DoState(PointerWrap &p)
{
auto s = p.Section("ActionAfterMipsCall", 1);
if (!s)
return;
p.Do(threadID);
p.Do(status);
p.Do(waitType);
@ -297,8 +307,6 @@ public:
p.Do(isProcessingCallbacks);
p.Do(currentCallbackId);
p.DoMarker("ActionAfterMipsCall");
int chainedActionType = 0;
if (chainedAction != NULL)
chainedActionType = chainedAction->actionTypeID;
@ -343,8 +351,11 @@ public:
void DoState(PointerWrap &p)
{
auto s = p.Section("ActionAfterCallback", 1);
if (!s)
return;
p.Do(cbId);
p.DoMarker("ActionAfterCallback");
}
SceUID cbId;
@ -502,6 +513,10 @@ public:
virtual void DoState(PointerWrap &p)
{
auto s = p.Section("Thread", 1);
if (!s)
return;
p.Do(nt);
p.Do(waitInfo);
p.Do(moduleId);
@ -515,8 +530,6 @@ public:
p.Do(pendingMipsCalls);
p.Do(pushedStacks);
p.Do(currentStack);
p.DoMarker("Thread");
}
NativeThread nt;
@ -688,6 +701,10 @@ struct ThreadQueueList
void DoState(PointerWrap &p)
{
auto s = p.Section("ThreadQueueList", 1);
if (!s)
return;
int numQueues = NUM_QUEUES;
p.Do(numQueues);
if (numQueues != NUM_QUEUES)
@ -721,8 +738,6 @@ struct ThreadQueueList
if (size != 0)
p.DoArray(&cur->data[cur->first], size);
}
p.DoMarker("ThreadQueueList");
}
private:
@ -870,6 +885,10 @@ Action *__KernelCreateAction(int actionType)
void MipsCall::DoState(PointerWrap &p)
{
auto s = p.Section("MipsCall", 1);
if (!s)
return;
p.Do(entryPoint);
p.Do(cbId);
p.DoArray(args, ARRAY_SIZE(args));
@ -883,8 +902,6 @@ void MipsCall::DoState(PointerWrap &p)
p.Do(savedId);
p.Do(reschedAfter);
p.DoMarker("MipsCall");
int actionTypeID = 0;
if (doAfter != NULL)
actionTypeID = doAfter->actionTypeID;
@ -1129,6 +1146,10 @@ void __KernelThreadingInit()
void __KernelThreadingDoState(PointerWrap &p)
{
auto s = p.Section("sceKernelThread", 1);
if (!s)
return;
p.Do(g_inCbCount);
p.Do(currentCallbackThreadID);
p.Do(readyCallbacksCount);
@ -1160,8 +1181,6 @@ void __KernelThreadingDoState(PointerWrap &p)
hleCurrentThreadName = __KernelGetThreadName(currentThread);
lastSwitchCycles = CoreTiming::GetTicks();
p.DoMarker("sceKernelThread");
}
void __KernelThreadingDoStateLate(PointerWrap &p)

View file

@ -41,8 +41,11 @@ void __KernelTimeInit()
void __KernelTimeDoState(PointerWrap &p)
{
auto s = p.Section("sceKernelTime", 1);
if (!s)
return;
p.Do(start_time);
p.DoMarker("sceKernelTime");
}
int sceKernelGetSystemTime(u32 sysclockPtr)

View file

@ -46,9 +46,12 @@ struct VTimer : public KernelObject {
int GetIDType() const { return SCE_KERNEL_TMID_VTimer; }
virtual void DoState(PointerWrap &p) {
auto s = p.Section("VTimer", 1);
if (!s)
return;
p.Do(nvt);
p.Do(memoryPtr);
p.DoMarker("VTimer");
}
NativeVTimer nvt;
@ -161,10 +164,13 @@ void __KernelTriggerVTimer(u64 userdata, int cyclesLate) {
}
void __KernelVTimerDoState(PointerWrap &p) {
auto s = p.Section("sceKernelVTimer", 1);
if (!s)
return;
p.Do(vtimerTimer);
p.Do(vtimers);
CoreTiming::RestoreRegisterEvent(vtimerTimer, "VTimer", __KernelTriggerVTimer);
p.DoMarker("sceKernelVTimer");
}
void __KernelVTimerInit() {

View file

@ -46,6 +46,10 @@ static const int MP3_BITRATES[] = {0, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160,
struct Mp3Context {
void DoState(PointerWrap &p) {
auto s = p.Section("Mp3Context", 1);
if (!s)
return;
p.Do(mp3StreamStart);
p.Do(mp3StreamEnd);
p.Do(mp3Buf);
@ -60,7 +64,6 @@ struct Mp3Context {
p.Do(mp3SamplingRate);
p.Do(mp3Version);
p.DoClass(mediaengine);
p.DoMarker("Mp3Context");
}
int mp3StreamStart;

View file

@ -126,6 +126,10 @@ struct MpegContext {
}
void DoState(PointerWrap &p) {
auto s = p.Section("MpegContext", 1);
if (!s)
return;
p.DoArray(mpegheader, 2048);
p.Do(defaultFrameWidth);
p.Do(videoFrameCount);
@ -155,7 +159,6 @@ struct MpegContext {
p.Do(isAnalyzed);
p.Do<u32, StreamInfo>(streamMap);
p.DoClass(mediaengine);
p.DoMarker("MpegContext");
}
u8 mpegheader[2048];
@ -298,7 +301,13 @@ public:
PostPutAction() {}
void setRingAddr(u32 ringAddr) { ringAddr_ = ringAddr; }
static Action *Create() { return new PostPutAction; }
void DoState(PointerWrap &p) { p.Do(ringAddr_); p.DoMarker("PostPutAction"); }
void DoState(PointerWrap &p) {
auto s = p.Section("PostPutAction", 1);
if (!s)
return;
p.Do(ringAddr_);
}
void run(MipsCall &call);
private:
u32 ringAddr_;
@ -318,6 +327,10 @@ void __MpegInit() {
}
void __MpegDoState(PointerWrap &p) {
auto s = p.Section("sceMpeg", 1);
if (!s)
return;
p.Do(lastMpegHandle);
p.Do(streamIdGen);
p.Do(isCurrentMpegAnalyzed);
@ -326,8 +339,6 @@ void __MpegDoState(PointerWrap &p) {
__KernelRestoreActionType(actionPostPut, PostPutAction::Create);
p.Do(mpegMap);
p.DoMarker("sceMpeg");
}
void __MpegShutdown() {

View file

@ -100,12 +100,15 @@ void __UpdateApctlHandlers(int oldState, int newState, int flag, int error) {
// This feels like a dubious proposition, mostly...
void __NetDoState(PointerWrap &p) {
auto s = p.Section("sceNet", 1);
if (!s)
return;
p.Do(netInited);
p.Do(netInetInited);
p.Do(netApctlInited);
p.Do(apctlHandlers);
p.Do(netMallocStat);
p.DoMarker("net");
}
// TODO: should that struct actually be initialized here?

View file

@ -103,11 +103,14 @@ void __NetAdhocShutdown() {
}
void __NetAdhocDoState(PointerWrap &p) {
auto s = p.Section("sceNetAdhoc", 1);
if (!s)
return;
p.Do(netAdhocInited);
p.Do(netAdhocctlInited);
p.Do(netAdhocMatchingInited);
p.Do(adhocctlHandlers);
p.DoMarker("netadhoc");
}
void __UpdateAdhocctlHandlers(int flag, int error) {

View file

@ -72,10 +72,13 @@ void __PowerInit() {
}
void __PowerDoState(PointerWrap &p) {
auto s = p.Section("scePower", 1);
if (!s)
return;
p.DoArray(powerCbSlots, ARRAY_SIZE(powerCbSlots));
p.Do(volatileMemLocked);
p.Do(volatileWaitingThreads);
p.DoMarker("scePower");
}
int scePowerGetBatteryLifePercent() {

View file

@ -220,6 +220,10 @@ public:
}
void DoState(PointerWrap &p) {
auto s = p.Section("PsmfStream", 1);
if (!s)
return;
p.Do(type);
p.Do(channel);
}
@ -289,6 +293,10 @@ PsmfPlayer::PsmfPlayer(u32 data) {
}
void Psmf::DoState(PointerWrap &p) {
auto s = p.Section("Psmf", 1);
if (!s)
return;
p.Do(magic);
p.Do(version);
p.Do(streamOffset);
@ -313,11 +321,13 @@ void Psmf::DoState(PointerWrap &p) {
p.Do(audioFrequency);
p.Do(streamMap);
p.DoMarker("Psmf");
}
void PsmfPlayer::DoState(PointerWrap &p) {
auto s = p.Section("PsmfPlayer", 1);
if (!s)
return;
p.Do(videoCodec);
p.Do(videoStreamNum);
p.Do(audioCodec);
@ -338,8 +348,6 @@ void PsmfPlayer::DoState(PointerWrap &p) {
p.Do(status);
p.Do(psmfPlayerAvcAu);
p.DoMarker("PsmfPlayer");
}
void Psmf::setStreamNum(int num) {
@ -412,18 +420,22 @@ void __PsmfInit()
void __PsmfDoState(PointerWrap &p)
{
p.Do(psmfMap);
auto s = p.Section("scePsmf", 1);
if (!s)
return;
p.DoMarker("scePsmf");
p.Do(psmfMap);
}
void __PsmfPlayerDoState(PointerWrap &p)
{
auto s = p.Section("scePsmfPlayer", 1);
if (!s)
return;
p.Do(psmfPlayerMap);
p.Do(videoPixelMode);
p.Do(videoLoopStatus);
p.DoMarker("scePsmfPlayer");
}
void __PsmfShutdown()

View file

@ -120,11 +120,13 @@ void __RtcInit()
void __RtcDoState(PointerWrap &p)
{
auto s = p.Section("sceRtc", 1);
if (!s)
return;
p.Do(rtcBaseTime);
// Update the precalc, pointless to savestate this as it's just based on the other value.
rtcBaseTicks = 1000000ULL * rtcBaseTime.tv_sec + rtcBaseTime.tv_usec + rtcMagicOffset;
p.DoMarker("sceRtc");
}
void __RtcTimeOfDay(PSPTimeval *tv)

View file

@ -59,8 +59,11 @@ void __SasInit() {
}
void __SasDoState(PointerWrap &p) {
auto s = p.Section("sceSas", 1);
if (!s)
return;
p.DoClass(sas);
p.DoMarker("sceSas");
}
void __SasShutdown() {

View file

@ -38,10 +38,13 @@ void __SslInit()
void __SslDoState(PointerWrap &p)
{
auto s = p.Section("sceSsl", 1);
if (!s)
return;
p.Do(isSslInit);
p.Do(maxMemSize);
p.Do(currentMemSize);
p.DoMarker("sceSsl");
}
int sceSslInit(int heapSize)

View file

@ -60,6 +60,10 @@ void __UmdInit()
void __UmdDoState(PointerWrap &p)
{
auto s = p.Section("sceUmd", 1);
if (!s)
return;
p.Do(umdActivated);
p.Do(umdStatus);
p.Do(umdErrorStat);
@ -70,7 +74,6 @@ void __UmdDoState(PointerWrap &p)
CoreTiming::RestoreRegisterEvent(umdStatChangeEvent, "UmdChange", __UmdStatChange);
p.Do(umdWaitingThreads);
p.Do(umdPausedWaits);
p.DoMarker("sceUmd");
}
u8 __KernelUmdGetState()

View file

@ -30,8 +30,11 @@ void __UsbInit()
void __UsbDoState(PointerWrap &p)
{
auto s = p.Section("sceUsb", 1);
if (!s)
return;
p.Do(usbActivated);
p.DoMarker("sceUsb");
}
u32 sceUsbActivate() {

View file

@ -68,6 +68,10 @@ void __UtilityInit()
void __UtilityDoState(PointerWrap &p)
{
auto s = p.Section("sceUtility", 1);
if (!s)
return;
p.Do(currentDialogType);
p.Do(currentDialogActive);
saveDialog.DoState(p);
@ -76,7 +80,6 @@ void __UtilityDoState(PointerWrap &p)
netDialog.DoState(p);
screenshotDialog.DoState(p);
p.Do(currentlyLoadedModules);
p.DoMarker("sceUtility");
}
void __UtilityShutdown()

View file

@ -31,8 +31,11 @@ void __VaudioInit() {
}
void __VaudioDoState(PointerWrap &p) {
auto s = p.Section("sceVaudio", 1);
if (!s)
return;
p.Do(vaudioReserved);
p.DoMarker("sceVaudio");
}
u32 sceVaudioChReserve(int sampleCount, int freq, int format) {

View file

@ -89,9 +89,12 @@ void AsyncIOManager::EventResult(u32 handle, AsyncIOResult result) {
}
void AsyncIOManager::DoState(PointerWrap &p) {
auto s = p.Section("AsyncIoManager", 1);
if (!s)
return;
SyncThread();
lock_guard guard(resultsLock_);
p.Do(resultsPending_);
p.Do(results_);
p.DoMarker("AsyncIOManager");
}

View file

@ -141,6 +141,10 @@ void MediaEngine::closeMedia() {
}
void MediaEngine::DoState(PointerWrap &p){
auto s = p.Section("MediaEngine", 1);
if (!s)
return;
p.Do(m_videoStream);
p.Do(m_audioStream);
@ -166,7 +170,6 @@ void MediaEngine::DoState(PointerWrap &p){
p.Do(m_isVideoEnd);
p.Do(m_noAudioData);
p.DoMarker("MediaEngine");
}
int _MpegReadbuffer(void *opaque, uint8_t *buf, int buf_size)

View file

@ -7,9 +7,12 @@ static MemStickFatState memStickFatState = PSP_FAT_MEMORYSTICK_STATE_ASSIGNED;
void MemoryStick_DoState(PointerWrap &p)
{
auto s = p.Section("MemoryStick", 1);
if (!s)
return;
p.Do(memStickState);
p.Do(memStickFatState);
p.DoMarker("MemoryStick");
}
MemStickState MemoryStick_State()

View file

@ -54,6 +54,10 @@ private:
int demuxStream(bool bdemux, int startCode, int channel);
public:
void DoState(PointerWrap &p) {
auto s = p.Section("MpegDemux", 1);
if (!s)
return;
p.Do(m_index);
p.Do(m_len);
p.Do(m_audioChannel);

View file

@ -137,6 +137,10 @@ void VagDecoder::GetSamples(s16 *outSamples, int numSamples) {
void VagDecoder::DoState(PointerWrap &p)
{
auto s = p.Section("VagDecoder", 1);
if (!s)
return;
p.DoArray(samples, ARRAY_SIZE(samples));
p.Do(curSample);
@ -190,6 +194,10 @@ int SasAtrac3::addStreamData(u8* buf, u32 addbytes) {
}
void SasAtrac3::DoState(PointerWrap &p) {
auto s = p.Section("SasAtrac3", 1);
if (!s)
return;
p.Do(contextAddr);
p.Do(atracID);
if (p.mode == p.MODE_READ && atracID >= 0 && !sampleQueue) {
@ -492,6 +500,10 @@ void SasInstance::Mix(u32 outAddr, u32 inAddr, int leftVol, int rightVol) {
}
void SasInstance::DoState(PointerWrap &p) {
auto s = p.Section("SasInstance", 1);
if (!s)
return;
p.Do(grainSize);
if (p.mode == p.MODE_READ) {
if (grainSize > 0) {
@ -525,8 +537,6 @@ void SasInstance::DoState(PointerWrap &p) {
}
p.DoArray(voices, ARRAY_SIZE(voices));
p.Do(waveformEffect);
p.DoMarker("SasInstance");
}
void SasVoice::Reset() {
@ -569,6 +579,10 @@ void SasVoice::ChangedParams(bool changedVag) {
void SasVoice::DoState(PointerWrap &p)
{
auto s = p.Section("SasVoice", 1);
if (!s)
return;
p.Do(playing);
p.Do(paused);
p.Do(on);
@ -596,8 +610,6 @@ void SasVoice::DoState(PointerWrap &p)
p.Do(effectRight);
p.DoArray(resampleHist, ARRAY_SIZE(resampleHist));
p.DoMarker("SasVoice");
envelope.DoState(p);
vag.DoState(p);
atrac3.DoState(p);
@ -789,6 +801,10 @@ void ADSREnvelope::KeyOff() {
}
void ADSREnvelope::DoState(PointerWrap &p) {
auto s = p.Section("ADSREnvelope", 1);
if (!s)
return;
p.Do(attackRate);
p.Do(decayRate);
p.Do(sustainRate);
@ -801,5 +817,4 @@ void ADSREnvelope::DoState(PointerWrap &p) {
p.Do(state_);
p.Do(steps_);
p.Do(height_);
p.DoMarker("ADSREnvelope");
}

View file

@ -72,16 +72,22 @@ Jit::Jit(MIPSState *mips) : blocks(mips, this), gpr(mips, &jo), fpr(mips), mips_
void Jit::DoState(PointerWrap &p)
{
auto s = p.Section("Jit", 1);
if (!s)
return;
p.Do(js.startDefaultPrefix);
p.DoMarker("Jit");
}
// This is here so the savestate matches between jit and non-jit.
void Jit::DoDummyState(PointerWrap &p)
{
auto s = p.Section("Jit", 1);
if (!s)
return;
bool dummy = false;
p.Do(dummy);
p.DoMarker("Jit");
}
void Jit::FlushAll()

View file

@ -147,6 +147,10 @@ void MIPSState::Reset()
}
void MIPSState::DoState(PointerWrap &p) {
auto s = p.Section("MIPSState", 1);
if (!s)
return;
// Reset the jit if we're loading.
if (p.mode == p.MODE_READ)
Reset();
@ -172,7 +176,6 @@ void MIPSState::DoState(PointerWrap &p) {
p.Do(inDelaySlot);
p.Do(llBit);
p.Do(debugCount);
p.DoMarker("MIPSState");
}
void MIPSState::SingleStep()

View file

@ -144,9 +144,17 @@ namespace MIPSComp
public:
Jit(MIPSState *mips);
void DoState(PointerWrap &p) {
auto s = p.Section("Jit", 1);
if (!s)
return;
// Do nothing
}
static void DoDummyState(PointerWrap &p) {
auto s = p.Section("Jit", 1);
if (!s)
return;
// Do nothing
}

View file

@ -123,16 +123,22 @@ Jit::Jit(MIPSState *mips) : blocks(mips, this), mips_(mips)
void Jit::DoState(PointerWrap &p)
{
auto s = p.Section("Jit", 1);
if (!s)
return;
p.Do(js.startDefaultPrefix);
p.DoMarker("Jit");
}
// This is here so the savestate matches between jit and non-jit.
void Jit::DoDummyState(PointerWrap &p)
{
auto s = p.Section("Jit", 1);
if (!s)
return;
bool dummy = false;
p.Do(dummy);
p.DoMarker("Jit");
}

View file

@ -98,6 +98,10 @@ void Init()
void DoState(PointerWrap &p)
{
auto s = p.Section("Memory", 1);
if (!s)
return;
p.DoArray(m_pRAM, g_MemorySize);
p.DoMarker("RAM");
p.DoArray(m_pVRAM, VRAM_SIZE);

View file

@ -66,6 +66,10 @@ namespace SaveState
void SaveStart::DoState(PointerWrap &p)
{
auto s = p.Section("SaveStart", 1);
if (!s)
return;
// Gotta do CoreTiming first since we'll restore into it.
CoreTiming::DoState(p);

View file

@ -419,6 +419,10 @@ u32 BlockAllocator::GetTotalFreeBytes() const
void BlockAllocator::DoState(PointerWrap &p)
{
auto s = p.Section("BlockAllocator", 1);
if (!s)
return;
int count = 0;
if (p.mode == p.MODE_READ)
@ -458,14 +462,16 @@ void BlockAllocator::DoState(PointerWrap &p)
p.Do(rangeStart_);
p.Do(rangeSize_);
p.Do(grain_);
p.DoMarker("BlockAllocator");
}
void BlockAllocator::Block::DoState(PointerWrap &p)
{
auto s = p.Section("Block", 1);
if (!s)
return;
p.Do(start);
p.Do(size);
p.Do(taken);
p.DoArray(tag, sizeof(tag));
p.DoMarker("Block");
}

View file

@ -187,6 +187,10 @@ void __PPGeInit()
void __PPGeDoState(PointerWrap &p)
{
auto s = p.Section("PPGeDraw", 1);
if (!s)
return;
p.Do(atlasPtr);
p.Do(atlasWidth);
p.Do(atlasHeight);
@ -208,8 +212,6 @@ void __PPGeDoState(PointerWrap &p)
p.Do(char_lines);
p.Do(char_lines_metrics);
p.DoMarker("PPGeDraw");
}
void __PPGeShutdown()

View file

@ -1450,5 +1450,6 @@ void GLES_GPU::DoState(PointerWrap &p) {
gstate_c.textureChanged = true;
framebufferManager_.DestroyAllFBOs();
// TODO: This one at least definitely shouldn't be necessary.
shaderManager_->ClearCache(true);
}

View file

@ -859,6 +859,10 @@ void GPUCommon::ExecuteOp(u32 op, u32 diff) {
void GPUCommon::DoState(PointerWrap &p) {
easy_guard guard(listLock);
auto s = p.Section("GPUCommon", 1);
if (!s)
return;
p.Do<int>(dlQueue);
p.DoArray(dls, ARRAY_SIZE(dls));
int currentID = 0;
@ -877,7 +881,6 @@ void GPUCommon::DoState(PointerWrap &p) {
p.Do(isbreak);
p.Do(drawCompleteTicks);
p.Do(busyTicks);
p.DoMarker("GPUCommon");
}
void GPUCommon::InterruptStart(int listid) {