*Reset/Power Button fix on Console by julienstephan

This commit is contained in:
dimok321 2009-05-03 20:30:17 +00:00
parent 7f1c6a3a9c
commit 97d59a61aa
2 changed files with 4107 additions and 4088 deletions

View File

@ -86,7 +86,7 @@ int direction = 0; // direction the gameprompt slides in
static char gameregion[7];
//power button fix
extern u8 shutdown;
extern u8 reset;
//Wiilight stuff
static vu32 *_wiilight_reg = (u32*)0xCD0000C0;
@ -439,6 +439,9 @@ WiiMenuWindowPrompt(const char *title, const char *btn1Label, const char *btn2La
wiilight(0);
Sys_Shutdown();
}
if(reset == 1)
Sys_Reboot();
if(btn1.GetState() == STATE_CLICKED) {
choice = 1;
}
@ -553,6 +556,8 @@ WindowPrompt(const char *title, const char *msg, const char *btn1Label, const ch
wiilight(0);
Sys_Shutdown();
}
if(reset == 1)
Sys_Reboot();
if(btn1.GetState() == STATE_CLICKED) {
choice = 1;
}
@ -1009,6 +1014,8 @@ int GameWindowPrompt()
wiilight(0);
Sys_Shutdown();
}
if(reset == 1)
Sys_Reboot();
if(btn1.GetState() == STATE_CLICKED) { //boot
choice = 1;
@ -2096,7 +2103,8 @@ static int MenuInstall()
if (shutdown == 1)
Sys_Shutdown();
if(reset == 1)
Sys_Reboot();
}
@ -2432,6 +2440,9 @@ static int MenuDiscList()
{
Sys_Shutdown();
}
if(reset == 1)
Sys_Reboot();
if(poweroffBtn.GetState() == STATE_CLICKED)
{
@ -3024,6 +3035,8 @@ static int MenuFormat()
}
if (shutdown == 1)
Sys_Shutdown();
if(reset == 1)
Sys_Reboot();
if(poweroffBtn.GetState() == STATE_CLICKED)
{
@ -3390,6 +3403,8 @@ static int MenuSettings()
if(shutdown == 1)
Sys_Shutdown();
if(reset == 1)
Sys_Reboot();
if(backBtn.GetState() == STATE_CLICKED)
{
@ -3632,6 +3647,8 @@ int GameSettings(struct discHdr * header)
if(shutdown == 1)
Sys_Shutdown();
if(reset == 1)
Sys_Reboot();
ret = optionBrowser3.GetClickedOption();
@ -3794,7 +3811,8 @@ static int MenuCheck()
if(shutdown == 1)
Sys_Shutdown();
if(reset == 1)
Sys_Reboot();
//Spieleliste laden
__Menu_GetEntries();

View File

@ -10,11 +10,12 @@
/* Variables */
static const char certs_fs[] ATTRIBUTE_ALIGN(32) = "/sys/cert.sys";
u8 shutdown = 0;
u8 reset = 0;
void __Sys_ResetCallback(void)
{
/* Reboot console */
Sys_Reboot();
reset = 1;
}
void __Sys_PowerCallback(void)
@ -42,8 +43,8 @@ void Sys_Reboot(void)
void Sys_Shutdown(void)
{
/* Disconnect WPAD */
Wpad_Disconnect();
Wpad_Disconnect();
/* Poweroff console */
if(CONF_GetShutdownMode() == CONF_SHUTDOWN_IDLE) {
s32 ret;