mirror of https://github.com/bsnes-emu/bsnes.git
24 lines
390 B
C++
24 lines
390 B
C++
#include <gb/gb.hpp>
|
|
|
|
namespace GameBoy {
|
|
|
|
Scheduler scheduler;
|
|
|
|
auto Scheduler::init() -> void {
|
|
host_thread = co_active();
|
|
active_thread = cpu.thread;
|
|
}
|
|
|
|
auto Scheduler::enter() -> void {
|
|
host_thread = co_active();
|
|
co_switch(active_thread);
|
|
}
|
|
|
|
auto Scheduler::exit(ExitReason reason) -> void {
|
|
exit_reason = reason;
|
|
active_thread = co_active();
|
|
co_switch(host_thread);
|
|
}
|
|
|
|
}
|