summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorGravatar MonsterDruide12021-06-18 16:32:46 +0200
committerGravatar MonsterDruide12021-09-18 23:22:20 +0200
commit4297d2fea2228ff4afe2a7c244fb8b3f1a97491a (patch)
tree25a1ce3a2d41bf9e066c7a57a441be65e282f16f /src/common
parentmain: TAS Playback state label (diff)
downloadyuzu-4297d2fea2228ff4afe2a7c244fb8b3f1a97491a.tar.gz
yuzu-4297d2fea2228ff4afe2a7c244fb8b3f1a97491a.tar.xz
yuzu-4297d2fea2228ff4afe2a7c244fb8b3f1a97491a.zip
core: Hacky TAS syncing & load pausing
To keep the TAS inputs synced to the game speed even through lag spikes and loading zones, deeper access is required. First, the `TAS::UpdateThread` has to be executed exactly once per frame. This is done by connecting it to the service method the game calls to pass parameters to the GPU: `Service::VI::QueueBuffer`. Second, the loading time of new subareas and/or kingdoms (SMO) can vary. To counteract that, the `CPU_BOOST_MODE` can be detected: In the `APM`-interface, the call to enabling/disabling the boost mode can be caught and forwarded to the TASing system, which can pause the script execution if neccessary and enabled in the settings.
Diffstat (limited to '')
-rw-r--r--src/common/fs/fs_paths.h1
-rw-r--r--src/common/fs/path_util.cpp3
-rw-r--r--src/common/settings.h9
3 files changed, 6 insertions, 7 deletions
diff --git a/src/common/fs/fs_paths.h b/src/common/fs/fs_paths.h
index b32614797..84968b8e0 100644
--- a/src/common/fs/fs_paths.h
+++ b/src/common/fs/fs_paths.h
@@ -21,6 +21,7 @@
21#define SCREENSHOTS_DIR "screenshots" 21#define SCREENSHOTS_DIR "screenshots"
22#define SDMC_DIR "sdmc" 22#define SDMC_DIR "sdmc"
23#define SHADER_DIR "shader" 23#define SHADER_DIR "shader"
24#define TAS_DIR "scripts"
24 25
25// yuzu-specific files 26// yuzu-specific files
26 27
diff --git a/src/common/fs/path_util.cpp b/src/common/fs/path_util.cpp
index 5f76adedb..97d026eb8 100644
--- a/src/common/fs/path_util.cpp
+++ b/src/common/fs/path_util.cpp
@@ -116,8 +116,7 @@ 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 119 GenerateYuzuPath(YuzuPath::TASFile, yuzu_path / TAS_DIR);
120 GenerateYuzuPath(YuzuPath::TASFile, fs::path{""});
121 } 120 }
122 121
123 ~PathManagerImpl() = default; 122 ~PathManagerImpl() = default;
diff --git a/src/common/settings.h b/src/common/settings.h
index 884ea55f8..7333a64dc 100644
--- a/src/common/settings.h
+++ b/src/common/settings.h
@@ -500,7 +500,6 @@ struct Values {
500 500
501 // Controls 501 // Controls
502 InputSetting<std::array<PlayerInput, 10>> players; 502 InputSetting<std::array<PlayerInput, 10>> players;
503 std::shared_ptr<InputCommon::InputSubsystem> inputSubsystem = NULL;
504 503
505 Setting<bool> use_docked_mode{true, "use_docked_mode"}; 504 Setting<bool> use_docked_mode{true, "use_docked_mode"};
506 505
@@ -514,9 +513,12 @@ struct Values {
514 "motion_device"}; 513 "motion_device"};
515 BasicSetting<std::string> udp_input_servers{"127.0.0.1:26760", "udp_input_servers"}; 514 BasicSetting<std::string> udp_input_servers{"127.0.0.1:26760", "udp_input_servers"};
516 515
517 BasicSetting<bool> tas_enable{false, "tas_enable"}; 516 BasicSetting<bool> pause_tas_on_load { false, "pause_tas_on_load" };
517 BasicSetting<bool> tas_enable{ false, "tas_enable" };
518 BasicSetting<bool> tas_reset{ false, "tas_reset" }; 518 BasicSetting<bool> tas_reset{ false, "tas_reset" };
519 BasicSetting<bool> tas_record{ false, "tas_record" }; 519 BasicSetting<bool> tas_record{ false, "tas_record" };
520 BasicSetting<bool> is_cpu_boxted{ false, " BasicSetting<bool> is_cpu_boxted{ false, "cpuBoosted" };
521" };
520 522
521 BasicSetting<bool> mouse_panning{false, "mouse_panning"}; 523 BasicSetting<bool> mouse_panning{false, "mouse_panning"};
522 BasicRangedSetting<u8> mouse_panning_sensitivity{10, 1, 100, "mouse_panning_sensitivity"}; 524 BasicRangedSetting<u8> mouse_panning_sensitivity{10, 1, 100, "mouse_panning_sensitivity"};
@@ -550,9 +552,6 @@ struct Values {
550 BasicSetting<bool> gamecard_current_game{false, "gamecard_current_game"}; 552 BasicSetting<bool> gamecard_current_game{false, "gamecard_current_game"};
551 BasicSetting<std::string> gamecard_path{std::string(), "gamecard_path"}; 553 BasicSetting<std::string> gamecard_path{std::string(), "gamecard_path"};
552 554
553 // TAS
554 bool pauseTasOnLoad;
555
556 // Debugging 555 // Debugging
557 bool record_frame_times; 556 bool record_frame_times;
558 BasicSetting<bool> use_gdbstub{false, "use_gdbstub"}; 557 BasicSetting<bool> use_gdbstub{false, "use_gdbstub"};