diff --git a/source/loader/sys.c b/source/loader/sys.c index ac185740..62bd8ac0 100644 --- a/source/loader/sys.c +++ b/source/loader/sys.c @@ -64,12 +64,24 @@ bool Sys_Exiting(void) return reset || shutdown || exiting; } +void Sys_Shutdown(void) +{ + /* via hollywood registers first */ + *HW_GPIO_OUT |= (1<<1); + /* If it failed just do the libogc way */ + SYS_ResetSystem(SYS_SHUTDOWN, 0, 0); +} + void Sys_Test(void) { - if(reset || shutdown) Close_Inputs(); - - if (reset) SYS_ResetSystem(SYS_RESTART, 0, 0); - else if (shutdown) SYS_ResetSystem(SYS_POWEROFF, 0, 0); + if(reset || shutdown) + { + Close_Inputs(); + if(reset) + SYS_ResetSystem(SYS_RESTART, 0, 0); + else + Sys_Shutdown(); + } } int Sys_GetExitTo(void) diff --git a/source/memory/memory.h b/source/memory/memory.h index 9864443a..e672bd10 100644 --- a/source/memory/memory.h +++ b/source/memory/memory.h @@ -32,6 +32,7 @@ extern "C" #define Priiloader_CFG1 ((vu32*)0x8132FFFB) #define Priiloader_CFG2 ((vu32*)0x817FEFF0) +#define HW_GPIO_OUT ((vu32*)0xCD8000E0) #define HW_AHBPROT ((vu32*)0xCD800064) #define MEM_PROT ((vu32)0xCD8B420A)