Debian Codegraph @

gba/scheduler/scheduler.cpp

raw
1 #include <gba/gba.hpp>
2
3 namespace GameBoyAdvance {
4
5 Scheduler scheduler;
6
7 void Scheduler::enter() {
8 host = co_active();
9 co_switch(active);
10 }
11
12 void Scheduler::exit(ExitReason reason) {
13 exit_reason = reason;
14 active = co_active();
15 co_switch(host);
16 }
17
18 void Scheduler::power() {
19 host = co_active();
20 active = cpu.thread;
21 }
22
23 Scheduler::Scheduler() {
24 sync = SynchronizeMode::None;
25 exit_reason = ExitReason::UnknownEvent;
26 host = nullptr;
27 active = nullptr;
28 }
29
30 }