void __KernelTimeDoState(PointerWrap &p) { p.Do(start_time); p.DoMarker("sceKernelTime"); }
void GameListItem::DoState(PointerWrap& p) { p.Do(m_valid); p.Do(m_file_name); p.Do(m_file_size); p.Do(m_volume_size); p.Do(m_names); p.Do(m_descriptions); p.Do(m_company); p.Do(m_game_id); p.Do(m_title_id); p.Do(m_region); p.Do(m_country); p.Do(m_platform); p.Do(m_blob_type); p.Do(m_revision); p.Do(m_disc_number); m_volume_banner.DoState(p); m_emu_state.DoState(p); p.Do(m_custom_name); if (p.GetMode() == PointerWrap::MODE_READ) { SetWxBannerFromRaw(m_volume_banner); } }
void __DisplayDoState(PointerWrap &p) { auto s = p.Section("sceDisplay", 1, 3); if (!s) return; p.Do(framebuf); p.Do(latchedFramebuf); p.Do(framebufIsLatched); p.Do(frameStartTicks); p.Do(vCount); if (s <= 2) { double oldHCountBase; p.Do(oldHCountBase); hCountBase = (int) oldHCountBase; } else { p.Do(hCountBase); } p.Do(isVblank); p.Do(hasSetMode); p.Do(mode); p.Do(resumeMode); p.Do(holdMode); p.Do(width); p.Do(height); WaitVBlankInfo wvi(0); p.Do(vblankWaitingThreads, wvi); p.Do(vblankPausedWaits); p.Do(enterVblankEvent); CoreTiming::RestoreRegisterEvent(enterVblankEvent, "EnterVBlank", &hleEnterVblank); p.Do(leaveVblankEvent); CoreTiming::RestoreRegisterEvent(leaveVblankEvent, "LeaveVBlank", &hleLeaveVblank); p.Do(afterFlipEvent); CoreTiming::RestoreRegisterEvent(afterFlipEvent, "AfterFlip", &hleAfterFlip); p.Do(gstate); p.Do(gstate_c); #ifndef _XBOX if (s < 2) { // This shouldn't have been savestated anyway, but it was. // It's unlikely to overlap with the first value in gpuStats. p.ExpectVoid(&gl_extensions.gpuVendor, sizeof(gl_extensions.gpuVendor)); } #endif p.Do(gpuStats); gpu->DoState(p); ReapplyGfxState(); if (p.mode == p.MODE_READ) { if (hasSetMode) { gpu->InitClear(); } gpu->SetDisplayFramebuffer(framebuf.topaddr, framebuf.pspFramebufLinesize, framebuf.pspFramebufFormat); } }
virtual void DoState(PointerWrap &p) { p.Do(nm); p.Do(memoryBlockAddr); p.DoMarker("Module"); }
void GameListItem::EmuState::DoState(PointerWrap& p) { p.Do(rating); p.Do(issues); }
void DoState(PointerWrap &p) { p.Do(request_queue); p.Do(reply_queue); p.Do(last_reply_time); for (const auto& entry : g_DeviceMap) { if (entry.second->IsHardware()) { entry.second->DoState(p); } } if (p.GetMode() == PointerWrap::MODE_READ) { for (u32 i=0; i<IPC_MAX_FDS; i++) { u32 exists = 0; p.Do(exists); if (exists) { u32 isHw = 0; p.Do(isHw); if (isHw) { u32 hwId = 0; p.Do(hwId); g_FdMap[i] = AccessDeviceByID(hwId); } else { g_FdMap[i] = std::make_shared<CWII_IPC_HLE_Device_FileIO>(i, ""); g_FdMap[i]->DoState(p); } } else { g_FdMap[i].reset(); } } for (u32 i=0; i<ES_MAX_COUNT; i++) { p.Do(es_inuse[i]); u32 handleID = es_handles[i]->GetDeviceID(); p.Do(handleID); es_handles[i] = AccessDeviceByID(handleID); } } else { for (auto& dev : g_FdMap) { u32 exists = dev ? 1 : 0; p.Do(exists); if (exists) { u32 isHw = dev->IsHardware() ? 1 : 0; p.Do(isHw); if (isHw) { u32 hwId = dev->GetDeviceID(); p.Do(hwId); } else { dev->DoState(p); } } } for (u32 i=0; i<ES_MAX_COUNT; i++) { p.Do(es_inuse[i]); u32 handleID = es_handles[i]->GetDeviceID(); p.Do(handleID); } } }
void ISOFileSystem::DoState(PointerWrap &p) { auto s = p.Section("ISOFileSystem", 1, 2); if (!s) return; int n = (int) entries.size(); p.Do(n); if (p.mode == p.MODE_READ) { entries.clear(); for (int i = 0; i < n; ++i) { u32 fd = 0; OpenFileEntry of; p.Do(fd); p.Do(of.seekPos); p.Do(of.isRawSector); p.Do(of.isBlockSectorMode); p.Do(of.sectorStart); p.Do(of.openSize); bool hasFile = false; p.Do(hasFile); if (hasFile) { std::string path; p.Do(path); of.file = GetFromPath(path); } else { of.file = NULL; } entries[fd] = of; } } else { for (EntryMap::iterator it = entries.begin(), end = entries.end(); it != end; ++it) { OpenFileEntry &of = it->second; p.Do(it->first); p.Do(of.seekPos); p.Do(of.isRawSector); p.Do(of.isBlockSectorMode); p.Do(of.sectorStart); p.Do(of.openSize); bool hasFile = of.file != NULL; p.Do(hasFile); if (hasFile) { std::string path = ""; path = EntryFullPath(of.file); p.Do(path); } } } if (s >= 2) { p.Do(lastReadBlock_); } else { lastReadBlock_ = 0; } }
void __KernelSemaDoState(PointerWrap &p) { p.Do(semaWaitTimer); CoreTiming::RestoreRegisterEvent(semaWaitTimer, "SemaphoreTimeout", __KernelSemaTimeout); p.DoMarker("sceKernelSema"); }
void __KernelDoState(PointerWrap &p) { { auto s = p.Section("Kernel", 1, 2); if (!s) return; p.Do(kernelRunning); kernelObjects.DoState(p); if (s >= 2) p.Do(registeredExitCbId); } { auto s = p.Section("Kernel Modules", 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); } { 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); __Mp3DoState(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); __CheatDoState(p); __sceAudiocodecDoState(p); __VideoPmpDoState(p); __AACDoState(p); } { auto s = p.Section("Kernel Cleanup", 1); if (!s) return; __InterruptsDoStateLate(p); __KernelThreadingDoStateLate(p); Reporting::DoState(p); } }
void AXUCode::DoAXState(PointerWrap& p) { p.Do(m_cmdlist); p.Do(m_cmdlist_size); p.Do(m_samples_left); p.Do(m_samples_right); p.Do(m_samples_surround); p.Do(m_samples_auxA_left); p.Do(m_samples_auxA_right); p.Do(m_samples_auxA_surround); p.Do(m_samples_auxB_left); p.Do(m_samples_auxB_right); p.Do(m_samples_auxB_surround); }
void MemoryCard::DoState(PointerWrap &p) { p.Do(card_index); p.Do(memory_card_size); p.DoArray(&m_memcard_data[0], memory_card_size); }
void PsmfPlayer::DoState(PointerWrap &p) { p.Do(videoCodec); p.Do(videoStreamNum); p.Do(audioCodec); p.Do(audioStreamNum); p.Do(playMode); p.Do(playSpeed); p.Do(displayBuffer); p.Do(displayBufferSize); p.Do(playbackThreadPriority); p.Do(psmfMaxAheadTimestamp); p.Do(psmfPlayerLastTimestamp); p.DoMarker("PsmfPlayer"); }
void VirtualDiscFileSystem::DoState(PointerWrap &p) { int fileListSize = fileList.size(); int entryCount = entries.size(); p.Do(fileListSize); p.Do(entryCount); p.Do(currentBlockIndex); if (p.mode == p.MODE_READ) { fileList.clear(); entries.clear(); for (int i = 0; i < fileListSize; i++) { FileListEntry entry; p.Do(entry.fileName); p.Do(entry.firstBlock); p.Do(entry.totalSize); fileList.push_back(entry); } for (int i = 0; i < entryCount; i++) { u32 fd; OpenFileEntry of; p.Do(fd); p.Do(of.fileIndex); p.Do(of.type); p.Do(of.curOffset); p.Do(of.startOffset); p.Do(of.size); // open file if (of.type != VFILETYPE_ISO) { bool success = of.hFile.Open(basePath,fileList[of.fileIndex].fileName,FILEACCESS_READ); if (!success) { ERROR_LOG(FILESYS, "Failed to create file handle for %s.",fileList[of.fileIndex].fileName.c_str()); } else { if (of.type == VFILETYPE_LBN) { of.hFile.Seek(of.curOffset+of.startOffset,FILEMOVE_BEGIN); } else { of.hFile.Seek(of.curOffset,FILEMOVE_BEGIN); } } } entries[fd] = of; } } else { for (int i = 0; i < fileListSize; i++) { p.Do(fileList[i].fileName); p.Do(fileList[i].firstBlock); p.Do(fileList[i].totalSize); } for (EntryMap::iterator it = entries.begin(), end = entries.end(); it != end; ++it) { OpenFileEntry &of = it->second; p.Do(it->first); p.Do(of.fileIndex); p.Do(of.type); p.Do(of.curOffset); p.Do(of.startOffset); p.Do(of.size); } } p.DoMarker("VirtualDiscFileSystem"); }
void VirtualDiscFileSystem::DoState(PointerWrap &p) { auto s = p.Section("VirtualDiscFileSystem", 1); if (!s) return; int fileListSize = (int)fileList.size(); int entryCount = (int)entries.size(); p.Do(fileListSize); p.Do(entryCount); p.Do(currentBlockIndex); FileListEntry dummy = {""}; fileList.resize(fileListSize, dummy); for (int i = 0; i < fileListSize; i++) { p.Do(fileList[i].fileName); p.Do(fileList[i].firstBlock); p.Do(fileList[i].totalSize); } if (p.mode == p.MODE_READ) { entries.clear(); for (int i = 0; i < entryCount; i++) { u32 fd = 0; OpenFileEntry of; p.Do(fd); p.Do(of.fileIndex); p.Do(of.type); p.Do(of.curOffset); p.Do(of.startOffset); p.Do(of.size); // open file if (of.type != VFILETYPE_ISO) { if (fileList[of.fileIndex].handler != NULL) { of.handler = fileList[of.fileIndex].handler; } bool success = of.Open(basePath, fileList[of.fileIndex].fileName, FILEACCESS_READ); if (!success) { ERROR_LOG(FILESYS, "Failed to create file handle for %s.", fileList[of.fileIndex].fileName.c_str()); } else { if (of.type == VFILETYPE_LBN) { of.Seek(of.curOffset + of.startOffset, FILEMOVE_BEGIN); } else { of.Seek(of.curOffset, FILEMOVE_BEGIN); } } } entries[fd] = of; } } else { for (EntryMap::iterator it = entries.begin(), end = entries.end(); it != end; ++it) { OpenFileEntry &of = it->second; p.Do(it->first); p.Do(of.fileIndex); p.Do(of.type); p.Do(of.curOffset); p.Do(of.startOffset); p.Do(of.size); } } // We don't savestate handlers (loaded on fs load), but if they change, it may not load properly. }
void PsmfPlayer::DoState(PointerWrap &p) { p.Do(videoCodec); p.Do(videoStreamNum); p.Do(audioCodec); p.Do(audioStreamNum); p.Do(playMode); p.Do(playSpeed); p.Do(displayBuffer); p.Do(displayBufferSize); p.Do(playbackThreadPriority); p.Do(psmfMaxAheadTimestamp); p.Do(psmfPlayerLastTimestamp); p.DoClass(mediaengine); p.Do(filehandle); p.Do(fileoffset); p.Do(readSize); p.Do(streamSize); p.Do(status); p.Do(psmfPlayerAvcAu); p.DoMarker("PsmfPlayer"); }
void __PsmfPlayerDoState(PointerWrap &p) { p.Do(psmfPlayerMap); p.DoMarker("scePsmfPlayer"); }
void __PsmfDoState(PointerWrap &p) { p.Do(psmfMap); p.DoMarker("scePsmf"); }
void IntrHandler::DoState(PointerWrap &p) { p.Do(intrNumber); p.Do<int, SubIntrHandler>(subIntrHandlers); p.DoMarker("IntrHandler"); }
virtual void DoState(PointerWrap &p) { p.Do(address); p.DoArray(name, sizeof(name)); p.DoMarker("PMB"); }
void PendingInterrupt::DoState(PointerWrap &p) { p.Do(intr); p.Do(subintr); p.DoMarker("PendingInterrupt"); }
void __CtrlDoState(PointerWrap &p) { std::lock_guard<std::recursive_mutex> guard(ctrlMutex); auto s = p.Section("sceCtrl", 1, 3); if (!s) return; p.Do(analogEnabled); p.Do(ctrlLatchBufs); p.Do(ctrlOldButtons); p.DoVoid(ctrlBufs, sizeof(ctrlBufs)); if (s <= 2) { _ctrl_data dummy = {0}; p.Do(dummy); } p.Do(ctrlBuf); p.Do(ctrlBufRead); p.Do(latch); if (s == 1) { dialogBtnMake = 0; } else { p.Do(dialogBtnMake); } p.Do(ctrlIdleReset); p.Do(ctrlIdleBack); p.Do(ctrlCycle); SceUID dv = 0; p.Do(waitingThreads, dv); p.Do(ctrlTimer); CoreTiming::RestoreRegisterEvent(ctrlTimer, "CtrlSampleTimer", __CtrlTimerUpdate); }
void DoState(PointerWrap &p) { p.Do(savedCpu); p.DoMarker("InterruptState"); }
// This feels like a dubious proposition, mostly... void __NetDoState(PointerWrap &p) { p.Do(netInited); p.Do(netAdhocInited); p.DoMarker("net"); }
void DSPHLE::DoState(PointerWrap &p) { bool isHLE = true; p.Do(isHLE); if (isHLE != true && p.GetMode() == PointerWrap::MODE_READ) { Core::DisplayMessage("State is incompatible with current DSP engine. Aborting load state.", 3000); p.SetMode(PointerWrap::MODE_VERIFY); return; } p.DoPOD(m_DSPControl); p.DoPOD(m_dspState); int ucode_crc = UCodeInterface::GetCRC(m_pUCode); int ucode_crc_beforeLoad = ucode_crc; int lastucode_crc = UCodeInterface::GetCRC(m_lastUCode); int lastucode_crc_beforeLoad = lastucode_crc; p.Do(ucode_crc); p.Do(lastucode_crc); // if a different type of ucode was being used when the savestate was created, // we have to reconstruct the old type of ucode so that we have a valid thing to call DoState on. UCodeInterface* ucode = (ucode_crc == ucode_crc_beforeLoad) ? m_pUCode : UCodeFactory( ucode_crc, this, m_bWii); UCodeInterface* lastucode = (lastucode_crc != lastucode_crc_beforeLoad) ? m_lastUCode : UCodeFactory(lastucode_crc, this, m_bWii); if (ucode) ucode->DoState(p); if (lastucode) lastucode->DoState(p); // if a different type of ucode was being used when the savestate was created, // discard it if we're not loading, otherwise discard the old one and keep the new one. if (ucode != m_pUCode) { if (p.GetMode() != PointerWrap::MODE_READ) { delete ucode; } else { delete m_pUCode; m_pUCode = ucode; } } if (lastucode != m_lastUCode) { if (p.GetMode() != PointerWrap::MODE_READ) { delete lastucode; } else { delete m_lastUCode; m_lastUCode = lastucode; } } m_MailHandler.DoState(p); }
void GameListItem::Banner::DoState(PointerWrap& p) { p.Do(buffer); p.Do(width); p.Do(height); }
void DoState(PointerWrap &p) { p.Do(type); p.Do(channel); }
void __CtrlDoState(PointerWrap &p) { std::lock_guard<std::recursive_mutex> guard(ctrlMutex); p.Do(analogEnabled); p.Do(ctrlLatchBufs); p.Do(ctrlOldButtons); p.DoVoid(ctrlBufs, sizeof(ctrlBufs)); p.Do(ctrlCurrent); p.Do(ctrlBuf); p.Do(ctrlBufRead); p.Do(latch); p.Do(ctrlIdleReset); p.Do(ctrlIdleBack); p.Do(ctrlCycle); SceUID dv = 0; p.Do(waitingThreads, dv); p.Do(ctrlTimer); CoreTiming::RestoreRegisterEvent(ctrlTimer, "CtrlSampleTimer", __CtrlTimerUpdate); p.DoMarker("sceCtrl"); }
void Psmf::DoState(PointerWrap &p) { p.Do(magic); p.Do(version); p.Do(streamOffset); p.Do(streamSize); p.Do(headerOffset); p.Do(streamDataTotalSize); p.Do(presentationStartTime); p.Do(presentationEndTime); p.Do(streamDataNextBlockSize); p.Do(streamDataNextInnerBlockSize); p.Do(numStreams); p.Do(currentStreamNum); p.Do(currentAudioStreamNum); p.Do(currentVideoStreamNum); p.Do(EPMapOffset); p.Do(EPMapEntriesNum); p.Do(videoWidth); p.Do(videoHeight); p.Do(audioChannels); p.Do(audioFrequency); p.Do(streamMap); p.DoMarker("Psmf"); }
virtual void DoState(PointerWrap &p) { p.Do(moduleID_); p.Do(retValAddr); p.DoMarker("AfterModuleEntryCall"); }
void __KernelMbxDoState(PointerWrap &p) { p.Do(mbxWaitTimer); CoreTiming::RestoreRegisterEvent(mbxWaitTimer, "MbxTimeout", __KernelMbxTimeout); p.DoMarker("sceKernelMbx"); }