From 13e2493b192897c177bbc10f9f9197b0318e6ff3 Mon Sep 17 00:00:00 2001 From: "fix94.1" Date: Sat, 8 Sep 2012 16:55:04 +0000 Subject: [PATCH] -if wii gets turned off do a full shutdown and ignore standby --- source/loader/sys.c | 20 ++++++++++++++++---- source/memory/memory.h | 1 + 2 files changed, 17 insertions(+), 4 deletions(-) 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)