core_timing: Allow configuring a fixed or random initial system tick value. (#7309)

* core_timing: Apply random base ticks value on startup.

* core: Maintain consistent base system ticks in TAS movies.

* frontend: Add setting to configure a fixed base system ticks value.
This commit is contained in:
Steveice10 2024-01-07 09:38:02 -08:00 committed by GitHub
parent 96aa1b3a08
commit 0165012ba4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 150 additions and 17 deletions

View file

@ -185,7 +185,7 @@ public:
class Timer {
public:
Timer();
Timer(s64 base_ticks = 0);
~Timer();
s64 GetMaxSliceLength() const;
@ -249,7 +249,7 @@ public:
friend class boost::serialization::access;
};
explicit Timing(std::size_t num_cores, u32 cpu_clock_percentage);
explicit Timing(std::size_t num_cores, u32 cpu_clock_percentage, s64 override_base_ticks = -1);
~Timing(){};
@ -290,6 +290,9 @@ public:
event_queue_locked = false;
}
/// Generates a random tick count to seed the system tick timer with.
static s64 GenerateBaseTicks();
private:
// unordered_map stores each element separately as a linked list node so pointers to
// elements remain stable regardless of rehashes/resizing.