Files
dspico-bootloader/arm7/source/main.cpp
2025-11-23 17:02:56 +01:00

45 lines
852 B
C++

#include "common.h"
#include <libtwl/rtos/rtosIrq.h>
#include <libtwl/rtos/rtosThread.h>
#include <libtwl/rtos/rtosEvent.h>
#include <libtwl/ipc/ipcSync.h>
#include <libtwl/ipc/ipcFifoSystem.h>
#include <libtwl/gfx/gfxStatus.h>
#include "picoLoaderBootstrap.h"
static rtos_event_t sVBlankEvent;
static void vblankIrq(u32 irqMask)
{
rtos_signalEvent(&sVBlankEvent);
}
int main()
{
rtos_initIrq();
rtos_startMainThread();
ipc_initFifoSystem();
pload_init();
rtos_createEvent(&sVBlankEvent);
rtos_setIrqFunc(RTOS_IRQ_VBLANK, vblankIrq);
rtos_enableIrqMask(RTOS_IRQ_VBLANK);
gfx_setVBlankIrqEnabled(true);
ipc_setArm7SyncBits(7);
while (true)
{
rtos_waitEvent(&sVBlankEvent, true, true);
if (pload_shouldStart())
{
pload_start();
}
}
return 0;
}