mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-28 01:49:33 -06:00
CoreTiming: Don't Throttle in event queue processing.
This commit is contained in:
@ -18,7 +18,6 @@
|
|||||||
|
|
||||||
#include "Core/AchievementManager.h"
|
#include "Core/AchievementManager.h"
|
||||||
#include "Core/CPUThreadConfigCallback.h"
|
#include "Core/CPUThreadConfigCallback.h"
|
||||||
#include "Core/Config/AchievementSettings.h"
|
|
||||||
#include "Core/Config/MainSettings.h"
|
#include "Core/Config/MainSettings.h"
|
||||||
#include "Core/Core.h"
|
#include "Core/Core.h"
|
||||||
#include "Core/PowerPC/PowerPC.h"
|
#include "Core/PowerPC/PowerPC.h"
|
||||||
@ -333,8 +332,6 @@ void CoreTimingManager::Advance()
|
|||||||
Event evt = std::move(m_event_queue.front());
|
Event evt = std::move(m_event_queue.front());
|
||||||
std::ranges::pop_heap(m_event_queue, std::ranges::greater{});
|
std::ranges::pop_heap(m_event_queue, std::ranges::greater{});
|
||||||
m_event_queue.pop_back();
|
m_event_queue.pop_back();
|
||||||
|
|
||||||
Throttle(evt.time);
|
|
||||||
evt.type->callback(m_system, evt.userdata, m_globals.global_timer - evt.time);
|
evt.type->callback(m_system, evt.userdata, m_globals.global_timer - evt.time);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -360,11 +357,6 @@ void CoreTimingManager::Throttle(const s64 target_cycle)
|
|||||||
{
|
{
|
||||||
// Based on number of cycles and emulation speed, increase the target deadline
|
// Based on number of cycles and emulation speed, increase the target deadline
|
||||||
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
|
|
||||||
if (cycles < m_throttle_min_clock_per_sleep)
|
|
||||||
return;
|
|
||||||
|
|
||||||
m_throttle_last_cycle = target_cycle;
|
m_throttle_last_cycle = target_cycle;
|
||||||
|
|
||||||
const double speed = Core::GetIsThrottlerTempDisabled() ? 0.0 : m_emulation_speed;
|
const double speed = Core::GetIsThrottlerTempDisabled() ? 0.0 : m_emulation_speed;
|
||||||
@ -442,7 +434,6 @@ 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)
|
||||||
{
|
{
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
// inside callback:
|
// inside callback:
|
||||||
// ScheduleEvent(periodInCycles - cyclesLate, callback, "whatever")
|
// ScheduleEvent(periodInCycles - cyclesLate, callback, "whatever")
|
||||||
|
|
||||||
#include <compare>
|
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
@ -156,8 +155,6 @@ public:
|
|||||||
Globals& GetGlobals() { return m_globals; }
|
Globals& GetGlobals() { return m_globals; }
|
||||||
|
|
||||||
// Throttle the CPU to the specified target cycle.
|
// 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);
|
void Throttle(const s64 target_cycle);
|
||||||
|
|
||||||
TimePoint GetCPUTimePoint(s64 cyclesLate) const; // Used by Dolphin Analytics
|
TimePoint GetCPUTimePoint(s64 cyclesLate) const; // Used by Dolphin Analytics
|
||||||
@ -203,7 +200,6 @@ 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 = 0;
|
s64 m_throttle_clock_per_sec = 0;
|
||||||
s64 m_throttle_min_clock_per_sleep = 0;
|
|
||||||
bool m_throttle_disable_vi_int = false;
|
bool m_throttle_disable_vi_int = false;
|
||||||
|
|
||||||
DT m_max_fallback = {};
|
DT m_max_fallback = {};
|
||||||
|
Reference in New Issue
Block a user