-fixed banner keeps playing on delete game (issue 117)

-small changes on wii game booting
This commit is contained in:
fix94.1 2012-08-10 13:47:05 +00:00
parent 0967af43b3
commit 5cd988fe23
4 changed files with 19 additions and 16 deletions

View File

@ -53,21 +53,20 @@ s32 Apploader_Run(entry_point *entry, u8 vidMode, GXRModeObj *vmode, bool vipatc
/* Read apploader header */
ret = WDVD_Read(buffer, 0x20, APPLDR_OFFSET);
if (ret < 0)
if(ret < 0)
return ret;
/* Calculate apploader length */
appldr_len = buffer[5] + buffer[6];
/* Clear Apploader region (important buffers are under that) */
memset((void*)0x81200000, 0, 0x500000);
/* Read apploader code */
ret = WDVD_Read(appldr, appldr_len, APPLDR_OFFSET + 0x20);
if(ret < 0)
return ret;
/* Flush into memory */
DCFlushRange(appldr, appldr_len);
ICInvalidateRange(appldr, appldr_len);
/* Set apploader entry function */
app_entry appldr_entry = (app_entry)buffer[4];
@ -78,7 +77,7 @@ s32 Apploader_Run(entry_point *entry, u8 vidMode, GXRModeObj *vmode, bool vipatc
/* Initialize apploader */
appldr_init(gprintf);
while (appldr_main(&dst, &len, &offset))
while(appldr_main(&dst, &len, &offset))
{
/* Read data from DVD */
WDVD_Read(dst, len, (u64)(offset << 2));
@ -86,7 +85,7 @@ s32 Apploader_Run(entry_point *entry, u8 vidMode, GXRModeObj *vmode, bool vipatc
}
free_wip();
if (hooktype != 0)
if(hooktype != 0)
{
if(hookpatched)
ocarina_do_code();
@ -99,7 +98,6 @@ s32 Apploader_Run(entry_point *entry, u8 vidMode, GXRModeObj *vmode, bool vipatc
/* ERROR 002 fix (WiiPower) */
*(u32 *)0x80003140 = *(u32 *)0x80003188;
DCFlushRange((void*)0x80000000, 0x3f00);
return 0;

View File

@ -388,7 +388,7 @@ s32 Disc_BootPartition()
/* Originally from tueidj - taken from NeoGamma (thx) */
*(vu32*)0xCC003024 = 1;
if (hooktype != 0)
if(hooktype != 0)
{
asm volatile (
"lis %r3, appentrypoint@h\n"
@ -418,8 +418,9 @@ s32 Disc_BootPartition()
return 0;
}
void RunApploader(u64 offset, u8 vidMode, bool vipatch, bool countryString, u8 patchVidMode, int aspectRatio, u32 returnTo)
void Disc_BootWiiGame(u64 offset, u8 vidMode, bool vipatch, bool countryString, u8 patchVidMode, int aspectRatio, u32 returnTo)
{
/* Open Partition */
WDVD_OpenPartition(offset);
/* Setup low memory */
@ -430,6 +431,9 @@ void RunApploader(u64 offset, u8 vidMode, bool vipatch, bool countryString, u8 p
/* Run apploader */
Apploader_Run(&p_entry, vidMode, vmode, vipatch, countryString, patchVidMode, aspectRatio, returnTo);
appentrypoint = (u32)p_entry;
/* Boot Game */
gprintf("Entry Point: 0x%08x\n", appentrypoint);
Disc_BootPartition();
}

View File

@ -109,7 +109,8 @@ s32 Disc_FindPartition(u64 *outbuf);
GXRModeObj *Disc_SelectVMode(u8 videoselected, u64 chantitle, u32 *rmode_reg);
void Disc_SetVMode(GXRModeObj *rmode, u32 rmode_reg);
void RunApploader(u64 offset, u8 vidMode, bool vipatch, bool countryString, u8 patchVidMode, int aspectRatio, u32 returnTo);
void Disc_BootWiiGame(u64 offset, u8 vidMode, bool vipatch, bool countryString,
u8 patchVidMode, int aspectRatio, u32 returnTo);
#ifdef __cplusplus
}

View File

@ -493,8 +493,10 @@ void CMenu::_game(bool launch)
_hideGame();
if(_wbfsOp(CMenu::WO_REMOVE_GAME))
{
m_gameSound->Stop();
m_gameSound->FreeMemory();
CheckGameSoundThread();
ClearGameSoundThreadStack();
m_banner->DeleteBanner();
break;
}
_showGame();
@ -1421,9 +1423,7 @@ void CMenu::_launchGame(dir_discHdr *hdr, bool dvd)
return;
DisableMEM1allocR();
RunApploader(offset, videoMode, vipatch, countryPatch, patchVidMode, aspectRatio, returnTo);
gprintf("Booting game\n");
Disc_BootPartition();
Disc_BootWiiGame(offset, videoMode, vipatch, countryPatch, patchVidMode, aspectRatio, returnTo);
}
void CMenu::_initGameMenu(CMenu::SThemeData &theme)