2009-10-01 01:10:58 +02: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 16:13:13 +02:00
|
|
|
#include <locale.h>
|
2009-10-01 01:10:58 +02:00
|
|
|
#include <wiiuse/wpad.h>
|
2009-12-03 02:06:09 +01:00
|
|
|
#include <di/di.h>
|
|
|
|
#include <sys/iosupport.h>
|
2009-10-01 01:10:58 +02:00
|
|
|
|
|
|
|
#include "video.h"
|
2010-11-28 16:31:08 +01:00
|
|
|
#include "themes/CTheme.h"
|
2010-12-31 00:49:22 +01:00
|
|
|
#include "menu/menus.h"
|
2009-10-01 01:10:58 +02:00
|
|
|
#include "main.h"
|
2010-12-31 00:49:22 +01:00
|
|
|
#include "Controls/DeviceHandler.hpp"
|
|
|
|
#include "settings/CSettings.h"
|
2009-12-04 16:05:20 +01:00
|
|
|
#include "memory/mem2.h"
|
2010-09-19 01:04:39 +02:00
|
|
|
#include "wad/nandtitle.h"
|
2010-09-24 01:47:51 +02:00
|
|
|
#include "system/IosLoader.h"
|
2010-12-31 00:49:22 +01:00
|
|
|
#include "usbloader/MountGamePartition.h"
|
2011-01-22 01:06:28 +01:00
|
|
|
#include "usbloader/GameBooter.hpp"
|
2010-12-31 00:49:22 +01:00
|
|
|
#include "StartUpProcess.h"
|
|
|
|
#include "sys.h"
|
2009-10-20 13:46:55 +02:00
|
|
|
|
2010-10-28 11:00:52 +02:00
|
|
|
extern "C"
|
|
|
|
{
|
2011-01-14 16:39:42 +01:00
|
|
|
extern s32 MagicPatches(s32);
|
2010-11-28 16:31:08 +01:00
|
|
|
void __exception_setreload(int t);
|
2010-10-28 11:00:52 +02:00
|
|
|
}
|
|
|
|
|
2010-12-31 00:49:22 +01:00
|
|
|
static int QuickGameBoot(const char * gameID)
|
2010-02-09 11:59:55 +01:00
|
|
|
{
|
2010-12-31 00:49:22 +01:00
|
|
|
DeviceHandler::Instance()->MountAll();
|
|
|
|
Settings.Load();
|
2010-11-28 16:31:08 +01:00
|
|
|
|
2010-12-31 00:49:22 +01:00
|
|
|
MountGamePartition(false);
|
2011-01-22 01:06:28 +01:00
|
|
|
return GameBooter::BootGame(gameID);
|
2010-12-31 00:49:22 +01:00
|
|
|
}
|
2010-05-29 09:38:54 +02:00
|
|
|
|
2010-12-31 00:49:22 +01:00
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
2011-01-12 20:30:04 +01:00
|
|
|
if(IOS_GetVersion() != 58)
|
|
|
|
IOS_ReloadIOS(58);
|
|
|
|
|
2010-12-31 00:49:22 +01:00
|
|
|
MEM2_init(48);
|
|
|
|
__exception_setreload(20);
|
2011-01-14 16:39:42 +01:00
|
|
|
MagicPatches(1);
|
2010-12-31 00:49:22 +01:00
|
|
|
InitVideo();
|
|
|
|
InitGecko();
|
2011-01-12 20:30:04 +01:00
|
|
|
USBGeckoOutput();
|
2010-12-31 00:49:22 +01:00
|
|
|
NandTitles.Get();
|
|
|
|
setlocale(LC_ALL, "en.UTF-8");
|
2010-01-18 00:59:59 +01:00
|
|
|
|
2010-12-31 00:49:22 +01:00
|
|
|
if(argc > 1 && argv[1])
|
|
|
|
return QuickGameBoot(argv[1]);
|
2010-12-03 19:38:57 +01:00
|
|
|
|
2010-12-31 00:49:22 +01:00
|
|
|
StartUpProcess::Run();
|
2009-10-01 01:10:58 +02:00
|
|
|
|
2010-10-27 21:50:48 +02:00
|
|
|
MainMenu(MENU_DISCLIST);
|
2009-10-01 01:10:58 +02:00
|
|
|
return 0;
|
|
|
|
}
|