-fixed exit wiiflow freeze

This commit is contained in:
fix94.1 2012-06-13 21:16:36 +00:00
parent e4bb926948
commit bd7d0a5374
4 changed files with 34 additions and 13 deletions

View File

@ -14,6 +14,13 @@
#include "gecko.h"
#include "mem2.hpp"
#define STACK_ALIGN(type, name, cnt, alignment) \
u8 _al__##name[((sizeof(type)*(cnt)) + (alignment) + \
(((sizeof(type)*(cnt))%(alignment)) > 0 ? ((alignment) - \
((sizeof(type)*(cnt))%(alignment))) : 0))]; \
type *name = (type*)(((u32)(_al__##name)) + ((alignment) - (( \
(u32)(_al__##name))&((alignment)-1))))
GXRModeObj * __Disc_SelectVMode(u8 videoselected, u64 chantitle);
void PatchCountryStrings(void *Address, int Size);
void __Disc_SetLowMem(void);
@ -319,3 +326,13 @@ u8 *GetDol(u64 title, u32 bootcontent)
gprintf("Failed!\n");
return NULL;
}
s32 WiiFlow_LaunchTitle(u64 titleID)
{
u32 numviews;
STACK_ALIGN(tikview,views,4,32);
ES_GetNumTicketViews(titleID, &numviews);
ES_GetTicketViews(titleID, views, numviews);
return ES_LaunchTitle(titleID, &views[0]);
}

View File

@ -13,11 +13,13 @@ s32 BootChannel(u32 entry, u64 chantitle, u32 ios, u8 vidMode, bool vipatch, boo
u32 LoadChannel(u8 *buffer);
void PatchChannel(u8 vidMode, GXRModeObj *vmode, bool vipatch, bool countryString, u8 patchVidModes, int aspectRatio);
u8 * GetDol(u64 title, u32 bootcontent);
u8 *GetDol(u64 title, u32 bootcontent);
bool Identify(u64 titleid, u32 *ios);
bool Identify_GenerateTik(signed_blob **outbuf, u32 *outlen);
s32 WiiFlow_LaunchTitle(u64 titleID);
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -1,15 +1,17 @@
#include <ogc/machine/processor.h>
#include <ogc/lwp_threads.h>
#include <ogc/lwp_watchdog.h>
#include <stdio.h>
#include <ogcsys.h>
#include <stdlib.h>
#include <string.h>
#include "wiiuse/wpad.h"
#include "mem2.hpp"
#include <string.h>
#include <ogc/lwp_threads.h>
#include <ogc/lwp_watchdog.h>
#include "sys.h"
#include "gecko.h"
#include <ogc/machine/processor.h>
#include "channel_launcher.h"
#include "sha1.h"
#include "fs.h"
#include "mem2.hpp"
@ -109,10 +111,10 @@ void Sys_Exit(void)
IOS_ReloadIOS(254);
//else
if(WII_LaunchTitle(HBC_108) < 0)
if(WII_LaunchTitle(HBC_HAXX) < 0)
if(WII_LaunchTitle(HBC_JODI) < 0)
WII_ReturnToMenu(); //SYS_ResetSystem doesnt work properly with new libogc
if(WiiFlow_LaunchTitle(HBC_108) < 0)
if(WiiFlow_LaunchTitle(HBC_HAXX) < 0)
if(WiiFlow_LaunchTitle(HBC_JODI) < 0)
WiiFlow_LaunchTitle(0x100000002LL); //SYS_ResetSystem doesnt work properly with new libogc
}
void __Sys_ResetCallback(void)
@ -135,7 +137,7 @@ void Sys_Init(void)
void Sys_LoadMenu(void)
{
/* Return to the Wii system menu */
WII_ReturnToMenu(); //SYS_ResetSystem doesnt work properly with new libogc
WiiFlow_LaunchTitle(0x100000002LL); //SYS_ResetSystem doesnt work properly with new libogc
}
void __dsp_shutdown(void)

View File

@ -764,7 +764,7 @@ void CMenu::_launchGC(dir_discHdr *hdr, bool DML)
DML_New_WriteOptions();
WII_Initialize();
if(WII_LaunchTitle(0x100000100LL) < 0)
if(WiiFlow_LaunchTitle(0x100000100LL) < 0)
Sys_LoadMenu();
}
@ -1072,7 +1072,7 @@ void CMenu::_launchChannel(dir_discHdr *hdr)
if(forwarder)
{
WII_Initialize();
if (WII_LaunchTitle(hdr->hdr.chantitle) < 0)
if (WiiFlow_LaunchTitle(hdr->hdr.chantitle) < 0)
Sys_LoadMenu();
}