mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-06-07 19:41:38 +12:00
Use CPU for counting ticks instead of scheduler
This commit is contained in:
parent
7343497f36
commit
97f97dc6e2
3 changed files with 36 additions and 36 deletions
|
@ -18,12 +18,10 @@ struct Scheduler {
|
|||
using EventMap = boost::container::flat_multimap<Key, Val, std::less<Key>, boost::container::static_vector<std::pair<Key, Val>, size>>;
|
||||
|
||||
EventMap<u64, EventType, totalNumberOfEvents> events;
|
||||
u64 currentTimestamp = 0;
|
||||
u64 nextTimestamp = 0;
|
||||
|
||||
// Set nextTimestamp to the timestamp of the next event
|
||||
void updateNextTimestamp() { nextTimestamp = events.cbegin()->first; }
|
||||
void addCycles(u64 cycles) { currentTimestamp += cycles; }
|
||||
|
||||
void addEvent(EventType type, u64 timestamp) {
|
||||
events.emplace(timestamp, type);
|
||||
|
@ -40,8 +38,6 @@ struct Scheduler {
|
|||
};
|
||||
|
||||
void reset() {
|
||||
currentTimestamp = 0;
|
||||
|
||||
// Clear any pending events
|
||||
events.clear();
|
||||
// Add a dummy event to always keep the scheduler non-empty
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue