mirror of
https://github.com/wiidev/usbloadergx.git
synced 2024-12-19 08:21:54 +01:00
*Reset/Power Button fix on Console by julienstephan
This commit is contained in:
parent
7f1c6a3a9c
commit
97d59a61aa
@ -86,7 +86,7 @@ int direction = 0; // direction the gameprompt slides in
|
|||||||
static char gameregion[7];
|
static char gameregion[7];
|
||||||
//power button fix
|
//power button fix
|
||||||
extern u8 shutdown;
|
extern u8 shutdown;
|
||||||
|
extern u8 reset;
|
||||||
|
|
||||||
//Wiilight stuff
|
//Wiilight stuff
|
||||||
static vu32 *_wiilight_reg = (u32*)0xCD0000C0;
|
static vu32 *_wiilight_reg = (u32*)0xCD0000C0;
|
||||||
@ -439,6 +439,9 @@ WiiMenuWindowPrompt(const char *title, const char *btn1Label, const char *btn2La
|
|||||||
wiilight(0);
|
wiilight(0);
|
||||||
Sys_Shutdown();
|
Sys_Shutdown();
|
||||||
}
|
}
|
||||||
|
if(reset == 1)
|
||||||
|
Sys_Reboot();
|
||||||
|
|
||||||
if(btn1.GetState() == STATE_CLICKED) {
|
if(btn1.GetState() == STATE_CLICKED) {
|
||||||
choice = 1;
|
choice = 1;
|
||||||
}
|
}
|
||||||
@ -553,6 +556,8 @@ WindowPrompt(const char *title, const char *msg, const char *btn1Label, const ch
|
|||||||
wiilight(0);
|
wiilight(0);
|
||||||
Sys_Shutdown();
|
Sys_Shutdown();
|
||||||
}
|
}
|
||||||
|
if(reset == 1)
|
||||||
|
Sys_Reboot();
|
||||||
if(btn1.GetState() == STATE_CLICKED) {
|
if(btn1.GetState() == STATE_CLICKED) {
|
||||||
choice = 1;
|
choice = 1;
|
||||||
}
|
}
|
||||||
@ -1009,6 +1014,8 @@ int GameWindowPrompt()
|
|||||||
wiilight(0);
|
wiilight(0);
|
||||||
Sys_Shutdown();
|
Sys_Shutdown();
|
||||||
}
|
}
|
||||||
|
if(reset == 1)
|
||||||
|
Sys_Reboot();
|
||||||
|
|
||||||
if(btn1.GetState() == STATE_CLICKED) { //boot
|
if(btn1.GetState() == STATE_CLICKED) { //boot
|
||||||
choice = 1;
|
choice = 1;
|
||||||
@ -2096,7 +2103,8 @@ static int MenuInstall()
|
|||||||
|
|
||||||
if (shutdown == 1)
|
if (shutdown == 1)
|
||||||
Sys_Shutdown();
|
Sys_Shutdown();
|
||||||
|
if(reset == 1)
|
||||||
|
Sys_Reboot();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2432,6 +2440,9 @@ static int MenuDiscList()
|
|||||||
{
|
{
|
||||||
Sys_Shutdown();
|
Sys_Shutdown();
|
||||||
}
|
}
|
||||||
|
if(reset == 1)
|
||||||
|
Sys_Reboot();
|
||||||
|
|
||||||
if(poweroffBtn.GetState() == STATE_CLICKED)
|
if(poweroffBtn.GetState() == STATE_CLICKED)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -3024,6 +3035,8 @@ static int MenuFormat()
|
|||||||
}
|
}
|
||||||
if (shutdown == 1)
|
if (shutdown == 1)
|
||||||
Sys_Shutdown();
|
Sys_Shutdown();
|
||||||
|
if(reset == 1)
|
||||||
|
Sys_Reboot();
|
||||||
|
|
||||||
if(poweroffBtn.GetState() == STATE_CLICKED)
|
if(poweroffBtn.GetState() == STATE_CLICKED)
|
||||||
{
|
{
|
||||||
@ -3390,6 +3403,8 @@ static int MenuSettings()
|
|||||||
|
|
||||||
if(shutdown == 1)
|
if(shutdown == 1)
|
||||||
Sys_Shutdown();
|
Sys_Shutdown();
|
||||||
|
if(reset == 1)
|
||||||
|
Sys_Reboot();
|
||||||
|
|
||||||
if(backBtn.GetState() == STATE_CLICKED)
|
if(backBtn.GetState() == STATE_CLICKED)
|
||||||
{
|
{
|
||||||
@ -3632,6 +3647,8 @@ int GameSettings(struct discHdr * header)
|
|||||||
|
|
||||||
if(shutdown == 1)
|
if(shutdown == 1)
|
||||||
Sys_Shutdown();
|
Sys_Shutdown();
|
||||||
|
if(reset == 1)
|
||||||
|
Sys_Reboot();
|
||||||
|
|
||||||
ret = optionBrowser3.GetClickedOption();
|
ret = optionBrowser3.GetClickedOption();
|
||||||
|
|
||||||
@ -3794,7 +3811,8 @@ static int MenuCheck()
|
|||||||
|
|
||||||
if(shutdown == 1)
|
if(shutdown == 1)
|
||||||
Sys_Shutdown();
|
Sys_Shutdown();
|
||||||
|
if(reset == 1)
|
||||||
|
Sys_Reboot();
|
||||||
//Spieleliste laden
|
//Spieleliste laden
|
||||||
__Menu_GetEntries();
|
__Menu_GetEntries();
|
||||||
|
|
||||||
|
@ -10,11 +10,12 @@
|
|||||||
/* Variables */
|
/* Variables */
|
||||||
static const char certs_fs[] ATTRIBUTE_ALIGN(32) = "/sys/cert.sys";
|
static const char certs_fs[] ATTRIBUTE_ALIGN(32) = "/sys/cert.sys";
|
||||||
u8 shutdown = 0;
|
u8 shutdown = 0;
|
||||||
|
u8 reset = 0;
|
||||||
|
|
||||||
void __Sys_ResetCallback(void)
|
void __Sys_ResetCallback(void)
|
||||||
{
|
{
|
||||||
/* Reboot console */
|
/* Reboot console */
|
||||||
Sys_Reboot();
|
reset = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __Sys_PowerCallback(void)
|
void __Sys_PowerCallback(void)
|
||||||
@ -42,8 +43,8 @@ void Sys_Reboot(void)
|
|||||||
|
|
||||||
void Sys_Shutdown(void)
|
void Sys_Shutdown(void)
|
||||||
{
|
{
|
||||||
/* Disconnect WPAD */
|
Wpad_Disconnect();
|
||||||
Wpad_Disconnect();
|
|
||||||
/* Poweroff console */
|
/* Poweroff console */
|
||||||
if(CONF_GetShutdownMode() == CONF_SHUTDOWN_IDLE) {
|
if(CONF_GetShutdownMode() == CONF_SHUTDOWN_IDLE) {
|
||||||
s32 ret;
|
s32 ret;
|
||||||
|
Loading…
Reference in New Issue
Block a user