diff --git a/source/loader/disc.c b/source/loader/disc.c index 850ae103..4494591e 100644 --- a/source/loader/disc.c +++ b/source/loader/disc.c @@ -170,16 +170,13 @@ GXRModeObj * __Disc_SelectVMode(u8 videoselected, u64 chantitle) void __Disc_SetVMode(void) { - // Stop wait message thread - extern void HideWaitMessage(); - HideWaitMessage(); - /* Set video mode register */ *(vu32 *)0x800000CC = vmode_reg; /* Set video mode */ - if (vmode != 0) VIDEO_Configure(vmode); - + if (vmode != 0) + VIDEO_Configure(vmode); + /* Setup video */ VIDEO_SetBlack(TRUE); VIDEO_Flush(); @@ -355,24 +352,32 @@ s32 Disc_BootPartition(u64 offset, u8 vidMode, bool vipatch, bool countryString, IOSReloadBlock(IOS_GetVersion(), false); else IOSReloadBlock(IOS_GetVersion(), true); - + s32 ret = WDVD_OpenPartition(offset, 0, 0, 0, Tmd_Buffer); if (ret < 0) return ret; - /* Select an appropriate video mode */ - __Disc_SelectVMode(vidMode, 0); + /* Greenscreen Fix */ + VIDEO_SetBlack(TRUE); + VIDEO_Flush(); + VIDEO_WaitVSync(); + + /* Clear memory */ + MEM2_clear(); /* Setup low memory */; __Disc_SetLowMem(); + /* Select an appropriate video mode */ + __Disc_SelectVMode(vidMode, 0); + /* Run apploader */ ret = Apploader_Run(&p_entry, vidMode, vmode, vipatch, countryString, patchVidMode, aspectRatio); if (ret < 0) return ret; - free_wip(); - + free_wip(); + if (hooktype != 0) ocarina_do_code(); diff --git a/source/loader/sys.c b/source/loader/sys.c index 36b989d9..21433dcf 100644 --- a/source/loader/sys.c +++ b/source/loader/sys.c @@ -166,6 +166,8 @@ static void __dsp_shutdown() //Modified libogc call void Sys_Shutdown(void) { + Close_Inputs(); + __dsp_shutdown(); u32 ret = __PADDisableRecalibration(TRUE); diff --git a/source/memory/mem2alloc.cpp b/source/memory/mem2alloc.cpp index e9bf2da7..ef403d65 100644 --- a/source/memory/mem2alloc.cpp +++ b/source/memory/mem2alloc.cpp @@ -39,7 +39,7 @@ void CMEM2Alloc::cleanup(void) void CMEM2Alloc::clear(void) { m_first = 0; - memset(m_baseAddress, 0, (u8 *)m_endAddress - (u8 *)m_endAddress); + memset(m_baseAddress, 0, (u8 *)m_endAddress - (u8 *)m_baseAddress); } unsigned int CMEM2Alloc::usableSize(void *p) diff --git a/source/menu/menu_game.cpp b/source/menu/menu_game.cpp index 1916f088..882bcaa5 100644 --- a/source/menu/menu_game.cpp +++ b/source/menu/menu_game.cpp @@ -1286,6 +1286,10 @@ void CMenu::_launchGame(dir_discHdr *hdr, bool dvd) if(currentPartition == 0) SDHC_Init(); + // Stop wait message thread + m_vid.hideWaitMessage(); + usleep(100 * 1000); + gprintf("Booting game\n"); if (Disc_WiiBoot(videoMode, vipatch, countryPatch, patchVidMode, disableIOSreload, aspectRatio) < 0) Sys_LoadMenu();