Skip to content

Commit

Permalink
Add a comment, some additional cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Jan 16, 2024
1 parent 7e427e4 commit 3fd5190
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 15 deletions.
16 changes: 5 additions & 11 deletions Core/CoreTiming.cpp
Expand Up @@ -363,11 +363,6 @@ void RemoveEvent(int event_type)
}
}

void RemoveAllEvents(int event_type)
{
RemoveEvent(event_type);
}

void ProcessEvents() {
while (first) {
if (first->time <= (s64)GetTicks()) {
Expand Down Expand Up @@ -482,17 +477,15 @@ std::string GetScheduledEventsSummary() {
return text;
}

void Event_DoState(PointerWrap &p, BaseEvent *ev)
{
void Event_DoState(PointerWrap &p, BaseEvent *ev) {
// There may be padding, so do each one individually.
Do(p, ev->time);
Do(p, ev->userdata);
Do(p, ev->type);
usedEventTypes.insert(ev->type);
}

void Event_DoStateOld(PointerWrap &p, BaseEvent *ev)
{
void Event_DoStateOld(PointerWrap &p, BaseEvent *ev) {
Do(p, *ev);
usedEventTypes.insert(ev->type);
}
Expand Down Expand Up @@ -521,10 +514,11 @@ void DoState(PointerWrap &p) {
restoredEventTypes.clear();

if (s >= 3) {
DoLinkedList<BaseEvent, GetNewEvent, FreeEvent, Event_DoState>(p, first, (Event **) NULL);
DoLinkedList<BaseEvent, GetNewEvent, FreeEvent, Event_DoState>(p, first, (Event **)nullptr);
// This is here because we previously stored a second queue of "threadsafe" events. Gone now. Remove in the next section version upgrade.
DoIgnoreUnusedLinkedList(p);
} else {
DoLinkedList<BaseEvent, GetNewEvent, FreeEvent, Event_DoStateOld>(p, first, (Event **) NULL);
DoLinkedList<BaseEvent, GetNewEvent, FreeEvent, Event_DoStateOld>(p, first, (Event **)nullptr);
DoIgnoreUnusedLinkedList(p);
}

Expand Down
2 changes: 0 additions & 2 deletions Core/CoreTiming.h
Expand Up @@ -95,10 +95,8 @@ namespace CoreTiming
s64 UnscheduleEvent(int event_type, u64 userdata);

void RemoveEvent(int event_type);
void RemoveAllEvents(int event_type);
bool IsScheduled(int event_type);
void Advance();
void ProcessFifoWaitEvents();
void ForceCheck();

// Pretend that the main CPU has executed enough cycles to reach the next event.
Expand Down
4 changes: 2 additions & 2 deletions Core/HLE/sceUmd.cpp
Expand Up @@ -179,7 +179,7 @@ static void __KernelUmdActivate()
__KernelNotifyCallback(driveCBId, notifyArg);

// Don't activate immediately, take time to "spin up."
CoreTiming::RemoveAllEvents(umdStatChangeEvent);
CoreTiming::RemoveEvent(umdStatChangeEvent);
CoreTiming::ScheduleEvent(usToCycles(MICRO_DELAY_ACTIVATE), umdStatChangeEvent, 1);
}

Expand All @@ -189,7 +189,7 @@ static void __KernelUmdDeactivate()
if (driveCBId != 0)
__KernelNotifyCallback(driveCBId, notifyArg);

CoreTiming::RemoveAllEvents(umdStatChangeEvent);
CoreTiming::RemoveEvent(umdStatChangeEvent);
__UmdStatChange(0, 0);
}

Expand Down

0 comments on commit 3fd5190

Please sign in to comment.