From b42c3ce21db249d5e3bc04b4f73202e757da317c Mon Sep 17 00:00:00 2001 From: MonsterDruide1 <5958456@gmail.com> Date: Fri, 18 Jun 2021 16:15:42 +0200 Subject: input_common/tas: Base playback & recording system The base playback system supports up to 8 controllers (specified by `PLAYER_NUMBER` in `tas_input.h`), which all change their inputs simulataneously when `TAS::UpdateThread` is called. The recording system uses the controller debugger to read the state of the first controller and forwards that data to the TASing system for recording. Currently, this process sadly is not frame-perfect and pixel-accurate. Co-authored-by: Naii-the-Baf Co-authored-by: Narr-the-Reg --- src/yuzu/configuration/configure_input_player_widget.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/yuzu/configuration/configure_input_player_widget.cpp') diff --git a/src/yuzu/configuration/configure_input_player_widget.cpp b/src/yuzu/configuration/configure_input_player_widget.cpp index 9c890ed5d..e649e2169 100644 --- a/src/yuzu/configuration/configure_input_player_widget.cpp +++ b/src/yuzu/configuration/configure_input_player_widget.cpp @@ -220,8 +220,20 @@ void PlayerControlPreview::UpdateInput() { } } + ControllerInput input{}; if (input_changed) { update(); + input.changed = true; + } + input.axis_values[Settings::NativeAnalog::LStick] = { + axis_values[Settings::NativeAnalog::LStick].value.x(), + axis_values[Settings::NativeAnalog::LStick].value.y()}; + input.axis_values[Settings::NativeAnalog::RStick] = { + axis_values[Settings::NativeAnalog::RStick].value.x(), + axis_values[Settings::NativeAnalog::RStick].value.y()}; + input.button_values = button_values; + if (controller_callback.input != NULL) { + controller_callback.input(std::move(input)); } if (mapping_active) { @@ -229,6 +241,10 @@ void PlayerControlPreview::UpdateInput() { } } +void PlayerControlPreview::SetCallBack(ControllerCallback callback_) { + controller_callback = callback_; +} + void PlayerControlPreview::paintEvent(QPaintEvent* event) { QFrame::paintEvent(event); QPainter p(this); -- cgit v1.2.3