diff options
Diffstat (limited to 'src/input_common/tas/tas_input.h')
| -rw-r--r-- | src/input_common/tas/tas_input.h | 48 |
1 files changed, 26 insertions, 22 deletions
diff --git a/src/input_common/tas/tas_input.h b/src/input_common/tas/tas_input.h index 52d000db4..3e2db8f00 100644 --- a/src/input_common/tas/tas_input.h +++ b/src/input_common/tas/tas_input.h | |||
| @@ -13,8 +13,8 @@ | |||
| 13 | 13 | ||
| 14 | /* | 14 | /* |
| 15 | To play back TAS scripts on Yuzu, select the folder with scripts in the configuration menu below | 15 | To play back TAS scripts on Yuzu, select the folder with scripts in the configuration menu below |
| 16 | Emulation -> Configure TAS. The file itself has normal text format and has to be called | 16 | Tools -> Configure TAS. The file itself has normal text format and has to be called script0-1.txt |
| 17 | script0-1.txt for controller 1, script0-2.txt for controller 2 and so forth (with max. 8 players). | 17 | for controller 1, script0-2.txt for controller 2 and so forth (with max. 8 players). |
| 18 | 18 | ||
| 19 | A script file has the same format as TAS-nx uses, so final files will look like this: | 19 | A script file has the same format as TAS-nx uses, so final files will look like this: |
| 20 | 20 | ||
| @@ -56,26 +56,26 @@ enum class TasState { | |||
| 56 | }; | 56 | }; |
| 57 | 57 | ||
| 58 | enum class TasButton : u32 { | 58 | enum class TasButton : u32 { |
| 59 | BUTTON_A = 0x000001, | 59 | BUTTON_A = 1U << 0, |
| 60 | BUTTON_B = 0x000002, | 60 | BUTTON_B = 1U << 1, |
| 61 | BUTTON_X = 0x000004, | 61 | BUTTON_X = 1U << 2, |
| 62 | BUTTON_Y = 0x000008, | 62 | BUTTON_Y = 1U << 3, |
| 63 | STICK_L = 0x000010, | 63 | STICK_L = 1U << 4, |
| 64 | STICK_R = 0x000020, | 64 | STICK_R = 1U << 5, |
| 65 | TRIGGER_L = 0x000040, | 65 | TRIGGER_L = 1U << 6, |
| 66 | TRIGGER_R = 0x000080, | 66 | TRIGGER_R = 1U << 7, |
| 67 | TRIGGER_ZL = 0x000100, | 67 | TRIGGER_ZL = 1U << 8, |
| 68 | TRIGGER_ZR = 0x000200, | 68 | TRIGGER_ZR = 1U << 9, |
| 69 | BUTTON_PLUS = 0x000400, | 69 | BUTTON_PLUS = 1U << 10, |
| 70 | BUTTON_MINUS = 0x000800, | 70 | BUTTON_MINUS = 1U << 11, |
| 71 | BUTTON_LEFT = 0x001000, | 71 | BUTTON_LEFT = 1U << 12, |
| 72 | BUTTON_UP = 0x002000, | 72 | BUTTON_UP = 1U << 13, |
| 73 | BUTTON_RIGHT = 0x004000, | 73 | BUTTON_RIGHT = 1U << 14, |
| 74 | BUTTON_DOWN = 0x008000, | 74 | BUTTON_DOWN = 1U << 15, |
| 75 | BUTTON_SL = 0x010000, | 75 | BUTTON_SL = 1U << 16, |
| 76 | BUTTON_SR = 0x020000, | 76 | BUTTON_SR = 1U << 17, |
| 77 | BUTTON_HOME = 0x040000, | 77 | BUTTON_HOME = 1U << 18, |
| 78 | BUTTON_CAPTURE = 0x080000, | 78 | BUTTON_CAPTURE = 1U << 19, |
| 79 | }; | 79 | }; |
| 80 | 80 | ||
| 81 | enum class TasAxes : u8 { | 81 | enum class TasAxes : u8 { |
| @@ -105,6 +105,9 @@ public: | |||
| 105 | // Sets the flag to start or stop the TAS command excecution and swaps controllers profiles | 105 | // Sets the flag to start or stop the TAS command excecution and swaps controllers profiles |
| 106 | void StartStop(); | 106 | void StartStop(); |
| 107 | 107 | ||
| 108 | // Stop the TAS and reverts any controller profile | ||
| 109 | void Stop(); | ||
| 110 | |||
| 108 | // Sets the flag to reload the file and start from the begining in the next update | 111 | // Sets the flag to reload the file and start from the begining in the next update |
| 109 | void Reset(); | 112 | void Reset(); |
| 110 | 113 | ||
| @@ -219,6 +222,7 @@ private: | |||
| 219 | 222 | ||
| 220 | size_t script_length{0}; | 223 | size_t script_length{0}; |
| 221 | std::array<TasData, PLAYER_NUMBER> tas_data; | 224 | std::array<TasData, PLAYER_NUMBER> tas_data; |
| 225 | bool is_old_input_saved{false}; | ||
| 222 | bool is_recording{false}; | 226 | bool is_recording{false}; |
| 223 | bool is_running{false}; | 227 | bool is_running{false}; |
| 224 | bool needs_reset{false}; | 228 | bool needs_reset{false}; |