40 lines
789 B
C
Raw Normal View History

#include "godmode.h"
2017-06-09 01:45:00 +02:00
#include "power.h"
2017-08-22 23:23:17 -03:00
#include "pxi.h"
#include "arm.h"
#include "shmem.h"
#include "hid.h"
2017-10-26 20:27:02 -03:00
void main(int argc, char** argv, int entrypoint)
{
(void) argc;
(void) argv;
2017-11-26 03:15:20 +01:00
PXI_Reset();
// Don't even try to send any messages until the
// ARM11 says it's ready
PXI_Barrier(ARM11_READY_BARRIER);
2019-05-21 00:39:40 +02:00
// Set screens to RGB16 mode
PXI_DoCMD(PXI_SET_VMODE, (u32[]){0}, 1);
// A pointer to the shared memory region is
// stored in the thread ID register in the ARM9
ARM_InitSHMEM();
#ifdef SCRIPT_RUNNER
// Run the script runner
if (ScriptRunner(entrypoint) == GODMODE_EXIT_REBOOT)
#else
2017-07-26 21:39:30 +02:00
// Run the main program
if (GodMode(entrypoint) == GODMODE_EXIT_REBOOT)
#endif
Reboot();
PowerOff();
}