GodMode9/source/main.c

25 lines
629 B
C
Raw Normal View History

#include "common.h"
#include "godmode.h"
2016-03-28 17:32:29 +02:00
#include "ui.h"
2017-06-09 01:45:00 +02:00
#include "power.h"
u8 *top_screen, *bottom_screen;
void main(int argc, char** argv)
{
// Fetch the framebuffer addresses
if(argc >= 2) {
// newer entrypoints
u8 **fb = (u8 **)(void *)argv[1];
top_screen = fb[0];
bottom_screen = fb[2];
} else {
// outdated entrypoints
top_screen = (u8*)(*(u32*)0x23FFFE00);
bottom_screen = (u8*)(*(u32*)0x23FFFE08);
}
2016-09-07 00:21:38 +02:00
u32 godmode_exit = GodMode();
ClearScreenF(true, true, COLOR_STD_BG);
(godmode_exit == GODMODE_EXIT_REBOOT) ? Reboot() : PowerOff();
}