mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-20 03:25:16 +00:00
Implement PPU usleep control setting hack
This commit is contained in:
parent
30a5d646ec
commit
e27e6c0b2d
2 changed files with 13 additions and 0 deletions
|
@ -447,6 +447,18 @@ error_code sys_timer_usleep(ppu_thread& ppu, u64 sleep_time)
|
|||
|
||||
if (sleep_time)
|
||||
{
|
||||
const s64 add_time = g_cfg.core.usleep_addend;
|
||||
|
||||
// Over/underflow checks
|
||||
if (add_time >= 0)
|
||||
{
|
||||
sleep_time = utils::add_saturate<u64>(sleep_time, add_time);
|
||||
}
|
||||
else
|
||||
{
|
||||
sleep_time = std::max<u64>(1, utils::sub_saturate<u64>(sleep_time, -add_time));
|
||||
}
|
||||
|
||||
lv2_obj::sleep(ppu, g_cfg.core.sleep_timers_accuracy < sleep_timers_accuracy_level::_usleep ? sleep_time : 0);
|
||||
|
||||
if (!lv2_obj::wait_timeout(sleep_time, &ppu, true, true))
|
||||
|
|
|
@ -99,6 +99,7 @@ struct cfg_root : cfg::node
|
|||
#else
|
||||
cfg::_enum<sleep_timers_accuracy_level> sleep_timers_accuracy{ this, "Sleep Timers Accuracy", sleep_timers_accuracy_level::_usleep, true };
|
||||
#endif
|
||||
cfg::_int<-1000, 1500> usleep_addend{ this, "Usleep Time Addend", 0, true };
|
||||
|
||||
cfg::uint64 perf_report_threshold{this, "Performance Report Threshold", 500, true}; // In µs, 0.5ms = default, 0 = everything
|
||||
cfg::_bool perf_report{this, "Enable Performance Report", false, true}; // Show certain perf-related logs
|
||||
|
|
Loading…
Add table
Reference in a new issue