void __KernelSemaDoState(PointerWrap &p) { p.Do(semaWaitTimer); CoreTiming::RestoreRegisterEvent(semaWaitTimer, "SemaphoreTimeout", __KernelSemaTimeout); p.DoMarker("sceKernelSema"); }
virtual void DoState(PointerWrap &p) { p.Do(moduleID_); p.Do(retValAddr); p.DoMarker("AfterModuleEntryCall"); }
void __PowerDoState(PointerWrap &p) { p.DoArray(powerCbSlots, ARRAY_SIZE(powerCbSlots)); p.Do(volatileMemLocked); p.DoMarker("scePower"); }
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 StereoResampler::DoState(PointerWrap &p) { auto s = p.Section("resampler", 1); if (!s) return; }
// This feels like a dubious proposition, mostly... void __NetDoState(PointerWrap &p) { p.Do(netInited); p.Do(netAdhocInited); p.DoMarker("net"); }
void GameListItem::Banner::DoState(PointerWrap& p) { p.Do(buffer); p.Do(width); p.Do(height); }
void DoState(PointerWrap &p) { u32 version = STATE_VERSION; { static const u32 COOKIE_BASE = 0xBAADBABE; u32 cookie = version + COOKIE_BASE; p.Do(cookie); version = cookie - COOKIE_BASE; } if (version != STATE_VERSION) { // if the version doesn't match, fail. // this will trigger a message like "Can't load state from other revisions" // we could use the version numbers to maintain some level of backward compatibility, but currently don't. p.SetMode(PointerWrap::MODE_MEASURE); return; } p.DoMarker("Version"); // Begin with video backend, so that it gets a chance to clear it's caches and writeback modified things to RAM g_video_backend->DoState(p); p.DoMarker("video_backend"); if (Core::g_CoreStartupParameter.bWii) Wiimote::DoState(p.GetPPtr(), p.GetMode()); p.DoMarker("Wiimote"); PowerPC::DoState(p); p.DoMarker("PowerPC"); HW::DoState(p); p.DoMarker("HW"); CoreTiming::DoState(p); p.DoMarker("CoreTiming"); Movie::DoState(p); p.DoMarker("Movie"); }
void DoState(PointerWrap &p) { Memory::DoState(p); p.DoMarker("Memory"); VideoInterface::DoState(p); p.DoMarker("VideoInterface"); SerialInterface::DoState(p); p.DoMarker("SerialInterface"); ProcessorInterface::DoState(p); p.DoMarker("ProcessorInterface"); DSP::DoState(p); p.DoMarker("DSP"); DVDInterface::DoState(p); p.DoMarker("DVDInterface"); GPFifo::DoState(p); p.DoMarker("GPFifo"); ExpansionInterface::DoState(p); p.DoMarker("ExpansionInterface"); AudioInterface::DoState(p); p.DoMarker("AudioInterface"); if (SConfig::GetInstance().bWii) { WII_IPCInterface::DoState(p); p.DoMarker("WII_IPCInterface"); WII_IPC_HLE_Interface::DoState(p); p.DoMarker("WII_IPC_HLE_Interface"); } p.DoMarker("WIIHW"); }
void PendingInterrupt::DoState(PointerWrap &p) { p.Do(intr); p.Do(subintr); p.DoMarker("PendingInterrupt"); }
void DoState(PointerWrap &p) { p.Do(savedCpu); p.DoMarker("InterruptState"); }
void IntrHandler::DoState(PointerWrap &p) { p.Do(intrNumber); p.Do<int, SubIntrHandler>(subIntrHandlers); p.DoMarker("IntrHandler"); }
void __PsmfPlayerDoState(PointerWrap &p) { p.Do(psmfPlayerMap); p.DoMarker("scePsmfPlayer"); }
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 __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 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); }
virtual void DoState(PointerWrap &p) { p.Do(nm); p.Do(memoryBlockAddr); p.DoMarker("Module"); }
void DoState(PointerWrap &p) { p.Do(type); p.Do(channel); }
void GameListItem::EmuState::DoState(PointerWrap& p) { p.Do(rating); p.Do(issues); }
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"); }
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 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 __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); } }
void __PsmfDoState(PointerWrap &p) { p.Do(psmfMap); p.DoMarker("scePsmf"); }
void MediaEngine::DoState(PointerWrap &p){ auto s = p.Section("MediaEngine", 1, 3); if (!s) return; p.Do(m_videoStream); p.Do(m_audioStream); p.DoArray(m_mpegheader, sizeof(m_mpegheader)); p.Do(m_ringbuffersize); u32 hasloadStream = m_pdata != NULL; p.Do(hasloadStream); if (hasloadStream && p.mode == p.MODE_READ) reloadStream(); #ifdef USE_FFMPEG u32 hasopencontext = m_pFormatCtx != NULL; #else u32 hasopencontext = false; #endif p.Do(hasopencontext); if (hasopencontext && p.mode == p.MODE_READ) openContext(); if (m_pdata) m_pdata->DoState(p); if (m_demux) m_demux->DoState(p); p.Do(m_videopts); p.Do(m_audiopts); if (s >= 2) { p.Do(m_firstTimeStamp); p.Do(m_lastTimeStamp); } p.Do(m_isVideoEnd); bool noAudioDataRemoved; p.Do(noAudioDataRemoved); if (s >= 3) { p.Do(m_audioType); } else { m_audioType = PSP_CODEC_AT3PLUS; } }
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); } } }
virtual void DoState(PointerWrap &p) { p.Do(address); p.DoArray(name, sizeof(name)); p.DoMarker("PMB"); }
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 GPUStateCache::DoState(PointerWrap &p) { auto s = p.Section("GPUStateCache", 0, 4); if (!s) { // Old state, this was not versioned. GPUStateCache_v0 old; p.Do(old); vertexAddr = old.vertexAddr; indexAddr = old.indexAddr; offsetAddr = old.offsetAddr; textureChanged = TEXCHANGE_UPDATED; textureFullAlpha = old.textureFullAlpha; vertexFullAlpha = old.vertexFullAlpha; framebufChanged = old.framebufChanged; skipDrawReason = old.skipDrawReason; uv = old.uv; } else { p.Do(vertexAddr); p.Do(indexAddr); p.Do(offsetAddr); p.Do(textureChanged); p.Do(textureFullAlpha); p.Do(vertexFullAlpha); p.Do(framebufChanged); p.Do(skipDrawReason); p.Do(uv); // No longer relevant. Remove when creating the next version. bool oldFlipTexture; p.Do(oldFlipTexture); } // needShaderTexClamp and bgraTexture don't need to be saved. if (s >= 3) { p.Do(textureSimpleAlpha); } else { textureSimpleAlpha = false; } if (s < 2) { float l12[12]; float l4[4]; p.Do(l12); // lightpos p.Do(l12); // lightdir p.Do(l12); // lightattr p.Do(l12); // lightcol0 p.Do(l12); // lightcol1 p.Do(l12); // lightcol2 p.Do(l4); // lightangle p.Do(l4); // lightspot } p.Do(morphWeights); p.Do(curTextureWidth); p.Do(curTextureHeight); p.Do(actualTextureHeight); // curTextureXOffset and curTextureYOffset don't need to be saved. Well, the above don't either... p.Do(vpWidth); p.Do(vpHeight); if (s == 4) { float oldDepth = 1.0f; p.Do(oldDepth); } p.Do(curRTWidth); p.Do(curRTHeight); // curRTBufferWidth, curRTBufferHeight, and cutRTOffsetX don't need to be saved. }
void VFSFileSystem::DoState(PointerWrap &p) { if (!entries.empty()) { p.SetError(p.ERROR_WARNING); ERROR_LOG(FILESYS, "FIXME: Open files during savestate, could go badly."); } }