2009-09-30 23:10:58 +00:00
|
|
|
/****************************************************************************
|
|
|
|
* USB Loader GX Team
|
|
|
|
*
|
|
|
|
* Main loadup of the application
|
|
|
|
*
|
|
|
|
* libwiigui
|
|
|
|
* Tantric 2009
|
|
|
|
***************************************************************************/
|
|
|
|
#include <gccore.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <sys/dir.h>
|
|
|
|
#include <ogcsys.h>
|
|
|
|
#include <unistd.h>
|
2009-10-15 14:13:13 +00:00
|
|
|
#include <locale.h>
|
2009-09-30 23:10:58 +00:00
|
|
|
#include <wiiuse/wpad.h>
|
2009-12-03 01:06:09 +00:00
|
|
|
#include <di/di.h>
|
|
|
|
#include <sys/iosupport.h>
|
2009-09-30 23:10:58 +00:00
|
|
|
|
|
|
|
#include "video.h"
|
2010-12-30 23:49:22 +00:00
|
|
|
#include "menu/menus.h"
|
2009-12-04 15:05:20 +00:00
|
|
|
#include "memory/mem2.h"
|
2010-09-18 23:04:39 +00:00
|
|
|
#include "wad/nandtitle.h"
|
2010-12-30 23:49:22 +00:00
|
|
|
#include "StartUpProcess.h"
|
|
|
|
#include "sys.h"
|
2009-10-20 11:46:55 +00:00
|
|
|
|
2010-10-28 09:00:52 +00:00
|
|
|
extern "C"
|
|
|
|
{
|
2011-07-25 22:28:22 +00:00
|
|
|
extern s32 MagicPatches(s32);
|
|
|
|
void __exception_setreload(int t);
|
2010-10-28 09:00:52 +00:00
|
|
|
}
|
|
|
|
|
2010-12-30 23:49:22 +00:00
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
2011-07-25 22:28:22 +00:00
|
|
|
__exception_setreload(20);
|
2012-02-05 18:38:26 +00:00
|
|
|
// activate magic access rights
|
2011-07-25 22:28:22 +00:00
|
|
|
MagicPatches(1);
|
2012-02-05 18:38:26 +00:00
|
|
|
// init video
|
2011-07-25 22:28:22 +00:00
|
|
|
InitVideo();
|
2012-02-05 18:38:26 +00:00
|
|
|
// video frame buffers must be in mem1
|
|
|
|
MEM2_init(48);
|
|
|
|
// init gecko
|
2011-07-25 22:28:22 +00:00
|
|
|
InitGecko();
|
2012-02-05 18:38:26 +00:00
|
|
|
// redirect stdout and stderr to gecko
|
2011-07-25 22:28:22 +00:00
|
|
|
USBGeckoOutput();
|
|
|
|
NandTitles.Get();
|
2021-08-01 18:00:18 +01:00
|
|
|
setlocale(LC_ALL, "en_US.UTF-8");
|
2010-01-17 23:59:59 +00:00
|
|
|
|
2011-06-14 17:53:19 +00:00
|
|
|
if(StartUpProcess::Run(argc, argv) < 0)
|
2011-07-25 22:28:22 +00:00
|
|
|
return -1;
|
2009-09-30 23:10:58 +00:00
|
|
|
|
2011-07-25 22:28:22 +00:00
|
|
|
MainMenu(MENU_DISCLIST);
|
|
|
|
return 0;
|
2009-09-30 23:10:58 +00:00
|
|
|
}
|