2016-02-25 16:57:01 +01:00
|
|
|
#include "godmode.h"
|
2017-06-09 01:45:00 +02:00
|
|
|
#include "power.h"
|
2019-04-08 17:38:38 -03:00
|
|
|
#include "timer.h"
|
2017-08-22 23:23:17 -03:00
|
|
|
#include "pxi.h"
|
2017-09-26 19:56:19 -03:00
|
|
|
#include "i2c.h"
|
2016-02-13 17:29:56 +01:00
|
|
|
|
2019-04-08 17:38:38 -03:00
|
|
|
#include "vram.h"
|
|
|
|
|
2017-10-26 20:27:02 -03:00
|
|
|
void main(int argc, char** argv, int entrypoint)
|
2016-02-13 17:29:56 +01:00
|
|
|
{
|
2017-10-27 19:25:26 +02:00
|
|
|
(void) argc;
|
|
|
|
(void) argv;
|
2017-08-08 09:40:09 -03:00
|
|
|
|
2017-11-26 03:15:20 +01:00
|
|
|
PXI_Reset();
|
2017-09-26 19:56:19 -03:00
|
|
|
|
2019-04-11 18:16:20 -03:00
|
|
|
// Don't even try to send any messages until the
|
|
|
|
// ARM11 says it's ready
|
|
|
|
PXI_Barrier(ARM11_READY_BARRIER);
|
|
|
|
|
2017-09-26 19:56:19 -03:00
|
|
|
PXI_DoCMD(PXI_SCREENINIT, NULL, 0);
|
|
|
|
I2C_writeReg(I2C_DEV_MCU, 0x22, 0x2A);
|
|
|
|
|
2017-12-07 02:01:15 +01:00
|
|
|
#ifdef SCRIPT_RUNNER
|
2017-09-08 15:39:06 +02:00
|
|
|
// Run the script runner
|
2017-10-27 19:25:26 +02:00
|
|
|
if (ScriptRunner(entrypoint) == GODMODE_EXIT_REBOOT)
|
2017-09-08 15:39:06 +02:00
|
|
|
#else
|
2017-07-26 21:39:30 +02:00
|
|
|
// Run the main program
|
2017-10-27 19:25:26 +02:00
|
|
|
if (GodMode(entrypoint) == GODMODE_EXIT_REBOOT)
|
2017-09-08 15:39:06 +02:00
|
|
|
#endif
|
2017-09-26 19:56:19 -03:00
|
|
|
Reboot();
|
|
|
|
|
|
|
|
PowerOff();
|
2016-02-13 17:29:56 +01:00
|
|
|
}
|