Limit Throttling to 1200hz
This commit is contained in:
parent
e95c1d55e8
commit
e849172dc9
|
@ -339,7 +339,7 @@ void CoreTimingManager::Throttle(const s64 target_cycle)
|
||||||
const s64 cycles = target_cycle - m_throttle_last_cycle;
|
const s64 cycles = target_cycle - m_throttle_last_cycle;
|
||||||
|
|
||||||
// Prevent any throttling code if the amount of time passed is < ~0.122ms
|
// Prevent any throttling code if the amount of time passed is < ~0.122ms
|
||||||
if (cycles < (m_throttle_clock_per_sec >> 13))
|
if (cycles < m_throttle_min_clock_per_sleep)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_throttle_last_cycle = target_cycle;
|
m_throttle_last_cycle = target_cycle;
|
||||||
|
@ -403,6 +403,7 @@ void CoreTimingManager::LogPendingEvents() const
|
||||||
void CoreTimingManager::AdjustEventQueueTimes(u32 new_ppc_clock, u32 old_ppc_clock)
|
void CoreTimingManager::AdjustEventQueueTimes(u32 new_ppc_clock, u32 old_ppc_clock)
|
||||||
{
|
{
|
||||||
m_throttle_clock_per_sec = new_ppc_clock;
|
m_throttle_clock_per_sec = new_ppc_clock;
|
||||||
|
m_throttle_min_clock_per_sleep = new_ppc_clock / 1200;
|
||||||
|
|
||||||
for (Event& ev : m_event_queue)
|
for (Event& ev : m_event_queue)
|
||||||
{
|
{
|
||||||
|
|
|
@ -140,6 +140,11 @@ public:
|
||||||
// Directly accessed by the JIT.
|
// Directly accessed by the JIT.
|
||||||
Globals& GetGlobals() { return m_globals; }
|
Globals& GetGlobals() { return m_globals; }
|
||||||
|
|
||||||
|
// Throttle the CPU to the specified target cycle.
|
||||||
|
// Never used outside of CoreTiming, however it remains public
|
||||||
|
// in order to allow custom throttling implementations to be tested.
|
||||||
|
void Throttle(const s64 target_cycle);
|
||||||
|
|
||||||
TimePoint GetCPUTimePoint(s64 cyclesLate) const; // Used by Dolphin Analytics
|
TimePoint GetCPUTimePoint(s64 cyclesLate) const; // Used by Dolphin Analytics
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -178,8 +183,7 @@ private:
|
||||||
s64 m_throttle_last_cycle = 0;
|
s64 m_throttle_last_cycle = 0;
|
||||||
TimePoint m_throttle_deadline = Clock::now();
|
TimePoint m_throttle_deadline = Clock::now();
|
||||||
s64 m_throttle_clock_per_sec;
|
s64 m_throttle_clock_per_sec;
|
||||||
|
s64 m_throttle_min_clock_per_sleep;
|
||||||
void Throttle(const s64 target_cycle);
|
|
||||||
|
|
||||||
int DowncountToCycles(int downcount) const;
|
int DowncountToCycles(int downcount) const;
|
||||||
int CyclesToDowncount(int cycles) const;
|
int CyclesToDowncount(int cycles) const;
|
||||||
|
|
Loading…
Reference in New Issue