void DoState(PointerWrap& p) { p.DoPOD(m_Control); p.DoPOD(m_Volume); p.Do(m_SampleCounter); p.Do(m_InterruptTiming); p.Do(g_LastCPUTime); p.Do(g_AISSampleRate); p.Do(g_AIDSampleRate); p.Do(g_CPUCyclesPerSample); }
void CEXIChannel::DoState(PointerWrap& p) { p.DoPOD(m_Status); p.Do(m_DMAMemoryAddress); p.Do(m_DMALength); p.Do(m_Control); p.Do(m_ImmData); for (int device_index = 0; device_index < NUM_DEVICES; ++device_index) { std::unique_ptr<IEXIDevice>& device = m_pDevices[device_index]; TEXIDevices type = device->m_deviceType; p.Do(type); if (type == device->m_deviceType) { device->DoState(p); } else { std::unique_ptr<IEXIDevice> save_device = EXIDevice_Create(type, m_ChannelId); save_device->DoState(p); AddDevice(std::move(save_device), device_index, false); } } }
void CEXIChannel::DoState(PointerWrap &p) { p.DoPOD(m_Status); p.Do(m_DMAMemoryAddress); p.Do(m_DMALength); p.Do(m_Control); p.Do(m_ImmData); for (int d = 0; d < NUM_DEVICES; ++d) { IEXIDevice* pDevice = m_pDevices[d].get(); TEXIDevices type = pDevice->m_deviceType; p.Do(type); IEXIDevice* pSaveDevice = (type == pDevice->m_deviceType) ? pDevice : EXIDevice_Create(type, m_ChannelId); pSaveDevice->DoState(p); if(pSaveDevice != pDevice) { // if we had to create a temporary device, discard it if we're not loading. // also, if no movie is active, we'll assume the user wants to keep their current devices // instead of the ones they had when the savestate was created, // unless the device is NONE (since ChangeDevice sets that temporarily). if(p.GetMode() != PointerWrap::MODE_READ) { delete pSaveDevice; } else { AddDevice(pSaveDevice, d, false); } } } }
void DoState(PointerWrap &p) { p.DoPOD(m_CPStatusReg); p.DoPOD(m_CPCtrlReg); p.DoPOD(m_CPClearReg); p.Do(m_bboxleft); p.Do(m_bboxtop); p.Do(m_bboxright); p.Do(m_bboxbottom); p.Do(m_tokenReg); p.Do(fifo); p.Do(s_interrupt_set); p.Do(s_interrupt_waiting); p.Do(s_interrupt_token_waiting); p.Do(s_interrupt_finish_waiting); }
void DoState(PointerWrap &p) { // some of this code has been disabled, because // it changes registers even in MODE_MEASURE (which is suspicious and seems like it could cause desyncs) // and because the values it's changing have been added to CoreTiming::DoState, so it might conflict to mess with them here. // rSPR(SPR_DEC) = SystemTimers::GetFakeDecrementer(); // *((u64 *)&TL) = SystemTimers::GetFakeTimeBase(); //works since we are little endian and TL comes first :) p.DoPOD(ppcState); // SystemTimers::DecrementerSet(); // SystemTimers::TimeBaseSet(); JitInterface::DoState(p); }
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 DSPHLE::DoState(PointerWrap &p) { bool isHLE = true; p.Do(isHLE); if (isHLE != true && p.GetMode() == PointerWrap::MODE_READ) { p.message.append("Audio: LLE"); Core::DisplayMessage("State is incompatible with current DSP engine. Aborting load state.", 3000); p.SetMode(PointerWrap::MODE_VERIFY); return; } bool prevInitMixer = m_InitMixer; p.Do(m_InitMixer); if (prevInitMixer != m_InitMixer && p.GetMode() == PointerWrap::MODE_READ) { if (m_InitMixer) { InitMixer(); AudioCommon::PauseAndLock(true); } else { AudioCommon::PauseAndLock(false); soundStream->Stop(); delete soundStream; soundStream = NULL; } } p.DoPOD(m_DSPControl); p.DoPOD(m_dspState); int ucode_crc = IUCode::GetCRC(m_pUCode); int ucode_crc_beforeLoad = ucode_crc; int lastucode_crc = IUCode::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. IUCode* ucode = (ucode_crc == ucode_crc_beforeLoad) ? m_pUCode : UCodeFactory( ucode_crc, this, m_bWii); IUCode* 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); }