From 68d987bbee49f96f25b0e74c3e24946c0f0183a6 Mon Sep 17 00:00:00 2001 From: Pokechu22 Date: Tue, 15 Feb 2022 22:34:29 -0800 Subject: [PATCH] CommandProcessor: Add FIFO_BP_LO/HI to directly_mapped_vars directly_mapped_vars was added in #69 (4129b30494757a79daf8a07e6a07ea937ba1c94b), but for some reason FIFO_BP_LO/HI were split out from it in in #885 (65af90669bd5f9e02bbaa994d51d5c83d147b868). As far as I can tell, this code (and the code that existed at the time) is identical, so there's no reason to have it handled separately. --- Source/Core/VideoCommon/CommandProcessor.cpp | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/Source/Core/VideoCommon/CommandProcessor.cpp b/Source/Core/VideoCommon/CommandProcessor.cpp index 890d7ebfa4..6ebb726d23 100644 --- a/Source/Core/VideoCommon/CommandProcessor.cpp +++ b/Source/Core/VideoCommon/CommandProcessor.cpp @@ -121,11 +121,6 @@ void DoState(PointerWrap& p) p.Do(s_interrupt_waiting); } -static inline void WriteLow(std::atomic& reg, u16 lowbits) -{ - reg.store((reg.load(std::memory_order_relaxed) & 0xFFFF0000) | lowbits, - std::memory_order_relaxed); -} static inline void WriteHigh(std::atomic& reg, u16 highbits) { reg.store((reg.load(std::memory_order_relaxed) & 0x0000FFFF) | (static_cast(highbits) << 16), @@ -205,6 +200,8 @@ void RegisterMMIO(MMIO::Mapping* mmio, u32 base) {FIFO_WRITE_POINTER_HI, MMIO::Utils::HighPart(&fifo.CPWritePointer), false, WMASK_HI_RESTRICT}, // FIFO_READ_POINTER has different code for single/dual core. + {FIFO_BP_LO, MMIO::Utils::LowPart(&fifo.CPBreakpoint), false, WMASK_LO_ALIGN_32BIT}, + {FIFO_BP_HI, MMIO::Utils::HighPart(&fifo.CPBreakpoint), false, WMASK_HI_RESTRICT}, }; for (auto& mapped_var : directly_mapped_vars) @@ -214,16 +211,6 @@ void RegisterMMIO(MMIO::Mapping* mmio, u32 base) MMIO::DirectWrite(mapped_var.ptr, mapped_var.wmask)); } - mmio->Register(base | FIFO_BP_LO, MMIO::DirectRead(MMIO::Utils::LowPart(&fifo.CPBreakpoint)), - MMIO::ComplexWrite([](u32, u16 val) { - WriteLow(fifo.CPBreakpoint, val & WMASK_LO_ALIGN_32BIT); - })); - mmio->Register(base | FIFO_BP_HI, - MMIO::DirectRead(MMIO::Utils::HighPart(&fifo.CPBreakpoint)), - MMIO::ComplexWrite([WMASK_HI_RESTRICT](u32, u16 val) { - WriteHigh(fifo.CPBreakpoint, val & WMASK_HI_RESTRICT); - })); - // Timing and metrics MMIOs are stubbed with fixed values. struct {