Skip to content

Commit

Permalink
CoreTiming::ProcessEvents : Reject bad event types. Rename function.
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Jan 15, 2024
1 parent 7b738ed commit 6066e74
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions Core/CoreTiming.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -536,22 +536,20 @@ void RemoveAllEvents(int event_type)
RemoveEvent(event_type);
}

//This raise only the events required while the fifo is processing data
void ProcessFifoWaitEvents()
{
while (first)
{
if (first->time <= (s64)GetTicks())
{
// LOG(CPU, "[Scheduler] %s (%lld, %lld) ",
// first->name ? first->name : "?", (u64)GetTicks(), (u64)first->time);
Event* evt = first;
void ProcessEvents() {
while (first) {
if (first->time <= (s64)GetTicks()) {
// INFO_LOG(CPU, "%s (%lld, %lld) ", first->name ? first->name : "?", (u64)GetTicks(), (u64)first->time);
Event *evt = first;
first = first->next;
event_types[evt->type].callback(evt->userdata, (int)(GetTicks() - evt->time));
if (evt->type >= 0 && evt->type < event_types.size()) {
event_types[evt->type].callback(evt->userdata, (int)(GetTicks() - evt->time));
} else {
_dbg_assert_msg_(false, "Bad event type %d", evt->type);
}
FreeEvent(evt);
}
else
{
} else {
// Caught up to the current time.
break;
}
}
Expand Down Expand Up @@ -604,7 +602,7 @@ void Advance() {

if (hasTsEvents.load(std::memory_order_acquire))
MoveEvents();
ProcessFifoWaitEvents();
ProcessEvents();

if (!first) {
// This should never happen in PPSSPP.
Expand Down

0 comments on commit 6066e74

Please sign in to comment.