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/debugger/controller.h | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'src/yuzu/debugger/controller.h') diff --git a/src/yuzu/debugger/controller.h b/src/yuzu/debugger/controller.h index c54750070..659923e1b 100644 --- a/src/yuzu/debugger/controller.h +++ b/src/yuzu/debugger/controller.h @@ -4,18 +4,36 @@ #pragma once +#include #include +#include "common/settings.h" class QAction; class QHideEvent; class QShowEvent; class PlayerControlPreview; +namespace InputCommon { +class InputSubsystem; +} + +struct ControllerInput { + std::array, Settings::NativeAnalog::NUM_STICKS_HID> axis_values{}; + std::array button_values{}; + bool changed{}; +}; + +struct ControllerCallback { + std::function input; + std::function update; +}; + class ControllerDialog : public QWidget { Q_OBJECT public: - explicit ControllerDialog(QWidget* parent = nullptr); + explicit ControllerDialog(QWidget* parent = nullptr, + InputCommon::InputSubsystem* input_subsystem_ = nullptr); /// Returns a QAction that can be used to toggle visibility of this dialog. QAction* toggleViewAction(); @@ -26,6 +44,10 @@ protected: void hideEvent(QHideEvent* ev) override; private: + void RefreshTasFile(); + void InputController(ControllerInput input); QAction* toggle_view_action = nullptr; + QFileSystemWatcher* watcher = nullptr; PlayerControlPreview* widget; + InputCommon::InputSubsystem* input_subsystem; }; -- cgit v1.2.3 From c01a872c8efa90065b6ba1a74079ddf6ec12058f Mon Sep 17 00:00:00 2001 From: german77 Date: Sat, 19 Jun 2021 14:38:49 -0500 Subject: config: Move TAS options to it's own menu --- src/yuzu/debugger/controller.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src/yuzu/debugger/controller.h') diff --git a/src/yuzu/debugger/controller.h b/src/yuzu/debugger/controller.h index 659923e1b..f2f6653f7 100644 --- a/src/yuzu/debugger/controller.h +++ b/src/yuzu/debugger/controller.h @@ -25,7 +25,6 @@ struct ControllerInput { struct ControllerCallback { std::function input; - std::function update; }; class ControllerDialog : public QWidget { -- cgit v1.2.3 From f078b15565c8cab08587b8f8629d878615705cfb Mon Sep 17 00:00:00 2001 From: MonsterDruide1 <5958456@gmail.com> Date: Sun, 20 Jun 2021 00:04:34 +0200 Subject: input_common/tas: Fallback to simple update --- src/yuzu/debugger/controller.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/yuzu/debugger/controller.h') diff --git a/src/yuzu/debugger/controller.h b/src/yuzu/debugger/controller.h index f2f6653f7..448d24b67 100644 --- a/src/yuzu/debugger/controller.h +++ b/src/yuzu/debugger/controller.h @@ -25,6 +25,7 @@ struct ControllerInput { struct ControllerCallback { std::function input; + std::function update; }; class ControllerDialog : public QWidget { @@ -43,8 +44,8 @@ protected: void hideEvent(QHideEvent* ev) override; private: - void RefreshTasFile(); void InputController(ControllerInput input); + void UpdateController(bool update); QAction* toggle_view_action = nullptr; QFileSystemWatcher* watcher = nullptr; PlayerControlPreview* widget; -- cgit v1.2.3 From 5401cf6eb583092ed144d0f30fb6221a0ab25fed Mon Sep 17 00:00:00 2001 From: german77 Date: Fri, 9 Jul 2021 23:30:58 -0500 Subject: input_common/tas: new update method --- src/yuzu/debugger/controller.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/yuzu/debugger/controller.h') diff --git a/src/yuzu/debugger/controller.h b/src/yuzu/debugger/controller.h index 448d24b67..7742db58b 100644 --- a/src/yuzu/debugger/controller.h +++ b/src/yuzu/debugger/controller.h @@ -25,7 +25,6 @@ struct ControllerInput { struct ControllerCallback { std::function input; - std::function update; }; class ControllerDialog : public QWidget { @@ -45,7 +44,6 @@ protected: private: void InputController(ControllerInput input); - void UpdateController(bool update); QAction* toggle_view_action = nullptr; QFileSystemWatcher* watcher = nullptr; PlayerControlPreview* widget; -- cgit v1.2.3