Call Do for every member of SCPFifoStruct individually

We need this because VS currently doesn't consider
std::is_trivially_copyable<typename
std::remove_volatile<SCPFifoStruct>::type>::value
to be true and because no compiler should consider it
to be true if we replace the volatiles with atomics.
This commit is contained in:
JosJuice 2017-11-12 17:20:59 +01:00
parent 983b986303
commit 8ad5ea2ede
2 changed files with 28 additions and 1 deletions

View File

@ -50,6 +50,31 @@ static void UpdateInterrupts_Wrapper(u64 userdata, s64 cyclesLate)
UpdateInterrupts(userdata);
}
void SCPFifoStruct::DoState(PointerWrap& p)
{
p.Do(CPBase);
p.Do(CPEnd);
p.Do(CPHiWatermark);
p.Do(CPLoWatermark);
p.Do(CPReadWriteDistance);
p.Do(CPWritePointer);
p.Do(CPReadPointer);
p.Do(CPBreakpoint);
p.Do(SafeCPReadPointer);
p.Do(bFF_GPLinkEnable);
p.Do(bFF_GPReadEnable);
p.Do(bFF_BPEnable);
p.Do(bFF_BPInt);
p.Do(bFF_Breakpoint);
p.Do(bFF_LoWatermarkInt);
p.Do(bFF_HiWatermarkInt);
p.Do(bFF_LoWatermark);
p.Do(bFF_HiWatermark);
}
void DoState(PointerWrap& p)
{
p.DoPOD(m_CPStatusReg);
@ -60,7 +85,7 @@ void DoState(PointerWrap& p)
p.Do(m_bboxright);
p.Do(m_bboxbottom);
p.Do(m_tokenReg);
p.Do(fifo);
fifo.DoState(p);
p.Do(s_interrupt_set);
p.Do(s_interrupt_waiting);

View File

@ -38,6 +38,8 @@ struct SCPFifoStruct
volatile u32 bFF_LoWatermark;
volatile u32 bFF_HiWatermark;
void DoState(PointerWrap& p);
};
// This one is shared between gfx thread and emulator thread.