From 867ab43530e3279a1885a6781080e772a5e378bd Mon Sep 17 00:00:00 2001 From: "fix94.1" Date: Sun, 6 May 2012 16:32:07 +0000 Subject: [PATCH] -fixed broken return to system menu (thanks libogc for such a huge failcommand) --- source/gui/video.cpp | 2 ++ source/loader/sys.c | 27 ++++++++++++++++----------- source/main.cpp | 1 - 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/source/gui/video.cpp b/source/gui/video.cpp index 93314937..e5e245af 100644 --- a/source/gui/video.cpp +++ b/source/gui/video.cpp @@ -228,11 +228,13 @@ void CVideo::prepare(void) void CVideo::cleanup(void) { + gprintf("Cleaning up video...\n"); for (u32 i = 0; i < sizeof m_aaBuffer / sizeof m_aaBuffer[0]; ++i) { SMART_FREE(m_aaBuffer[i]); m_aaBufferSize[i] = 0; } + SAFE_FREE(m_fifo); } void CVideo::prepareAAPass(int aaStep) diff --git a/source/loader/sys.c b/source/loader/sys.c index 32f7fbf1..08379512 100644 --- a/source/loader/sys.c +++ b/source/loader/sys.c @@ -82,16 +82,17 @@ void Sys_ExitTo(int option) //magic word to force wii menu in priiloader. if(return_to_menu) { - Write32(0x8132fffb, 0x50756e65); + *(vu32*)0x8132FFFB = 0x50756e65; } else if(return_to_priiloader) { - Write32(0x8132fffb,0x4461636f); + *(vu32*)0x8132FFFB = 0x4461636f; } else { - Write32(0x8132fffb,0xffffffff); + *(vu32*)0x8132FFFB = 0xffffffff; } + DCFlushRange((void *)(0x8132FFFB), 4); } void Sys_Exit(void) @@ -101,12 +102,16 @@ void Sys_Exit(void) /* Shutdown Inputs */ Close_Inputs(); - if (return_to_menu || return_to_priiloader || priiloader_def) Sys_LoadMenu(); - else if(return_to_bootmii) IOS_ReloadIOS(254); - if(WII_LaunchTitle(HBC_108)<0) - if(WII_LaunchTitle(HBC_HAXX)<0) - if(WII_LaunchTitle(HBC_JODI)<0) - SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0); + if (return_to_menu || return_to_priiloader || priiloader_def) + Sys_LoadMenu(); + else if(return_to_bootmii) + IOS_ReloadIOS(254); + + //else + if(WII_LaunchTitle(HBC_108) < 0) + if(WII_LaunchTitle(HBC_HAXX) < 0) + if(WII_LaunchTitle(HBC_JODI) < 0) + WII_LaunchTitle(0x100000002LL); //SYS_ResetSystem doesnt work properly with new libogc } void __Sys_ResetCallback(void) @@ -130,5 +135,5 @@ void Sys_Init(void) void Sys_LoadMenu(void) { /* Return to the Wii system menu */ - SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0); -} \ No newline at end of file + WII_LaunchTitle(0x100000002LL); //SYS_ResetSystem doesnt work properly with new libogc +} diff --git a/source/main.cpp b/source/main.cpp index 25485aaf..7cf2fc35 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -130,7 +130,6 @@ int main(int argc, char **argv) ret = menu.main(); } } - vid.cleanup(); if (bootHB) { //IOS_ReloadIOS(58);