mirror of
https://github.com/wiidev/usbloadergx.git
synced 2024-11-18 09:19:17 +01:00
NOTE: this commit requires "make clean" and the new libfat (see Downloads libfat-01-06-2009)
* clean up the wild mounts and unmounts (this and the new libfat fix the download-bug) * reorganize shutdowns and reboots use now the functions Sys_Reboot(), Sys_Shutdown(), Sys_ShutdownToIdel(), Sys_ShutdownToStandby() and Sys_BackToLoader() this functions stops the GUI-Thread, Shutdowns the Audio, Video, WPad and unmounts the SD and USB
This commit is contained in:
parent
976ea2041c
commit
904fda37d4
@ -1,33 +1,31 @@
|
|||||||
#include <fat.h>
|
#include <fat.h>
|
||||||
#include <sys/dir.h>
|
#include <sys/dir.h>
|
||||||
|
#include <sys/iosupport.h>
|
||||||
#include <ogc/lwp_watchdog.h>
|
#include <ogc/lwp_watchdog.h>
|
||||||
#include <ogc/mutex.h>
|
#include <ogc/mutex.h>
|
||||||
#include <ogc/system.h>
|
#include <ogc/system.h>
|
||||||
#include <ogc/usbstorage.h>
|
#include <ogc/usbstorage.h>
|
||||||
#include <sdcard/wiisd_io.h>
|
#include <sdcard/wiisd_io.h>
|
||||||
|
|
||||||
#define CACHE 32
|
#define CACHE 4
|
||||||
#define SECTORS 128
|
#define SECTORS 64
|
||||||
|
|
||||||
|
|
||||||
int USBDevice_Init()
|
int USBDevice_Init()
|
||||||
{
|
{
|
||||||
//right now only mounts first partition and only under IOS36
|
//closing all open Files write back the cache and then shutdown em!
|
||||||
__io_usbstorage.startup();
|
fatUnmount("USB:/");
|
||||||
|
//right now only mounts first partition
|
||||||
if (fatMount("USB", &__io_usbstorage, 0, CACHE, SECTORS)) {
|
if (fatMount("USB", &__io_usbstorage, 0, CACHE, SECTORS)) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
return -1;
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void USBDevice_deInit()
|
void USBDevice_deInit()
|
||||||
{
|
{
|
||||||
//First unmount all the devs...
|
//closing all open Files write back the cache and then shutdown em!
|
||||||
fatUnmount("USB:/");
|
fatUnmount("USB:/");
|
||||||
//...and then shutdown em!
|
|
||||||
__io_usbstorage.shutdown();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int isSdInserted()
|
int isSdInserted()
|
||||||
@ -37,21 +35,16 @@ int isSdInserted()
|
|||||||
|
|
||||||
int SDCard_Init()
|
int SDCard_Init()
|
||||||
{
|
{
|
||||||
//mount SD if inserted
|
//closing all open Files write back the cache and then shutdown em!
|
||||||
__io_wiisd.startup();
|
fatUnmount("SD:/");
|
||||||
if (!isSdInserted()){
|
//right now only mounts first partition
|
||||||
return -1;
|
if (fatMount("SD", &__io_wiisd, 0, CACHE, SECTORS))
|
||||||
}
|
|
||||||
if (fatMount("SD", &__io_wiisd, 0, CACHE, SECTORS)) {
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
return -1;
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SDCard_deInit()
|
void SDCard_deInit()
|
||||||
{
|
{
|
||||||
//First unmount all the devs...
|
//closing all open Files write back the cache and then shutdown em!
|
||||||
fatUnmount("SD:/");
|
fatUnmount("SD:/");
|
||||||
//...and then shutdown em!
|
|
||||||
__io_wiisd.shutdown();
|
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ u32 do_sd_code(char *filename)
|
|||||||
|
|
||||||
fp = fopen(filepath, "rb");
|
fp = fopen(filepath, "rb");
|
||||||
if (!fp) {
|
if (!fp) {
|
||||||
fatUnmount("SD");
|
fatUnmount("SD:/");
|
||||||
__io_wiisd.shutdown();
|
__io_wiisd.shutdown();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -93,7 +93,7 @@ u32 do_sd_code(char *filename)
|
|||||||
if(ret != filesize){
|
if(ret != filesize){
|
||||||
free(filebuff);
|
free(filebuff);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
fatUnmount("SD");
|
fatUnmount("SD:/");
|
||||||
__io_wiisd.shutdown();
|
__io_wiisd.shutdown();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -106,7 +106,7 @@ u32 do_sd_code(char *filename)
|
|||||||
free(filebuff);
|
free(filebuff);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
|
||||||
fatUnmount("SD");
|
fatUnmount("SD:/");
|
||||||
__io_wiisd.shutdown();
|
__io_wiisd.shutdown();
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
#include "gui.h"
|
#include "gui.h"
|
||||||
extern int SetValue(int i, const char *format, ...) __attribute__((format(printf,2,3)));
|
|
||||||
|
|
||||||
class customOptionList {
|
class customOptionList {
|
||||||
public:
|
public:
|
||||||
|
@ -43,7 +43,6 @@
|
|||||||
|
|
||||||
FreeTypeGX *fontSystem=0;
|
FreeTypeGX *fontSystem=0;
|
||||||
FreeTypeGX *fontClock=0;
|
FreeTypeGX *fontClock=0;
|
||||||
int ExitRequested = 0;
|
|
||||||
bool netcheck = false;
|
bool netcheck = false;
|
||||||
|
|
||||||
|
|
||||||
@ -64,21 +63,6 @@ int Net_Init(char *ip){
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExitApp()
|
|
||||||
{
|
|
||||||
ShutoffRumble();
|
|
||||||
StopGX();
|
|
||||||
ShutdownAudio();
|
|
||||||
|
|
||||||
if(isSdInserted())
|
|
||||||
SDCard_deInit();
|
|
||||||
|
|
||||||
//WPAD_Flush(0);
|
|
||||||
//WPAD_Disconnect(0);
|
|
||||||
//WPAD_Shutdown();
|
|
||||||
//exit(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
DefaultSettings()
|
DefaultSettings()
|
||||||
{
|
{
|
||||||
@ -107,6 +91,9 @@ DefaultSettings()
|
|||||||
CFG_LoadGlobal();
|
CFG_LoadGlobal();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check for libfat.a from 1. Jun 2009
|
||||||
|
extern int LibFat4USB_Loader_GX;
|
||||||
|
int fatCheck = LibFat4USB_Loader_GX; // remove when libfat newer than 1. Jun 2009
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char *argv[])
|
main(int argc, char *argv[])
|
||||||
@ -114,14 +101,14 @@ main(int argc, char *argv[])
|
|||||||
|
|
||||||
s32 ret2;
|
s32 ret2;
|
||||||
|
|
||||||
SDCard_Init();
|
SDCard_Init(); // mount SD for loading cfg's
|
||||||
lang_default();
|
lang_default();
|
||||||
CFG_Load();
|
CFG_Load();
|
||||||
|
|
||||||
DefaultSettings();
|
DefaultSettings();
|
||||||
|
|
||||||
|
|
||||||
SDCard_deInit();
|
SDCard_deInit();// unmount SD for reloading IOS
|
||||||
|
|
||||||
/* Load Custom IOS */
|
/* Load Custom IOS */
|
||||||
if(Settings.cios == ios222) {
|
if(Settings.cios == ios222) {
|
||||||
@ -139,17 +126,18 @@ main(int argc, char *argv[])
|
|||||||
SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);
|
SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
SDCard_Init();
|
SDCard_Init(); // now mount SD:/
|
||||||
|
USBDevice_Init(); // and mount USB:/
|
||||||
|
|
||||||
Sys_Init();
|
Sys_Init();
|
||||||
//Video_SetMode();
|
|
||||||
//Con_Init(CONSOLE_XCOORD, CONSOLE_YCOORD, CONSOLE_WIDTH, CONSOLE_HEIGHT);
|
|
||||||
//Wpad_Init();
|
|
||||||
|
|
||||||
PAD_Init();
|
|
||||||
InitVideo(); // Initialise video
|
InitVideo(); // Initialise video
|
||||||
InitAudio(); // Initialize audio
|
InitAudio(); // Initialize audio
|
||||||
|
|
||||||
|
PAD_Init(); // initialize PAD/WPAD
|
||||||
|
Wpad_Init();
|
||||||
|
WPAD_SetDataFormat(WPAD_CHAN_ALL,WPAD_FMT_BTNS_ACC_IR);
|
||||||
|
WPAD_SetVRes(WPAD_CHAN_ALL, screenwidth, screenheight);
|
||||||
|
|
||||||
fontSystem = new FreeTypeGX();
|
fontSystem = new FreeTypeGX();
|
||||||
fontSystem->loadFont(font_ttf, font_ttf_size, 0);
|
fontSystem->loadFont(font_ttf, font_ttf_size, 0);
|
||||||
|
@ -12,9 +12,7 @@
|
|||||||
|
|
||||||
extern struct SSettings Settings;
|
extern struct SSettings Settings;
|
||||||
|
|
||||||
void ExitApp();
|
|
||||||
void DefaultSettings();
|
void DefaultSettings();
|
||||||
extern int ExitRequested;
|
|
||||||
extern FreeTypeGX *fontSystem;
|
extern FreeTypeGX *fontSystem;
|
||||||
extern bool netcheck;
|
extern bool netcheck;
|
||||||
extern int Net_Init(char *ip);
|
extern int Net_Init(char *ip);
|
||||||
|
322
source/menu.cpp
322
source/menu.cpp
@ -19,6 +19,7 @@
|
|||||||
#include "libwiigui/gui.h"
|
#include "libwiigui/gui.h"
|
||||||
#include "menu.h"
|
#include "menu.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
#include "audio.h"
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "http.h"
|
#include "http.h"
|
||||||
#include "dns.h"
|
#include "dns.h"
|
||||||
@ -66,6 +67,7 @@ static s32 gameSelected = 0, gameStart = 0;
|
|||||||
static GuiWindow * mainWindow = NULL;
|
static GuiWindow * mainWindow = NULL;
|
||||||
static lwp_t guithread = LWP_THREAD_NULL;
|
static lwp_t guithread = LWP_THREAD_NULL;
|
||||||
static bool guiHalt = true;
|
static bool guiHalt = true;
|
||||||
|
static int ExitRequested = 0;
|
||||||
static GuiImageData progressbar(progressbar_png);
|
static GuiImageData progressbar(progressbar_png);
|
||||||
static GuiImage progressbarImg(&progressbar);
|
static GuiImage progressbarImg(&progressbar);
|
||||||
int godmode = 0;
|
int godmode = 0;
|
||||||
@ -404,15 +406,15 @@ WindowPrompt(const char *title, const char *msg, const char *btn1Label,
|
|||||||
dialogBoxImg.SetWidescreen(CFG.widescreen);
|
dialogBoxImg.SetWidescreen(CFG.widescreen);
|
||||||
}
|
}
|
||||||
|
|
||||||
GuiText titleTxt(title, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255});
|
GuiText titleTxt(title, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
|
||||||
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
||||||
titleTxt.SetPosition(0,55);
|
titleTxt.SetPosition(0,55);
|
||||||
GuiText msgTxt(msg, 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255});
|
GuiText msgTxt(msg, 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
|
||||||
msgTxt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
|
msgTxt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
|
||||||
msgTxt.SetPosition(0,-40);
|
msgTxt.SetPosition(0,-40);
|
||||||
msgTxt.SetMaxWidth(430);
|
msgTxt.SetMaxWidth(430);
|
||||||
|
|
||||||
GuiText btn1Txt(btn1Label, 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255});
|
GuiText btn1Txt(btn1Label, 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
|
||||||
GuiImage btn1Img(&btnOutline);
|
GuiImage btn1Img(&btnOutline);
|
||||||
if (Settings.wsprompt == yes){
|
if (Settings.wsprompt == yes){
|
||||||
btn1Txt.SetWidescreen(CFG.widescreen);
|
btn1Txt.SetWidescreen(CFG.widescreen);
|
||||||
@ -423,7 +425,7 @@ WindowPrompt(const char *title, const char *msg, const char *btn1Label,
|
|||||||
btn1.SetLabel(&btn1Txt);
|
btn1.SetLabel(&btn1Txt);
|
||||||
btn1.SetState(STATE_SELECTED);
|
btn1.SetState(STATE_SELECTED);
|
||||||
|
|
||||||
GuiText btn2Txt(btn2Label, 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255});
|
GuiText btn2Txt(btn2Label, 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
|
||||||
GuiImage btn2Img(&btnOutline);
|
GuiImage btn2Img(&btnOutline);
|
||||||
if (Settings.wsprompt == yes){
|
if (Settings.wsprompt == yes){
|
||||||
btn2Txt.SetWidescreen(CFG.widescreen);
|
btn2Txt.SetWidescreen(CFG.widescreen);
|
||||||
@ -434,7 +436,7 @@ WindowPrompt(const char *title, const char *msg, const char *btn1Label,
|
|||||||
if(!btn3Label && !btn4Label)
|
if(!btn3Label && !btn4Label)
|
||||||
btn2.SetTrigger(&trigB);
|
btn2.SetTrigger(&trigB);
|
||||||
|
|
||||||
GuiText btn3Txt(btn3Label, 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255});
|
GuiText btn3Txt(btn3Label, 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
|
||||||
GuiImage btn3Img(&btnOutline);
|
GuiImage btn3Img(&btnOutline);
|
||||||
if (Settings.wsprompt == yes){
|
if (Settings.wsprompt == yes){
|
||||||
btn3Txt.SetWidescreen(CFG.widescreen);
|
btn3Txt.SetWidescreen(CFG.widescreen);
|
||||||
@ -445,7 +447,7 @@ WindowPrompt(const char *title, const char *msg, const char *btn1Label,
|
|||||||
if(!btn4Label)
|
if(!btn4Label)
|
||||||
btn3.SetTrigger(&trigB);
|
btn3.SetTrigger(&trigB);
|
||||||
|
|
||||||
GuiText btn4Txt(btn4Label, 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255});
|
GuiText btn4Txt(btn4Label, 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
|
||||||
GuiImage btn4Img(&btnOutline);
|
GuiImage btn4Img(&btnOutline);
|
||||||
if (Settings.wsprompt == yes){
|
if (Settings.wsprompt == yes){
|
||||||
btn4Txt.SetWidescreen(CFG.widescreen);
|
btn4Txt.SetWidescreen(CFG.widescreen);
|
||||||
@ -985,7 +987,7 @@ int GameWindowPrompt()
|
|||||||
GuiTooltip nameBtnTT(LANGUAGE.RenameGameonWBFS);
|
GuiTooltip nameBtnTT(LANGUAGE.RenameGameonWBFS);
|
||||||
if (Settings.wsprompt == yes)
|
if (Settings.wsprompt == yes)
|
||||||
nameBtnTT.SetWidescreen(CFG.widescreen);
|
nameBtnTT.SetWidescreen(CFG.widescreen);
|
||||||
GuiText nameTxt("", 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{50, 50, 50, 255});
|
GuiText nameTxt("", 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
|
||||||
if (Settings.wsprompt == yes)
|
if (Settings.wsprompt == yes)
|
||||||
nameTxt.SetWidescreen(CFG.widescreen);
|
nameTxt.SetWidescreen(CFG.widescreen);
|
||||||
nameTxt.SetMaxWidth(350, GuiText::SCROLL);
|
nameTxt.SetMaxWidth(350, GuiText::SCROLL);
|
||||||
@ -1003,7 +1005,7 @@ int GameWindowPrompt()
|
|||||||
nameBtn.SetEffectGrow();
|
nameBtn.SetEffectGrow();
|
||||||
}
|
}
|
||||||
|
|
||||||
GuiText sizeTxt(NULL, 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{50, 50, 50, 255}); //TODO: get the size here
|
GuiText sizeTxt(NULL, 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //TODO: get the size here
|
||||||
sizeTxt.SetAlignment(ALIGN_RIGHT, ALIGN_TOP);
|
sizeTxt.SetAlignment(ALIGN_RIGHT, ALIGN_TOP);
|
||||||
sizeTxt.SetPosition(-60,70);
|
sizeTxt.SetPosition(-60,70);
|
||||||
|
|
||||||
@ -1033,7 +1035,7 @@ int GameWindowPrompt()
|
|||||||
btn1.SetTrigger(&trigA);
|
btn1.SetTrigger(&trigA);
|
||||||
btn1.SetState(STATE_SELECTED);
|
btn1.SetState(STATE_SELECTED);
|
||||||
|
|
||||||
GuiText btn2Txt(LANGUAGE.Back, 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255});
|
GuiText btn2Txt(LANGUAGE.Back, 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
|
||||||
GuiImage btn2Img(&btnOutline);
|
GuiImage btn2Img(&btnOutline);
|
||||||
if (Settings.wsprompt == yes){
|
if (Settings.wsprompt == yes){
|
||||||
btn2Txt.SetWidescreen(CFG.widescreen);
|
btn2Txt.SetWidescreen(CFG.widescreen);
|
||||||
@ -1054,7 +1056,7 @@ int GameWindowPrompt()
|
|||||||
btn2.SetLabel(&btn2Txt);
|
btn2.SetLabel(&btn2Txt);
|
||||||
btn2.SetTrigger(&trigB);
|
btn2.SetTrigger(&trigB);
|
||||||
|
|
||||||
GuiText btn3Txt(LANGUAGE.settings, 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255});
|
GuiText btn3Txt(LANGUAGE.settings, 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
|
||||||
GuiImage btn3Img(&btnOutline);
|
GuiImage btn3Img(&btnOutline);
|
||||||
if (Settings.wsprompt == yes){
|
if (Settings.wsprompt == yes){
|
||||||
btn3Txt.SetWidescreen(CFG.widescreen);
|
btn3Txt.SetWidescreen(CFG.widescreen);
|
||||||
@ -1454,15 +1456,15 @@ DiscWait(const char *title, const char *msg, const char *btn1Label, const char *
|
|||||||
dialogBoxImg.SetWidescreen(CFG.widescreen);
|
dialogBoxImg.SetWidescreen(CFG.widescreen);
|
||||||
}
|
}
|
||||||
|
|
||||||
GuiText titleTxt(title, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255});
|
GuiText titleTxt(title, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
|
||||||
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
||||||
titleTxt.SetPosition(0,60);
|
titleTxt.SetPosition(0,60);
|
||||||
GuiText msgTxt(msg, 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255});
|
GuiText msgTxt(msg, 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
|
||||||
msgTxt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
|
msgTxt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
|
||||||
msgTxt.SetPosition(0,-40);
|
msgTxt.SetPosition(0,-40);
|
||||||
msgTxt.SetMaxWidth(430);
|
msgTxt.SetMaxWidth(430);
|
||||||
|
|
||||||
GuiText btn1Txt(btn1Label, 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255});
|
GuiText btn1Txt(btn1Label, 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
|
||||||
GuiImage btn1Img(&btnOutline);
|
GuiImage btn1Img(&btnOutline);
|
||||||
if (Settings.wsprompt == yes){
|
if (Settings.wsprompt == yes){
|
||||||
btn1Txt.SetWidescreen(CFG.widescreen);
|
btn1Txt.SetWidescreen(CFG.widescreen);
|
||||||
@ -1485,7 +1487,7 @@ DiscWait(const char *title, const char *msg, const char *btn1Label, const char *
|
|||||||
btn1.SetTrigger(&trigB);
|
btn1.SetTrigger(&trigB);
|
||||||
btn1.SetState(STATE_SELECTED);
|
btn1.SetState(STATE_SELECTED);
|
||||||
|
|
||||||
GuiText btn2Txt(btn2Label, 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255});
|
GuiText btn2Txt(btn2Label, 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
|
||||||
GuiImage btn2Img(&btnOutline);
|
GuiImage btn2Img(&btnOutline);
|
||||||
if (Settings.wsprompt == yes){
|
if (Settings.wsprompt == yes){
|
||||||
btn2Txt.SetWidescreen(CFG.widescreen);
|
btn2Txt.SetWidescreen(CFG.widescreen);
|
||||||
@ -1509,7 +1511,7 @@ DiscWait(const char *title, const char *msg, const char *btn1Label, const char *
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GuiText timerTxt(NULL, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255});
|
GuiText timerTxt(NULL, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
|
||||||
timerTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
timerTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
||||||
timerTxt.SetPosition(0,160);
|
timerTxt.SetPosition(0,160);
|
||||||
|
|
||||||
@ -1531,12 +1533,10 @@ DiscWait(const char *title, const char *msg, const char *btn1Label, const char *
|
|||||||
mainWindow->ChangeFocus(&promptWindow);
|
mainWindow->ChangeFocus(&promptWindow);
|
||||||
ResumeGui();
|
ResumeGui();
|
||||||
|
|
||||||
SDCard_deInit();
|
|
||||||
|
|
||||||
if(IsDeviceWait) {
|
if(IsDeviceWait) {
|
||||||
while(i >= 0)
|
while(i >= 0)
|
||||||
{
|
{
|
||||||
timerTxt.SetTextf("%u%s", i,LANGUAGE.secondsleft);
|
timerTxt.SetTextf("%u %s", i,LANGUAGE.secondsleft);
|
||||||
VIDEO_WaitVSync();
|
VIDEO_WaitVSync();
|
||||||
if(Settings.cios == ios222) {
|
if(Settings.cios == ios222) {
|
||||||
ret = IOS_ReloadIOS(222);
|
ret = IOS_ReloadIOS(222);
|
||||||
@ -1599,7 +1599,7 @@ FormatingPartition(const char *title, partitionEntry *entry)
|
|||||||
dialogBoxImg.SetWidescreen(CFG.widescreen);
|
dialogBoxImg.SetWidescreen(CFG.widescreen);
|
||||||
}
|
}
|
||||||
|
|
||||||
GuiText titleTxt(title, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255});
|
GuiText titleTxt(title, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
|
||||||
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
||||||
titleTxt.SetPosition(0,60);
|
titleTxt.SetPosition(0,60);
|
||||||
|
|
||||||
@ -1657,16 +1657,16 @@ int NetworkInitPromp(int choice2)
|
|||||||
dialogBoxImg.SetWidescreen(CFG.widescreen);
|
dialogBoxImg.SetWidescreen(CFG.widescreen);
|
||||||
}
|
}
|
||||||
|
|
||||||
GuiText titleTxt(LANGUAGE.InitializingNetwork, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255});
|
GuiText titleTxt(LANGUAGE.InitializingNetwork, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
|
||||||
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
||||||
titleTxt.SetPosition(0,60);
|
titleTxt.SetPosition(0,60);
|
||||||
|
|
||||||
char msg[20] = " ";
|
char msg[20] = " ";
|
||||||
GuiText msgTxt(msg, 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255});
|
GuiText msgTxt(msg, 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
|
||||||
msgTxt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
|
msgTxt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
|
||||||
msgTxt.SetPosition(0,-40);
|
msgTxt.SetPosition(0,-40);
|
||||||
|
|
||||||
GuiText btn1Txt(LANGUAGE.Cancel, 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255});
|
GuiText btn1Txt(LANGUAGE.Cancel, 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
|
||||||
GuiImage btn1Img(&btnOutline);
|
GuiImage btn1Img(&btnOutline);
|
||||||
if (Settings.wsprompt == yes){
|
if (Settings.wsprompt == yes){
|
||||||
btn1Txt.SetWidescreen(CFG.widescreen);
|
btn1Txt.SetWidescreen(CFG.widescreen);
|
||||||
@ -1869,14 +1869,14 @@ ProgressWindow(const char *title, const char *msg)
|
|||||||
progressbarImg.SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
|
progressbarImg.SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
|
||||||
progressbarImg.SetPosition(25, 40);
|
progressbarImg.SetPosition(25, 40);
|
||||||
|
|
||||||
GuiText titleTxt(title, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255});
|
GuiText titleTxt(title, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
|
||||||
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
||||||
titleTxt.SetPosition(0,60);
|
titleTxt.SetPosition(0,60);
|
||||||
GuiText msgTxt(msg, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255});
|
GuiText msgTxt(msg, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
|
||||||
msgTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
msgTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
||||||
msgTxt.SetPosition(0,120);
|
msgTxt.SetPosition(0,120);
|
||||||
|
|
||||||
GuiText prsTxt("%", 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255});
|
GuiText prsTxt("%", 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
|
||||||
prsTxt.SetAlignment(ALIGN_RIGHT, ALIGN_MIDDLE);
|
prsTxt.SetAlignment(ALIGN_RIGHT, ALIGN_MIDDLE);
|
||||||
prsTxt.SetPosition(-188,40);
|
prsTxt.SetPosition(-188,40);
|
||||||
|
|
||||||
@ -1989,22 +1989,22 @@ ProgressDownloadWindow(int choice2)
|
|||||||
progressbarImg.SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
|
progressbarImg.SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
|
||||||
progressbarImg.SetPosition(25, 40);
|
progressbarImg.SetPosition(25, 40);
|
||||||
|
|
||||||
GuiText titleTxt(LANGUAGE.Downloadingfile, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255});
|
GuiText titleTxt(LANGUAGE.Downloadingfile, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
|
||||||
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
||||||
titleTxt.SetPosition(0,60);
|
titleTxt.SetPosition(0,60);
|
||||||
|
|
||||||
GuiText msgTxt(NULL, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255});
|
GuiText msgTxt(NULL, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
|
||||||
msgTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
msgTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
||||||
msgTxt.SetPosition(0,130);
|
msgTxt.SetPosition(0,130);
|
||||||
|
|
||||||
GuiText msg2Txt(NULL, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255});
|
GuiText msg2Txt(NULL, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
|
||||||
msg2Txt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
msg2Txt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
||||||
msg2Txt.SetPosition(0,100);
|
msg2Txt.SetPosition(0,100);
|
||||||
|
|
||||||
prTxt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
|
prTxt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
|
||||||
prTxt.SetPosition(0, 40);
|
prTxt.SetPosition(0, 40);
|
||||||
|
|
||||||
GuiText btn1Txt(LANGUAGE.Cancel, 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255});
|
GuiText btn1Txt(LANGUAGE.Cancel, 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
|
||||||
GuiImage btn1Img(&btnOutline);
|
GuiImage btn1Img(&btnOutline);
|
||||||
if (Settings.wsprompt == yes){
|
if (Settings.wsprompt == yes){
|
||||||
btn1Txt.SetWidescreen(CFG.widescreen);
|
btn1Txt.SetWidescreen(CFG.widescreen);
|
||||||
@ -2060,14 +2060,19 @@ ProgressDownloadWindow(int choice2)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
while (i < cntMissFiles) {
|
while (i < cntMissFiles)
|
||||||
|
{
|
||||||
|
|
||||||
prTxt.SetTextf("%i%%", 100*i/cntMissFiles);
|
prTxt.SetTextf("%i%%", 100*i/cntMissFiles);
|
||||||
|
|
||||||
if ((Settings.wsprompt == yes) && (CFG.widescreen)){/////////////adjust for widescreen
|
if ((Settings.wsprompt == yes) && (CFG.widescreen))
|
||||||
|
{
|
||||||
|
//adjust for widescreen
|
||||||
progressbarImg.SetPosition(80,40);
|
progressbarImg.SetPosition(80,40);
|
||||||
progressbarImg.SetTile(80*i/cntMissFiles);
|
progressbarImg.SetTile(80*i/cntMissFiles);
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
progressbarImg.SetTile(100*i/cntMissFiles);
|
progressbarImg.SetTile(100*i/cntMissFiles);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2077,15 +2082,18 @@ ProgressDownloadWindow(int choice2)
|
|||||||
//download boxart image
|
//download boxart image
|
||||||
char imgPath[100];
|
char imgPath[100];
|
||||||
char URLFile[100];
|
char URLFile[100];
|
||||||
if (choice2 == 2) {
|
if (choice2 == 2)
|
||||||
|
{
|
||||||
sprintf(URLFile,"http://www.theotherzone.com/wii/3d/176/248/%s",missingFiles[i]); // For 3D Covers
|
sprintf(URLFile,"http://www.theotherzone.com/wii/3d/176/248/%s",missingFiles[i]); // For 3D Covers
|
||||||
sprintf(imgPath,"%s%s", CFG.covers_path, missingFiles[i]);
|
sprintf(imgPath,"%s%s", CFG.covers_path, missingFiles[i]);
|
||||||
}
|
}
|
||||||
if(choice2 == 3) {
|
if(choice2 == 3)
|
||||||
|
{
|
||||||
sprintf(URLFile,"http://www.theotherzone.com/wii/diskart/160/160/%s",missingFiles[i]);
|
sprintf(URLFile,"http://www.theotherzone.com/wii/diskart/160/160/%s",missingFiles[i]);
|
||||||
sprintf(imgPath,"%s%s", CFG.disc_path, missingFiles[i]);
|
sprintf(imgPath,"%s%s", CFG.disc_path, missingFiles[i]);
|
||||||
}
|
}
|
||||||
if(choice2 == 1) {
|
if(choice2 == 1)
|
||||||
|
{
|
||||||
sprintf(URLFile,"http://www.theotherzone.com/wii/resize/160/224/%s",missingFiles[i]);
|
sprintf(URLFile,"http://www.theotherzone.com/wii/resize/160/224/%s",missingFiles[i]);
|
||||||
sprintf(imgPath,"%s%s", CFG.covers_path, missingFiles[i]);
|
sprintf(imgPath,"%s%s", CFG.covers_path, missingFiles[i]);
|
||||||
}
|
}
|
||||||
@ -2095,29 +2103,32 @@ ProgressDownloadWindow(int choice2)
|
|||||||
if (file.size == 36864 || file.size <= 1024 || file.size == 7386 || file.data == NULL) {
|
if (file.size == 36864 || file.size <= 1024 || file.size == 7386 || file.data == NULL) {
|
||||||
cntNotFound++;
|
cntNotFound++;
|
||||||
i++;
|
i++;
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
if(file.data != NULL)
|
if(file.data != NULL)
|
||||||
{
|
{
|
||||||
// save png to sd card
|
// save png to sd card
|
||||||
FILE *pfile;
|
FILE *pfile=NULL;
|
||||||
pfile = fopen(imgPath, "wb");
|
if((pfile = fopen(imgPath, "wb"))!=NULL)
|
||||||
|
{
|
||||||
fwrite(file.data,1,file.size,pfile);
|
fwrite(file.data,1,file.size,pfile);
|
||||||
fclose (pfile);
|
fclose (pfile);
|
||||||
|
}
|
||||||
free(file.data);
|
free(file.data);
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(btn1.GetState() == STATE_CLICKED) {
|
if(btn1.GetState() == STATE_CLICKED)
|
||||||
|
{
|
||||||
cntNotFound = cntMissFiles-i+cntNotFound;
|
cntNotFound = cntMissFiles-i+cntNotFound;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**Temporary redownloading 1st image because of a fucking corruption bug **/
|
/**Temporary redownloading 1st image because of a fucking corruption bug **/
|
||||||
|
/*
|
||||||
char URLFile[100];
|
char URLFile[100];
|
||||||
if (choice2 == 2) {
|
if (choice2 == 2) {
|
||||||
sprintf(URLFile,"http://www.theotherzone.com/wii/3d/176/248/%s",missingFiles[0]); // For 3D Covers
|
sprintf(URLFile,"http://www.theotherzone.com/wii/3d/176/248/%s",missingFiles[0]); // For 3D Covers
|
||||||
@ -2146,7 +2157,7 @@ ProgressDownloadWindow(int choice2)
|
|||||||
free(file.data);
|
free(file.data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
HaltGui();
|
HaltGui();
|
||||||
mainWindow->Remove(&promptWindow);
|
mainWindow->Remove(&promptWindow);
|
||||||
@ -2218,23 +2229,23 @@ ProgressUpdateWindow()
|
|||||||
|
|
||||||
char title[50];
|
char title[50];
|
||||||
sprintf(title, "%s", LANGUAGE.CheckingforUpdates);
|
sprintf(title, "%s", LANGUAGE.CheckingforUpdates);
|
||||||
GuiText titleTxt(title, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255});
|
GuiText titleTxt(title, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
|
||||||
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
||||||
titleTxt.SetPosition(0,50);
|
titleTxt.SetPosition(0,50);
|
||||||
char msg[50];
|
char msg[50];
|
||||||
sprintf(msg, "%s", LANGUAGE.InitializingNetwork);
|
sprintf(msg, "%s", LANGUAGE.InitializingNetwork);
|
||||||
GuiText msgTxt(msg, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255});
|
GuiText msgTxt(msg, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
|
||||||
msgTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
msgTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
||||||
msgTxt.SetPosition(0,140);
|
msgTxt.SetPosition(0,140);
|
||||||
char msg2[50] = " ";
|
char msg2[50] = " ";
|
||||||
GuiText msg2Txt(msg2, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255});
|
GuiText msg2Txt(msg2, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
|
||||||
msg2Txt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
|
msg2Txt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
|
||||||
msg2Txt.SetPosition(0, 50);
|
msg2Txt.SetPosition(0, 50);
|
||||||
|
|
||||||
prTxt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
|
prTxt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
|
||||||
prTxt.SetPosition(0, 7);
|
prTxt.SetPosition(0, 7);
|
||||||
|
|
||||||
GuiText btn1Txt(LANGUAGE.Cancel, 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255});
|
GuiText btn1Txt(LANGUAGE.Cancel, 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
|
||||||
GuiImage btn1Img(&btnOutline);
|
GuiImage btn1Img(&btnOutline);
|
||||||
if (Settings.wsprompt == yes){
|
if (Settings.wsprompt == yes){
|
||||||
btn1Txt.SetWidescreen(CFG.widescreen);
|
btn1Txt.SetWidescreen(CFG.widescreen);
|
||||||
@ -2314,10 +2325,10 @@ ProgressUpdateWindow()
|
|||||||
int revnumber = 0;
|
int revnumber = 0;
|
||||||
int currentrev = atoi(SVN_REV);
|
int currentrev = atoi(SVN_REV);
|
||||||
|
|
||||||
SDCard_deInit();
|
/// SDCard_deInit();
|
||||||
struct block file = downloadfile("http://www.techjawa.com/usbloadergx/rev.txt");
|
struct block file = downloadfile("http://www.techjawa.com/usbloadergx/rev.txt");
|
||||||
FILE *pfile;
|
FILE *pfile;
|
||||||
SDCard_Init();
|
/// SDCard_Init();
|
||||||
|
|
||||||
if(file.data != NULL)
|
if(file.data != NULL)
|
||||||
{
|
{
|
||||||
@ -2442,9 +2453,7 @@ ProgressUpdateWindow()
|
|||||||
|
|
||||||
if(!failed && ret >= 0) {
|
if(!failed && ret >= 0) {
|
||||||
WindowPrompt(LANGUAGE.Successfullyupdated , LANGUAGE.Restarting, LANGUAGE.ok, 0, 0, 0);
|
WindowPrompt(LANGUAGE.Successfullyupdated , LANGUAGE.Restarting, LANGUAGE.ok, 0, 0, 0);
|
||||||
ExitApp();
|
Sys_BackToLoader();
|
||||||
if (*((u32*) 0x80001800)) exit(0);
|
|
||||||
SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
promptWindow.SetEffect(EFFECT_SLIDE_TOP | EFFECT_SLIDE_OUT, 50);
|
promptWindow.SetEffect(EFFECT_SLIDE_TOP | EFFECT_SLIDE_OUT, 50);
|
||||||
@ -2514,13 +2523,14 @@ UpdateGUI (void *arg)
|
|||||||
|
|
||||||
if(ExitRequested)
|
if(ExitRequested)
|
||||||
{
|
{
|
||||||
for(int a = 0; a < 255; a += 15)
|
for(int a = 5; a < 255; a += 10)
|
||||||
{
|
{
|
||||||
mainWindow->Draw();
|
mainWindow->Draw();
|
||||||
Menu_DrawRectangle(0,0,screenwidth,screenheight,(GXColor){0, 0, 0, a},1);
|
Menu_DrawRectangle(0,0,screenwidth,screenheight,(GXColor){0, 0, 0, a},1);
|
||||||
Menu_Render();
|
Menu_Render();
|
||||||
}
|
}
|
||||||
ExitApp();
|
ShutoffRumble();
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2537,7 +2547,12 @@ InitGUIThreads()
|
|||||||
{
|
{
|
||||||
LWP_CreateThread (&guithread, UpdateGUI, NULL, NULL, 0, 70);
|
LWP_CreateThread (&guithread, UpdateGUI, NULL, NULL, 0, 70);
|
||||||
}
|
}
|
||||||
|
void
|
||||||
|
ExitGUIThreads()
|
||||||
|
{
|
||||||
|
ExitRequested = 1;
|
||||||
|
LWP_JoinThread(guithread, NULL);
|
||||||
|
}
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* EntryCmp
|
* EntryCmp
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
@ -2732,7 +2747,7 @@ static int OnScreenKeyboard(char * var, u32 maxlen, int min)
|
|||||||
GuiTrigger trigB;
|
GuiTrigger trigB;
|
||||||
trigB.SetSimpleTrigger(-1, WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B, PAD_BUTTON_B);
|
trigB.SetSimpleTrigger(-1, WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B, PAD_BUTTON_B);
|
||||||
|
|
||||||
GuiText okBtnTxt(LANGUAGE.ok, 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255});
|
GuiText okBtnTxt(LANGUAGE.ok, 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
|
||||||
GuiImage okBtnImg(&btnOutline);
|
GuiImage okBtnImg(&btnOutline);
|
||||||
if (Settings.wsprompt == yes){
|
if (Settings.wsprompt == yes){
|
||||||
okBtnTxt.SetWidescreen(CFG.widescreen);
|
okBtnTxt.SetWidescreen(CFG.widescreen);
|
||||||
@ -2740,7 +2755,7 @@ static int OnScreenKeyboard(char * var, u32 maxlen, int min)
|
|||||||
}
|
}
|
||||||
GuiButton okBtn(&okBtnImg,&okBtnImg, 0, 4, 5, 15, &trigA, &btnSoundOver, &btnClick,1);
|
GuiButton okBtn(&okBtnImg,&okBtnImg, 0, 4, 5, 15, &trigA, &btnSoundOver, &btnClick,1);
|
||||||
okBtn.SetLabel(&okBtnTxt);
|
okBtn.SetLabel(&okBtnTxt);
|
||||||
GuiText cancelBtnTxt(LANGUAGE.Cancel, 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255});
|
GuiText cancelBtnTxt(LANGUAGE.Cancel, 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
|
||||||
GuiImage cancelBtnImg(&btnOutline);
|
GuiImage cancelBtnImg(&btnOutline);
|
||||||
if (Settings.wsprompt == yes){
|
if (Settings.wsprompt == yes){
|
||||||
cancelBtnTxt.SetWidescreen(CFG.widescreen);
|
cancelBtnTxt.SetWidescreen(CFG.widescreen);
|
||||||
@ -2949,8 +2964,8 @@ static int MenuInstall()
|
|||||||
|
|
||||||
mainWindow->Remove(&w);
|
mainWindow->Remove(&w);
|
||||||
ResumeGui();
|
ResumeGui();
|
||||||
SDCard_deInit();
|
/// SDCard_deInit();
|
||||||
SDCard_Init();
|
/// SDCard_Init();
|
||||||
return menu;
|
return menu;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3371,22 +3386,9 @@ static int MenuDiscList()
|
|||||||
choice = WindowPrompt(LANGUAGE.HowtoShutdown,0,LANGUAGE.FullShutdown, LANGUAGE.ShutdowntoIdle, LANGUAGE.Cancel,0);
|
choice = WindowPrompt(LANGUAGE.HowtoShutdown,0,LANGUAGE.FullShutdown, LANGUAGE.ShutdowntoIdle, LANGUAGE.Cancel,0);
|
||||||
if(choice == 2)
|
if(choice == 2)
|
||||||
{
|
{
|
||||||
WPAD_Flush(0);
|
Sys_ShutdownToIdel();
|
||||||
WPAD_Disconnect(0);
|
|
||||||
WPAD_Shutdown();
|
|
||||||
|
|
||||||
/* Set LED mode */
|
|
||||||
ret = CONF_GetIdleLedMode();
|
|
||||||
if(ret >= 0 && ret <= 2)
|
|
||||||
STM_SetLedMode(ret);
|
|
||||||
|
|
||||||
STM_ShutdownToIdle();
|
|
||||||
|
|
||||||
} else if(choice == 1) {
|
} else if(choice == 1) {
|
||||||
WPAD_Flush(0);
|
Sys_ShutdownToStandby();
|
||||||
WPAD_Disconnect(0);
|
|
||||||
WPAD_Shutdown();
|
|
||||||
STM_ShutdownToStandby();
|
|
||||||
} else {
|
} else {
|
||||||
poweroffBtn.ResetState();
|
poweroffBtn.ResetState();
|
||||||
if (Settings.gameDisplay==list){gameBrowser.SetFocus(1);}
|
if (Settings.gameDisplay==list){gameBrowser.SetFocus(1);}
|
||||||
@ -3410,15 +3412,11 @@ static int MenuDiscList()
|
|||||||
|
|
||||||
if(choice == 3)
|
if(choice == 3)
|
||||||
{
|
{
|
||||||
ExitApp();
|
Sys_LoadMenu(); // Back to System Menu
|
||||||
SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0); // Back to System Menu
|
|
||||||
}
|
}
|
||||||
else if (choice == 2)
|
else if (choice == 2)
|
||||||
{
|
{
|
||||||
ExitApp();
|
Sys_BackToLoader();
|
||||||
if (*((u32*) 0x80001800)) exit(0);
|
|
||||||
// Channel Version
|
|
||||||
SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);
|
|
||||||
} else {
|
} else {
|
||||||
homeBtn.ResetState();
|
homeBtn.ResetState();
|
||||||
if (Settings.gameDisplay==list){gameBrowser.SetFocus(1);}
|
if (Settings.gameDisplay==list){gameBrowser.SetFocus(1);}
|
||||||
@ -3995,28 +3993,22 @@ static int MenuDiscList()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if we have used the network or cios222 we need to reload the disklist
|
// if we have used the network or cios222 we need to reload the disklist
|
||||||
if(networkisinitialized == 1 || ios2 == 1 || Settings.cios == ios222) {
|
if(networkisinitialized == 1 || ios2 == 1 || Settings.cios == ios222)
|
||||||
|
{
|
||||||
|
if(ios2 == 1)
|
||||||
if(ios2 == 1) {
|
{
|
||||||
|
|
||||||
ret = Sys_IosReload(222);
|
ret = Sys_IosReload(222);
|
||||||
|
|
||||||
if(ret < 0) {
|
if(ret < 0)
|
||||||
Wpad_Init();
|
{
|
||||||
WPAD_SetDataFormat(WPAD_CHAN_ALL,WPAD_FMT_BTNS_ACC_IR);
|
|
||||||
WPAD_SetVRes(WPAD_CHAN_ALL, screenwidth, screenheight);
|
|
||||||
|
|
||||||
WindowPrompt(LANGUAGE.YoudonthavecIOS,LANGUAGE.LoadingincIOS,LANGUAGE.ok, 0,0,0);
|
WindowPrompt(LANGUAGE.YoudonthavecIOS,LANGUAGE.LoadingincIOS,LANGUAGE.ok, 0,0,0);
|
||||||
|
|
||||||
Sys_IosReload(249);
|
Sys_IosReload(249);
|
||||||
ios2 = 0;
|
ios2 = 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
else
|
||||||
|
{
|
||||||
ret = Sys_IosReload(249);
|
ret = Sys_IosReload(249);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4089,28 +4081,21 @@ static int MenuDiscList()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if we have used the network or cios222 we need to reload the disklist
|
// if we have used the network or cios222 we need to reload the disklist
|
||||||
if(networkisinitialized == 1 || ios2 == 1 || Settings.cios == ios222) {
|
if(networkisinitialized == 1 || ios2 == 1 || Settings.cios == ios222)
|
||||||
|
{
|
||||||
|
if(ios2 == 1)
|
||||||
if(ios2 == 1) {
|
{
|
||||||
|
|
||||||
ret = Sys_IosReload(222);
|
ret = Sys_IosReload(222);
|
||||||
|
if(ret < 0)
|
||||||
if(ret < 0) {
|
{
|
||||||
Wpad_Init();
|
|
||||||
WPAD_SetDataFormat(WPAD_CHAN_ALL,WPAD_FMT_BTNS_ACC_IR);
|
|
||||||
WPAD_SetVRes(WPAD_CHAN_ALL, screenwidth, screenheight);
|
|
||||||
|
|
||||||
WindowPrompt(LANGUAGE.YoudonthavecIOS,LANGUAGE.LoadingincIOS,LANGUAGE.ok, 0,0,0);
|
WindowPrompt(LANGUAGE.YoudonthavecIOS,LANGUAGE.LoadingincIOS,LANGUAGE.ok, 0,0,0);
|
||||||
|
|
||||||
Sys_IosReload(249);
|
Sys_IosReload(249);
|
||||||
ios2 = 0;
|
ios2 = 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
else
|
||||||
|
{
|
||||||
ret = Sys_IosReload(249);
|
ret = Sys_IosReload(249);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4191,6 +4176,7 @@ static int MenuDiscList()
|
|||||||
|
|
||||||
static int MenuFormat()
|
static int MenuFormat()
|
||||||
{
|
{
|
||||||
|
USBDevice_deInit();
|
||||||
int menu = MENU_NONE;
|
int menu = MENU_NONE;
|
||||||
char imgPath[100];
|
char imgPath[100];
|
||||||
|
|
||||||
@ -4386,9 +4372,6 @@ static int MenuFormat()
|
|||||||
choice = WindowPrompt (LANGUAGE.ShutdownSystem,LANGUAGE.Areyousure,LANGUAGE.Yes,LANGUAGE.No,0,0);
|
choice = WindowPrompt (LANGUAGE.ShutdownSystem,LANGUAGE.Areyousure,LANGUAGE.Yes,LANGUAGE.No,0,0);
|
||||||
if(choice == 1)
|
if(choice == 1)
|
||||||
{
|
{
|
||||||
WPAD_Flush(0);
|
|
||||||
WPAD_Disconnect(0);
|
|
||||||
WPAD_Shutdown();
|
|
||||||
Sys_Shutdown();
|
Sys_Shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4397,8 +4380,7 @@ static int MenuFormat()
|
|||||||
choice = WindowPrompt (LANGUAGE.ReturntoWiiMenu,LANGUAGE.Areyousure,LANGUAGE.Yes,LANGUAGE.No,0,0);
|
choice = WindowPrompt (LANGUAGE.ReturntoWiiMenu,LANGUAGE.Areyousure,LANGUAGE.Yes,LANGUAGE.No,0,0);
|
||||||
if(choice == 1)
|
if(choice == 1)
|
||||||
{
|
{
|
||||||
ExitApp();
|
Sys_LoadMenu();
|
||||||
SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4419,6 +4401,7 @@ static int MenuFormat()
|
|||||||
mainWindow->Remove(&optionBrowser);
|
mainWindow->Remove(&optionBrowser);
|
||||||
mainWindow->Remove(&w);
|
mainWindow->Remove(&w);
|
||||||
ResumeGui();
|
ResumeGui();
|
||||||
|
USBDevice_Init();
|
||||||
return menu;
|
return menu;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4474,7 +4457,7 @@ static int MenuSettings()
|
|||||||
settingsbackgroundbtn.SetPosition(0, 0);
|
settingsbackgroundbtn.SetPosition(0, 0);
|
||||||
settingsbackgroundbtn.SetImage(&settingsbackground);
|
settingsbackgroundbtn.SetImage(&settingsbackground);
|
||||||
|
|
||||||
GuiText backBtnTxt(LANGUAGE.Back , 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255});
|
GuiText backBtnTxt(LANGUAGE.Back , 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
|
||||||
backBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30);
|
backBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30);
|
||||||
GuiImage backBtnImg(&btnOutline);
|
GuiImage backBtnImg(&btnOutline);
|
||||||
if (Settings.wsprompt == yes){
|
if (Settings.wsprompt == yes){
|
||||||
@ -5420,15 +5403,11 @@ static int MenuSettings()
|
|||||||
|
|
||||||
if(choice == 3)
|
if(choice == 3)
|
||||||
{
|
{
|
||||||
ExitApp();
|
Sys_LoadMenu(); // Back to System Menu
|
||||||
SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0); // Back to System Menu
|
|
||||||
}
|
}
|
||||||
else if (choice == 2)
|
else if (choice == 2)
|
||||||
{
|
{
|
||||||
ExitApp();
|
Sys_BackToLoader();
|
||||||
if (*((u32*) 0x80001800)) exit(0);
|
|
||||||
// Channel Version
|
|
||||||
SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -5514,7 +5493,7 @@ int GameSettings(struct discHdr * header)
|
|||||||
settingsbackgroundbtn.SetPosition(0, 0);
|
settingsbackgroundbtn.SetPosition(0, 0);
|
||||||
settingsbackgroundbtn.SetImage(&settingsbackground);
|
settingsbackgroundbtn.SetImage(&settingsbackground);
|
||||||
|
|
||||||
GuiText saveBtnTxt(LANGUAGE.Save, 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255});
|
GuiText saveBtnTxt(LANGUAGE.Save, 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
|
||||||
saveBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30);
|
saveBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30);
|
||||||
GuiImage saveBtnImg(&btnOutline);
|
GuiImage saveBtnImg(&btnOutline);
|
||||||
if (Settings.wsprompt == yes){
|
if (Settings.wsprompt == yes){
|
||||||
@ -5524,7 +5503,7 @@ int GameSettings(struct discHdr * header)
|
|||||||
saveBtn.SetScale(0.9);
|
saveBtn.SetScale(0.9);
|
||||||
saveBtn.SetLabel(&saveBtnTxt);
|
saveBtn.SetLabel(&saveBtnTxt);
|
||||||
|
|
||||||
GuiText cancelBtnTxt(LANGUAGE.Back, 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255});
|
GuiText cancelBtnTxt(LANGUAGE.Back, 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
|
||||||
cancelBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30);
|
cancelBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30);
|
||||||
GuiImage cancelBtnImg(&btnOutline);
|
GuiImage cancelBtnImg(&btnOutline);
|
||||||
if (Settings.wsprompt == yes){
|
if (Settings.wsprompt == yes){
|
||||||
@ -5535,7 +5514,7 @@ int GameSettings(struct discHdr * header)
|
|||||||
cancelBtn.SetLabel(&cancelBtnTxt);
|
cancelBtn.SetLabel(&cancelBtnTxt);
|
||||||
cancelBtn.SetTrigger(&trigB);
|
cancelBtn.SetTrigger(&trigB);
|
||||||
|
|
||||||
GuiText deleteBtnTxt(LANGUAGE.Uninstall, 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255});
|
GuiText deleteBtnTxt(LANGUAGE.Uninstall, 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
|
||||||
deleteBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30);
|
deleteBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30);
|
||||||
GuiImage deleteBtnImg(&btnOutline);
|
GuiImage deleteBtnImg(&btnOutline);
|
||||||
if (Settings.wsprompt == yes){
|
if (Settings.wsprompt == yes){
|
||||||
@ -5752,7 +5731,7 @@ static int MenuCheck()
|
|||||||
int menu = MENU_NONE;
|
int menu = MENU_NONE;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
int choice;
|
int choice;
|
||||||
s32 ret2;
|
s32 ret, ret2;
|
||||||
OptionList options;
|
OptionList options;
|
||||||
options.length = i;
|
options.length = i;
|
||||||
partitionEntry partitions[MAX_PARTITIONS];
|
partitionEntry partitions[MAX_PARTITIONS];
|
||||||
@ -5762,87 +5741,92 @@ static int MenuCheck()
|
|||||||
ret2 = WBFS_Init(WBFS_DEVICE_USB);
|
ret2 = WBFS_Init(WBFS_DEVICE_USB);
|
||||||
if (ret2 < 0)
|
if (ret2 < 0)
|
||||||
{
|
{
|
||||||
//initialize WiiMote for Prompt
|
|
||||||
Wpad_Init();
|
|
||||||
WPAD_SetDataFormat(WPAD_CHAN_ALL,WPAD_FMT_BTNS_ACC_IR);
|
|
||||||
WPAD_SetVRes(WPAD_CHAN_ALL, screenwidth, screenheight);
|
|
||||||
ret2 = WindowPrompt(LANGUAGE.NoUSBDevicefound,
|
ret2 = WindowPrompt(LANGUAGE.NoUSBDevicefound,
|
||||||
LANGUAGE.Doyouwanttoretryfor30secs,
|
LANGUAGE.Doyouwanttoretryfor30secs,
|
||||||
"cIOS249", "cIOS222",
|
"cIOS249", "cIOS222",
|
||||||
LANGUAGE.BacktoWiiMenu, 0);
|
LANGUAGE.BacktoWiiMenu, 0);
|
||||||
//shutdown SD
|
|
||||||
SDCard_deInit();
|
|
||||||
if(ret2 == 1) {
|
if(ret2 == 1) {
|
||||||
Settings.cios = ios249;
|
Settings.cios = ios249;
|
||||||
} else if(ret2 == 2) {
|
} else if(ret2 == 2) {
|
||||||
Settings.cios = ios222;
|
if(Settings.cios != ios222)
|
||||||
} else {
|
{
|
||||||
ExitApp();
|
|
||||||
SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);
|
|
||||||
}
|
|
||||||
//shutdown WiiMote before IOS Reload
|
//shutdown WiiMote before IOS Reload
|
||||||
WPAD_Flush(0);
|
WPAD_Flush(0);
|
||||||
WPAD_Disconnect(0);
|
WPAD_Disconnect(0);
|
||||||
WPAD_Shutdown();
|
WPAD_Shutdown();
|
||||||
|
|
||||||
SDCard_Init();
|
//shutdown SD and USB before IOS Reload
|
||||||
ret2 = DiscWait(LANGUAGE.NoUSBDevice, LANGUAGE.WaitingforUSBDevice, 0, 0, 1);
|
SDCard_deInit();
|
||||||
|
USBDevice_deInit();
|
||||||
|
ret = IOS_ReloadIOS(222);
|
||||||
|
if(ret < 0)
|
||||||
|
IOS_ReloadIOS(249);
|
||||||
|
//reinitialize WiiMote for Prompt
|
||||||
PAD_Init();
|
PAD_Init();
|
||||||
Wpad_Init();
|
Wpad_Init();
|
||||||
WPAD_SetDataFormat(WPAD_CHAN_ALL,WPAD_FMT_BTNS_ACC_IR);
|
WPAD_SetDataFormat(WPAD_CHAN_ALL,WPAD_FMT_BTNS_ACC_IR);
|
||||||
WPAD_SetVRes(WPAD_CHAN_ALL, screenwidth, screenheight);
|
WPAD_SetVRes(WPAD_CHAN_ALL, screenwidth, screenheight);
|
||||||
|
//reinitialize SD and USB
|
||||||
SDCard_Init();
|
SDCard_Init();
|
||||||
|
USBDevice_Init();
|
||||||
|
if(ret < 0)
|
||||||
|
WindowPrompt(LANGUAGE.YoudonthavecIOS,LANGUAGE.LoadingincIOS,LANGUAGE.ok, 0,0,0);
|
||||||
|
else
|
||||||
|
Settings.cios = ios222;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Sys_LoadMenu();
|
||||||
|
}
|
||||||
|
|
||||||
|
//shutdown WiiMote before IOS Reload
|
||||||
|
WPAD_Flush(0);
|
||||||
|
WPAD_Disconnect(0);
|
||||||
|
WPAD_Shutdown();
|
||||||
|
|
||||||
|
//shutdown SD and USB before IOS Reload in DiscWait
|
||||||
|
SDCard_deInit();
|
||||||
|
USBDevice_deInit();
|
||||||
|
|
||||||
|
ret2 = DiscWait(LANGUAGE.NoUSBDevice, LANGUAGE.WaitingforUSBDevice, 0, 0, 1);
|
||||||
|
//reinitialize WiiMote for Prompt
|
||||||
|
PAD_Init();
|
||||||
|
Wpad_Init();
|
||||||
|
WPAD_SetDataFormat(WPAD_CHAN_ALL,WPAD_FMT_BTNS_ACC_IR);
|
||||||
|
WPAD_SetVRes(WPAD_CHAN_ALL, screenwidth, screenheight);
|
||||||
|
//reinitialize SD and USB
|
||||||
|
SDCard_Init();
|
||||||
|
USBDevice_Init();
|
||||||
}
|
}
|
||||||
if (ret2 < 0) {
|
if (ret2 < 0) {
|
||||||
SDCard_Init();
|
|
||||||
WindowPrompt (LANGUAGE.Error,LANGUAGE.USBDevicenotfound, LANGUAGE.ok, 0,0,0);
|
WindowPrompt (LANGUAGE.Error,LANGUAGE.USBDevicenotfound, LANGUAGE.ok, 0,0,0);
|
||||||
SDCard_deInit();
|
Sys_LoadMenu();
|
||||||
ExitApp();
|
|
||||||
SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);
|
|
||||||
} else {
|
|
||||||
PAD_Init();
|
|
||||||
Wpad_Init();
|
|
||||||
WPAD_SetDataFormat(WPAD_CHAN_ALL,WPAD_FMT_BTNS_ACC_IR);
|
|
||||||
WPAD_SetVRes(WPAD_CHAN_ALL, screenwidth, screenheight);
|
|
||||||
SDCard_Init();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ret2 = Disc_Init();
|
ret2 = Disc_Init();
|
||||||
if (ret2 < 0) {
|
if (ret2 < 0) {
|
||||||
SDCard_Init();
|
|
||||||
WindowPrompt (LANGUAGE.Error,LANGUAGE.CouldnotinitializeDIPmodule,LANGUAGE.ok, 0,0,0);
|
WindowPrompt (LANGUAGE.Error,LANGUAGE.CouldnotinitializeDIPmodule,LANGUAGE.ok, 0,0,0);
|
||||||
SDCard_deInit();
|
Sys_LoadMenu();
|
||||||
ExitApp();
|
|
||||||
SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ret2 = WBFS_Open();
|
ret2 = WBFS_Open();
|
||||||
if (ret2 < 0) {
|
if (ret2 < 0) {
|
||||||
SDCard_Init();
|
|
||||||
choice = WindowPrompt(LANGUAGE.NoWBFSpartitionfound,
|
choice = WindowPrompt(LANGUAGE.NoWBFSpartitionfound,
|
||||||
LANGUAGE.Youneedtoformatapartition,
|
LANGUAGE.Youneedtoformatapartition,
|
||||||
LANGUAGE.Format,
|
LANGUAGE.Format,
|
||||||
LANGUAGE.Return,0,0);
|
LANGUAGE.Return,0,0);
|
||||||
SDCard_deInit();
|
|
||||||
if(choice == 0)
|
if(choice == 0)
|
||||||
{
|
{
|
||||||
ExitApp();
|
Sys_LoadMenu();
|
||||||
SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
/* Get partition entries */
|
/* Get partition entries */
|
||||||
u32 sector_size;
|
u32 sector_size;
|
||||||
ret2 = Partition_GetEntries(partitions, §or_size);
|
ret2 = Partition_GetEntries(partitions, §or_size);
|
||||||
if (ret2 < 0) {
|
if (ret2 < 0) {
|
||||||
SDCard_Init();
|
|
||||||
WindowPrompt (LANGUAGE.Nopartitionsfound,0, LANGUAGE.Restart, 0,0,0);
|
WindowPrompt (LANGUAGE.Nopartitionsfound,0, LANGUAGE.Restart, 0,0,0);
|
||||||
SDCard_deInit();
|
Sys_LoadMenu();
|
||||||
ExitApp();
|
|
||||||
SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
menu = MENU_FORMAT;
|
menu = MENU_FORMAT;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6302,6 +6286,7 @@ int MainMenu(int menu)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ExitGUIThreads();
|
||||||
|
|
||||||
|
|
||||||
bgMusic->Stop();
|
bgMusic->Stop();
|
||||||
@ -6319,7 +6304,11 @@ int MainMenu(int menu)
|
|||||||
delete cover;
|
delete cover;
|
||||||
delete coverImg;
|
delete coverImg;
|
||||||
|
|
||||||
ExitApp();
|
StopGX();
|
||||||
|
ShutdownAudio();
|
||||||
|
|
||||||
|
SDCard_deInit();
|
||||||
|
USBDevice_deInit();
|
||||||
|
|
||||||
struct discHdr *header = &gameList[gameSelected];
|
struct discHdr *header = &gameList[gameSelected];
|
||||||
struct Game_CFG* game_cfg = CFG_get_game_opt(header->id);
|
struct Game_CFG* game_cfg = CFG_get_game_opt(header->id);
|
||||||
@ -6461,8 +6450,7 @@ int MainMenu(int menu)
|
|||||||
int ret = 0;
|
int ret = 0;
|
||||||
ret = Disc_WiiBoot(videoselected, cheat, vipatch, Settings.patchcountrystrings);
|
ret = Disc_WiiBoot(videoselected, cheat, vipatch, Settings.patchcountrystrings);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
ExitApp();
|
Sys_LoadMenu();
|
||||||
SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -11,7 +11,16 @@
|
|||||||
|
|
||||||
#include <ogcsys.h>
|
#include <ogcsys.h>
|
||||||
|
|
||||||
void InitGUIThreads();
|
#ifdef __cplusplus
|
||||||
|
//extern "C"
|
||||||
|
//{
|
||||||
|
#endif
|
||||||
|
void InitGUIThreads(void);
|
||||||
|
void ExitGUIThreads(void);
|
||||||
|
#ifdef __cplusplus
|
||||||
|
//}
|
||||||
|
#endif
|
||||||
|
|
||||||
int MainMenu (int menuitem);
|
int MainMenu (int menuitem);
|
||||||
void wiilight(int enable);
|
void wiilight(int enable);
|
||||||
int GameSettings(struct discHdr *);
|
int GameSettings(struct discHdr *);
|
||||||
|
@ -8,6 +8,8 @@
|
|||||||
#include "disc.h"
|
#include "disc.h"
|
||||||
#include "wbfs.h"
|
#include "wbfs.h"
|
||||||
#include "video.h"
|
#include "video.h"
|
||||||
|
#include "audio.h"
|
||||||
|
#include "menu.h"
|
||||||
#include "fatmounter.h"
|
#include "fatmounter.h"
|
||||||
|
|
||||||
/* Constants */
|
/* Constants */
|
||||||
@ -41,9 +43,21 @@ void Sys_Init(void)
|
|||||||
SYS_SetPowerCallback(__Sys_PowerCallback);
|
SYS_SetPowerCallback(__Sys_PowerCallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void _ExitApp()
|
||||||
|
{
|
||||||
|
ExitGUIThreads();
|
||||||
|
StopGX();
|
||||||
|
ShutdownAudio();
|
||||||
|
|
||||||
|
SDCard_deInit();
|
||||||
|
USBDevice_deInit();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Sys_Reboot(void)
|
void Sys_Reboot(void)
|
||||||
{
|
{
|
||||||
/* Restart console */
|
/* Restart console */
|
||||||
|
_ExitApp();
|
||||||
STM_RebootSystem();
|
STM_RebootSystem();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -51,8 +65,9 @@ int Sys_IosReload(int IOS)
|
|||||||
{
|
{
|
||||||
s32 ret;
|
s32 ret;
|
||||||
|
|
||||||
if(isSdInserted())
|
//shutdown SD and USB before IOS Reload in DiscWait
|
||||||
SDCard_deInit();
|
SDCard_deInit();
|
||||||
|
USBDevice_deInit();
|
||||||
|
|
||||||
WPAD_Flush(0);
|
WPAD_Flush(0);
|
||||||
WPAD_Disconnect(0);
|
WPAD_Disconnect(0);
|
||||||
@ -62,35 +77,49 @@ int Sys_IosReload(int IOS)
|
|||||||
|
|
||||||
USBStorage_Deinit();
|
USBStorage_Deinit();
|
||||||
|
|
||||||
__IOS_ShutdownSubsystems();
|
|
||||||
|
|
||||||
ret = IOS_ReloadIOS(IOS);
|
ret = IOS_ReloadIOS(IOS);
|
||||||
|
|
||||||
if(ret < 0) {
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
PAD_Init();
|
PAD_Init();
|
||||||
Wpad_Init();
|
Wpad_Init();
|
||||||
WPAD_SetDataFormat(WPAD_CHAN_ALL,WPAD_FMT_BTNS_ACC_IR);
|
WPAD_SetDataFormat(WPAD_CHAN_ALL,WPAD_FMT_BTNS_ACC_IR);
|
||||||
WPAD_SetVRes(WPAD_CHAN_ALL, screenwidth, screenheight);
|
WPAD_SetVRes(WPAD_CHAN_ALL, screenwidth, screenheight);
|
||||||
|
|
||||||
if(IOS == 249 || IOS == 222) {
|
if(ret < 0) {
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(IOS == 249 || IOS == 222 || IOS == 223) {
|
||||||
ret = WBFS_Init(WBFS_DEVICE_USB);
|
ret = WBFS_Init(WBFS_DEVICE_USB);
|
||||||
|
if(ret>=0)
|
||||||
|
{
|
||||||
ret = Disc_Init();
|
ret = Disc_Init();
|
||||||
|
if(ret>=0)
|
||||||
ret = WBFS_Open();
|
ret = WBFS_Open();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
//reinitialize SD and USB
|
||||||
|
SDCard_Init();
|
||||||
|
USBDevice_Init();
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Sys_Shutdown(void)
|
|
||||||
|
|
||||||
|
#define ShutdownToDefault 0
|
||||||
|
#define ShutdownToIdle 1
|
||||||
|
#define ShutdownToStandby 2
|
||||||
|
|
||||||
|
static void _Sys_Shutdown(int SHUTDOWN_MODE)
|
||||||
{
|
{
|
||||||
Wpad_Disconnect();
|
_ExitApp();
|
||||||
|
WPAD_Flush(0);
|
||||||
|
WPAD_Disconnect(0);
|
||||||
|
WPAD_Shutdown();
|
||||||
|
|
||||||
/* Poweroff console */
|
/* Poweroff console */
|
||||||
if(CONF_GetShutdownMode() == CONF_SHUTDOWN_IDLE) {
|
if((CONF_GetShutdownMode() == CONF_SHUTDOWN_IDLE && SHUTDOWN_MODE != ShutdownToStandby) || SHUTDOWN_MODE == ShutdownToIdle) {
|
||||||
s32 ret;
|
s32 ret;
|
||||||
|
|
||||||
/* Set LED mode */
|
/* Set LED mode */
|
||||||
@ -105,13 +134,37 @@ void Sys_Shutdown(void)
|
|||||||
STM_ShutdownToStandby();
|
STM_ShutdownToStandby();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
void Sys_Shutdown(void)
|
||||||
|
{
|
||||||
|
_Sys_Shutdown(ShutdownToDefault);
|
||||||
|
}
|
||||||
|
void Sys_ShutdownToIdel(void)
|
||||||
|
{
|
||||||
|
_Sys_Shutdown(ShutdownToIdle);
|
||||||
|
}
|
||||||
|
void Sys_ShutdownToStandby(void)
|
||||||
|
{
|
||||||
|
_Sys_Shutdown(ShutdownToStandby);
|
||||||
|
}
|
||||||
|
|
||||||
void Sys_LoadMenu(void)
|
void Sys_LoadMenu(void)
|
||||||
{
|
{
|
||||||
|
_ExitApp();
|
||||||
/* Return to the Wii system menu */
|
/* Return to the Wii system menu */
|
||||||
SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);
|
SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Sys_BackToLoader(void)
|
||||||
|
{
|
||||||
|
if (*((u32*) 0x80001800))
|
||||||
|
{
|
||||||
|
_ExitApp();
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
// Channel Version
|
||||||
|
Sys_LoadMenu();
|
||||||
|
}
|
||||||
|
|
||||||
s32 Sys_GetCerts(signed_blob **certs, u32 *len)
|
s32 Sys_GetCerts(signed_blob **certs, u32 *len)
|
||||||
{
|
{
|
||||||
static signed_blob certificates[CERTS_LEN] ATTRIBUTE_ALIGN(32);
|
static signed_blob certificates[CERTS_LEN] ATTRIBUTE_ALIGN(32);
|
@ -3,18 +3,21 @@
|
|||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
//{
|
||||||
#endif
|
#endif
|
||||||
/* Prototypes */
|
/* Prototypes */
|
||||||
void Sys_Init(void);
|
void Sys_Init(void);
|
||||||
void Sys_Reboot(void);
|
void Sys_Reboot(void);
|
||||||
void Sys_Shutdown(void);
|
void Sys_Shutdown(void);
|
||||||
|
void Sys_ShutdownToIdel(void);
|
||||||
|
void Sys_ShutdownToStandby(void);
|
||||||
void Sys_LoadMenu(void);
|
void Sys_LoadMenu(void);
|
||||||
|
void Sys_BackToLoader(void);
|
||||||
int Sys_IosReload(int IOS);
|
int Sys_IosReload(int IOS);
|
||||||
s32 Sys_GetCerts(signed_blob **, u32 *);
|
s32 Sys_GetCerts(signed_blob **, u32 *);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
//}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user