本文整理汇总了C++中PointerWrap::GetMode方法的典型用法代码示例。如果您正苦于以下问题:C++ PointerWrap::GetMode方法的具体用法?C++ PointerWrap::GetMode怎么用?C++ PointerWrap::GetMode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PointerWrap
的用法示例。
在下文中一共展示了PointerWrap::GetMode方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: EventDoState
static void EventDoState(PointerWrap &p, BaseEvent* ev)
{
p.Do(ev->time);
// this is why we can't have (nice things) pointers as userdata
p.Do(ev->userdata);
// we can't savestate ev->type directly because events might not get registered in the same order (or at all) every time.
// so, we savestate the event's type's name, and derive ev->type from that when loading.
std::string name;
if (p.GetMode() != PointerWrap::MODE_READ)
name = event_types[ev->type].name;
p.Do(name);
if (p.GetMode() == PointerWrap::MODE_READ)
{
bool foundMatch = false;
for (unsigned int i = 0; i < event_types.size(); ++i)
{
if (name == event_types[i].name)
{
ev->type = i;
foundMatch = true;
break;
}
}
if (!foundMatch)
{
WARN_LOG(POWERPC, "Lost event from savestate because its type, \"%s\", has not been registered.", name.c_str());
ev->type = ev_lost;
}
}
}
示例3: 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;
}
}
}
示例4: DoState
void VertexShaderManager::DoState(PointerWrap &p)
{
p.Do(g_fProjectionMatrix);
p.Do(s_viewportCorrection);
p.Do(s_viewRotationMatrix);
p.Do(s_viewInvRotationMatrix);
p.Do(s_fViewTranslationVector);
p.Do(s_fViewRotation);
p.Do(nTransformMatricesChanged);
p.Do(nNormalMatricesChanged);
p.Do(nPostTransformMatricesChanged);
p.Do(nLightsChanged);
p.Do(nMaterialsChanged);
p.Do(bTexMatricesChanged);
p.Do(bPosNormalMatrixChanged);
p.Do(bProjectionChanged);
p.Do(bViewportChanged);
p.Do(constants);
if (p.GetMode() == PointerWrap::MODE_READ)
{
Dirty();
}
}
示例5: DoState
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);
}
}
示例6: DoState
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);
}
}
}
}
示例7: DoState
void USBHost::DoState(PointerWrap& p)
{
if (IsOpened() && p.GetMode() == PointerWrap::MODE_READ)
{
// After a state has loaded, there may be insertion hooks for devices that were
// already plugged in, and which need to be triggered.
UpdateDevices(true);
}
}
示例8: DoState
void GeometryShaderManager::DoState(PointerWrap &p)
{
if (p.GetMode() == PointerWrap::MODE_READ)
{
// Reload current state from global GPU state
// NOTE: This requires that all GPU memory has been loaded already.
Dirty();
}
}
示例9: DoState
void DoState(PointerWrap& p)
{
std::lock_guard<std::mutex> lk(s_ts_write_lock);
p.Do(g_slice_length);
p.Do(g_global_timer);
p.Do(s_idled_cycles);
p.Do(s_fake_dec_start_value);
p.Do(s_fake_dec_start_ticks);
p.Do(g_fake_TB_start_value);
p.Do(g_fake_TB_start_ticks);
p.Do(s_last_OC_factor);
g_last_OC_factor_inverted = 1.0f / s_last_OC_factor;
p.Do(s_event_fifo_id);
p.DoMarker("CoreTimingData");
MoveEvents();
p.DoEachElement(s_event_queue, [](PointerWrap& pw, Event& ev) {
pw.Do(ev.time);
pw.Do(ev.fifo_order);
// this is why we can't have (nice things) pointers as userdata
pw.Do(ev.userdata);
// we can't savestate ev.type directly because events might not get registered in the same
// order (or at all) every time.
// so, we savestate the event's type's name, and derive ev.type from that when loading.
std::string name;
if (pw.GetMode() != PointerWrap::MODE_READ)
name = *ev.type->name;
pw.Do(name);
if (pw.GetMode() == PointerWrap::MODE_READ)
{
auto itr = s_event_types.find(name);
if (itr != s_event_types.end())
{
ev.type = &itr->second;
}
else
{
WARN_LOG(POWERPC,
"Lost event from savestate because its type, \"%s\", has not been registered.",
name.c_str());
ev.type = s_ev_lost;
}
}
});
p.DoMarker("CoreTimingEvents");
// When loading from a save state, we must assume the Event order is random and meaningless.
// The exact layout of the heap in memory is implementation defined, therefore it is platform
// and library version specific.
if (p.GetMode() == PointerWrap::MODE_READ)
std::make_heap(s_event_queue.begin(), s_event_queue.end(), std::greater<Event>());
}
示例10:
void CWII_IPC_HLE_Device_sdio_slot0::DoState(PointerWrap& p)
{
DoStateShared(p);
if (p.GetMode() == PointerWrap::MODE_READ)
{
OpenInternal();
}
p.Do(m_Status);
p.Do(m_BlockLength);
p.Do(m_BusWidth);
p.Do(m_Registers);
}
示例11: DoState
void PixelShaderManager::DoState(PointerWrap &p)
{
p.DoArray(s_tev_color);
p.DoArray(s_tev_konst_color);
if (p.GetMode() == PointerWrap::MODE_READ)
{
// Reload current state from global GPU state
// NOTE: This requires that all GPU memory has been loaded already.
Dirty();
}
}
示例12: 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);
}
示例13: DoState
void CWII_IPC_HLE_Device_FileIO::DoState(PointerWrap &p)
{
DoStateShared(p);
p.Do(m_Mode);
p.Do(m_SeekPos);
m_filepath = HLE_IPC_BuildFilename(m_Name);
if (p.GetMode() == PointerWrap::MODE_READ)
{
OpenFile();
}
}
示例14: DoState
void GeometryShaderManager::DoState(PointerWrap &p)
{
p.Do(s_projection_changed);
p.Do(s_viewport_changed);
p.Do(constants);
if (p.GetMode() == PointerWrap::MODE_READ)
{
// Fixup the current state from global GPU state
// NOTE: This requires that all GPU memory has been loaded already.
Dirty();
}
}
示例15: DoState
void PixelShaderManager::DoState(PointerWrap &p)
{
p.Do(s_bFogRangeAdjustChanged);
p.Do(s_bViewPortChanged);
p.Do(constants);
if (p.GetMode() == PointerWrap::MODE_READ)
{
// Fixup the current state from global GPU state
// NOTE: This requires that all GPU memory has been loaded already.
Dirty();
}
}