mirror of
https://github.com/wiidev/usbloadergx.git
synced 2024-10-05 05:05:08 +02:00
e8de174866
*Fixed browsers not getting darker when going into HOME Menu *Removed MP3 Menu *Added Patch Country Strings (thanks to WiiPower and SoftChip Team) Note: "This is an option for import games only. If you have problems with that try this option. Mostly japanese users need that. *some other small fixes **Note 2: Right now the loader is having some issue with IOS Reload. If you initialized network and try to run a game and its not working its due to that bug. I am trying to find why it isnt working right now. FreetypGX is making codedumps on there sometimes (ardi look into it you missed something). ** Also there is a new libogc in our download in which there are new libfat and libogc files. If you had issues with SD they might now be fixed, so try it out.
165 lines
3.4 KiB
C++
165 lines
3.4 KiB
C++
/****************************************************************************
|
|
* libwiigui Template
|
|
* Tantric 2009
|
|
*
|
|
* demo.cpp
|
|
* Basic template/demonstration of libwiigui capabilities. For a
|
|
* full-featured app using many more extensions, check out Snes9x GX.
|
|
***************************************************************************/
|
|
|
|
#include <gccore.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <ogcsys.h>
|
|
#include <unistd.h>
|
|
#include <wiiuse/wpad.h>
|
|
|
|
#include "FreeTypeGX.h"
|
|
#include "video.h"
|
|
#include "audio.h"
|
|
#include "menu.h"
|
|
#include "input.h"
|
|
#include "filelist.h"
|
|
#include "main.h"
|
|
#include "http.h"
|
|
#include "dns.h"
|
|
#include "fatmounter.h"
|
|
#include "disc.h"
|
|
#include "wbfs.h"
|
|
#include "sys.h"
|
|
#include "video2.h"
|
|
#include "wpad.h"
|
|
#include "cfg.h"
|
|
#include "language.h"
|
|
#include "fat.h"
|
|
|
|
|
|
/* Constants */
|
|
#define CONSOLE_XCOORD 260
|
|
#define CONSOLE_YCOORD 115
|
|
#define CONSOLE_WIDTH 340
|
|
#define CONSOLE_HEIGHT 218
|
|
|
|
FreeTypeGX *fontSystem=0;
|
|
FreeTypeGX *fontClock=0;
|
|
int ExitRequested = 0;
|
|
bool netcheck = false;
|
|
|
|
|
|
/*Networking - Forsaekn*/
|
|
int Net_Init(char *ip){
|
|
|
|
s32 res;
|
|
while ((res = net_init()) == -EAGAIN)
|
|
{
|
|
usleep(100 * 1000); //100ms
|
|
}
|
|
|
|
if (if_config(ip, NULL, NULL, true) < 0) {
|
|
printf(" Error reading IP address, exiting");
|
|
usleep(1000 * 1000 * 1); //1 sec
|
|
return FALSE;
|
|
}
|
|
return TRUE;
|
|
}
|
|
|
|
void ExitApp()
|
|
{
|
|
ShutoffRumble();
|
|
StopGX();
|
|
ShutdownAudio();
|
|
|
|
SDCard_deInit();
|
|
|
|
//WPAD_Flush(0);
|
|
//WPAD_Disconnect(0);
|
|
//WPAD_Shutdown();
|
|
//exit(0);
|
|
}
|
|
|
|
void
|
|
DefaultSettings()
|
|
{
|
|
Settings.video = discdefault;
|
|
Settings.vpatch = off;
|
|
Settings.language = ConsoleLangDefault;
|
|
Settings.ocarina = off;
|
|
Settings.hddinfo = hr12;
|
|
Settings.sinfo = ((THEME.showID) ? GameID : Neither);
|
|
Settings.rumble = RumbleOn;
|
|
if (THEME.showRegion)
|
|
{
|
|
Settings.sinfo = ((Settings.sinfo == GameID) ? Both : GameRegion);
|
|
}
|
|
Settings.volume = v80;
|
|
Settings.tooltips = TooltipsOn;
|
|
snprintf(Settings.unlockCode, sizeof(Settings.unlockCode), "ab121b");
|
|
Settings.parentalcontrol = 0;
|
|
Settings.cios = ios249;
|
|
Settings.xflip = no;
|
|
Settings.qboot = no;
|
|
Settings.unicodefix = 0;
|
|
Settings.wiilight = 1;
|
|
Settings.patchcountrystrings = 0;
|
|
|
|
CFG_LoadGlobal();
|
|
}
|
|
|
|
|
|
int
|
|
main(int argc, char *argv[])
|
|
{
|
|
|
|
s32 ret2;
|
|
|
|
SDCard_Init();
|
|
lang_default();
|
|
CFG_Load();
|
|
|
|
DefaultSettings();
|
|
|
|
|
|
SDCard_deInit();
|
|
|
|
/* Load Custom IOS */
|
|
if(Settings.cios == ios222) {
|
|
ret2 = IOS_ReloadIOS(222);
|
|
if (ret2 < 0) {
|
|
Settings.cios = ios249;
|
|
ret2 = IOS_ReloadIOS(249);
|
|
}
|
|
} else {
|
|
ret2 = IOS_ReloadIOS(249);
|
|
}
|
|
|
|
if (ret2 < 0) {
|
|
printf("ERROR: cIOS could not be loaded!");
|
|
SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);
|
|
}
|
|
|
|
SDCard_Init();
|
|
|
|
Sys_Init();
|
|
//Video_SetMode();
|
|
//Con_Init(CONSOLE_XCOORD, CONSOLE_YCOORD, CONSOLE_WIDTH, CONSOLE_HEIGHT);
|
|
//Wpad_Init();
|
|
|
|
PAD_Init();
|
|
InitVideo(); // Initialise video
|
|
InitAudio(); // Initialize audio
|
|
|
|
|
|
fontSystem = new FreeTypeGX();
|
|
fontSystem->loadFont(font_ttf, font_ttf_size, 0);
|
|
fontSystem->setCompatibilityMode(FTGX_COMPATIBILITY_DEFAULT_TEVOP_GX_PASSCLR | FTGX_COMPATIBILITY_DEFAULT_VTXDESC_GX_NONE);
|
|
|
|
fontClock = new FreeTypeGX();
|
|
fontClock->loadFont(clock_ttf, clock_ttf_size, 0);
|
|
fontClock->setCompatibilityMode(FTGX_COMPATIBILITY_DEFAULT_TEVOP_GX_PASSCLR | FTGX_COMPATIBILITY_DEFAULT_VTXDESC_GX_NONE);
|
|
|
|
InitGUIThreads();
|
|
MainMenu(MENU_CHECK);
|
|
return 0;
|
|
}
|