diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/fs/path_util.cpp | 2 | ||||
| -rw-r--r-- | src/common/fs/path_util.h | 2 | ||||
| -rw-r--r-- | src/common/settings.h | 3 | ||||
| -rw-r--r-- | src/yuzu/configuration/config.cpp | 24 | ||||
| -rw-r--r-- | src/yuzu/configuration/config.h | 2 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_filesystem.cpp | 10 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_filesystem.h | 1 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_filesystem.ui | 49 | ||||
| -rw-r--r-- | src/yuzu/main.cpp | 13 |
9 files changed, 104 insertions, 2 deletions
diff --git a/src/common/fs/path_util.cpp b/src/common/fs/path_util.cpp index 6cdd14f13..5f76adedb 100644 --- a/src/common/fs/path_util.cpp +++ b/src/common/fs/path_util.cpp | |||
| @@ -116,6 +116,8 @@ private: | |||
| 116 | GenerateYuzuPath(YuzuPath::ScreenshotsDir, yuzu_path / SCREENSHOTS_DIR); | 116 | GenerateYuzuPath(YuzuPath::ScreenshotsDir, yuzu_path / SCREENSHOTS_DIR); |
| 117 | GenerateYuzuPath(YuzuPath::SDMCDir, yuzu_path / SDMC_DIR); | 117 | GenerateYuzuPath(YuzuPath::SDMCDir, yuzu_path / SDMC_DIR); |
| 118 | GenerateYuzuPath(YuzuPath::ShaderDir, yuzu_path / SHADER_DIR); | 118 | GenerateYuzuPath(YuzuPath::ShaderDir, yuzu_path / SHADER_DIR); |
| 119 | |||
| 120 | GenerateYuzuPath(YuzuPath::TASFile, fs::path{""}); | ||
| 119 | } | 121 | } |
| 120 | 122 | ||
| 121 | ~PathManagerImpl() = default; | 123 | ~PathManagerImpl() = default; |
diff --git a/src/common/fs/path_util.h b/src/common/fs/path_util.h index f956ac9a2..6079de4c6 100644 --- a/src/common/fs/path_util.h +++ b/src/common/fs/path_util.h | |||
| @@ -23,6 +23,8 @@ enum class YuzuPath { | |||
| 23 | ScreenshotsDir, // Where yuzu screenshots are stored. | 23 | ScreenshotsDir, // Where yuzu screenshots are stored. |
| 24 | SDMCDir, // Where the emulated SDMC is stored. | 24 | SDMCDir, // Where the emulated SDMC is stored. |
| 25 | ShaderDir, // Where shaders are stored. | 25 | ShaderDir, // Where shaders are stored. |
| 26 | |||
| 27 | TASFile, // Where the current script file is stored. | ||
| 26 | }; | 28 | }; |
| 27 | 29 | ||
| 28 | /** | 30 | /** |
diff --git a/src/common/settings.h b/src/common/settings.h index 29b888f10..884ea55f8 100644 --- a/src/common/settings.h +++ b/src/common/settings.h | |||
| @@ -550,6 +550,9 @@ struct Values { | |||
| 550 | BasicSetting<bool> gamecard_current_game{false, "gamecard_current_game"}; | 550 | BasicSetting<bool> gamecard_current_game{false, "gamecard_current_game"}; |
| 551 | BasicSetting<std::string> gamecard_path{std::string(), "gamecard_path"}; | 551 | BasicSetting<std::string> gamecard_path{std::string(), "gamecard_path"}; |
| 552 | 552 | ||
| 553 | // TAS | ||
| 554 | bool pauseTasOnLoad; | ||
| 555 | |||
| 553 | // Debugging | 556 | // Debugging |
| 554 | bool record_frame_times; | 557 | bool record_frame_times; |
| 555 | BasicSetting<bool> use_gdbstub{false, "use_gdbstub"}; | 558 | BasicSetting<bool> use_gdbstub{false, "use_gdbstub"}; |
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index 952e96769..99e318a8f 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp | |||
| @@ -221,7 +221,7 @@ const std::array<int, Settings::NativeKeyboard::NumKeyboardMods> Config::default | |||
| 221 | // This must be in alphabetical order according to action name as it must have the same order as | 221 | // This must be in alphabetical order according to action name as it must have the same order as |
| 222 | // UISetting::values.shortcuts, which is alphabetically ordered. | 222 | // UISetting::values.shortcuts, which is alphabetically ordered. |
| 223 | // clang-format off | 223 | // clang-format off |
| 224 | const std::array<UISettings::Shortcut, 18> Config::default_hotkeys{{ | 224 | const std::array<UISettings::Shortcut, 21> Config::default_hotkeys{{ |
| 225 | {QStringLiteral("Capture Screenshot"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+P"), Qt::WidgetWithChildrenShortcut}}, | 225 | {QStringLiteral("Capture Screenshot"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+P"), Qt::WidgetWithChildrenShortcut}}, |
| 226 | {QStringLiteral("Change Docked Mode"), QStringLiteral("Main Window"), {QStringLiteral("F10"), Qt::ApplicationShortcut}}, | 226 | {QStringLiteral("Change Docked Mode"), QStringLiteral("Main Window"), {QStringLiteral("F10"), Qt::ApplicationShortcut}}, |
| 227 | {QStringLiteral("Continue/Pause Emulation"), QStringLiteral("Main Window"), {QStringLiteral("F4"), Qt::WindowShortcut}}, | 227 | {QStringLiteral("Continue/Pause Emulation"), QStringLiteral("Main Window"), {QStringLiteral("F4"), Qt::WindowShortcut}}, |
| @@ -235,6 +235,9 @@ const std::array<UISettings::Shortcut, 18> Config::default_hotkeys{{ | |||
| 235 | {QStringLiteral("Mute Audio"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+M"), Qt::WindowShortcut}}, | 235 | {QStringLiteral("Mute Audio"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+M"), Qt::WindowShortcut}}, |
| 236 | {QStringLiteral("Restart Emulation"), QStringLiteral("Main Window"), {QStringLiteral("F6"), Qt::WindowShortcut}}, | 236 | {QStringLiteral("Restart Emulation"), QStringLiteral("Main Window"), {QStringLiteral("F6"), Qt::WindowShortcut}}, |
| 237 | {QStringLiteral("Stop Emulation"), QStringLiteral("Main Window"), {QStringLiteral("F5"), Qt::WindowShortcut}}, | 237 | {QStringLiteral("Stop Emulation"), QStringLiteral("Main Window"), {QStringLiteral("F5"), Qt::WindowShortcut}}, |
| 238 | {QStringLiteral("TAS Start/Stop"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+F5"), Qt::ApplicationShortcut}}, | ||
| 239 | {QStringLiteral("TAS Reset"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+F6"), Qt::ApplicationShortcut}}, | ||
| 240 | {QStringLiteral("TAS Record"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+F7"), Qt::ApplicationShortcut}}, | ||
| 238 | {QStringLiteral("Toggle Filter Bar"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+F"), Qt::WindowShortcut}}, | 241 | {QStringLiteral("Toggle Filter Bar"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+F"), Qt::WindowShortcut}}, |
| 239 | {QStringLiteral("Toggle Framerate Limit"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+U"), Qt::ApplicationShortcut}}, | 242 | {QStringLiteral("Toggle Framerate Limit"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+U"), Qt::ApplicationShortcut}}, |
| 240 | {QStringLiteral("Toggle Mouse Panning"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+F9"), Qt::ApplicationShortcut}}, | 243 | {QStringLiteral("Toggle Mouse Panning"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+F9"), Qt::ApplicationShortcut}}, |
| @@ -564,6 +567,9 @@ void Config::ReadControlValues() { | |||
| 564 | Settings::values.mouse_panning = false; | 567 | Settings::values.mouse_panning = false; |
| 565 | ReadBasicSetting(Settings::values.mouse_panning_sensitivity); | 568 | ReadBasicSetting(Settings::values.mouse_panning_sensitivity); |
| 566 | 569 | ||
| 570 | ReadBasicSetting(Settings::values.tas_enable = false); | ||
| 571 | ReadBasicSetting(Settings::values.tas_reset = false); | ||
| 572 | |||
| 567 | ReadGlobalSetting(Settings::values.use_docked_mode); | 573 | ReadGlobalSetting(Settings::values.use_docked_mode); |
| 568 | 574 | ||
| 569 | // Disable docked mode if handheld is selected | 575 | // Disable docked mode if handheld is selected |
| @@ -661,9 +667,20 @@ void Config::ReadDataStorageValues() { | |||
| 661 | QString::fromStdString(FS::GetYuzuPathString(FS::YuzuPath::DumpDir))) | 667 | QString::fromStdString(FS::GetYuzuPathString(FS::YuzuPath::DumpDir))) |
| 662 | .toString() | 668 | .toString() |
| 663 | .toStdString()); | 669 | .toStdString()); |
| 670 | FS::SetYuzuPath( | ||
| 671 | FS::YuzuPath::TASFile, | ||
| 672 | qt_config | ||
| 673 | ->value(QStringLiteral("tas_path"), | ||
| 674 | QString::fromStdString(FS::GetYuzuPathString(FS::YuzuPath::TASFile))) | ||
| 675 | .toString() | ||
| 676 | .toStdString()); | ||
| 677 | |||
| 678 | ReadBasicSetting(Settings::values.pauseTasOnLoad); | ||
| 679 | |||
| 664 | ReadBasicSetting(Settings::values.gamecard_inserted); | 680 | ReadBasicSetting(Settings::values.gamecard_inserted); |
| 665 | ReadBasicSetting(Settings::values.gamecard_current_game); | 681 | ReadBasicSetting(Settings::values.gamecard_current_game); |
| 666 | ReadBasicSetting(Settings::values.gamecard_path); | 682 | ReadBasicSetting(Settings::values.gamecard_path); |
| 683 | |||
| 667 | 684 | ||
| 668 | qt_config->endGroup(); | 685 | qt_config->endGroup(); |
| 669 | } | 686 | } |
| @@ -1215,6 +1232,11 @@ void Config::SaveDataStorageValues() { | |||
| 1215 | WriteSetting(QStringLiteral("dump_directory"), | 1232 | WriteSetting(QStringLiteral("dump_directory"), |
| 1216 | QString::fromStdString(FS::GetYuzuPathString(FS::YuzuPath::DumpDir)), | 1233 | QString::fromStdString(FS::GetYuzuPathString(FS::YuzuPath::DumpDir)), |
| 1217 | QString::fromStdString(FS::GetYuzuPathString(FS::YuzuPath::DumpDir))); | 1234 | QString::fromStdString(FS::GetYuzuPathString(FS::YuzuPath::DumpDir))); |
| 1235 | WriteSetting(QStringLiteral("tas_path"), | ||
| 1236 | QString::fromStdString(FS::GetYuzuPathString(FS::YuzuPath::TASFile)), | ||
| 1237 | QString::fromStdString(FS::GetYuzuPathString(FS::YuzuPath::TASFile))); | ||
| 1238 | WriteSetting(QStringLiteral("tas_pause_on_load"), Settings::values.pauseTasOnLoad, true); | ||
| 1239 | |||
| 1218 | WriteBasicSetting(Settings::values.gamecard_inserted); | 1240 | WriteBasicSetting(Settings::values.gamecard_inserted); |
| 1219 | WriteBasicSetting(Settings::values.gamecard_current_game); | 1241 | WriteBasicSetting(Settings::values.gamecard_current_game); |
| 1220 | WriteBasicSetting(Settings::values.gamecard_path); | 1242 | WriteBasicSetting(Settings::values.gamecard_path); |
diff --git a/src/yuzu/configuration/config.h b/src/yuzu/configuration/config.h index 4733227b6..3ee694e7c 100644 --- a/src/yuzu/configuration/config.h +++ b/src/yuzu/configuration/config.h | |||
| @@ -42,7 +42,7 @@ public: | |||
| 42 | default_mouse_buttons; | 42 | default_mouse_buttons; |
| 43 | static const std::array<int, Settings::NativeKeyboard::NumKeyboardKeys> default_keyboard_keys; | 43 | static const std::array<int, Settings::NativeKeyboard::NumKeyboardKeys> default_keyboard_keys; |
| 44 | static const std::array<int, Settings::NativeKeyboard::NumKeyboardMods> default_keyboard_mods; | 44 | static const std::array<int, Settings::NativeKeyboard::NumKeyboardMods> default_keyboard_mods; |
| 45 | static const std::array<UISettings::Shortcut, 18> default_hotkeys; | 45 | static const std::array<UISettings::Shortcut, 21> default_hotkeys; |
| 46 | 46 | ||
| 47 | private: | 47 | private: |
| 48 | void Initialize(const std::string& config_name); | 48 | void Initialize(const std::string& config_name); |
diff --git a/src/yuzu/configuration/configure_filesystem.cpp b/src/yuzu/configuration/configure_filesystem.cpp index 9cb317822..cd9ba0a90 100644 --- a/src/yuzu/configuration/configure_filesystem.cpp +++ b/src/yuzu/configuration/configure_filesystem.cpp | |||
| @@ -26,6 +26,8 @@ ConfigureFilesystem::ConfigureFilesystem(QWidget* parent) | |||
| 26 | [this] { SetDirectory(DirectoryTarget::Dump, ui->dump_path_edit); }); | 26 | [this] { SetDirectory(DirectoryTarget::Dump, ui->dump_path_edit); }); |
| 27 | connect(ui->load_path_button, &QToolButton::pressed, this, | 27 | connect(ui->load_path_button, &QToolButton::pressed, this, |
| 28 | [this] { SetDirectory(DirectoryTarget::Load, ui->load_path_edit); }); | 28 | [this] { SetDirectory(DirectoryTarget::Load, ui->load_path_edit); }); |
| 29 | connect(ui->tas_path_button, &QToolButton::pressed, this, | ||
| 30 | [this] { SetDirectory(DirectoryTarget::TAS, ui->tas_path_edit); }); | ||
| 29 | 31 | ||
| 30 | connect(ui->reset_game_list_cache, &QPushButton::pressed, this, | 32 | connect(ui->reset_game_list_cache, &QPushButton::pressed, this, |
| 31 | &ConfigureFilesystem::ResetMetadata); | 33 | &ConfigureFilesystem::ResetMetadata); |
| @@ -49,9 +51,12 @@ void ConfigureFilesystem::setConfiguration() { | |||
| 49 | QString::fromStdString(Common::FS::GetYuzuPathString(Common::FS::YuzuPath::DumpDir))); | 51 | QString::fromStdString(Common::FS::GetYuzuPathString(Common::FS::YuzuPath::DumpDir))); |
| 50 | ui->load_path_edit->setText( | 52 | ui->load_path_edit->setText( |
| 51 | QString::fromStdString(Common::FS::GetYuzuPathString(Common::FS::YuzuPath::LoadDir))); | 53 | QString::fromStdString(Common::FS::GetYuzuPathString(Common::FS::YuzuPath::LoadDir))); |
| 54 | ui->tas_path_edit->setText( | ||
| 55 | QString::fromStdString(Common::FS::GetYuzuPathString(Common::FS::YuzuPath::TASFile))); | ||
| 52 | 56 | ||
| 53 | ui->gamecard_inserted->setChecked(Settings::values.gamecard_inserted.GetValue()); | 57 | ui->gamecard_inserted->setChecked(Settings::values.gamecard_inserted.GetValue()); |
| 54 | ui->gamecard_current_game->setChecked(Settings::values.gamecard_current_game.GetValue()); | 58 | ui->gamecard_current_game->setChecked(Settings::values.gamecard_current_game.GetValue()); |
| 59 | ui->tas_pause_on_load->setChecked(Settings::values.pauseTasOnLoad); | ||
| 55 | ui->dump_exefs->setChecked(Settings::values.dump_exefs.GetValue()); | 60 | ui->dump_exefs->setChecked(Settings::values.dump_exefs.GetValue()); |
| 56 | ui->dump_nso->setChecked(Settings::values.dump_nso.GetValue()); | 61 | ui->dump_nso->setChecked(Settings::values.dump_nso.GetValue()); |
| 57 | 62 | ||
| @@ -69,9 +74,11 @@ void ConfigureFilesystem::applyConfiguration() { | |||
| 69 | ui->dump_path_edit->text().toStdString()); | 74 | ui->dump_path_edit->text().toStdString()); |
| 70 | Common::FS::SetYuzuPath(Common::FS::YuzuPath::LoadDir, | 75 | Common::FS::SetYuzuPath(Common::FS::YuzuPath::LoadDir, |
| 71 | ui->load_path_edit->text().toStdString()); | 76 | ui->load_path_edit->text().toStdString()); |
| 77 | Common::FS::SetYuzuPath(Common::FS::YuzuPath::TASFile, ui->tas_path_edit->text().toStdString()); | ||
| 72 | 78 | ||
| 73 | Settings::values.gamecard_inserted = ui->gamecard_inserted->isChecked(); | 79 | Settings::values.gamecard_inserted = ui->gamecard_inserted->isChecked(); |
| 74 | Settings::values.gamecard_current_game = ui->gamecard_current_game->isChecked(); | 80 | Settings::values.gamecard_current_game = ui->gamecard_current_game->isChecked(); |
| 81 | Settings::values.pauseTasOnLoad = ui->tas_pause_on_load->isChecked(); | ||
| 75 | Settings::values.dump_exefs = ui->dump_exefs->isChecked(); | 82 | Settings::values.dump_exefs = ui->dump_exefs->isChecked(); |
| 76 | Settings::values.dump_nso = ui->dump_nso->isChecked(); | 83 | Settings::values.dump_nso = ui->dump_nso->isChecked(); |
| 77 | 84 | ||
| @@ -97,6 +104,9 @@ void ConfigureFilesystem::SetDirectory(DirectoryTarget target, QLineEdit* edit) | |||
| 97 | case DirectoryTarget::Load: | 104 | case DirectoryTarget::Load: |
| 98 | caption = tr("Select Mod Load Directory..."); | 105 | caption = tr("Select Mod Load Directory..."); |
| 99 | break; | 106 | break; |
| 107 | case DirectoryTarget::TAS: | ||
| 108 | caption = tr("Select TAS Directory..."); | ||
| 109 | break; | ||
| 100 | } | 110 | } |
| 101 | 111 | ||
| 102 | QString str; | 112 | QString str; |
diff --git a/src/yuzu/configuration/configure_filesystem.h b/src/yuzu/configuration/configure_filesystem.h index 2147cd405..86dab8684 100644 --- a/src/yuzu/configuration/configure_filesystem.h +++ b/src/yuzu/configuration/configure_filesystem.h | |||
| @@ -32,6 +32,7 @@ private: | |||
| 32 | Gamecard, | 32 | Gamecard, |
| 33 | Dump, | 33 | Dump, |
| 34 | Load, | 34 | Load, |
| 35 | TAS, | ||
| 35 | }; | 36 | }; |
| 36 | 37 | ||
| 37 | void SetDirectory(DirectoryTarget target, QLineEdit* edit); | 38 | void SetDirectory(DirectoryTarget target, QLineEdit* edit); |
diff --git a/src/yuzu/configuration/configure_filesystem.ui b/src/yuzu/configuration/configure_filesystem.ui index 62b9abc7a..8ac7250fd 100644 --- a/src/yuzu/configuration/configure_filesystem.ui +++ b/src/yuzu/configuration/configure_filesystem.ui | |||
| @@ -219,6 +219,55 @@ | |||
| 219 | </layout> | 219 | </layout> |
| 220 | </widget> | 220 | </widget> |
| 221 | </item> | 221 | </item> |
| 222 | <item> | ||
| 223 | <widget class="QGroupBox" name="groupBox"> | ||
| 224 | <property name="title"> | ||
| 225 | <string>TAS Directories</string> | ||
| 226 | </property> | ||
| 227 | <layout class="QGridLayout" name="gridLayout"> | ||
| 228 | <item row="0" column="0"> | ||
| 229 | <widget class="QLabel" name="label"> | ||
| 230 | <property name="text"> | ||
| 231 | <string>Path</string> | ||
| 232 | </property> | ||
| 233 | </widget> | ||
| 234 | </item> | ||
| 235 | <item row="0" column="3"> | ||
| 236 | <widget class="QToolButton" name="tas_path_button"> | ||
| 237 | <property name="text"> | ||
| 238 | <string>...</string> | ||
| 239 | </property> | ||
| 240 | </widget> | ||
| 241 | </item> | ||
| 242 | <item row="0" column="2"> | ||
| 243 | <widget class="QLineEdit" name="tas_path_edit"/> | ||
| 244 | </item> | ||
| 245 | <item row="0" column="1"> | ||
| 246 | <spacer name="horizontalSpacer"> | ||
| 247 | <property name="orientation"> | ||
| 248 | <enum>Qt::Horizontal</enum> | ||
| 249 | </property> | ||
| 250 | <property name="sizeType"> | ||
| 251 | <enum>QSizePolicy::Maximum</enum> | ||
| 252 | </property> | ||
| 253 | <property name="sizeHint" stdset="0"> | ||
| 254 | <size> | ||
| 255 | <width>60</width> | ||
| 256 | <height>20</height> | ||
| 257 | </size> | ||
| 258 | </property> | ||
| 259 | </spacer> | ||
| 260 | </item> | ||
| 261 | <item row="1" column="0" colspan="4"> | ||
| 262 | <widget class="QCheckBox" name="tas_pause_on_load"> | ||
| 263 | <property name="text"> | ||
| 264 | <string>Pause TAS execution during loads (SMO - 1.3)</string> | ||
| 265 | </property> | ||
| 266 | </widget> | ||
| 267 | </item> | ||
| 268 | </layout> | ||
| 269 | </widget> | ||
| 270 | </item> | ||
| 222 | </layout> | 271 | </layout> |
| 223 | </item> | 272 | </item> |
| 224 | <item> | 273 | <item> |
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 22489231b..f3529d151 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -1015,6 +1015,19 @@ void GMainWindow::InitializeHotkeys() { | |||
| 1015 | render_window->setAttribute(Qt::WA_Hover, true); | 1015 | render_window->setAttribute(Qt::WA_Hover, true); |
| 1016 | } | 1016 | } |
| 1017 | }); | 1017 | }); |
| 1018 | connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("TAS Start/Stop"), this), | ||
| 1019 | &QShortcut::activated, this, [&] { | ||
| 1020 | Settings::values.tas_enable = !Settings::values.tas_enable; | ||
| 1021 | LOG_INFO(Frontend, "Tas enabled {}", Settings::values.tas_enable); | ||
| 1022 | }); | ||
| 1023 | |||
| 1024 | connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("TAS Reset"), this), | ||
| 1025 | &QShortcut::activated, this, [&] { Settings::values.tas_reset = true; }); | ||
| 1026 | connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("TAS Record"), this), | ||
| 1027 | &QShortcut::activated, this, [&] { | ||
| 1028 | Settings::values.tas_record = !Settings::values.tas_record; | ||
| 1029 | LOG_INFO(Frontend, "Tas recording {}", Settings::values.tas_record); | ||
| 1030 | }); | ||
| 1018 | } | 1031 | } |
| 1019 | 1032 | ||
| 1020 | void GMainWindow::SetDefaultUIGeometry() { | 1033 | void GMainWindow::SetDefaultUIGeometry() { |