From 4d34f861214612b8b3ef88a0291a89c783734144 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Tue, 4 Oct 2022 21:24:33 +0200 Subject: DolphinQt: Add MotionPlus support to TAS input Will manually controlling both an accelerometer and a gyroscope at the same time be reasonable to do? No idea. Was this easy to implement thanks to the input override system? Yes. Fixes https://bugs.dolphin-emu.org/issues/12443. --- Source/Core/DolphinQt/TAS/TASControlState.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Source/Core/DolphinQt/TAS/TASControlState.cpp') diff --git a/Source/Core/DolphinQt/TAS/TASControlState.cpp b/Source/Core/DolphinQt/TAS/TASControlState.cpp index fd0c209aa6..a961d8e437 100644 --- a/Source/Core/DolphinQt/TAS/TASControlState.cpp +++ b/Source/Core/DolphinQt/TAS/TASControlState.cpp @@ -7,7 +7,7 @@ #include "Common/CommonTypes.h" -u16 TASControlState::GetValue() const +int TASControlState::GetValue() const { const State ui_thread_state = m_ui_thread_state.load(std::memory_order_relaxed); const State cpu_thread_state = m_cpu_thread_state.load(std::memory_order_relaxed); @@ -16,7 +16,7 @@ u16 TASControlState::GetValue() const .value; } -bool TASControlState::OnControllerValueChanged(u16 new_value) +bool TASControlState::OnControllerValueChanged(int new_value) { const State cpu_thread_state = m_cpu_thread_state.load(std::memory_order_relaxed); @@ -26,13 +26,13 @@ bool TASControlState::OnControllerValueChanged(u16 new_value) return false; } - const State new_state{static_cast(cpu_thread_state.version + 1), new_value}; + const State new_state{static_cast(cpu_thread_state.version + 1), new_value}; m_cpu_thread_state.store(new_state, std::memory_order_relaxed); return true; } -void TASControlState::OnUIValueChanged(u16 new_value) +void TASControlState::OnUIValueChanged(int new_value) { const State ui_thread_state = m_ui_thread_state.load(std::memory_order_relaxed); @@ -40,7 +40,7 @@ void TASControlState::OnUIValueChanged(u16 new_value) m_ui_thread_state.store(new_state, std::memory_order_relaxed); } -u16 TASControlState::ApplyControllerValueChange() +int TASControlState::ApplyControllerValueChange() { const State ui_thread_state = m_ui_thread_state.load(std::memory_order_relaxed); const State cpu_thread_state = m_cpu_thread_state.load(std::memory_order_relaxed); -- cgit v1.2.3