-fixed really cruel bug in memory clearing which cleared nothing

at all :P
-(hopefully) fixed game launching properly
This commit is contained in:
fix94.1 2012-05-15 16:08:15 +00:00
parent 5716a3a225
commit a728a96480
4 changed files with 23 additions and 12 deletions

View File

@ -170,15 +170,12 @@ GXRModeObj * __Disc_SelectVMode(u8 videoselected, u64 chantitle)
void __Disc_SetVMode(void) void __Disc_SetVMode(void)
{ {
// Stop wait message thread
extern void HideWaitMessage();
HideWaitMessage();
/* Set video mode register */ /* Set video mode register */
*(vu32 *)0x800000CC = vmode_reg; *(vu32 *)0x800000CC = vmode_reg;
/* Set video mode */ /* Set video mode */
if (vmode != 0) VIDEO_Configure(vmode); if (vmode != 0)
VIDEO_Configure(vmode);
/* Setup video */ /* Setup video */
VIDEO_SetBlack(TRUE); VIDEO_SetBlack(TRUE);
@ -360,12 +357,20 @@ s32 Disc_BootPartition(u64 offset, u8 vidMode, bool vipatch, bool countryString,
if (ret < 0) if (ret < 0)
return ret; return ret;
/* Select an appropriate video mode */ /* Greenscreen Fix */
__Disc_SelectVMode(vidMode, 0); VIDEO_SetBlack(TRUE);
VIDEO_Flush();
VIDEO_WaitVSync();
/* Clear memory */
MEM2_clear();
/* Setup low memory */; /* Setup low memory */;
__Disc_SetLowMem(); __Disc_SetLowMem();
/* Select an appropriate video mode */
__Disc_SelectVMode(vidMode, 0);
/* Run apploader */ /* Run apploader */
ret = Apploader_Run(&p_entry, vidMode, vmode, vipatch, countryString, patchVidMode, aspectRatio); ret = Apploader_Run(&p_entry, vidMode, vmode, vipatch, countryString, patchVidMode, aspectRatio);
if (ret < 0) if (ret < 0)

View File

@ -166,6 +166,8 @@ static void __dsp_shutdown()
//Modified libogc call //Modified libogc call
void Sys_Shutdown(void) void Sys_Shutdown(void)
{ {
Close_Inputs();
__dsp_shutdown(); __dsp_shutdown();
u32 ret = __PADDisableRecalibration(TRUE); u32 ret = __PADDisableRecalibration(TRUE);

View File

@ -39,7 +39,7 @@ void CMEM2Alloc::cleanup(void)
void CMEM2Alloc::clear(void) void CMEM2Alloc::clear(void)
{ {
m_first = 0; 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) unsigned int CMEM2Alloc::usableSize(void *p)

View File

@ -1286,6 +1286,10 @@ void CMenu::_launchGame(dir_discHdr *hdr, bool dvd)
if(currentPartition == 0) if(currentPartition == 0)
SDHC_Init(); SDHC_Init();
// Stop wait message thread
m_vid.hideWaitMessage();
usleep(100 * 1000);
gprintf("Booting game\n"); gprintf("Booting game\n");
if (Disc_WiiBoot(videoMode, vipatch, countryPatch, patchVidMode, disableIOSreload, aspectRatio) < 0) if (Disc_WiiBoot(videoMode, vipatch, countryPatch, patchVidMode, disableIOSreload, aspectRatio) < 0)
Sys_LoadMenu(); Sys_LoadMenu();