Skip to content

Commit

Permalink
Implement Custom CPU Ticks to the code
Browse files Browse the repository at this point in the history
  • Loading branch information
Gamer64ytb committed Jul 25, 2024
1 parent 7255d79 commit ceffa2a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/common/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,10 @@ struct Values {
SwitchableSetting<bool> preload_textures{false, "preload_textures"};
SwitchableSetting<bool> async_custom_loading{true, "async_custom_loading"};

// Tweaks
SwitchableSetting<bool> enable_custom_cpu_ticks{false, "enable_custom_cpu_ticks"};
SwitchableSetting<u32, true> custom_cpu_ticks{16000, 77, 65535, "custom_cpu_ticks"};

// Audio
bool audio_muted;
SwitchableSetting<AudioEmulation> audio_emulation{AudioEmulation::HLE, "audio_emulation"};
Expand Down
5 changes: 4 additions & 1 deletion src/core/core_timing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,10 @@ u64 Timing::Timer::GetTicks() const {
}

void Timing::Timer::AddTicks(u64 ticks) {
downcount -= static_cast<u64>(ticks * cpu_clock_scale);
downcount -= static_cast<u64>((Settings::values.enable_custom_cpu_ticks
? Settings::values.custom_cpu_ticks.GetValue()
: ticks) *
cpu_clock_scale);
}

u64 Timing::Timer::GetIdleTicks() const {
Expand Down

0 comments on commit ceffa2a

Please sign in to comment.