mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
CoreTiming: make loops easier to read
This commit is contained in:
@ -324,22 +324,12 @@ bool IsScheduled(int event_type)
|
|||||||
|
|
||||||
void RemoveEvent(int event_type)
|
void RemoveEvent(int event_type)
|
||||||
{
|
{
|
||||||
if (!first)
|
while (first && first->type == event_type)
|
||||||
return;
|
|
||||||
|
|
||||||
while (first)
|
|
||||||
{
|
|
||||||
if (first->type == event_type)
|
|
||||||
{
|
{
|
||||||
Event* next = first->next;
|
Event* next = first->next;
|
||||||
FreeEvent(first);
|
FreeEvent(first);
|
||||||
first = next;
|
first = next;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!first)
|
if (!first)
|
||||||
return;
|
return;
|
||||||
@ -434,9 +424,7 @@ void Advance()
|
|||||||
lastOCFactor = SConfig::GetInstance().m_OCEnable ? SConfig::GetInstance().m_OCFactor : 1.0f;
|
lastOCFactor = SConfig::GetInstance().m_OCEnable ? SConfig::GetInstance().m_OCFactor : 1.0f;
|
||||||
PowerPC::ppcState.downcount = CyclesToDowncount(slicelength);
|
PowerPC::ppcState.downcount = CyclesToDowncount(slicelength);
|
||||||
|
|
||||||
while (first)
|
while (first && first->time <= globalTimer)
|
||||||
{
|
|
||||||
if (first->time <= globalTimer)
|
|
||||||
{
|
{
|
||||||
//LOG(POWERPC, "[Scheduler] %s (%lld, %lld) ",
|
//LOG(POWERPC, "[Scheduler] %s (%lld, %lld) ",
|
||||||
// event_types[first->type].name ? event_types[first->type].name : "?", (u64)globalTimer, (u64)first->time);
|
// event_types[first->type].name ? event_types[first->type].name : "?", (u64)globalTimer, (u64)first->time);
|
||||||
@ -445,11 +433,6 @@ void Advance()
|
|||||||
event_types[evt->type].callback(evt->userdata, (int)(globalTimer - evt->time));
|
event_types[evt->type].callback(evt->userdata, (int)(globalTimer - evt->time));
|
||||||
FreeEvent(evt);
|
FreeEvent(evt);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!first)
|
if (!first)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user