mirror of
https://github.com/LNH-team/pico-launcher.git
synced 2026-06-02 17:16:57 +02:00
Initial commit
This commit is contained in:
26
arm9/source/services/process/ProcessManager.cpp
Normal file
26
arm9/source/services/process/ProcessManager.cpp
Normal file
@@ -0,0 +1,26 @@
|
||||
#include "common.h"
|
||||
#include <libtwl/rtos/rtosIrq.h>
|
||||
#include "ProcessManager.h"
|
||||
|
||||
static void vblankIrq(u32 irqMask)
|
||||
{
|
||||
VBlank::NotifyIrq();
|
||||
}
|
||||
|
||||
void ProcessManager::MainLoop()
|
||||
{
|
||||
SetupDefaultVBlankHandler();
|
||||
while (_nextProcConstructFunc)
|
||||
{
|
||||
_curProcess = _nextProcConstructFunc();
|
||||
_curProcess->Run();
|
||||
SetupDefaultVBlankHandler(); // reset because the currently registered one may use _curProcess
|
||||
_curProcess.reset();
|
||||
}
|
||||
}
|
||||
|
||||
void ProcessManager::SetupDefaultVBlankHandler()
|
||||
{
|
||||
rtos_setIrqFunc(RTOS_IRQ_VBLANK, vblankIrq);
|
||||
rtos_enableIrqMask(RTOS_IRQ_VBLANK);
|
||||
}
|
||||
Reference in New Issue
Block a user