本文整理汇总了C++中PointerWrap::SetMode方法的典型用法代码示例。如果您正苦于以下问题:C++ PointerWrap::SetMode方法的具体用法?C++ PointerWrap::SetMode怎么用?C++ PointerWrap::SetMode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PointerWrap
的用法示例。
在下文中一共展示了PointerWrap::SetMode方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoState
// Run from the CPU thread
void VideoBackendHardware::DoState(PointerWrap& p)
{
bool software = false;
p.Do(software);
if (p.GetMode() == PointerWrap::MODE_READ && software == true)
{
// change mode to abort load of incompatible save state.
p.SetMode(PointerWrap::MODE_VERIFY);
}
VideoCommon_DoState(p);
p.DoMarker("VideoCommon");
p.Do(s_beginFieldArgs);
p.DoMarker("VideoBackendHardware");
// Refresh state.
if (p.GetMode() == PointerWrap::MODE_READ)
{
m_invalid = true;
// Clear all caches that touch RAM
// (? these don't appear to touch any emulation state that gets saved. moved to on load only.)
VertexLoaderManager::MarkAllDirty();
}
}
示例2: DoState
void DSPLLE::DoState(PointerWrap &p)
{
bool isHLE = false;
p.Do(isHLE);
if (isHLE != false && 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.Do(g_dsp.r);
p.Do(g_dsp.pc);
#if PROFILE
p.Do(g_dsp.err_pc);
#endif
p.Do(g_dsp.cr);
p.Do(g_dsp.reg_stack_ptr);
p.Do(g_dsp.exceptions);
p.Do(g_dsp.external_interrupt_waiting);
for (int i = 0; i < 4; i++)
{
p.Do(g_dsp.reg_stack[i]);
}
p.Do(g_dsp.step_counter);
p.Do(g_dsp.ifx_regs);
p.Do(g_dsp.mbox[0]);
p.Do(g_dsp.mbox[1]);
UnWriteProtectMemory(g_dsp.iram, DSP_IRAM_BYTE_SIZE, false);
p.DoArray(g_dsp.iram, DSP_IRAM_SIZE);
WriteProtectMemory(g_dsp.iram, DSP_IRAM_BYTE_SIZE, false);
if (p.GetMode() == PointerWrap::MODE_READ)
DSPHost::CodeLoaded((const u8*)g_dsp.iram, DSP_IRAM_BYTE_SIZE);
p.DoArray(g_dsp.dram, DSP_DRAM_SIZE);
p.Do(cyclesLeft);
p.Do(init_hax);
p.Do(m_cycle_count);
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 = nullptr;
}
}
}
示例3: DoState
static 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 (SConfig::GetInstance().m_LocalCoreStartupParameter.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");
#if defined(HAVE_LIBAV) || defined (WIN32)
AVIDump::DoState();
#endif
}
示例4: DoState
void DSPLLE::DoState(PointerWrap &p)
{
bool is_hle = false;
p.Do(is_hle);
if (is_hle && 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.Do(g_dsp.r);
p.Do(g_dsp.pc);
#if PROFILE
p.Do(g_dsp.err_pc);
#endif
p.Do(g_dsp.cr);
p.Do(g_dsp.reg_stack_ptr);
p.Do(g_dsp.exceptions);
p.Do(g_dsp.external_interrupt_waiting);
for (int i = 0; i < 4; i++)
{
p.Do(g_dsp.reg_stack[i]);
}
p.Do(g_dsp.step_counter);
p.DoArray(g_dsp.ifx_regs);
p.Do(g_dsp.mbox[0]);
p.Do(g_dsp.mbox[1]);
UnWriteProtectMemory(g_dsp.iram, DSP_IRAM_BYTE_SIZE, false);
p.DoArray(g_dsp.iram, DSP_IRAM_SIZE);
WriteProtectMemory(g_dsp.iram, DSP_IRAM_BYTE_SIZE, false);
if (p.GetMode() == PointerWrap::MODE_READ)
DSPHost::CodeLoaded((const u8*)g_dsp.iram, DSP_IRAM_BYTE_SIZE);
p.DoArray(g_dsp.dram, DSP_DRAM_SIZE);
p.Do(g_cycles_left);
p.Do(g_init_hax);
p.Do(m_cycle_count);
}
示例5: DoState
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);
}
示例6: DoState
void BluetoothStub::DoState(PointerWrap& p)
{
Core::DisplayMessage("The current IPC_HLE_Device_usb is a stub. Aborting load.", 4000);
p.SetMode(PointerWrap::MODE_VERIFY);
}
示例7: DoState
static std::string 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;
}
std::string version_created_by = scm_rev_str;
if (version > 42)
p.Do(version_created_by);
else
version_created_by.clear();
if (version != STATE_VERSION)
{
if (version_created_by.empty() && s_old_versions.count(version))
{
// The savestate is from an old version that doesn't
// save the Dolphin version number to savestates, but
// by looking up the savestate version number, it is possible
// to know approximately which Dolphin version was used.
std::pair<std::string, std::string> version_range = s_old_versions.find(version)->second;
std::string oldest_version = version_range.first;
std::string newest_version = version_range.second;
version_created_by = "Dolphin " + oldest_version + " - " + newest_version;
}
// because the version doesn't match, fail.
// this will trigger an OSD 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 version_created_by;
}
p.DoMarker("Version");
// Begin with video backend, so that it gets a chance to clear its caches and writeback modified things to RAM
g_video_backend->DoState(p);
p.DoMarker("video_backend");
if (SConfig::GetInstance().m_LocalCoreStartupParameter.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");
#if defined(HAVE_LIBAV) || defined (WIN32)
AVIDump::DoState();
#endif
return version_created_by;
}