2011-10-15 17:31:29 +02:00
|
|
|
|
|
|
|
#include <malloc.h>
|
|
|
|
#include <wiiuse/wpad.h>
|
|
|
|
|
|
|
|
#include "RuntimeIOSPatch.h"
|
|
|
|
#include "menu.h"
|
|
|
|
#include "video.h"
|
|
|
|
#include "wad.h"
|
2012-05-12 23:02:38 +02:00
|
|
|
#include "getios.h"
|
2011-10-15 17:31:29 +02:00
|
|
|
|
|
|
|
#define HAVE_AHBPROT ((*(vu32*)0xcd800064 == 0xFFFFFFFF) ? 1 : 0)
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------
|
|
|
|
int main(int argc, char **argv) {
|
|
|
|
//---------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// Initialise the video system
|
|
|
|
VIDEO_Init();
|
|
|
|
Video_SetMode();
|
2012-03-21 19:30:49 +01:00
|
|
|
|
2011-10-15 17:31:29 +02:00
|
|
|
if(HAVE_AHBPROT)
|
|
|
|
runtimePatchApply();
|
2012-03-21 19:30:49 +01:00
|
|
|
|
|
|
|
WPAD_Init();
|
|
|
|
PAD_Init();
|
|
|
|
|
2011-10-15 17:31:29 +02:00
|
|
|
menu();
|
2012-03-21 19:30:49 +01:00
|
|
|
|
2012-06-01 12:17:17 +02:00
|
|
|
signed_blob *p_tmd = NULL;
|
|
|
|
u32 len;
|
|
|
|
s32 ret;
|
2012-05-12 23:02:38 +02:00
|
|
|
|
2012-06-01 12:17:17 +02:00
|
|
|
ret = GetTMD(0x0001000154484246LL, &p_tmd, &len);
|
|
|
|
|
|
|
|
if(ret < 0)
|
2012-05-12 23:02:38 +02:00
|
|
|
{
|
|
|
|
*(vu32*)0x8132FFFB = 0x50756E65;
|
|
|
|
DCFlushRange((void*)0x8132FFFB, 4);
|
|
|
|
SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);
|
|
|
|
}
|
2012-06-01 12:17:17 +02:00
|
|
|
else
|
|
|
|
{
|
|
|
|
WII_LaunchTitle(0x0001000154484246);
|
|
|
|
|
|
|
|
}
|
2011-10-15 17:31:29 +02:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|