From 8ad5ea2ede6c19bf3ea9f0ad0ef9c65d7982378f Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sun, 12 Nov 2017 17:20:59 +0100 Subject: [PATCH] Call Do for every member of SCPFifoStruct individually We need this because VS currently doesn't consider std::is_trivially_copyable::type>::value to be true and because no compiler should consider it to be true if we replace the volatiles with atomics. --- Source/Core/VideoCommon/CommandProcessor.cpp | 27 +++++++++++++++++++- Source/Core/VideoCommon/CommandProcessor.h | 2 ++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/Source/Core/VideoCommon/CommandProcessor.cpp b/Source/Core/VideoCommon/CommandProcessor.cpp index 04ede7c412..424435a178 100644 --- a/Source/Core/VideoCommon/CommandProcessor.cpp +++ b/Source/Core/VideoCommon/CommandProcessor.cpp @@ -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); diff --git a/Source/Core/VideoCommon/CommandProcessor.h b/Source/Core/VideoCommon/CommandProcessor.h index 7257d3e861..77623357d9 100644 --- a/Source/Core/VideoCommon/CommandProcessor.h +++ b/Source/Core/VideoCommon/CommandProcessor.h @@ -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.