mirror of
https://github.com/wiidev/usbloadergx.git
synced 2024-11-22 11:19:17 +01:00
*Finished the background initialization thread for devices started by giantpune and merged it into trunk. Now you can startup the loader without a HDD. Also you can put in your device after startup and it will be recognized. Hot swapping not yet added (as in remove and than stick it in).
You will see the list of available channels on your system if you start without a HDD or if your HDD is slow and is being recognized late. The list of games is than reloading as soon as it is recognized. *Hot swapping of the SD card was implemented into background thread (by giantpune) *Made lots of cleanups and some fixes *Format menu was moved to settings page 3 (only on godmode accessable) *Added ScreenShot and Reset/Shutdown call to background thread. Removed the not needed ones. Now you can call for Screenshot/Reset/Shutdown anywhere in the loader (after gui is started).
This commit is contained in:
parent
ffb017b6bc
commit
15bcbfa482
File diff suppressed because one or more lines are too long
@ -5,98 +5,127 @@
|
|||||||
* Shows TPL Banner images
|
* Shows TPL Banner images
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
#include "gui_banner.h"
|
#include "gui_banner.h"
|
||||||
|
|
||||||
GuiBanner::GuiBanner(const char *tplfilepath)
|
typedef struct
|
||||||
{
|
{
|
||||||
memory = NULL;
|
u32 texture_header_offset;
|
||||||
tplfilesize = 0;
|
u32 palette_header_offset;
|
||||||
width = 0;
|
} TPLTexture;
|
||||||
height = 0;
|
|
||||||
|
typedef struct
|
||||||
FILE *tplfp = fopen(tplfilepath,"rb");
|
{
|
||||||
|
u16 heigth;
|
||||||
if(tplfp !=NULL) {
|
u16 width;
|
||||||
|
//...
|
||||||
unsigned short heighttemp = 0;
|
//there is more but we only need these
|
||||||
unsigned short widthtemp = 0;
|
} TPLTextureHeader;
|
||||||
|
|
||||||
fseek(tplfp , 0x14, SEEK_SET);
|
//only one field tpls
|
||||||
fread((void*)&heighttemp,1,2,tplfp);
|
typedef struct
|
||||||
fread((void*)&widthtemp,1,2,tplfp);
|
{
|
||||||
fseek (tplfp , 0 , SEEK_END);
|
u32 magic;
|
||||||
tplfilesize = ftell (tplfp);
|
u32 ntextures;
|
||||||
rewind (tplfp);
|
u32 texture_size;
|
||||||
memory = memalign(32, tplfilesize);
|
TPLTexture textures;
|
||||||
if(!memory) {
|
} TPLHeader;
|
||||||
fclose(tplfp);
|
|
||||||
return;
|
|
||||||
}
|
GuiBanner::GuiBanner(const char *tplfilepath)
|
||||||
fread(memory, 1, tplfilesize, tplfp);
|
{
|
||||||
fclose(tplfp);
|
memory = NULL;
|
||||||
|
tplfilesize = 0;
|
||||||
TPLFile tplfile;
|
width = 0;
|
||||||
int ret;
|
height = 0;
|
||||||
|
|
||||||
ret = TPL_OpenTPLFromMemory(&tplfile, memory, tplfilesize);
|
FILE *tplfp = fopen(tplfilepath,"rb");
|
||||||
if(ret < 0) {
|
|
||||||
free(memory);
|
if(tplfp !=NULL) {
|
||||||
memory = NULL;
|
|
||||||
return;
|
fseek (tplfp , 0 , SEEK_END);
|
||||||
}
|
tplfilesize = ftell (tplfp);
|
||||||
ret = TPL_GetTexture(&tplfile,0,&texObj);
|
rewind (tplfp);
|
||||||
if(ret < 0) {
|
memory = memalign(32, tplfilesize);
|
||||||
free(memory);
|
if(!memory) {
|
||||||
memory = NULL;
|
fclose(tplfp);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
TPL_CloseTPLFile(&tplfile);
|
fread(memory, 1, tplfilesize, tplfp);
|
||||||
|
fclose(tplfp);
|
||||||
width = widthtemp;
|
|
||||||
height = heighttemp;
|
const u8 * buffer = (const u8*) memory;
|
||||||
widescreen = 0;
|
const TPLHeader *hdr = (TPLHeader *) buffer;
|
||||||
filecheck = true;
|
const TPLTextureHeader *texhdr = (TPLTextureHeader *) &buffer[hdr->textures.texture_header_offset];
|
||||||
|
|
||||||
} else {
|
height = texhdr[0].heigth;
|
||||||
filecheck = false;
|
width = texhdr[0].width;
|
||||||
fclose(tplfp);
|
|
||||||
}
|
TPLFile tplfile;
|
||||||
}
|
int ret;
|
||||||
|
|
||||||
GuiBanner::GuiBanner(void *mem, u32 len, int w, int h)
|
ret = TPL_OpenTPLFromMemory(&tplfile, memory, tplfilesize);
|
||||||
{
|
if(ret < 0) {
|
||||||
if(!mem || !len)
|
free(memory);
|
||||||
return;
|
memory = NULL;
|
||||||
memory = mem;
|
return;
|
||||||
tplfilesize = len;
|
}
|
||||||
width = w;
|
ret = TPL_GetTexture(&tplfile,0,&texObj);
|
||||||
height = h;
|
if(ret < 0) {
|
||||||
|
free(memory);
|
||||||
TPLFile tplfile;
|
memory = NULL;
|
||||||
|
return;
|
||||||
int ret;
|
}
|
||||||
|
TPL_CloseTPLFile(&tplfile);
|
||||||
ret = TPL_OpenTPLFromMemory(&tplfile, memory, tplfilesize);
|
|
||||||
if(ret < 0) {
|
widescreen = 0;
|
||||||
free(memory);
|
filecheck = true;
|
||||||
memory = NULL;
|
|
||||||
return;
|
} else {
|
||||||
}
|
filecheck = false;
|
||||||
ret = TPL_GetTexture(&tplfile,0,&texObj);
|
fclose(tplfp);
|
||||||
if(ret < 0) {
|
}
|
||||||
free(memory);
|
}
|
||||||
memory = NULL;
|
|
||||||
return;
|
GuiBanner::GuiBanner(void *mem, u32 len)
|
||||||
}
|
{
|
||||||
TPL_CloseTPLFile(&tplfile);
|
if(!mem || !len)
|
||||||
|
return;
|
||||||
filecheck = true;
|
|
||||||
}
|
memory = mem;
|
||||||
|
tplfilesize = len;
|
||||||
|
|
||||||
|
const u8 * buffer = (const u8*) memory;
|
||||||
|
const TPLHeader *hdr = (TPLHeader *) buffer;
|
||||||
|
const TPLTextureHeader *texhdr = (TPLTextureHeader *) &buffer[hdr->textures.texture_header_offset];
|
||||||
|
|
||||||
|
height = texhdr[0].heigth;
|
||||||
|
width = texhdr[0].width;
|
||||||
|
|
||||||
|
TPLFile tplfile;
|
||||||
|
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
ret = TPL_OpenTPLFromMemory(&tplfile, memory, tplfilesize);
|
||||||
|
if(ret < 0) {
|
||||||
|
free(memory);
|
||||||
|
memory = NULL;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ret = TPL_GetTexture(&tplfile,0,&texObj);
|
||||||
|
if(ret < 0) {
|
||||||
|
free(memory);
|
||||||
|
memory = NULL;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
TPL_CloseTPLFile(&tplfile);
|
||||||
|
|
||||||
|
filecheck = true;
|
||||||
|
}
|
||||||
|
|
||||||
GuiBanner::~GuiBanner()
|
GuiBanner::~GuiBanner()
|
||||||
{
|
{
|
||||||
if(memory != NULL) {
|
if(memory != NULL) {
|
||||||
free(memory);
|
free(memory);
|
||||||
memory = NULL;
|
memory = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -104,11 +133,11 @@ void GuiBanner::Draw()
|
|||||||
{
|
{
|
||||||
LOCK(this);
|
LOCK(this);
|
||||||
if(!filecheck ||!this->IsVisible())
|
if(!filecheck ||!this->IsVisible())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
float currScale = this->GetScale();
|
float currScale = this->GetScale();
|
||||||
|
|
||||||
Menu_DrawTPLImg(this->GetLeft(), this->GetTop(), 0, width, height, &texObj, imageangle, widescreen ? currScale*0.80 : currScale, currScale, this->GetAlpha(), xx1,yy1,xx2,yy2,xx3,yy3,xx4,yy4);
|
Menu_DrawTPLImg(this->GetLeft(), this->GetTop(), 0, width, height, &texObj, imageangle, widescreen ? currScale*0.80 : currScale, currScale, this->GetAlpha(), xx1,yy1,xx2,yy2,xx3,yy3,xx4,yy4);
|
||||||
|
|
||||||
this->UpdateEffects();
|
this->UpdateEffects();
|
||||||
}
|
}
|
||||||
|
@ -19,9 +19,7 @@ public:
|
|||||||
//!Constructor
|
//!Constructor
|
||||||
//!\param mem Memory of the loaded tpl
|
//!\param mem Memory of the loaded tpl
|
||||||
//!\param len Filesize of the tpl
|
//!\param len Filesize of the tpl
|
||||||
//!\param w Width of the tpl
|
GuiBanner(void *mem, u32 len);
|
||||||
//!\param h Height of the tpl
|
|
||||||
GuiBanner(void *mem, u32 len, int w, int h);
|
|
||||||
//!Destructor
|
//!Destructor
|
||||||
~GuiBanner();
|
~GuiBanner();
|
||||||
void Draw();
|
void Draw();
|
||||||
|
@ -13,6 +13,8 @@ extern "C"
|
|||||||
{
|
{
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <gccore.h>
|
||||||
|
|
||||||
/***********************************************************
|
/***********************************************************
|
||||||
* Error description:
|
* Error description:
|
||||||
* 0 Successfully extracted
|
* 0 Successfully extracted
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#ifndef BANNERSOUND_H
|
#ifndef BANNERSOUND_H
|
||||||
#define BANNERSOUND_H
|
#define BANNERSOUND_H
|
||||||
|
|
||||||
const u8 *LoadBannerSound(const u8 *discid, u32 *size);
|
const u8 *LoadBannerSound(const u8 *discid, u32 *size);
|
||||||
|
|
||||||
#endif /* BANNERSOUND_H */
|
#endif /* BANNERSOUND_H */
|
||||||
|
@ -12,11 +12,7 @@
|
|||||||
#include "filelist.h"
|
#include "filelist.h"
|
||||||
#include "sys.h"
|
#include "sys.h"
|
||||||
#include "gct.h"
|
#include "gct.h"
|
||||||
|
#include "../menu/menus.h"
|
||||||
/*** Extern functions ***/
|
|
||||||
extern void ResumeGui();
|
|
||||||
extern void HaltGui();
|
|
||||||
|
|
||||||
/*** Extern variables ***/
|
/*** Extern variables ***/
|
||||||
extern GuiWindow * mainWindow;
|
extern GuiWindow * mainWindow;
|
||||||
|
|
||||||
|
@ -28,9 +28,7 @@
|
|||||||
#include "unzip/miniunz.h"
|
#include "unzip/miniunz.h"
|
||||||
#include "usbloader/utils.h"
|
#include "usbloader/utils.h"
|
||||||
|
|
||||||
/*** Extern functions ***/
|
#include "../menu/menus.h"
|
||||||
extern void ResumeGui();
|
|
||||||
extern void HaltGui();
|
|
||||||
|
|
||||||
/*** Extern variables ***/
|
/*** Extern variables ***/
|
||||||
extern GuiWindow * mainWindow;
|
extern GuiWindow * mainWindow;
|
||||||
@ -39,8 +37,6 @@ extern GuiImage * bgImg;
|
|||||||
extern u32 infilesize;
|
extern u32 infilesize;
|
||||||
extern u32 uncfilesize;
|
extern u32 uncfilesize;
|
||||||
extern char wiiloadVersion[2];
|
extern char wiiloadVersion[2];
|
||||||
extern u8 shutdown;
|
|
||||||
extern u8 reset;
|
|
||||||
extern struct SSettings Settings;
|
extern struct SSettings Settings;
|
||||||
extern void *innetbuffer;
|
extern void *innetbuffer;
|
||||||
|
|
||||||
@ -731,11 +727,6 @@ int MenuHomebrewBrowse() {
|
|||||||
MainButton4.ResetState();
|
MainButton4.ResetState();
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (shutdown == 1)
|
|
||||||
Sys_Shutdown();
|
|
||||||
else if (reset == 1)
|
|
||||||
Sys_Reboot();
|
|
||||||
|
|
||||||
else if (backBtn.GetState() == STATE_CLICKED) {
|
else if (backBtn.GetState() == STATE_CLICKED) {
|
||||||
menu = MENU_DISCLIST;
|
menu = MENU_DISCLIST;
|
||||||
changed = true;
|
changed = true;
|
||||||
@ -834,29 +825,29 @@ int MenuHomebrewBrowse() {
|
|||||||
|
|
||||||
read += result;
|
read += result;
|
||||||
}
|
}
|
||||||
|
|
||||||
char filename[101];
|
char filename[101];
|
||||||
if (!error) {
|
if (!error) {
|
||||||
|
|
||||||
network_read((u8*) &filename, 100);
|
network_read((u8*) &filename, 100);
|
||||||
|
|
||||||
// Do we need to unzip this thing?
|
// Do we need to unzip this thing?
|
||||||
if (wiiloadVersion[0] > 0 || wiiloadVersion[1] > 4) {
|
if (wiiloadVersion[0] > 0 || wiiloadVersion[1] > 4) {
|
||||||
|
|
||||||
// We need to unzip...
|
// We need to unzip...
|
||||||
if (temp[0] == 'P' && temp[1] == 'K' && temp[2] == 0x03 && temp[3] == 0x04) {
|
if (temp[0] == 'P' && temp[1] == 'K' && temp[2] == 0x03 && temp[3] == 0x04) {
|
||||||
// It's a zip file, unzip to the apps directory
|
// It's a zip file, unzip to the apps directory
|
||||||
|
|
||||||
// Zip archive, ask for permission to install the zip
|
// Zip archive, ask for permission to install the zip
|
||||||
char zippath[255];
|
char zippath[255];
|
||||||
sprintf((char *) &zippath, "%s%s", Settings.homebrewapps_path, filename);
|
sprintf((char *) &zippath, "%s%s", Settings.homebrewapps_path, filename);
|
||||||
|
|
||||||
FILE *fp = fopen(zippath, "wb");
|
FILE *fp = fopen(zippath, "wb");
|
||||||
if (fp != NULL)
|
if (fp != NULL)
|
||||||
{
|
{
|
||||||
fwrite(temp, 1, infilesize, fp);
|
fwrite(temp, 1, infilesize, fp);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
|
||||||
// Now unzip the zip file...
|
// Now unzip the zip file...
|
||||||
unzFile uf = unzOpen(zippath);
|
unzFile uf = unzOpen(zippath);
|
||||||
if (uf==NULL) {
|
if (uf==NULL) {
|
||||||
@ -864,9 +855,9 @@ int MenuHomebrewBrowse() {
|
|||||||
} else {
|
} else {
|
||||||
extractZip(uf,0,1,0, Settings.homebrewapps_path);
|
extractZip(uf,0,1,0, Settings.homebrewapps_path);
|
||||||
unzCloseCurrentFile(uf);
|
unzCloseCurrentFile(uf);
|
||||||
|
|
||||||
remove(zippath);
|
remove(zippath);
|
||||||
|
|
||||||
// Reload this menu here...
|
// Reload this menu here...
|
||||||
menu = MENU_HOMEBREWBROWSE;
|
menu = MENU_HOMEBREWBROWSE;
|
||||||
break;
|
break;
|
||||||
@ -880,17 +871,17 @@ int MenuHomebrewBrowse() {
|
|||||||
uLongf f = uncfilesize;
|
uLongf f = uncfilesize;
|
||||||
error = uncompress(unc, &f, temp, infilesize) != Z_OK;
|
error = uncompress(unc, &f, temp, infilesize) != Z_OK;
|
||||||
uncfilesize = f;
|
uncfilesize = f;
|
||||||
|
|
||||||
free(temp);
|
free(temp);
|
||||||
temp = unc;
|
temp = unc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!error && strstr(filename,".zip") == NULL) {
|
if (!error && strstr(filename,".zip") == NULL) {
|
||||||
innetbuffer = temp;
|
innetbuffer = temp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ProgressStop();
|
ProgressStop();
|
||||||
|
|
||||||
if (error || read != infilesize) {
|
if (error || read != infilesize) {
|
||||||
|
File diff suppressed because it is too large
Load Diff
458
source/main.cpp
458
source/main.cpp
@ -15,14 +15,13 @@
|
|||||||
#include <ogcsys.h>
|
#include <ogcsys.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
|
#include <ogc/libversion.h>
|
||||||
#include <wiiuse/wpad.h>
|
#include <wiiuse/wpad.h>
|
||||||
//#include <debug.h>
|
//#include <debug.h>
|
||||||
extern "C"
|
extern "C" {
|
||||||
{
|
extern void __exception_setreload(int t);
|
||||||
extern void __exception_setreload(int t);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#include <di/di.h>
|
#include <di/di.h>
|
||||||
#include <sys/iosupport.h>
|
#include <sys/iosupport.h>
|
||||||
|
|
||||||
@ -50,436 +49,144 @@ extern "C"
|
|||||||
#include "usbloader/usbstorage.h"
|
#include "usbloader/usbstorage.h"
|
||||||
#include "memory/mem2.h"
|
#include "memory/mem2.h"
|
||||||
#include "lstub.h"
|
#include "lstub.h"
|
||||||
|
#include "xml/xml.h"
|
||||||
|
#include "settings/newtitles.h"
|
||||||
|
#include "menu/menus.h"
|
||||||
|
|
||||||
extern bool geckoinit;
|
extern bool geckoinit;
|
||||||
extern bool textVideoInit;
|
extern bool textVideoInit;
|
||||||
extern char headlessID[8];
|
extern char headlessID[8];
|
||||||
|
PartList partitions;
|
||||||
|
|
||||||
/* Constants */
|
/* Constants */
|
||||||
#define CONSOLE_XCOORD 260
|
#define CONSOLE_XCOORD 260
|
||||||
#define CONSOLE_YCOORD 115
|
#define CONSOLE_YCOORD 115
|
||||||
#define CONSOLE_WIDTH 340
|
#define CONSOLE_WIDTH 340
|
||||||
#define CONSOLE_HEIGHT 218
|
#define CONSOLE_HEIGHT 218
|
||||||
|
|
||||||
FreeTypeGX *fontSystem=0;
|
FreeTypeGX *fontSystem=0;
|
||||||
FreeTypeGX *fontClock=0;
|
FreeTypeGX *fontClock=0;
|
||||||
PartList partitions;
|
|
||||||
|
|
||||||
u8 dbvideo =0;
|
void LoadHeadlessID(const char * ID)
|
||||||
|
|
||||||
static void BootUpProblems()
|
|
||||||
{
|
{
|
||||||
s32 ret2;
|
InitTextVideo();
|
||||||
|
strncpy(headlessID, ID, sizeof(headlessID));
|
||||||
// load main font from file, or default to built-in font
|
InitCheckThread();
|
||||||
fontSystem = new FreeTypeGX();
|
|
||||||
fontSystem->loadFont(NULL, font_ttf, font_ttf_size, 0);
|
|
||||||
fontSystem->setCompatibilityMode(FTGX_COMPATIBILITY_DEFAULT_TEVOP_GX_PASSCLR | FTGX_COMPATIBILITY_DEFAULT_VTXDESC_GX_NONE);
|
|
||||||
|
|
||||||
GuiImageData bootimageData(gxlogo_png);
|
|
||||||
GuiImage bootimage(&bootimageData);
|
|
||||||
GuiText boottext(NULL, 20, (GXColor) {255, 255, 255, 255}
|
|
||||||
);
|
|
||||||
boottext.SetPosition(200, 240-1.2*bootimage.GetHeight()/2+250);
|
|
||||||
bootimage.SetPosition(320-1.2*bootimage.GetWidth()/2, 240-1.2*bootimage.GetHeight()/2);
|
|
||||||
bootimage.SetScale(1.2);
|
|
||||||
|
|
||||||
GuiImageData usbimageData(usbport_png);
|
|
||||||
GuiImage usbimage(&usbimageData);
|
|
||||||
usbimage.SetPosition(400,300);
|
|
||||||
usbimage.SetScale(.7);
|
|
||||||
usbimage.SetAlpha(200);
|
|
||||||
|
|
||||||
time_t curtime;
|
|
||||||
time_t endtime = time(0) + 30;
|
time_t endtime = time(0) + 30;
|
||||||
do
|
time_t curtime;
|
||||||
|
printf("\tWaiting for USB-Device:\n");
|
||||||
|
while(checkthreadState != 1)
|
||||||
{
|
{
|
||||||
/*ret2 = IOS_ReloadIOSsafe(249);
|
usleep(100);
|
||||||
if (ret2 < 0) {
|
|
||||||
ret2 = IOS_ReloadIOSsafe(222);
|
|
||||||
SDCard_Init();
|
|
||||||
load_ehc_module();
|
|
||||||
SDCard_deInit();
|
|
||||||
if(ret2 <0) {
|
|
||||||
boottext.SetText("ERROR: cIOS could not be loaded!");
|
|
||||||
bootimage.Draw();
|
|
||||||
boottext.Draw();
|
|
||||||
Menu_Render();
|
|
||||||
sleep(5);
|
|
||||||
SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
USBDevice_deInit();
|
|
||||||
USBDevice_Init();
|
|
||||||
ret2 = WBFS_Init(WBFS_DEVICE_USB);
|
|
||||||
if (ret2 >= 0)
|
|
||||||
{
|
|
||||||
boottext.SetText("Loading...");
|
|
||||||
bootimage.Draw();
|
|
||||||
boottext.Draw();
|
|
||||||
Menu_Render();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
curtime = time(0);
|
curtime = time(0);
|
||||||
boottext.SetTextf("Waiting for your slow USB Device: %i secs...", int(endtime-curtime));
|
printf("\t\t%d\n", int(endtime-curtime));
|
||||||
while(curtime == time(0))
|
if(endtime == curtime)
|
||||||
{
|
{
|
||||||
boottext.Draw();
|
printf("\n\tDevice could not be loaded.\n\tExiting...\n");
|
||||||
bootimage.Draw();
|
sleep(5);
|
||||||
if (endtime-curtime<15)usbimage.Draw();
|
SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);
|
||||||
Menu_Render();
|
|
||||||
}
|
}
|
||||||
} while((endtime-time(0)) > 0);
|
|
||||||
|
|
||||||
/*if(ret2 < 0) {
|
|
||||||
boottext.SetText("ERROR: USB device could not be loaded!");
|
|
||||||
usbimage.Draw();
|
|
||||||
bootimage.Draw();
|
|
||||||
boottext.Draw();
|
|
||||||
Menu_Render();
|
|
||||||
SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
///delete font to load up custom if set
|
|
||||||
if(fontSystem)
|
|
||||||
{
|
|
||||||
delete fontSystem;
|
|
||||||
fontSystem = NULL;
|
|
||||||
}
|
}
|
||||||
|
mountMethod = 0;
|
||||||
|
checkthreadState = 0;
|
||||||
|
ExitCheckThread();
|
||||||
|
CloseXMLDatabase();
|
||||||
|
NewTitles::DestroyInstance();
|
||||||
|
ShutdownAudio();
|
||||||
|
StopGX();
|
||||||
|
gettextCleanUp();
|
||||||
|
menuBootgame(headlessID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
unsigned int *xfb = NULL;
|
|
||||||
|
|
||||||
void InitTextVideo ()
|
|
||||||
{
|
{
|
||||||
gprintf("\nInitTextVideo ()");
|
setlocale(LC_ALL, "en.UTF-8");
|
||||||
if (textVideoInit)
|
geckoinit = InitGecko();
|
||||||
{
|
|
||||||
gprintf("...0");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
dbvideo=1;
|
|
||||||
VIDEO_Init();
|
|
||||||
// get default video mode
|
|
||||||
GXRModeObj *vmode = VIDEO_GetPreferredMode(NULL);
|
|
||||||
|
|
||||||
// widescreen fix
|
if (hbcStubAvailable() || geckoinit)
|
||||||
VIDEO_Configure (vmode);
|
InitTextVideo();
|
||||||
|
|
||||||
// Allocate the video buffers
|
__exception_setreload(5);//auto reset code dump nobody gives us codedump info anyways.
|
||||||
xfb = (u32 *) MEM_K0_TO_K1 (SYS_AllocateFramebuffer (vmode));
|
|
||||||
|
|
||||||
// A console is always useful while debugging
|
gprintf("\n\n------------------");
|
||||||
console_init (xfb, 20, 64, vmode->fbWidth, vmode->xfbHeight, vmode->fbWidth * 2);
|
gprintf("\nUSB Loader GX rev%s linked with %s",GetRev(), _V_STRING);
|
||||||
|
gprintf("\nmain(%d", argc);
|
||||||
// Clear framebuffers etc.
|
for (int i=0;i<argc;i++)
|
||||||
VIDEO_ClearFrameBuffer (vmode, xfb, COLOR_BLACK);
|
gprintf(", %s",argv[i]?argv[i]:"<NULL>");
|
||||||
VIDEO_SetNextFramebuffer (xfb);
|
|
||||||
|
|
||||||
VIDEO_SetBlack (FALSE);
|
|
||||||
VIDEO_Flush ();
|
|
||||||
VIDEO_WaitVSync ();
|
|
||||||
if (vmode->viTVMode & VI_NON_INTERLACE)
|
|
||||||
VIDEO_WaitVSync ();
|
|
||||||
|
|
||||||
//send console output to the gecko
|
|
||||||
if (geckoinit)CON_EnableGecko(1, true);
|
|
||||||
textVideoInit = true;
|
|
||||||
gprintf("...1");
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int
|
|
||||||
main(int argc, char *argv[])
|
|
||||||
{
|
|
||||||
setlocale(LC_ALL, "en.UTF-8");
|
|
||||||
geckoinit = InitGecko();
|
|
||||||
|
|
||||||
if (hbcStubAvailable() || geckoinit)
|
|
||||||
{
|
|
||||||
InitTextVideo();
|
|
||||||
}
|
|
||||||
|
|
||||||
// DEBUG_Init(GDBSTUB_DEVICE_USB, 1);
|
|
||||||
//_break();
|
|
||||||
|
|
||||||
__exception_setreload(5); //auto reset code dump nobody gives us codedump info anyways.
|
|
||||||
|
|
||||||
gprintf("\n\n------------------");
|
|
||||||
gprintf("\nUSB Loader GX rev%s",GetRev());
|
|
||||||
gprintf("\nmain(%d", argc);
|
|
||||||
for (int i=0;i<argc;i++)
|
|
||||||
gprintf(", %s",argv[i]?argv[i]:"<NULL>");
|
|
||||||
gprintf(")");
|
gprintf(")");
|
||||||
|
|
||||||
// This part is added, because we need a identify patched ios
|
// This part is added, because we need a identify patched ios
|
||||||
// printf("\n\tReloading into ios 236");
|
//printf("\n\tReloading into ios 236");
|
||||||
if (IOS_ReloadIOSsafe(236) < 0)
|
if (IOS_ReloadIOSsafe(236) < 0)
|
||||||
{
|
IOS_ReloadIOSsafe(36);
|
||||||
// printf("\n\tIOS 236 not found, reloading into 36");
|
|
||||||
IOS_ReloadIOSsafe(36);
|
|
||||||
}
|
|
||||||
|
|
||||||
printf("\n\tStarting up");
|
printf("\n\tStarting up");
|
||||||
|
|
||||||
MEM2_init(36); // Initialize 36 MB
|
MEM2_init(36); // Initialize 36 MB
|
||||||
MEM2_takeBigOnes(true);
|
MEM2_takeBigOnes(true);
|
||||||
|
|
||||||
s32 ret;
|
s32 ret;
|
||||||
bool startupproblem = false;
|
|
||||||
|
|
||||||
bool bootDevice_found=false;
|
bool bootDevice_found=false;
|
||||||
if (argc >= 1)
|
if (argc >= 1) {
|
||||||
{
|
if (!strncasecmp(argv[0], "usb:/", 5)) {
|
||||||
if (!strncasecmp(argv[0], "usb:/", 5))
|
|
||||||
{
|
|
||||||
strcpy(bootDevice, "USB:");
|
strcpy(bootDevice, "USB:");
|
||||||
bootDevice_found = true;
|
bootDevice_found = true;
|
||||||
} else if (!strncasecmp(argv[0], "sd:/", 4))
|
} else if (!strncasecmp(argv[0], "sd:/", 4))
|
||||||
bootDevice_found = true;
|
bootDevice_found = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("\n\tInitializing controllers");
|
printf("\n\tInitializing controllers");
|
||||||
|
|
||||||
/** PAD_Init has to be before InitVideo don't move that **/
|
/** PAD_Init has to be before InitVideo don't move that **/
|
||||||
PAD_Init(); // initialize PAD/WPAD
|
PAD_Init(); // initialize PAD/WPAD
|
||||||
|
|
||||||
printf("\n\tInitialize USB (wake up)");
|
printf("\n\tInitialize USB (wake up)");
|
||||||
|
|
||||||
USBDevice_Init(); // seems enough to wake up some HDDs if they are in sleep mode when the loader starts (tested with WD MyPassport Essential 2.5")
|
USBDevice_Init();// seems enough to wake up some HDDs if they are in sleep mode when the loader starts (tested with WD MyPassport Essential 2.5")
|
||||||
|
USBDevice_deInit();
|
||||||
|
|
||||||
gprintf("\n\tChecking for stub IOS");
|
ret = CheckForCIOS();
|
||||||
ios222rev = getIOSrev(0x00000001000000dell);
|
|
||||||
ios249rev = getIOSrev(0x00000001000000f9ll);
|
|
||||||
|
|
||||||
//if we don't like either of the cIOS then scram
|
printf("\n\tInitialize sd card");
|
||||||
if (!(ios222rev==4 || (ios249rev>=9 && ios249rev<65280)))
|
SDCard_Init(); // mount SD for loading cfg's
|
||||||
{
|
printf("\n\tInitialize usb device");
|
||||||
InitTextVideo();
|
USBDevice_Init(); // and mount USB:/
|
||||||
printf("\x1b[2J");
|
|
||||||
if ((ios222rev < 0 && ios222rev != WII_EINSTALL) && (ios249rev < 0 && ios249rev != WII_EINSTALL))
|
|
||||||
{
|
|
||||||
printf("\n\n\n\tWARNING!");
|
|
||||||
printf("\n\tUSB Loader GX needs unstubbed cIOS 222 v4 or 249 v9+");
|
|
||||||
printf("\n\n\tWe cannot determine the versions on your system,\n\tsince you have no patched ios 36 or 236 installed.");
|
|
||||||
printf("\n\tTherefor, if loading of USB Loader GX fails, you\n\tprobably have installed the 4.2 update,");
|
|
||||||
printf("\n\tand you should go figure out how to get some cios action going on\n\tin your Wii.");
|
|
||||||
printf("\n\n\tThis message will show every time.");
|
|
||||||
sleep(5);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
printf("\n\n\n\tERROR!");
|
|
||||||
printf("\n\tUSB Loader GX needs unstubbed cIOS 222 v4 or 249 v9+");
|
|
||||||
printf("\n\n\tI found \n\t\t222 = %d%s",ios222rev,ios222rev==65280?" (Stubbed by 4.2 update)":"");
|
|
||||||
printf("\n\t\t249 = %d%s",ios249rev,ios249rev==65280?" (Stubbed by 4.2 update)":"");
|
|
||||||
printf("\n\n\tGo figure out how to get some cIOS action going on\n\tin your Wii and come back and see me.");
|
|
||||||
|
|
||||||
sleep(15);
|
|
||||||
printf("\n\n\tBye");
|
|
||||||
|
|
||||||
USBDevice_deInit();
|
|
||||||
exit(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
printf("\n\tReloading ios 249...");
|
|
||||||
ret = IOS_ReloadIOSsafe(249);
|
|
||||||
|
|
||||||
printf("%d", ret);
|
|
||||||
|
|
||||||
if (ret < 0)
|
|
||||||
{
|
|
||||||
printf("\n\tIOS 249 failed, reloading ios 222...");
|
|
||||||
ret = IOS_ReloadIOSsafe(222);
|
|
||||||
printf("%d", ret);
|
|
||||||
|
|
||||||
if (ret < 0)
|
|
||||||
{
|
|
||||||
printf("\n\tIOS 222 failed, reloading ios 250...");
|
|
||||||
ret = IOS_ReloadIOSsafe(250);
|
|
||||||
printf("%d", ret);
|
|
||||||
|
|
||||||
if(ret < 0)
|
|
||||||
{
|
|
||||||
printf("\n\tIOS 250 failed, reloading ios 223...");
|
|
||||||
ret = IOS_ReloadIOSsafe(223);
|
|
||||||
printf("%d", ret);
|
|
||||||
|
|
||||||
if (ret < 0)
|
|
||||||
{
|
|
||||||
printf("\n\tERROR: cIOS could not be loaded!\n");
|
|
||||||
sleep(5);
|
|
||||||
SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
printf("\n\tInitialize sd card");
|
|
||||||
SDCard_Init();
|
|
||||||
printf("\n\tLoad ehc module");
|
|
||||||
load_ehc_module();
|
|
||||||
printf("\n\tdeinit sd card");
|
|
||||||
SDCard_deInit();
|
|
||||||
}
|
|
||||||
|
|
||||||
printf("\n\tInit wbfs...");
|
|
||||||
ret = WBFS_Init(WBFS_DEVICE_USB);
|
|
||||||
printf("%d", ret);
|
|
||||||
|
|
||||||
if (ret < 0)
|
|
||||||
{
|
|
||||||
printf("\n\tYou have issues with a slow disc, or a difficult disc\n\tReloading 222...");
|
|
||||||
ret = IOS_ReloadIOSsafe(222);
|
|
||||||
printf("%d", ret);
|
|
||||||
/*if(ret < 0) {
|
|
||||||
// printf("\n\tSleeping for 4 seconds");
|
|
||||||
// sleep(4);
|
|
||||||
|
|
||||||
InitVideo(); // Initialise video
|
|
||||||
Menu_Render();
|
|
||||||
BootUpProblems();
|
|
||||||
startupproblem = true;
|
|
||||||
ret = 1;
|
|
||||||
}*/
|
|
||||||
printf("\n\tInitialize sd card");
|
|
||||||
SDCard_Init();
|
|
||||||
printf("\n\tLoad ehc module");
|
|
||||||
load_ehc_module();
|
|
||||||
printf("\n\tdeinit sd card");
|
|
||||||
SDCard_deInit();
|
|
||||||
|
|
||||||
printf("\n\tInitialize wbfs...");
|
|
||||||
USBDevice_deInit();
|
|
||||||
USBDevice_Init();
|
|
||||||
ret = WBFS_Init(WBFS_DEVICE_USB);
|
|
||||||
printf("%d", ret);
|
|
||||||
|
|
||||||
if(ret < 0)
|
|
||||||
{
|
|
||||||
// printf("\n\tSleeping for 4 seconds");
|
|
||||||
// sleep(4);
|
|
||||||
InitVideo(); // Initialise video
|
|
||||||
Menu_Render();
|
|
||||||
BootUpProblems();
|
|
||||||
startupproblem = true;
|
|
||||||
ret = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
printf("\n\tInitialize sd card");
|
|
||||||
SDCard_Init(); // mount SD for loading cfg's
|
|
||||||
|
|
||||||
//this should have already been done by now in order to WBFS_Init().
|
|
||||||
printf("\n\tInitialize usb device");
|
|
||||||
USBDevice_Init(); // and mount USB:/
|
|
||||||
|
|
||||||
if (!bootDevice_found)
|
if (!bootDevice_found)
|
||||||
{
|
{
|
||||||
printf("\n\tSearch for configuration file");
|
printf("\n\tSearch for configuration file");
|
||||||
|
|
||||||
//try USB
|
//try USB
|
||||||
//left in all the dol and elf files in this check in case this is the first time running the app and they dont have the config
|
//left in all the dol and elf files in this check in case this is the first time running the app and they dont have the config
|
||||||
if (checkfile((char*) "USB:/config/GXglobal.cfg") || (checkfile((char*) "USB:/apps/usbloader_gx/boot.elf"))
|
if (checkfile((char*) "USB:/config/GXglobal.cfg") || (checkfile((char*) "USB:/apps/usbloader_gx/boot.elf"))
|
||||||
|| checkfile((char*) "USB:/apps/usbloadergx/boot.dol") || (checkfile((char*) "USB:/apps/usbloadergx/boot.elf"))
|
|| checkfile((char*) "USB:/apps/usbloadergx/boot.dol") || (checkfile((char*) "USB:/apps/usbloadergx/boot.elf"))
|
||||||
|| checkfile((char*) "USB:/apps/usbloader_gx/boot.dol"))
|
|| checkfile((char*) "USB:/apps/usbloader_gx/boot.dol"))
|
||||||
strcpy(bootDevice, "USB:");
|
strcpy(bootDevice, "USB:");
|
||||||
|
|
||||||
printf("\n\tConfiguration file is on %s", bootDevice);
|
printf("\n\tConfiguration file is on %s", bootDevice);
|
||||||
}
|
|
||||||
|
|
||||||
// Try opening and closing the configuration file here
|
|
||||||
// to prevent a crash dump later on - giantpune
|
|
||||||
char GXGlobal_cfg[26];
|
|
||||||
sprintf(GXGlobal_cfg, "%s/config/GXGlobal.cfg", bootDevice);
|
|
||||||
FILE *fp = fopen(GXGlobal_cfg, "r");
|
|
||||||
if (fp)
|
|
||||||
{
|
|
||||||
fclose(fp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gettextCleanUp();
|
gettextCleanUp();
|
||||||
printf("\n\tLoading configuration...");
|
printf("\n\tLoading configuration...");
|
||||||
CFG_Load();
|
CFG_Load();
|
||||||
printf("done");
|
printf("done");
|
||||||
// gprintf("\n\tbootDevice = %s",bootDevice);
|
|
||||||
|
|
||||||
/* Load Custom IOS */
|
LoadAppCIOS();
|
||||||
if ((Settings.cios == ios222 && IOS_GetVersion() != 222) ||
|
printf("\n\tcIOS = %u (Rev %u)",IOS_GetVersion(), IOS_GetRevision());
|
||||||
(Settings.cios == ios223 && IOS_GetVersion() != 223))
|
|
||||||
{
|
|
||||||
printf("\n\tReloading IOS to config setting (%d)...", ios222 ? 222 : 223);
|
|
||||||
SDCard_deInit(); // unmount SD for reloading IOS
|
|
||||||
USBDevice_deInit(); // unmount USB for reloading IOS
|
|
||||||
USBStorage_Deinit();
|
|
||||||
ret = IOS_ReloadIOSsafe(ios222 ? 222 : 223);
|
|
||||||
printf("%d", ret);
|
|
||||||
SDCard_Init();
|
|
||||||
load_ehc_module();
|
|
||||||
if (ret < 0)
|
|
||||||
{
|
|
||||||
SDCard_deInit();
|
|
||||||
Settings.cios = ios249;
|
|
||||||
ret = IOS_ReloadIOSsafe(249);
|
|
||||||
// now mount SD:/ //no need to keep mindlessly mounting and unmounting SD card
|
|
||||||
SDCard_Init();
|
|
||||||
}
|
|
||||||
|
|
||||||
USBDevice_Init(); // and mount USB:/
|
//if a ID was passed via args copy it and try to boot it after the partition is mounted
|
||||||
WBFS_Init(WBFS_DEVICE_USB);
|
//its not really a headless mode. more like hairless.
|
||||||
} else if ((Settings.cios == ios249 && IOS_GetVersion() != 249) ||
|
if (argc > 1 && argv[1])
|
||||||
(Settings.cios == ios250 && IOS_GetVersion() != 250))
|
{
|
||||||
{
|
if (strlen(argv[1]) == 6)
|
||||||
|
LoadHeadlessID(argv[1]);
|
||||||
printf("\n\tReloading IOS to config setting (%d)...", ios249 ? 249 : 250);
|
}
|
||||||
SDCard_deInit(); // unmount SD for reloading IOS
|
|
||||||
USBDevice_deInit(); // unmount USB for reloading IOS
|
|
||||||
USBStorage_Deinit();
|
|
||||||
ret = IOS_ReloadIOSsafe(ios249 ? 249 : 250);
|
|
||||||
printf("%d", ret);
|
|
||||||
if (ret < 0)
|
|
||||||
{
|
|
||||||
Settings.cios = ios222;
|
|
||||||
ret = IOS_ReloadIOSsafe(222);
|
|
||||||
SDCard_Init();
|
|
||||||
load_ehc_module();
|
|
||||||
}
|
|
||||||
|
|
||||||
else SDCard_Init(); // now mount SD:/ //no need to keep mindlessly mounting and unmounting SD card
|
|
||||||
USBDevice_Init(); // and mount USB:/
|
|
||||||
WBFS_Init(WBFS_DEVICE_USB);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Partition_GetList(&partitions);
|
|
||||||
|
|
||||||
if (ret < 0)
|
|
||||||
{
|
|
||||||
printf("\nERROR: cIOS could not be loaded!");
|
|
||||||
sleep(5);
|
|
||||||
exit(0);
|
|
||||||
//SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);
|
|
||||||
}
|
|
||||||
//gprintf("\n\tcIOS = %u (Rev %u)",IOS_GetVersion(), IOS_GetRevision());//don't need gprintf if sending console shit to gecko, too
|
|
||||||
printf("\n\tcIOS = %u (Rev %u)",IOS_GetVersion(), IOS_GetRevision());
|
|
||||||
|
|
||||||
// printf("Sleeping for 5 seconds\n");
|
|
||||||
// sleep(5);
|
|
||||||
|
|
||||||
//if a ID was passed via args copy it and try to boot it after the partition is mounted
|
|
||||||
//its not really a headless mode. more like hairless.
|
|
||||||
if (argc > 1 && argv[1])
|
|
||||||
{
|
|
||||||
if (strlen(argv[1])==6)
|
|
||||||
strncpy(headlessID, argv[1], sizeof(headlessID));
|
|
||||||
}
|
|
||||||
|
|
||||||
//! Init the rest of the System
|
//! Init the rest of the System
|
||||||
Sys_Init();
|
Sys_Init();
|
||||||
Wpad_Init();
|
Wpad_Init();
|
||||||
if(!startupproblem)
|
InitVideo();
|
||||||
InitVideo();
|
InitAudio(); // Initialize audio
|
||||||
InitAudio(); // Initialize audio
|
|
||||||
|
|
||||||
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);
|
||||||
@ -496,8 +203,9 @@ main(int argc, char *argv[])
|
|||||||
fontClock->loadFont(NULL, clock_ttf, clock_ttf_size, 0);
|
fontClock->loadFont(NULL, clock_ttf, clock_ttf_size, 0);
|
||||||
fontClock->setCompatibilityMode(FTGX_COMPATIBILITY_DEFAULT_TEVOP_GX_PASSCLR | FTGX_COMPATIBILITY_DEFAULT_VTXDESC_GX_NONE);
|
fontClock->setCompatibilityMode(FTGX_COMPATIBILITY_DEFAULT_TEVOP_GX_PASSCLR | FTGX_COMPATIBILITY_DEFAULT_VTXDESC_GX_NONE);
|
||||||
|
|
||||||
gprintf("\n\tEnd of Main()");
|
gprintf("\n\tEnd of Main()");
|
||||||
InitGUIThreads();
|
InitGUIThreads();
|
||||||
MainMenu(MENU_CHECK);
|
MainMenu(MENU_DISCLIST);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
327
source/menu.cpp
327
source/menu.cpp
@ -21,7 +21,9 @@
|
|||||||
#include "settings/cfg.h"
|
#include "settings/cfg.h"
|
||||||
#include "themes/Theme_Downloader.h"
|
#include "themes/Theme_Downloader.h"
|
||||||
#include "usbloader/disc.h"
|
#include "usbloader/disc.h"
|
||||||
|
#include "usbloader/wdvd.h"
|
||||||
#include "usbloader/getentries.h"
|
#include "usbloader/getentries.h"
|
||||||
|
#include "usbloader/usbstorage.h"
|
||||||
#include "wad/title.h"
|
#include "wad/title.h"
|
||||||
#include "xml/xml.h"
|
#include "xml/xml.h"
|
||||||
#include "audio.h"
|
#include "audio.h"
|
||||||
@ -44,7 +46,7 @@ GuiSound *btnClick2 = NULL;
|
|||||||
|
|
||||||
struct discHdr *dvdheader = NULL;
|
struct discHdr *dvdheader = NULL;
|
||||||
int currentMenu;
|
int currentMenu;
|
||||||
u8 mountMethod=0;
|
u8 mountMethod=3;
|
||||||
|
|
||||||
char game_partition[6];
|
char game_partition[6];
|
||||||
int load_from_fs;
|
int load_from_fs;
|
||||||
@ -65,8 +67,6 @@ static int ExitRequested = 0;
|
|||||||
/*** Extern variables ***/
|
/*** Extern variables ***/
|
||||||
extern struct discHdr * gameList;
|
extern struct discHdr * gameList;
|
||||||
extern FreeTypeGX *fontClock;
|
extern FreeTypeGX *fontClock;
|
||||||
extern u8 shutdown;
|
|
||||||
extern u8 reset;
|
|
||||||
extern s32 gameSelected, gameStart;
|
extern s32 gameSelected, gameStart;
|
||||||
extern u8 boothomebrew;
|
extern u8 boothomebrew;
|
||||||
extern u8 dbvideo;
|
extern u8 dbvideo;
|
||||||
@ -79,7 +79,8 @@ extern u8 dbvideo;
|
|||||||
* after finishing the removal/insertion of new elements, and after initial
|
* after finishing the removal/insertion of new elements, and after initial
|
||||||
* GUI setup.
|
* GUI setup.
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
void ResumeGui() {
|
void ResumeGui()
|
||||||
|
{
|
||||||
guiHalt = false;
|
guiHalt = false;
|
||||||
LWP_ResumeThread (guithread);
|
LWP_ResumeThread (guithread);
|
||||||
}
|
}
|
||||||
@ -92,8 +93,11 @@ void ResumeGui() {
|
|||||||
* This eliminates the possibility that the GUI is in the middle of accessing
|
* This eliminates the possibility that the GUI is in the middle of accessing
|
||||||
* an element that is being changed.
|
* an element that is being changed.
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
void HaltGui() {
|
void HaltGui()
|
||||||
if (guiHalt)return;
|
{
|
||||||
|
if (guiHalt)
|
||||||
|
return;
|
||||||
|
|
||||||
guiHalt = true;
|
guiHalt = true;
|
||||||
|
|
||||||
// wait for thread to finish
|
// wait for thread to finish
|
||||||
@ -182,13 +186,16 @@ void InitGUIThreads() {
|
|||||||
LWP_CreateThread(&guithread, UpdateGUI, NULL, NULL, 0, LWP_PRIO_HIGHEST);
|
LWP_CreateThread(&guithread, UpdateGUI, NULL, NULL, 0, LWP_PRIO_HIGHEST);
|
||||||
InitProgressThread();
|
InitProgressThread();
|
||||||
InitNetworkThread();
|
InitNetworkThread();
|
||||||
|
InitCheckThread();
|
||||||
|
|
||||||
if (Settings.autonetwork)
|
if (Settings.autonetwork)
|
||||||
ResumeNetworkThread();
|
ResumeNetworkThread();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExitGUIThreads() {
|
void ExitGUIThreads()
|
||||||
|
{
|
||||||
ExitRequested = 1;
|
ExitRequested = 1;
|
||||||
|
ExitCheckThread();
|
||||||
LWP_JoinThread(guithread, NULL);
|
LWP_JoinThread(guithread, NULL);
|
||||||
guithread = LWP_THREAD_NULL;
|
guithread = LWP_THREAD_NULL;
|
||||||
}
|
}
|
||||||
@ -253,9 +260,6 @@ int MainMenu(int menu) {
|
|||||||
currentMenu = menu;
|
currentMenu = menu;
|
||||||
char imgPath[100];
|
char imgPath[100];
|
||||||
|
|
||||||
//if (strcmp(headlessID,"")!=0)HaltGui();
|
|
||||||
//WindowPrompt("Can you see me now",0,"ok");
|
|
||||||
|
|
||||||
snprintf(imgPath, sizeof(imgPath), "%splayer1_point.png", CFG.theme_path);
|
snprintf(imgPath, sizeof(imgPath), "%splayer1_point.png", CFG.theme_path);
|
||||||
pointer[0] = new GuiImageData(imgPath, player1_point_png);
|
pointer[0] = new GuiImageData(imgPath, player1_point_png);
|
||||||
snprintf(imgPath, sizeof(imgPath), "%splayer2_point.png", CFG.theme_path);
|
snprintf(imgPath, sizeof(imgPath), "%splayer2_point.png", CFG.theme_path);
|
||||||
@ -277,8 +281,7 @@ int MainMenu(int menu) {
|
|||||||
bgImg = new GuiImage(background);
|
bgImg = new GuiImage(background);
|
||||||
mainWindow->Append(bgImg);
|
mainWindow->Append(bgImg);
|
||||||
|
|
||||||
if (strcmp(headlessID,"")==0)
|
ResumeGui();
|
||||||
ResumeGui();
|
|
||||||
|
|
||||||
bgMusic = new GuiSound(bg_music_ogg, bg_music_ogg_size, Settings.volume);
|
bgMusic = new GuiSound(bg_music_ogg, bg_music_ogg_size, Settings.volume);
|
||||||
bgMusic->SetLoop(1); //loop music
|
bgMusic->SetLoop(1); //loop music
|
||||||
@ -291,43 +294,37 @@ int MainMenu(int menu) {
|
|||||||
while (currentMenu != MENU_EXIT) {
|
while (currentMenu != MENU_EXIT) {
|
||||||
bgMusic->SetVolume(Settings.volume);
|
bgMusic->SetVolume(Settings.volume);
|
||||||
|
|
||||||
switch (currentMenu) {
|
switch (currentMenu)
|
||||||
case MENU_CHECK:
|
{
|
||||||
|
case MENU_FORMAT:
|
||||||
currentMenu = MenuCheck();
|
currentMenu = MenuFormat();
|
||||||
break;
|
break;
|
||||||
case MENU_FORMAT:
|
case MENU_INSTALL:
|
||||||
currentMenu = MenuFormat();
|
currentMenu = MenuInstall();
|
||||||
break;
|
break;
|
||||||
case MENU_INSTALL:
|
case MENU_SETTINGS:
|
||||||
currentMenu = MenuInstall();
|
currentMenu = MenuSettings();
|
||||||
break;
|
break;
|
||||||
case MENU_SETTINGS:
|
case MENU_THEMEDOWNLOADER:
|
||||||
currentMenu = MenuSettings();
|
currentMenu = Theme_Downloader();
|
||||||
break;
|
break;
|
||||||
case MENU_THEMEDOWNLOADER:
|
case MENU_HOMEBREWBROWSE:
|
||||||
currentMenu = Theme_Downloader();
|
currentMenu = MenuHomebrewBrowse();
|
||||||
break;
|
break;
|
||||||
case MENU_HOMEBREWBROWSE:
|
case MENU_DISCLIST:
|
||||||
currentMenu = MenuHomebrewBrowse();
|
currentMenu = MenuDiscList();
|
||||||
break;
|
break;
|
||||||
case MENU_DISCLIST:
|
default: // unrecognized menu
|
||||||
currentMenu = MenuDiscList();
|
currentMenu = MenuDiscList();
|
||||||
break;
|
break;
|
||||||
default: // unrecognized menu
|
|
||||||
currentMenu = MenuCheck();
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// MemInfoPrompt();
|
|
||||||
gprintf("\nExiting main GUI. mountMethod = %d",mountMethod);
|
gprintf("\nExiting main GUI. mountMethod = %d",mountMethod);
|
||||||
|
|
||||||
CloseXMLDatabase();
|
CloseXMLDatabase();
|
||||||
NewTitles::DestroyInstance();
|
NewTitles::DestroyInstance();
|
||||||
if (strcmp(headlessID,"")!=0)//the GUIthread was never started, so it cant be ended and joined properly if headless mode was used. so we resume it and close it.
|
|
||||||
ResumeGui();
|
|
||||||
ExitGUIThreads();
|
ExitGUIThreads();
|
||||||
|
|
||||||
bgMusic->Stop();
|
bgMusic->Stop();
|
||||||
@ -347,70 +344,72 @@ int MainMenu(int menu) {
|
|||||||
StopGX();
|
StopGX();
|
||||||
gettextCleanUp();
|
gettextCleanUp();
|
||||||
|
|
||||||
if(dbvideo)
|
menuBootgame("");
|
||||||
{
|
|
||||||
InitVideodebug ();
|
return 0;
|
||||||
printf("\n\n\n\n\n");
|
}
|
||||||
}
|
|
||||||
if (mountMethod==3)
|
void menuBootgame(const char *headless)
|
||||||
{
|
{
|
||||||
struct discHdr *header = &gameList[gameSelected];
|
if (mountMethod==3)
|
||||||
char tmp[20];
|
{
|
||||||
u32 tid;
|
struct discHdr *header = &gameList[gameSelected];
|
||||||
sprintf(tmp,"%c%c%c%c",header->id[0],header->id[1],header->id[2],header->id[3]);
|
char tmp[20];
|
||||||
memcpy(&tid, tmp, 4);
|
u32 tid;
|
||||||
gprintf("\nBooting title %016llx",TITLE_ID((header->id[5]=='1'?0x00010001:0x00010002),tid));
|
sprintf(tmp,"%c%c%c%c",header->id[0],header->id[1],header->id[2],header->id[3]);
|
||||||
WII_Initialize();
|
memcpy(&tid, tmp, 4);
|
||||||
WII_LaunchTitle(TITLE_ID((header->id[5]=='1'?0x00010001:0x00010002),tid));
|
gprintf("\nBooting title %016llx",TITLE_ID((header->id[5]=='1'?0x00010001:0x00010002),tid));
|
||||||
}
|
WII_Initialize();
|
||||||
if (mountMethod==2)
|
WII_LaunchTitle(TITLE_ID((header->id[5]=='1'?0x00010001:0x00010002),tid));
|
||||||
{
|
}
|
||||||
gprintf("\nLoading BC for GameCube");
|
if (mountMethod==2)
|
||||||
WII_Initialize();
|
{
|
||||||
WII_LaunchTitle(0x0000000100000100ULL);
|
gprintf("\nLoading BC for GameCube");
|
||||||
}
|
WII_Initialize();
|
||||||
|
WII_LaunchTitle(0x0000000100000100ULL);
|
||||||
|
}
|
||||||
|
|
||||||
else if (boothomebrew == 1) {
|
else if (boothomebrew == 1) {
|
||||||
gprintf("\nBootHomebrew");
|
gprintf("\nBootHomebrew");
|
||||||
BootHomebrew(Settings.selected_homebrew);
|
BootHomebrew(Settings.selected_homebrew);
|
||||||
}
|
}
|
||||||
else if (boothomebrew == 2) {
|
else if (boothomebrew == 2) {
|
||||||
gprintf("\nBootHomebrewFromMenu");
|
gprintf("\nBootHomebrewFromMenu");
|
||||||
BootHomebrewFromMem();
|
BootHomebrewFromMem();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
gprintf("\n\tSettings.partition:%d",Settings.partition);
|
gprintf("\n\tSettings.partition:%d",Settings.partition);
|
||||||
struct discHdr *header = NULL;
|
struct discHdr *header = NULL;
|
||||||
//if the GUI was "skipped" to boot a game from main(argv[1])
|
//if the GUI was "skipped" to boot a game from main(argv[1])
|
||||||
if (strcmp(headlessID,"")!=0)
|
if (strcmp(headless,"")!=0)
|
||||||
{
|
{
|
||||||
gprintf("\n\tHeadless mode (%s)",headlessID);
|
gprintf("\n\tHeadless mode (%s)",headless);
|
||||||
__Menu_GetEntries(1);
|
__Menu_GetEntries(1);
|
||||||
if (!gameCnt)
|
if (!gameCnt)
|
||||||
{
|
{
|
||||||
gprintf(" ERROR : !gameCnt");
|
gprintf(" ERROR : !gameCnt");
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
//gprintf("\n\tgameCnt:%d",gameCnt);
|
gprintf("\n\tgameCnt:%d",gameCnt);
|
||||||
for(u32 i=0;i<gameCnt;i++)
|
for(u32 i=0;i<gameCnt;i++)
|
||||||
{
|
{
|
||||||
header = &gameList[i];
|
header = &gameList[i];
|
||||||
char tmp[8];
|
char tmp[8];
|
||||||
sprintf(tmp,"%c%c%c%c%c%c",header->id[0],header->id[1],header->id[2],header->id[3],header->id[4],header->id[5]);
|
sprintf(tmp,"%c%c%c%c%c%c",header->id[0],header->id[1],header->id[2],header->id[3],header->id[4],header->id[5]);
|
||||||
if (strcmp(tmp,headlessID)==0)
|
if (strcmp(tmp,headless)==0)
|
||||||
{
|
{
|
||||||
gameSelected = i;
|
gameSelected = i;
|
||||||
gprintf(" found (%d)",i);
|
gprintf(" found (%d)",i);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
//if the game was not found
|
//if the game was not found
|
||||||
if (i==gameCnt-1)
|
if (i==gameCnt-1)
|
||||||
{
|
{
|
||||||
gprintf(" not found (%d IDs checked)",i);
|
gprintf(" not found (%d IDs checked)",i);
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
@ -426,10 +425,10 @@ int MainMenu(int menu) {
|
|||||||
fix002 = game_cfg->errorfix002;
|
fix002 = game_cfg->errorfix002;
|
||||||
iosChoice = game_cfg->ios;
|
iosChoice = game_cfg->ios;
|
||||||
countrystrings = game_cfg->patchcountrystrings;
|
countrystrings = game_cfg->patchcountrystrings;
|
||||||
if (!altdoldefault) {
|
if (!altdoldefault) {
|
||||||
alternatedol = game_cfg->loadalternatedol;
|
alternatedol = game_cfg->loadalternatedol;
|
||||||
alternatedoloffset = game_cfg->alternatedolstart;
|
alternatedoloffset = game_cfg->alternatedolstart;
|
||||||
}
|
}
|
||||||
reloadblock = game_cfg->iosreloadblock;
|
reloadblock = game_cfg->iosreloadblock;
|
||||||
} else {
|
} else {
|
||||||
videoChoice = Settings.video;
|
videoChoice = Settings.video;
|
||||||
@ -443,81 +442,86 @@ int MainMenu(int menu) {
|
|||||||
}
|
}
|
||||||
fix002 = Settings.error002;
|
fix002 = Settings.error002;
|
||||||
countrystrings = Settings.patchcountrystrings;
|
countrystrings = Settings.patchcountrystrings;
|
||||||
if (!altdoldefault) {
|
if (!altdoldefault) {
|
||||||
alternatedol = off;
|
alternatedol = off;
|
||||||
alternatedoloffset = 0;
|
alternatedoloffset = 0;
|
||||||
}
|
}
|
||||||
reloadblock = off;
|
reloadblock = off;
|
||||||
}
|
}
|
||||||
int ios2;
|
int ios2;
|
||||||
|
|
||||||
switch (iosChoice) {
|
switch (iosChoice) {
|
||||||
case i249:
|
case i249:
|
||||||
ios2 = 249;
|
ios2 = 249;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case i222:
|
case i222:
|
||||||
ios2 = 222;
|
ios2 = 222;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case i223:
|
case i223:
|
||||||
ios2 = 223;
|
ios2 = 223;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
ios2 = 249;
|
ios2 = 249;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// When the selected ios is 249, and you're loading from FAT, reset ios to 222
|
// When the selected ios is 249, and you're loading from FAT, reset ios to 222
|
||||||
if (load_from_fs != PART_FS_WBFS && ios2 == 249) {
|
if (load_from_fs != PART_FS_WBFS && ios2 == 249)
|
||||||
ios2 = 222;
|
ios2 = 222;
|
||||||
}
|
|
||||||
bool onlinefix = ShutdownWC24();
|
|
||||||
|
|
||||||
// You cannot reload ios when loading from fat
|
ShutdownWC24();
|
||||||
if (IOS_GetVersion() != ios2 || onlinefix) {
|
|
||||||
|
// You cannot reload ios when loading from fat
|
||||||
|
if (IOS_GetVersion() != ios2)
|
||||||
|
{
|
||||||
ret = Sys_ChangeIos(ios2);
|
ret = Sys_ChangeIos(ios2);
|
||||||
if (ret < 0) {
|
if (ret < 0)
|
||||||
Sys_ChangeIos(249);
|
Sys_ChangeIos(249);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (!mountMethod)
|
|
||||||
{
|
|
||||||
gprintf("\nLoading fragment list...");
|
|
||||||
ret = get_frag_list(header->id);
|
|
||||||
gprintf("%d\n", ret);
|
|
||||||
|
|
||||||
gprintf("\nSetting fragment list...");
|
if (!mountMethod)
|
||||||
ret = set_frag_list(header->id);
|
{
|
||||||
gprintf("%d\n", ret);
|
gprintf("\nLoading fragment list...");
|
||||||
|
ret = get_frag_list(header->id);
|
||||||
|
gprintf("%d\n", ret);
|
||||||
|
|
||||||
ret = Disc_SetUSB(header->id);
|
gprintf("\nSetting fragment list...");
|
||||||
if (ret < 0) Sys_BackToLoader();
|
ret = set_frag_list(header->id);
|
||||||
gprintf("\n\tUSB set to game");
|
gprintf("%d\n", ret);
|
||||||
}
|
|
||||||
else {
|
ret = Disc_SetUSB(header->id);
|
||||||
gprintf("\n\tUSB not set, loading DVD");
|
if (ret < 0) Sys_BackToLoader();
|
||||||
}
|
gprintf("\n\tUSB set to game");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
gprintf("\n\tUSB not set, loading DVD");
|
||||||
|
Disc_SetUSB(NULL);
|
||||||
|
ret = WDVD_Close();
|
||||||
|
ret = Disc_Init();
|
||||||
|
}
|
||||||
ret = Disc_Open();
|
ret = Disc_Open();
|
||||||
|
gprintf("\n\tDisc_Open():%d",ret);
|
||||||
|
|
||||||
if (ret < 0) Sys_BackToLoader();
|
if (ret < 0 && !mountMethod) Sys_BackToLoader();
|
||||||
|
|
||||||
if (gameList){
|
if (gameList)
|
||||||
free(gameList);
|
free(gameList);
|
||||||
}
|
|
||||||
if(dvdheader)
|
|
||||||
delete dvdheader;
|
|
||||||
|
|
||||||
gprintf("\nLoading BCA data...");
|
if(dvdheader)
|
||||||
ret = do_bca_code(header->id);
|
delete dvdheader;
|
||||||
gprintf("%d\n", ret);
|
|
||||||
|
|
||||||
if (reloadblock == on && Sys_IsHermes()) {
|
gprintf("\nLoading BCA data...");
|
||||||
|
ret = do_bca_code(header->id);
|
||||||
|
gprintf("%d\n", ret);
|
||||||
|
|
||||||
|
if (reloadblock == on && Sys_IsHermes())
|
||||||
|
{
|
||||||
patch_cios_data();
|
patch_cios_data();
|
||||||
if (load_from_fs == PART_FS_WBFS) {
|
if (load_from_fs == PART_FS_WBFS)
|
||||||
mload_close();
|
mload_close();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 errorfixer002 = 0;
|
u8 errorfixer002 = 0;
|
||||||
@ -644,14 +648,13 @@ int MainMenu(int menu) {
|
|||||||
vipatch = 0;
|
vipatch = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
gprintf("\n\tDisc_wiiBoot");
|
gprintf("\n\tDisc_wiiBoot");
|
||||||
|
|
||||||
ret = Disc_WiiBoot(videoselected, cheat, vipatch, countrystrings, errorfixer002, alternatedol, alternatedoloffset);
|
ret = Disc_WiiBoot(videoselected, cheat, vipatch, countrystrings, errorfixer002, alternatedol, alternatedoloffset);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
Sys_LoadMenu();
|
Sys_LoadMenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("Returning entry point: 0x%0x\n", ret);
|
printf("Returning entry point: 0x%0x\n", ret);
|
||||||
}
|
}
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
@ -15,8 +15,11 @@
|
|||||||
|
|
||||||
void InitGUIThreads(void);
|
void InitGUIThreads(void);
|
||||||
void ExitGUIThreads(void);
|
void ExitGUIThreads(void);
|
||||||
|
void ResumeGui();
|
||||||
|
void HaltGui();
|
||||||
|
void menuBootgame(const char *headless);
|
||||||
|
|
||||||
int MainMenu (int menuitem);
|
int MainMenu (int menu);
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
MENU_EXIT = -1,
|
MENU_EXIT = -1,
|
||||||
|
202
source/menu/device_check.cpp
Normal file
202
source/menu/device_check.cpp
Normal file
@ -0,0 +1,202 @@
|
|||||||
|
#include <dirent.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#include "gecko.h"
|
||||||
|
#include "menus.h"
|
||||||
|
#include "wpad.h"
|
||||||
|
#include "fatmounter.h"
|
||||||
|
#include "usbloader/getentries.h"
|
||||||
|
#include "usbloader/wbfs.h"
|
||||||
|
|
||||||
|
extern int load_from_fs;
|
||||||
|
extern char game_partition[6];
|
||||||
|
|
||||||
|
static lwp_t checkthread = LWP_THREAD_NULL;
|
||||||
|
static bool checkHalt = false;
|
||||||
|
static bool ExitRequested = false;
|
||||||
|
static u8 sdState =0;
|
||||||
|
u8 hddState = 0;
|
||||||
|
u8 checkthreadState = 0;
|
||||||
|
|
||||||
|
extern u8 shutdown;
|
||||||
|
extern u8 reset;
|
||||||
|
|
||||||
|
void ResumeCheck()
|
||||||
|
{
|
||||||
|
checkHalt = false;
|
||||||
|
LWP_ResumeThread(checkthread);
|
||||||
|
}
|
||||||
|
|
||||||
|
void HaltCheck()
|
||||||
|
{
|
||||||
|
if(checkHalt)
|
||||||
|
return;
|
||||||
|
|
||||||
|
checkHalt = true;
|
||||||
|
|
||||||
|
while (!LWP_ThreadIsSuspended(checkthread))
|
||||||
|
usleep(50);
|
||||||
|
}
|
||||||
|
|
||||||
|
int CheckPartition()
|
||||||
|
{
|
||||||
|
s32 ret2 = -1;
|
||||||
|
memset(game_partition, 0, 6);
|
||||||
|
load_from_fs = -1;
|
||||||
|
|
||||||
|
extern PartList partitions;
|
||||||
|
// Added for slow HDD
|
||||||
|
for (int runs = 0; runs < 10; runs++)
|
||||||
|
{
|
||||||
|
if (Partition_GetList(WBFS_DEVICE_USB, &partitions) != 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (Settings.partition != -1 && partitions.num > Settings.partition)
|
||||||
|
{
|
||||||
|
PartInfo pinfo = partitions.pinfo[Settings.partition];
|
||||||
|
if (WBFS_OpenPart(pinfo.part_fs, pinfo.index, partitions.pentry[Settings.partition].sector, partitions.pentry[Settings.partition].size, (char *) &game_partition) == 0)
|
||||||
|
{
|
||||||
|
ret2 = 0;
|
||||||
|
load_from_fs = pinfo.part_fs;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (partitions.wbfs_n != 0)
|
||||||
|
{
|
||||||
|
ret2 = WBFS_Open();
|
||||||
|
for (int p = 0; p < partitions.num; p++)
|
||||||
|
{
|
||||||
|
if (partitions.pinfo[p].fs_type == FS_TYPE_WBFS)
|
||||||
|
{
|
||||||
|
Settings.partition = p;
|
||||||
|
load_from_fs = PART_FS_WBFS;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (Sys_IsHermes() && (partitions.fat_n != 0 || partitions.ntfs_n != 0))
|
||||||
|
{
|
||||||
|
// Loop through FAT/NTFS partitions, and find the first partition with games on it (if there is one)
|
||||||
|
u32 count;
|
||||||
|
for (int i = 0; i < partitions.num; i++)
|
||||||
|
{
|
||||||
|
if (partitions.pinfo[i].fs_type == FS_TYPE_FAT32 || partitions.pinfo[i].fs_type == FS_TYPE_NTFS)
|
||||||
|
{
|
||||||
|
if (!WBFS_OpenPart(partitions.pinfo[i].part_fs, partitions.pinfo[i].index, partitions.pentry[i].sector, partitions.pentry[i].size, (char *) &game_partition))
|
||||||
|
{
|
||||||
|
// Get the game count...
|
||||||
|
WBFS_GetCount(&count);
|
||||||
|
if (count > 0)
|
||||||
|
{
|
||||||
|
load_from_fs = partitions.pinfo[i].part_fs;
|
||||||
|
Settings.partition = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
WBFS_Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((ret2 >= 0 || load_from_fs != PART_FS_WBFS) && isInserted(bootDevice))
|
||||||
|
{
|
||||||
|
cfg_save_global();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ret2 < 0 && load_from_fs != PART_FS_WBFS)
|
||||||
|
return ret2;
|
||||||
|
|
||||||
|
ret2 = Disc_Init();
|
||||||
|
if (ret2 < 0)
|
||||||
|
return ret2;
|
||||||
|
|
||||||
|
// open database if needed, load titles if needed
|
||||||
|
if(isInserted(bootDevice))
|
||||||
|
OpenXMLDatabase(Settings.titlestxt_path,Settings.db_language, Settings.db_JPtoEN, true, Settings.titlesOverride==1?true:false, true);
|
||||||
|
|
||||||
|
hddState = 1;
|
||||||
|
|
||||||
|
return hddState;
|
||||||
|
}
|
||||||
|
|
||||||
|
int CheckHDD()
|
||||||
|
{
|
||||||
|
USBDevice_deInit();
|
||||||
|
USBDevice_Init();
|
||||||
|
|
||||||
|
int wbfsinit = WBFS_Init(WBFS_DEVICE_USB);
|
||||||
|
|
||||||
|
if (wbfsinit >= 0)
|
||||||
|
wbfsinit = CheckPartition();
|
||||||
|
|
||||||
|
return wbfsinit;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void * CheckDevices (void *arg)
|
||||||
|
{
|
||||||
|
sdState = isInserted(bootDevice);
|
||||||
|
while (!ExitRequested)
|
||||||
|
{
|
||||||
|
usleep(100);
|
||||||
|
|
||||||
|
if (checkHalt && !ExitRequested)
|
||||||
|
{
|
||||||
|
LWP_SuspendThread(checkthread);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (shutdown == 1)
|
||||||
|
Sys_Shutdown();
|
||||||
|
|
||||||
|
else if (reset == 1)
|
||||||
|
Sys_Reboot();
|
||||||
|
|
||||||
|
if (!hddState)
|
||||||
|
{
|
||||||
|
if(CheckHDD() >= 0)
|
||||||
|
{
|
||||||
|
checkthreadState = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//this really doesnt work right. it seems that isInserted() isn't what it should be.
|
||||||
|
int sdNow = isInserted(bootDevice);
|
||||||
|
if (sdState != sdNow)
|
||||||
|
{
|
||||||
|
sdState = sdNow;
|
||||||
|
checkthreadState = 2;
|
||||||
|
WindowPrompt("2",0,"OK");
|
||||||
|
}
|
||||||
|
|
||||||
|
u32 buttons = ButtonsPressed();
|
||||||
|
if((buttons & WPAD_NUNCHUK_BUTTON_Z) || (buttons & WPAD_CLASSIC_BUTTON_ZL) ||
|
||||||
|
(buttons & PAD_TRIGGER_Z))
|
||||||
|
{
|
||||||
|
gprintf("\n\tscreenShotBtn clicked");
|
||||||
|
ScreenShot();
|
||||||
|
gprintf("...It's easy, mmmmmmKay");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
void InitCheckThread()
|
||||||
|
{
|
||||||
|
LWP_CreateThread(&checkthread, CheckDevices, NULL, NULL, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ExitCheckThread()
|
||||||
|
{
|
||||||
|
ExitRequested = true;
|
||||||
|
LWP_ResumeThread(checkthread);
|
||||||
|
LWP_JoinThread(checkthread, NULL);
|
||||||
|
checkthread = LWP_THREAD_NULL;
|
||||||
|
}
|
@ -1,164 +0,0 @@
|
|||||||
#include <dirent.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
#include "menus.h"
|
|
||||||
#include "wpad.h"
|
|
||||||
#include "fatmounter.h"
|
|
||||||
#include "usbloader/getentries.h"
|
|
||||||
#include "usbloader/wbfs.h"
|
|
||||||
|
|
||||||
extern int load_from_fs;
|
|
||||||
extern char game_partition[6];
|
|
||||||
extern char headlessID[8];
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* MenuCheck
|
|
||||||
***************************************************************************/
|
|
||||||
int MenuCheck() {
|
|
||||||
gprintf("\nMenuCheck()");
|
|
||||||
int menu = MENU_NONE;
|
|
||||||
int i = 0;
|
|
||||||
int choice;
|
|
||||||
s32 ret2, wbfsinit;
|
|
||||||
OptionList options;
|
|
||||||
options.length = i;
|
|
||||||
|
|
||||||
VIDEO_WaitVSync ();
|
|
||||||
|
|
||||||
wbfsinit = WBFS_Init(WBFS_DEVICE_USB);
|
|
||||||
if (wbfsinit < 0) {
|
|
||||||
ret2 = WindowPrompt(tr("No USB Device found."), tr("Do you want to retry for 30 secs?"), "cIOS249", "cIOS222", tr("Back to Wii Menu"));
|
|
||||||
SDCard_deInit();
|
|
||||||
USBDevice_deInit();
|
|
||||||
WPAD_Flush(0);
|
|
||||||
WPAD_Disconnect(0);
|
|
||||||
WPAD_Shutdown();
|
|
||||||
if (ret2 == 1) {
|
|
||||||
Settings.cios = ios249;
|
|
||||||
} else if (ret2 == 2) {
|
|
||||||
Settings.cios = ios222;
|
|
||||||
} else {
|
|
||||||
Sys_LoadMenu();
|
|
||||||
}
|
|
||||||
ret2 = DiscWait(tr("No USB Device"), tr("Waiting for USB Device"), 0, 0, 1);
|
|
||||||
//reinitialize SD and USB
|
|
||||||
Wpad_Init();
|
|
||||||
WPAD_SetDataFormat(WPAD_CHAN_ALL,WPAD_FMT_BTNS_ACC_IR);
|
|
||||||
WPAD_SetVRes(WPAD_CHAN_ALL, screenwidth, screenheight);
|
|
||||||
if (ret2 < 0) {
|
|
||||||
WindowPrompt (tr("Error !"),tr("USB Device not found"), tr("OK"));
|
|
||||||
Sys_LoadMenu();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ret2 = -1;
|
|
||||||
memset(game_partition, 0, 6);
|
|
||||||
load_from_fs = -1;
|
|
||||||
|
|
||||||
extern PartList partitions;
|
|
||||||
// Added for slow HDD
|
|
||||||
for (int runs = 0; runs < 10; runs++) {
|
|
||||||
if (Partition_GetList(WBFS_DEVICE_USB, &partitions) != 0) {
|
|
||||||
sleep(1);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Settings.partition != -1 && partitions.num > Settings.partition) {
|
|
||||||
PartInfo pinfo = partitions.pinfo[Settings.partition];
|
|
||||||
if (WBFS_OpenPart(pinfo.part_fs, pinfo.index, partitions.pentry[Settings.partition].sector, partitions.pentry[Settings.partition].size, (char *) &game_partition) == 0)
|
|
||||||
{
|
|
||||||
ret2 = 0;
|
|
||||||
load_from_fs = pinfo.part_fs;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (partitions.wbfs_n != 0) {
|
|
||||||
ret2 = WBFS_Open();
|
|
||||||
for (int p = 0; p < partitions.num; p++) {
|
|
||||||
if (partitions.pinfo[p].fs_type == FS_TYPE_WBFS) {
|
|
||||||
Settings.partition = p;
|
|
||||||
load_from_fs = PART_FS_WBFS;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (Sys_IsHermes() && (partitions.fat_n != 0 || partitions.ntfs_n != 0)) {
|
|
||||||
// Loop through FAT/NTFS partitions, and find the first partition with games on it (if there is one)
|
|
||||||
u32 count;
|
|
||||||
|
|
||||||
for (int i = 0; i < partitions.num; i++) {
|
|
||||||
if (partitions.pinfo[i].fs_type == FS_TYPE_FAT32 || partitions.pinfo[i].fs_type == FS_TYPE_NTFS) {
|
|
||||||
|
|
||||||
if (!WBFS_OpenPart(partitions.pinfo[i].part_fs, partitions.pinfo[i].index, partitions.pentry[i].sector, partitions.pentry[i].size, (char *) &game_partition)) {
|
|
||||||
// Get the game count...
|
|
||||||
WBFS_GetCount(&count);
|
|
||||||
|
|
||||||
if (count > 0) {
|
|
||||||
load_from_fs = partitions.pinfo[i].part_fs;
|
|
||||||
Settings.partition = i;
|
|
||||||
break;
|
|
||||||
} else {
|
|
||||||
WBFS_Close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((ret2 >= 0 || load_from_fs != PART_FS_WBFS) && isInserted(bootDevice)) {
|
|
||||||
cfg_save_global();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
sleep(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ret2 < 0 && load_from_fs != PART_FS_WBFS) {
|
|
||||||
choice = WindowPrompt(tr("No WBFS or FAT/NTFS partition found"),tr("You need to select or format a partition"), tr("Select"), tr("Format"), tr("Return"));
|
|
||||||
if (choice == 0) {
|
|
||||||
Sys_LoadMenu();
|
|
||||||
} else {
|
|
||||||
load_from_fs = choice == 1 ? PART_FS_FAT : PART_FS_WBFS;
|
|
||||||
menu = MENU_FORMAT;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ret2 = Disc_Init();
|
|
||||||
if (ret2 < 0) {
|
|
||||||
WindowPrompt (tr("Error !"),tr("Could not initialize DIP module!"),tr("OK"));
|
|
||||||
Sys_LoadMenu();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (shutdown == 1)
|
|
||||||
Sys_Shutdown();
|
|
||||||
if (reset == 1)
|
|
||||||
Sys_Reboot();
|
|
||||||
|
|
||||||
if (wbfsinit < 0) {
|
|
||||||
sleep(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
// open database if needed, load titles if needed
|
|
||||||
if(isInserted(bootDevice))OpenXMLDatabase(Settings.titlestxt_path,Settings.db_language, Settings.db_JPtoEN, true, Settings.titlesOverride==1?true:false, true);
|
|
||||||
|
|
||||||
// titles.txt loaded after database to override database titles with custom titles
|
|
||||||
//snprintf(pathname, sizeof(pathname), "%stitles.txt", Settings.titlestxt_path);
|
|
||||||
//cfg_parsefile(pathname, &title_set);
|
|
||||||
|
|
||||||
//Spieleliste laden
|
|
||||||
__Menu_GetEntries(0);
|
|
||||||
|
|
||||||
if (strcmp(headlessID,"")!=0)
|
|
||||||
menu = MENU_EXIT;
|
|
||||||
|
|
||||||
if (menu == MENU_NONE)
|
|
||||||
menu = MENU_DISCLIST;
|
|
||||||
|
|
||||||
//for HDDs with issues
|
|
||||||
if (wbfsinit < 0) {
|
|
||||||
sleep(1);
|
|
||||||
USBDevice_Init();
|
|
||||||
SDCard_Init();
|
|
||||||
}
|
|
||||||
|
|
||||||
return menu;
|
|
||||||
}
|
|
File diff suppressed because it is too large
Load Diff
@ -1,185 +1,196 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include "menus.h"
|
#include "menus.h"
|
||||||
#include "fatmounter.h"
|
#include "menus.h"
|
||||||
#include "usbloader/usbstorage.h"
|
#include "fatmounter.h"
|
||||||
#include "usbloader/utils.h"
|
#include "usbloader/usbstorage.h"
|
||||||
#include "usbloader/wbfs.h"
|
#include "usbloader/utils.h"
|
||||||
#include "libwiigui/gui_customoptionbrowser.h"
|
#include "usbloader/wbfs.h"
|
||||||
|
#include "libwiigui/gui_customoptionbrowser.h"
|
||||||
extern int load_from_fs;
|
|
||||||
extern char game_partition[6];
|
extern int load_from_fs;
|
||||||
|
extern char game_partition[6];
|
||||||
/****************************************************************************
|
|
||||||
* MenuFormat
|
/****************************************************************************
|
||||||
***************************************************************************/
|
* MenuFormat
|
||||||
int MenuFormat() {
|
***************************************************************************/
|
||||||
|
int MenuFormat() {
|
||||||
USBDevice_deInit();
|
|
||||||
sleep(1);
|
USBDevice_deInit();
|
||||||
|
sleep(1);
|
||||||
USBStorage_Init();
|
|
||||||
|
USBStorage_Init();
|
||||||
int menu = MENU_NONE;
|
|
||||||
char imgPath[100];
|
int menu = MENU_NONE;
|
||||||
|
char imgPath[100];
|
||||||
customOptionList options(MAX_PARTITIONS_EX);
|
|
||||||
extern PartList partitions;
|
customOptionList options(MAX_PARTITIONS_EX);
|
||||||
|
extern PartList partitions;
|
||||||
u32 cnt, counter = 0;
|
|
||||||
int choice, ret;
|
u32 cnt, counter = 0;
|
||||||
char text[ISFS_MAXPATH];
|
int choice, ret;
|
||||||
|
char text[ISFS_MAXPATH];
|
||||||
//create the partitionlist
|
|
||||||
for (cnt = 0; cnt < (u32) partitions.num; cnt++) {
|
//create the partitionlist
|
||||||
partitionEntry *entry = &partitions.pentry[cnt];
|
for (cnt = 0; cnt < (u32) partitions.num; cnt++) {
|
||||||
|
partitionEntry *entry = &partitions.pentry[cnt];
|
||||||
/* Calculate size in gigabytes */
|
|
||||||
f32 size = entry->size * (partitions.sector_size / GB_SIZE);
|
/* Calculate size in gigabytes */
|
||||||
|
f32 size = entry->size * (partitions.sector_size / GB_SIZE);
|
||||||
if (size) {
|
|
||||||
options.SetName(counter, "%s %d:",tr("Partition"), cnt+1);
|
if (size) {
|
||||||
options.SetValue(counter,"%.2fGB", size);
|
options.SetName(counter, "%s %d:",tr("Partition"), cnt+1);
|
||||||
} else {
|
options.SetValue(counter,"%.2fGB", size);
|
||||||
options.SetName(counter, "%s %d:",tr("Partition"), cnt+1);
|
} else {
|
||||||
options.SetValue(counter,tr("Can't be formatted"));
|
options.SetName(counter, "%s %d:",tr("Partition"), cnt+1);
|
||||||
}
|
options.SetValue(counter,tr("Can't be formatted"));
|
||||||
counter++;
|
}
|
||||||
}
|
counter++;
|
||||||
|
}
|
||||||
GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, Settings.sfxvolume);
|
|
||||||
// because destroy GuiSound must wait while sound playing is finished, we use a global sound
|
GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, Settings.sfxvolume);
|
||||||
if(!btnClick2) btnClick2=new GuiSound(button_click2_pcm, button_click2_pcm_size, Settings.sfxvolume);
|
// because destroy GuiSound must wait while sound playing is finished, we use a global sound
|
||||||
// GuiSound btnClick(button_click2_pcm, button_click2_pcm_size, Settings.sfxvolume);
|
if(!btnClick2) btnClick2=new GuiSound(button_click2_pcm, button_click2_pcm_size, Settings.sfxvolume);
|
||||||
snprintf(imgPath, sizeof(imgPath), "%swiimote_poweroff.png", CFG.theme_path);
|
// GuiSound btnClick(button_click2_pcm, button_click2_pcm_size, Settings.sfxvolume);
|
||||||
GuiImageData btnpwroff(imgPath, wiimote_poweroff_png);
|
snprintf(imgPath, sizeof(imgPath), "%swiimote_poweroff.png", CFG.theme_path);
|
||||||
snprintf(imgPath, sizeof(imgPath), "%swiimote_poweroff_over.png", CFG.theme_path);
|
GuiImageData btnpwroff(imgPath, wiimote_poweroff_png);
|
||||||
GuiImageData btnpwroffOver(imgPath, wiimote_poweroff_over_png);
|
snprintf(imgPath, sizeof(imgPath), "%swiimote_poweroff_over.png", CFG.theme_path);
|
||||||
snprintf(imgPath, sizeof(imgPath), "%smenu_button.png", CFG.theme_path);
|
GuiImageData btnpwroffOver(imgPath, wiimote_poweroff_over_png);
|
||||||
GuiImageData btnhome(imgPath, menu_button_png);
|
snprintf(imgPath, sizeof(imgPath), "%smenu_button.png", CFG.theme_path);
|
||||||
snprintf(imgPath, sizeof(imgPath), "%smenu_button_over.png", CFG.theme_path);
|
GuiImageData btnhome(imgPath, menu_button_png);
|
||||||
GuiImageData btnhomeOver(imgPath, menu_button_over_png);
|
snprintf(imgPath, sizeof(imgPath), "%smenu_button_over.png", CFG.theme_path);
|
||||||
GuiImageData battery(battery_png);
|
GuiImageData btnhomeOver(imgPath, menu_button_over_png);
|
||||||
GuiImageData batteryBar(battery_bar_png);
|
GuiImageData battery(battery_png);
|
||||||
GuiImageData batteryRed(battery_red_png);
|
GuiImageData batteryBar(battery_bar_png);
|
||||||
GuiImageData batteryBarRed(battery_bar_red_png);
|
GuiImageData batteryRed(battery_red_png);
|
||||||
|
GuiImageData batteryBarRed(battery_bar_red_png);
|
||||||
|
|
||||||
GuiTrigger trigA;
|
|
||||||
trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
|
GuiTrigger trigA;
|
||||||
GuiTrigger trigHome;
|
trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
|
||||||
trigHome.SetButtonOnlyTrigger(-1, WPAD_BUTTON_HOME | WPAD_CLASSIC_BUTTON_HOME, 0);
|
GuiTrigger trigHome;
|
||||||
|
trigHome.SetButtonOnlyTrigger(-1, WPAD_BUTTON_HOME | WPAD_CLASSIC_BUTTON_HOME, 0);
|
||||||
GuiImage poweroffBtnImg(&btnpwroff);
|
GuiTrigger trigB;
|
||||||
GuiImage poweroffBtnImgOver(&btnpwroffOver);
|
trigB.SetButtonOnlyTrigger(-1, WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B, PAD_BUTTON_B);
|
||||||
poweroffBtnImg.SetWidescreen(CFG.widescreen);
|
|
||||||
poweroffBtnImgOver.SetWidescreen(CFG.widescreen);
|
GuiButton backBtn(0,0);
|
||||||
GuiButton poweroffBtn(&poweroffBtnImg,&poweroffBtnImgOver, 0, 3, THEME.power_x, THEME.power_y, &trigA, &btnSoundOver, btnClick2,1);
|
backBtn.SetTrigger(&trigB);
|
||||||
GuiImage exitBtnImg(&btnhome);
|
|
||||||
GuiImage exitBtnImgOver(&btnhomeOver);
|
GuiImage poweroffBtnImg(&btnpwroff);
|
||||||
exitBtnImg.SetWidescreen(CFG.widescreen);
|
GuiImage poweroffBtnImgOver(&btnpwroffOver);
|
||||||
exitBtnImgOver.SetWidescreen(CFG.widescreen);
|
poweroffBtnImg.SetWidescreen(CFG.widescreen);
|
||||||
GuiButton exitBtn(&exitBtnImg,&exitBtnImgOver, 0, 3, THEME.home_x, THEME.home_y, &trigA, &btnSoundOver, btnClick2,1);
|
poweroffBtnImgOver.SetWidescreen(CFG.widescreen);
|
||||||
exitBtn.SetTrigger(&trigHome);
|
GuiButton poweroffBtn(&poweroffBtnImg,&poweroffBtnImgOver, 0, 3, THEME.power_x, THEME.power_y, &trigA, &btnSoundOver, btnClick2,1);
|
||||||
|
GuiImage exitBtnImg(&btnhome);
|
||||||
GuiCustomOptionBrowser optionBrowser(396, 280, &options, CFG.theme_path, "bg_options_settings.png", bg_options_settings_png, 0, 10);
|
GuiImage exitBtnImgOver(&btnhomeOver);
|
||||||
optionBrowser.SetPosition(0, 40);
|
exitBtnImg.SetWidescreen(CFG.widescreen);
|
||||||
optionBrowser.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
exitBtnImgOver.SetWidescreen(CFG.widescreen);
|
||||||
|
GuiButton exitBtn(&exitBtnImg,&exitBtnImgOver, 0, 3, THEME.home_x, THEME.home_y, &trigA, &btnSoundOver, btnClick2,1);
|
||||||
HaltGui();
|
exitBtn.SetTrigger(&trigHome);
|
||||||
GuiWindow w(screenwidth, screenheight);
|
|
||||||
w.Append(&poweroffBtn);
|
GuiCustomOptionBrowser optionBrowser(396, 280, &options, CFG.theme_path, "bg_options_settings.png", bg_options_settings_png, 0, 10);
|
||||||
w.Append(&exitBtn);
|
optionBrowser.SetPosition(0, 40);
|
||||||
|
optionBrowser.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
||||||
mainWindow->Append(&w);
|
|
||||||
mainWindow->Append(&optionBrowser);
|
HaltGui();
|
||||||
|
GuiWindow w(screenwidth, screenheight);
|
||||||
ResumeGui();
|
w.Append(&poweroffBtn);
|
||||||
|
w.Append(&backBtn);
|
||||||
while (menu == MENU_NONE) {
|
w.Append(&exitBtn);
|
||||||
|
|
||||||
VIDEO_WaitVSync ();
|
mainWindow->Append(&w);
|
||||||
|
mainWindow->Append(&optionBrowser);
|
||||||
ret = optionBrowser.GetClickedOption();
|
|
||||||
|
ResumeGui();
|
||||||
if(ret >= 0) {
|
|
||||||
if(Settings.godmode == 1) {
|
while (menu == MENU_NONE) {
|
||||||
partitionEntry *entry = &partitions.pentry[ret];
|
|
||||||
if (entry->size) {
|
VIDEO_WaitVSync ();
|
||||||
if (load_from_fs == PART_FS_FAT) {
|
|
||||||
WBFS_OpenPart(partitions.pinfo[ret].part_fs, partitions.pinfo[ret].index, entry->sector,
|
ret = optionBrowser.GetClickedOption();
|
||||||
entry->size, (char *) &game_partition);
|
|
||||||
load_from_fs = partitions.pinfo[ret].part_fs;
|
if(ret >= 0) {
|
||||||
menu = MENU_DISCLIST;
|
if(Settings.godmode == 1) {
|
||||||
|
partitionEntry *entry = &partitions.pentry[ret];
|
||||||
Settings.partition = ret;
|
if (entry->size) {
|
||||||
if(isInserted(bootDevice))cfg_save_global();
|
if (load_from_fs == PART_FS_FAT) {
|
||||||
} else {
|
WBFS_OpenPart(partitions.pinfo[ret].part_fs, partitions.pinfo[ret].index, entry->sector,
|
||||||
sprintf(text, "%s %d : %.2fGB",tr("Partition"), ret+1, entry->size * (partitions.sector_size / GB_SIZE));
|
entry->size, (char *) &game_partition);
|
||||||
choice = WindowPrompt( tr("Do you want to format:"), text,tr("Yes"),tr("No"));
|
load_from_fs = partitions.pinfo[ret].part_fs;
|
||||||
if (choice == 1) {
|
menu = MENU_SETTINGS;
|
||||||
ret = FormatingPartition(tr("Formatting, please wait..."), entry);
|
|
||||||
if (ret < 0) {
|
Settings.partition = ret;
|
||||||
WindowPrompt(tr("Error !"),tr("Failed formating"),tr("Return"));
|
if(isInserted(bootDevice))cfg_save_global();
|
||||||
menu = MENU_SETTINGS;
|
} else {
|
||||||
} else {
|
sprintf(text, "%s %d : %.2fGB",tr("Partition"), ret+1, entry->size * (partitions.sector_size / GB_SIZE));
|
||||||
sleep(1);
|
choice = WindowPrompt( tr("Do you want to format:"), text,tr("Yes"),tr("No"));
|
||||||
ret = WBFS_Open();
|
if (choice == 1) {
|
||||||
sprintf(text, "%s %s", text,tr("formatted!"));
|
ret = FormatingPartition(tr("Formatting, please wait..."), entry);
|
||||||
WindowPrompt(tr("Success:"),text,tr("OK"));
|
if (ret < 0) {
|
||||||
if(ret < 0) {
|
WindowPrompt(tr("Error !"),tr("Failed formating"),tr("Return"));
|
||||||
WindowPrompt(tr("ERROR"), tr("Failed to open partition"), tr("OK"));
|
menu = MENU_SETTINGS;
|
||||||
Sys_LoadMenu();
|
} else {
|
||||||
}
|
sleep(1);
|
||||||
menu = MENU_DISCLIST;
|
ret = WBFS_Open();
|
||||||
}
|
sprintf(text, "%s %s", text,tr("formatted!"));
|
||||||
}
|
WindowPrompt(tr("Success:"),text,tr("OK"));
|
||||||
}
|
if(ret < 0) {
|
||||||
} else if(Settings.godmode == 0) {
|
WindowPrompt(tr("ERROR"), tr("Failed to open partition"), tr("OK"));
|
||||||
mainWindow->Remove(&optionBrowser);
|
Sys_LoadMenu();
|
||||||
char entered[20] = "";
|
}
|
||||||
int result = OnScreenKeyboard(entered, 20,0);
|
menu = MENU_SETTINGS;
|
||||||
mainWindow->Append(&optionBrowser);
|
}
|
||||||
if ( result == 1 ) {
|
}
|
||||||
if (!strcmp(entered, Settings.unlockCode)) { //if password correct
|
}
|
||||||
if (Settings.godmode == 0) {
|
} else if(Settings.godmode == 0) {
|
||||||
WindowPrompt(tr("Correct Password"),tr("All the features of USB Loader GX are unlocked."),tr("OK"));
|
mainWindow->Remove(&optionBrowser);
|
||||||
Settings.godmode = 1;
|
char entered[20] = "";
|
||||||
}
|
int result = OnScreenKeyboard(entered, 20,0);
|
||||||
} else {
|
mainWindow->Append(&optionBrowser);
|
||||||
WindowPrompt(tr("Wrong Password"),tr("USB Loader GX is protected"),tr("OK"));
|
if ( result == 1 ) {
|
||||||
}
|
if (!strcmp(entered, Settings.unlockCode)) { //if password correct
|
||||||
}
|
if (Settings.godmode == 0) {
|
||||||
}
|
WindowPrompt(tr("Correct Password"),tr("All the features of USB Loader GX are unlocked."),tr("OK"));
|
||||||
}
|
Settings.godmode = 1;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
if (shutdown == 1)
|
WindowPrompt(tr("Wrong Password"),tr("USB Loader GX is protected"),tr("OK"));
|
||||||
Sys_Shutdown();
|
}
|
||||||
if (reset == 1)
|
}
|
||||||
Sys_Reboot();
|
}
|
||||||
|
}
|
||||||
if (poweroffBtn.GetState() == STATE_CLICKED) {
|
}
|
||||||
choice = WindowPrompt (tr("Shutdown System"),tr("Are you sure?"),tr("Yes"),tr("No"));
|
|
||||||
if (choice == 1) {
|
/* if (shutdown == 1)
|
||||||
Sys_Shutdown();
|
Sys_Shutdown();
|
||||||
}
|
if (reset == 1)
|
||||||
|
Sys_Reboot();*/
|
||||||
} else if (exitBtn.GetState() == STATE_CLICKED) {
|
|
||||||
choice = WindowPrompt (tr("Return to Wii Menu"),tr("Are you sure?"),tr("Yes"),tr("No"));
|
if (poweroffBtn.GetState() == STATE_CLICKED) {
|
||||||
if (choice == 1) {
|
choice = WindowPrompt (tr("Shutdown System"),tr("Are you sure?"),tr("Yes"),tr("No"));
|
||||||
Sys_LoadMenu();
|
if (choice == 1) {
|
||||||
}
|
Sys_Shutdown();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
} else if (exitBtn.GetState() == STATE_CLICKED) {
|
||||||
|
choice = WindowPrompt (tr("Return to Wii Menu"),tr("Are you sure?"),tr("Yes"),tr("No"));
|
||||||
HaltGui();
|
if (choice == 1) {
|
||||||
|
Sys_LoadMenu();
|
||||||
mainWindow->Remove(&optionBrowser);
|
}
|
||||||
mainWindow->Remove(&w);
|
}
|
||||||
ResumeGui();
|
else if (backBtn.GetState() == STATE_CLICKED) {
|
||||||
|
menu = MENU_SETTINGS;
|
||||||
return menu;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
HaltGui();
|
||||||
|
|
||||||
|
mainWindow->Remove(&optionBrowser);
|
||||||
|
mainWindow->Remove(&w);
|
||||||
|
ResumeGui();
|
||||||
|
|
||||||
|
return menu;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -134,15 +134,6 @@ int MenuInstall() {
|
|||||||
menu = MENU_DISCLIST;
|
menu = MENU_DISCLIST;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (shutdown == 1) {
|
|
||||||
wiilight(0);
|
|
||||||
Sys_Shutdown();
|
|
||||||
}
|
|
||||||
if (reset == 1) {
|
|
||||||
wiilight(0);
|
|
||||||
Sys_Reboot();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Turn off the WiiLight
|
//Turn off the WiiLight
|
||||||
|
@ -1,24 +1,31 @@
|
|||||||
#ifndef _MENUS_H
|
#ifndef _MENUS_H
|
||||||
#define _MENUS_H
|
#define _MENUS_H
|
||||||
|
|
||||||
#include "libwiigui/gui.h"
|
#include <unistd.h>
|
||||||
#include "language/gettext.h"
|
|
||||||
#include "prompts/PromptWindows.h"
|
#include "libwiigui/gui.h"
|
||||||
#include "menu.h"
|
#include "language/gettext.h"
|
||||||
#include "gecko.h"
|
#include "prompts/PromptWindows.h"
|
||||||
#include "filelist.h"
|
#include "menu.h"
|
||||||
#include "sys.h"
|
#include "gecko.h"
|
||||||
|
#include "filelist.h"
|
||||||
extern void ResumeGui();
|
#include "sys.h"
|
||||||
extern void HaltGui();
|
|
||||||
extern GuiWindow * mainWindow;
|
extern GuiWindow * mainWindow;
|
||||||
extern GuiSound * bgMusic;
|
extern GuiSound * bgMusic;
|
||||||
extern u8 shutdown;
|
extern u8 checkthreadState;
|
||||||
extern u8 reset;
|
extern u8 needToReloadGamelist;
|
||||||
|
extern u8 hddOK;
|
||||||
int MenuInstall();
|
extern u8 mountMethod;
|
||||||
int MenuDiscList();
|
|
||||||
int MenuFormat();
|
|
||||||
int MenuCheck();
|
int MenuInstall();
|
||||||
|
int MenuDiscList();
|
||||||
#endif // _MENUS_H
|
int MenuFormat();
|
||||||
|
|
||||||
|
extern void ResumeCheck();
|
||||||
|
extern void HaltCheck();
|
||||||
|
extern void InitCheckThread();
|
||||||
|
extern void ExitCheckThread();
|
||||||
|
|
||||||
|
#endif // _MENUS_H
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
#include "prompts/PromptWindows.h"
|
#include "prompts/PromptWindows.h"
|
||||||
#include "filelist.h"
|
#include "filelist.h"
|
||||||
#include "menu.h"
|
#include "menu.h"
|
||||||
|
#include "../menu/menus.h"
|
||||||
#include "usbloader/disc.h"
|
#include "usbloader/disc.h"
|
||||||
#include "usbloader/fstfile.h"
|
#include "usbloader/fstfile.h"
|
||||||
#include "usbloader/wdvd.h"
|
#include "usbloader/wdvd.h"
|
||||||
@ -21,14 +22,8 @@
|
|||||||
#include "../gecko.h"
|
#include "../gecko.h"
|
||||||
#include "../patches/dvd_broadway.h"
|
#include "../patches/dvd_broadway.h"
|
||||||
|
|
||||||
/*** Extern functions ***/
|
|
||||||
extern void ResumeGui();
|
|
||||||
extern void HaltGui();
|
|
||||||
|
|
||||||
/*** Extern variables ***/
|
/*** Extern variables ***/
|
||||||
extern GuiWindow * mainWindow;
|
extern GuiWindow * mainWindow;
|
||||||
extern u8 shutdown;
|
|
||||||
extern u8 reset;
|
|
||||||
extern u8 mountMethod;
|
extern u8 mountMethod;
|
||||||
|
|
||||||
/********************************************************************************
|
/********************************************************************************
|
||||||
@ -50,7 +45,7 @@ int DiscBrowse(struct discHdr * header) {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = Disc_Open();
|
ret = Disc_Open();
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
ResumeGui();
|
ResumeGui();
|
||||||
@ -71,7 +66,7 @@ int DiscBrowse(struct discHdr * header) {
|
|||||||
WindowPrompt(tr("ERROR:"), tr("Could not open WBFS partition"), tr("OK"));
|
WindowPrompt(tr("ERROR:"), tr("Could not open WBFS partition"), tr("OK"));
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int *buffer = (int*)allocate_memory(0x20);
|
int *buffer = (int*)allocate_memory(0x20);
|
||||||
|
|
||||||
if (buffer == NULL) {
|
if (buffer == NULL) {
|
||||||
@ -86,7 +81,7 @@ int DiscBrowse(struct discHdr * header) {
|
|||||||
WindowPrompt(tr("ERROR:"), tr("Could not read the disc."), tr("OK"));
|
WindowPrompt(tr("ERROR:"), tr("Could not read the disc."), tr("OK"));
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *fstbuffer = allocate_memory(buffer[2]*4);
|
void *fstbuffer = allocate_memory(buffer[2]*4);
|
||||||
FST_ENTRY *fst = (FST_ENTRY *)fstbuffer;
|
FST_ENTRY *fst = (FST_ENTRY *)fstbuffer;
|
||||||
|
|
||||||
@ -204,11 +199,6 @@ int DiscBrowse(struct discHdr * header) {
|
|||||||
while (!exit) {
|
while (!exit) {
|
||||||
VIDEO_WaitVSync();
|
VIDEO_WaitVSync();
|
||||||
|
|
||||||
if (shutdown == 1)
|
|
||||||
Sys_Shutdown();
|
|
||||||
if (reset == 1)
|
|
||||||
Sys_Reboot();
|
|
||||||
|
|
||||||
ret = optionBrowser3.GetClickedOption();
|
ret = optionBrowser3.GetClickedOption();
|
||||||
|
|
||||||
if (ret > 0) {
|
if (ret > 0) {
|
||||||
@ -244,29 +234,29 @@ int autoSelectDol(const char *id, bool force) {
|
|||||||
|
|
||||||
char id4[10];
|
char id4[10];
|
||||||
sprintf(id4,"%c%c%c%c",id[0],id[1],id[2],id[3]);
|
sprintf(id4,"%c%c%c%c",id[0],id[1],id[2],id[3]);
|
||||||
|
|
||||||
////// games that can be forced (always need alt dol)
|
////// games that can be forced (always need alt dol)
|
||||||
|
|
||||||
//Boogie
|
//Boogie
|
||||||
if (strcmp(id,"RBOP69") == 0) return 675;//previous value was 657
|
if (strcmp(id,"RBOP69") == 0) return 675;//previous value was 657
|
||||||
if (strcmp(id,"RBOE69") == 0) return 675;//starstremr
|
if (strcmp(id,"RBOE69") == 0) return 675;//starstremr
|
||||||
|
|
||||||
//Fifa 08
|
//Fifa 08
|
||||||
if (strcmp(id,"RF8E69") == 0) return 439;//from isostar
|
if (strcmp(id,"RF8E69") == 0) return 439;//from isostar
|
||||||
if (strcmp(id,"RF8P69") == 0) return 463;//from isostar
|
if (strcmp(id,"RF8P69") == 0) return 463;//from isostar
|
||||||
if (strcmp(id,"RF8X69") == 0) return 464;//from isostar
|
if (strcmp(id,"RF8X69") == 0) return 464;//from isostar
|
||||||
|
|
||||||
//Madden NFL07
|
//Madden NFL07
|
||||||
if (strcmp(id,"RMDP69") == 0) return 39;//from isostar
|
if (strcmp(id,"RMDP69") == 0) return 39;//from isostar
|
||||||
|
|
||||||
//Madden NFL08
|
//Madden NFL08
|
||||||
if (strcmp(id,"RNFP69") == 0) return 1079;//from isostar
|
if (strcmp(id,"RNFP69") == 0) return 1079;//from isostar
|
||||||
|
|
||||||
//Medal of Honor: Heroes 2
|
//Medal of Honor: Heroes 2
|
||||||
if (strcmp(id,"RM2X69") == 0)return 601;//dj_skual
|
if (strcmp(id,"RM2X69") == 0)return 601;//dj_skual
|
||||||
if (strcmp(id,"RM2P69") == 0)return 517;//MZottel
|
if (strcmp(id,"RM2P69") == 0)return 517;//MZottel
|
||||||
if (strcmp(id,"RM2E69") == 0) return 492;//Old8oy
|
if (strcmp(id,"RM2E69") == 0) return 492;//Old8oy
|
||||||
|
|
||||||
//Mortal Kombat
|
//Mortal Kombat
|
||||||
if (strcmp(id,"RKMP5D") == 0) return 290;//from isostar
|
if (strcmp(id,"RKMP5D") == 0) return 290;//from isostar
|
||||||
if (strcmp(id,"RKME5D") == 0) return 290;//starstremr
|
if (strcmp(id,"RKME5D") == 0) return 290;//starstremr
|
||||||
@ -276,7 +266,7 @@ int autoSelectDol(const char *id, bool force) {
|
|||||||
|
|
||||||
//Pangya! Golf with Style
|
//Pangya! Golf with Style
|
||||||
if (strcmp(id,"RPYP9B") == 0) return 12490;//from isostar
|
if (strcmp(id,"RPYP9B") == 0) return 12490;//from isostar
|
||||||
|
|
||||||
//Redsteel
|
//Redsteel
|
||||||
if (strcmp(id,"REDP41") == 0) return 1957;//from isostar
|
if (strcmp(id,"REDP41") == 0) return 1957;//from isostar
|
||||||
if (strcmp(id,"REDE41") == 0) return 1957;//starstremr
|
if (strcmp(id,"REDE41") == 0) return 1957;//starstremr
|
||||||
@ -284,37 +274,37 @@ int autoSelectDol(const char *id, bool force) {
|
|||||||
//SSX
|
//SSX
|
||||||
if (strcmp(id,"RSXP69") == 0) return 377;//previous value was 337
|
if (strcmp(id,"RSXP69") == 0) return 377;//previous value was 337
|
||||||
if (strcmp(id,"RSXE69") == 0) return 377;//previous value was 337
|
if (strcmp(id,"RSXE69") == 0) return 377;//previous value was 337
|
||||||
|
|
||||||
//Wii Sports Resort, needs alt dol one time only, to show the Motion Plus video
|
//Wii Sports Resort, needs alt dol one time only, to show the Motion Plus video
|
||||||
//if (strcmp(id,"RZTP01") == 0 && CheckForSave(id4)==0) return 952;//from isostar
|
//if (strcmp(id,"RZTP01") == 0 && CheckForSave(id4)==0) return 952;//from isostar
|
||||||
//if (strcmp(id,"RZTE01") == 0 && CheckForSave(id4)==0) return 674;//from starstremr
|
//if (strcmp(id,"RZTE01") == 0 && CheckForSave(id4)==0) return 674;//from starstremr
|
||||||
//as well as Grand Slam Tennis, Tiger Woods 10, Virtual Tennis 2009
|
//as well as Grand Slam Tennis, Tiger Woods 10, Virtual Tennis 2009
|
||||||
|
|
||||||
///// games that can't be forced (alt dol is not always needed)
|
///// games that can't be forced (alt dol is not always needed)
|
||||||
if (!force) {
|
if (!force) {
|
||||||
|
|
||||||
//Grand Slam Tennis
|
//Grand Slam Tennis
|
||||||
if (strcmp(id,"R5TP69") == 0) return 1493;//from isostar
|
if (strcmp(id,"R5TP69") == 0) return 1493;//from isostar
|
||||||
if (strcmp(id,"R5TE69") == 0) return 1493;//starstremr
|
if (strcmp(id,"R5TE69") == 0) return 1493;//starstremr
|
||||||
|
|
||||||
//Medal of Honor Heroes
|
//Medal of Honor Heroes
|
||||||
if (strcmp(id,"RMZX69") == 0) return 492;//from isostar
|
if (strcmp(id,"RMZX69") == 0) return 492;//from isostar
|
||||||
if (strcmp(id,"RMZP69") == 0) return 492;//from isostar
|
if (strcmp(id,"RMZP69") == 0) return 492;//from isostar
|
||||||
if (strcmp(id,"RMZE69") == 0) return 492;//starstremr
|
if (strcmp(id,"RMZE69") == 0) return 492;//starstremr
|
||||||
|
|
||||||
//Tiger Woods 10
|
//Tiger Woods 10
|
||||||
if (strcmp(id,"R9OP69") == 0) return 1991;//from isostar
|
if (strcmp(id,"R9OP69") == 0) return 1991;//from isostar
|
||||||
if (strcmp(id,"R9OE69") == 0) return 1973;//starstremr
|
if (strcmp(id,"R9OE69") == 0) return 1973;//starstremr
|
||||||
|
|
||||||
//Virtual Tennis 2009
|
//Virtual Tennis 2009
|
||||||
if (strcmp(id,"RVUP8P") == 0) return 16426;//from isostar
|
if (strcmp(id,"RVUP8P") == 0) return 16426;//from isostar
|
||||||
if (strcmp(id,"RVUE8P") == 0) return 16405;//from isostar
|
if (strcmp(id,"RVUE8P") == 0) return 16405;//from isostar
|
||||||
|
|
||||||
//Wii Sports Resort
|
//Wii Sports Resort
|
||||||
if (strcmp(id,"RZTP01") == 0) return 952;//from isostar
|
if (strcmp(id,"RZTP01") == 0) return 952;//from isostar
|
||||||
if (strcmp(id,"RZTE01") == 0) return 674;//from starstremr
|
if (strcmp(id,"RZTE01") == 0) return 674;//from starstremr
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -323,7 +313,7 @@ int autoSelectDolMenu(const char *id, bool force) {
|
|||||||
/*
|
/*
|
||||||
char id4[10];
|
char id4[10];
|
||||||
sprintf(id4,"%c%c%c%c",id[0],id[1],id[2],id[3]);
|
sprintf(id4,"%c%c%c%c",id[0],id[1],id[2],id[3]);
|
||||||
|
|
||||||
switch (CheckForSave(id4)) {
|
switch (CheckForSave(id4)) {
|
||||||
case 0:
|
case 0:
|
||||||
WindowPrompt(tr("NO save"),0,tr("OK"));
|
WindowPrompt(tr("NO save"),0,tr("OK"));
|
||||||
@ -339,7 +329,7 @@ int autoSelectDolMenu(const char *id, bool force) {
|
|||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//Indiana Jones and the Staff of Kings (Fate of Atlantis)
|
//Indiana Jones and the Staff of Kings (Fate of Atlantis)
|
||||||
if (strcmp(id,"RJ8E64") == 0) {
|
if (strcmp(id,"RJ8E64") == 0) {
|
||||||
int choice = WindowPrompt(tr("Select a DOL"), 0, "Fate of Atlantis", tr("Default"));
|
int choice = WindowPrompt(tr("Select a DOL"), 0, "Fate of Atlantis", tr("Default"));
|
||||||
@ -365,7 +355,7 @@ int autoSelectDolMenu(const char *id, bool force) {
|
|||||||
}
|
}
|
||||||
return choice;
|
return choice;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Metal Slug Anthology (Metal Slug 6)
|
//Metal Slug Anthology (Metal Slug 6)
|
||||||
if (strcmp(id,"RMLEH4") == 0) {
|
if (strcmp(id,"RMLEH4") == 0) {
|
||||||
int choice = WindowPrompt(tr("Select a DOL"), 0, "Metal Slug 6", tr("Default"));
|
int choice = WindowPrompt(tr("Select a DOL"), 0, "Metal Slug 6", tr("Default"));
|
||||||
@ -391,7 +381,7 @@ int autoSelectDolMenu(const char *id, bool force) {
|
|||||||
}
|
}
|
||||||
return choice;
|
return choice;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Metroid Prime Trilogy
|
//Metroid Prime Trilogy
|
||||||
if (strcmp(id,"R3ME01") == 0) {
|
if (strcmp(id,"R3ME01") == 0) {
|
||||||
//do not use any alt dol if there is no save game in the nand
|
//do not use any alt dol if there is no save game in the nand
|
||||||
@ -442,7 +432,7 @@ int autoSelectDolMenu(const char *id, bool force) {
|
|||||||
}
|
}
|
||||||
return choice;
|
return choice;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Rampage: Total Destruction (M1.dol=Rampage, jarvos.dol=Rampage World Tour)
|
//Rampage: Total Destruction (M1.dol=Rampage, jarvos.dol=Rampage World Tour)
|
||||||
if (strcmp(id,"RPGP5D") == 0) {
|
if (strcmp(id,"RPGP5D") == 0) {
|
||||||
int choice = WindowPrompt(tr("Select a DOL"), 0, "Rampage", "World Tour", tr("Default"));
|
int choice = WindowPrompt(tr("Select a DOL"), 0, "Rampage", "World Tour", tr("Default"));
|
||||||
@ -459,7 +449,7 @@ int autoSelectDolMenu(const char *id, bool force) {
|
|||||||
}
|
}
|
||||||
return choice;
|
return choice;
|
||||||
}
|
}
|
||||||
|
|
||||||
//The House Of The Dead 2 & 3 Return (only to play 2)
|
//The House Of The Dead 2 & 3 Return (only to play 2)
|
||||||
if (strcmp(id,"RHDE8P") == 0) {
|
if (strcmp(id,"RHDE8P") == 0) {
|
||||||
int choice = WindowPrompt(tr("Select a DOL"), 0, "HotD 2", tr("Default"));
|
int choice = WindowPrompt(tr("Select a DOL"), 0, "HotD 2", tr("Default"));
|
||||||
@ -501,11 +491,11 @@ void __dvd_readidcb(s32 result)
|
|||||||
dvddone = result;
|
dvddone = result;
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 DiscMount(discHdr *header) {
|
u8 DiscMount1(discHdr *header) {
|
||||||
gprintf("\nDiscMount() ");
|
gprintf("\nDiscMount() ");
|
||||||
int ret;
|
int ret;
|
||||||
HaltGui();
|
HaltGui();
|
||||||
|
|
||||||
u8 *tmpBuff = (u8 *) malloc(0x60);
|
u8 *tmpBuff = (u8 *) malloc(0x60);
|
||||||
memcpy(tmpBuff, g_diskID, 0x60); // Make a backup of the first 96 bytes at 0x80000000
|
memcpy(tmpBuff, g_diskID, 0x60); // Make a backup of the first 96 bytes at 0x80000000
|
||||||
|
|
||||||
@ -513,7 +503,7 @@ u8 DiscMount(discHdr *header) {
|
|||||||
dvddone = 0;
|
dvddone = 0;
|
||||||
ret = bwDVD_LowReset(__dvd_readidcb);
|
ret = bwDVD_LowReset(__dvd_readidcb);
|
||||||
while(ret>=0 && dvddone==0);
|
while(ret>=0 && dvddone==0);
|
||||||
|
|
||||||
dvddone = 0;
|
dvddone = 0;
|
||||||
ret = bwDVD_LowReadID(g_diskID, __dvd_readidcb); // Leave this one here, or you'll get an IOCTL error
|
ret = bwDVD_LowReadID(g_diskID, __dvd_readidcb); // Leave this one here, or you'll get an IOCTL error
|
||||||
while(ret>=0 && dvddone==0);
|
while(ret>=0 && dvddone==0);
|
||||||
@ -521,15 +511,65 @@ u8 DiscMount(discHdr *header) {
|
|||||||
dvddone = 0;
|
dvddone = 0;
|
||||||
ret = bwDVD_LowUnencryptedRead(g_diskID, 0x60, 0x00, __dvd_readidcb); // Overwrite the g_diskID thing
|
ret = bwDVD_LowUnencryptedRead(g_diskID, 0x60, 0x00, __dvd_readidcb); // Overwrite the g_diskID thing
|
||||||
while(ret>=0 && dvddone==0);
|
while(ret>=0 && dvddone==0);
|
||||||
|
|
||||||
memcpy(header, g_diskID, 0x60);
|
memcpy(header, g_diskID, 0x60);
|
||||||
memcpy(g_diskID, tmpBuff, 0x60); // Put the backup back, or games won't load
|
memcpy(g_diskID, tmpBuff, 0x60); // Put the backup back, or games won't load
|
||||||
free(tmpBuff);
|
free(tmpBuff);
|
||||||
|
|
||||||
|
|
||||||
ResumeGui();
|
ResumeGui();
|
||||||
if (dvddone != 1) {
|
if (dvddone != 1) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return (header->magic == 0x5D1C9EA3) ? 1 : 2; // Don't check gamecube magic (0xC2339F3D)
|
return (header->magic == 0x5D1C9EA3) ? 1 : 2; // Don't check gamecube magic (0xC2339F3D)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
u8 DiscMount(discHdr *header) {
|
||||||
|
gprintf("\nDiscMount() ");
|
||||||
|
|
||||||
|
HaltGui();
|
||||||
|
GuiWindow w(screenwidth, screenheight);
|
||||||
|
|
||||||
|
mainWindow->Append(&w);
|
||||||
|
|
||||||
|
ResumeGui();
|
||||||
|
|
||||||
|
//HaltCheck();
|
||||||
|
int ret = Disc_SetUSB(NULL);
|
||||||
|
ret = WDVD_Close();
|
||||||
|
ret = Disc_Init();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ret = DiscWait(tr("Insert Disk"),tr("Waiting..."),tr("Cancel"),0,0);
|
||||||
|
if (ret < 0) {
|
||||||
|
WindowPrompt (tr("Error reading Disc"),0,tr("Back"));
|
||||||
|
goto OUT;
|
||||||
|
}
|
||||||
|
mainWindow->SetState(STATE_DISABLED);
|
||||||
|
//gprintf("..1");
|
||||||
|
ret = Disc_Open();
|
||||||
|
if (ret < 0) {
|
||||||
|
WindowPrompt (tr("Could not open Disc"),0,tr("Back"));
|
||||||
|
goto OUT;
|
||||||
|
}
|
||||||
|
//gprintf("..2");
|
||||||
|
Disc_ReadHeader(header);
|
||||||
|
//gprintf("..3");
|
||||||
|
ret = Disc_IsWii();
|
||||||
|
//gprintf("..4");
|
||||||
|
//ResumeCheck();
|
||||||
|
if (ret < 0) {
|
||||||
|
ret = 2;
|
||||||
|
}
|
||||||
|
ret = 1;
|
||||||
|
|
||||||
|
|
||||||
|
OUT:
|
||||||
|
HaltGui();
|
||||||
|
mainWindow->Remove(&w);
|
||||||
|
mainWindow->SetState(STATE_DEFAULT);
|
||||||
|
ResumeGui();
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
@ -40,10 +40,6 @@ static time_t start;
|
|||||||
extern GuiWindow * mainWindow;
|
extern GuiWindow * mainWindow;
|
||||||
extern float gamesize;
|
extern float gamesize;
|
||||||
|
|
||||||
/*** Extern functions ***/
|
|
||||||
extern void ResumeGui();
|
|
||||||
extern void HaltGui();
|
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* GameInstallProgress
|
* GameInstallProgress
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
#include "fatmounter.h"
|
#include "fatmounter.h"
|
||||||
#include "listfiles.h"
|
#include "listfiles.h"
|
||||||
#include "menu.h"
|
#include "menu.h"
|
||||||
#include "menu.h"
|
|
||||||
#include "filelist.h"
|
#include "filelist.h"
|
||||||
#include "sys.h"
|
#include "sys.h"
|
||||||
#include "wpad.h"
|
#include "wpad.h"
|
||||||
@ -53,15 +52,10 @@ extern u32 gameCnt;
|
|||||||
extern s32 gameSelected, gameStart;
|
extern s32 gameSelected, gameStart;
|
||||||
extern float gamesize;
|
extern float gamesize;
|
||||||
extern struct discHdr * gameList;
|
extern struct discHdr * gameList;
|
||||||
extern u8 shutdown;
|
|
||||||
extern u8 reset;
|
|
||||||
extern u8 mountMethod;
|
extern u8 mountMethod;
|
||||||
extern struct discHdr *dvdheader;
|
extern struct discHdr *dvdheader;
|
||||||
extern char game_partition[6];
|
extern char game_partition[6];
|
||||||
|
extern u8 shutdown;
|
||||||
/*** Extern functions ***/
|
|
||||||
extern void ResumeGui();
|
|
||||||
extern void HaltGui();
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* OnScreenNumpad
|
* OnScreenNumpad
|
||||||
@ -71,9 +65,9 @@ extern void HaltGui();
|
|||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
int OnScreenNumpad(char * var, u32 maxlen) {
|
int OnScreenNumpad(char * var, u32 maxlen) {
|
||||||
int save = -1;
|
int save = -1;
|
||||||
|
|
||||||
GuiNumpad numpad(var, maxlen);
|
GuiNumpad numpad(var, maxlen);
|
||||||
|
|
||||||
GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, Settings.sfxvolume);
|
GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, Settings.sfxvolume);
|
||||||
// because destroy GuiSound must wait while sound playing is finished, we use a global sound
|
// because destroy GuiSound must wait while sound playing is finished, we use a global sound
|
||||||
if(!btnClick2) btnClick2=new GuiSound(button_click2_pcm, button_click2_pcm_size,Settings.sfxvolume);
|
if(!btnClick2) btnClick2=new GuiSound(button_click2_pcm, button_click2_pcm_size,Settings.sfxvolume);
|
||||||
@ -104,7 +98,7 @@ int OnScreenNumpad(char * var, u32 maxlen) {
|
|||||||
GuiButton cancelBtn(&cancelBtnImg,&cancelBtnImg, 1, 4, -5, -15, &trigA, &btnSoundOver, btnClick2,1);
|
GuiButton cancelBtn(&cancelBtnImg,&cancelBtnImg, 1, 4, -5, -15, &trigA, &btnSoundOver, btnClick2,1);
|
||||||
cancelBtn.SetLabel(&cancelBtnTxt);
|
cancelBtn.SetLabel(&cancelBtnTxt);
|
||||||
cancelBtn.SetTrigger(&trigB);
|
cancelBtn.SetTrigger(&trigB);
|
||||||
|
|
||||||
numpad.Append(&okBtn);
|
numpad.Append(&okBtn);
|
||||||
numpad.Append(&cancelBtn);
|
numpad.Append(&cancelBtn);
|
||||||
|
|
||||||
@ -132,7 +126,7 @@ int OnScreenNumpad(char * var, u32 maxlen) {
|
|||||||
mainWindow->SetState(STATE_DEFAULT);
|
mainWindow->SetState(STATE_DEFAULT);
|
||||||
ResumeGui();
|
ResumeGui();
|
||||||
gprintf("\t%s",(save == 1?"saved":"discarded"));
|
gprintf("\t%s",(save == 1?"saved":"discarded"));
|
||||||
return save;
|
return save;
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@ -696,17 +690,9 @@ int WindowPrompt(const char *title, const char *msg, const char *btn1Label,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GuiTrigger trigZ;
|
|
||||||
trigZ.SetButtonOnlyTrigger(-1, WPAD_NUNCHUK_BUTTON_Z | WPAD_CLASSIC_BUTTON_ZL, PAD_TRIGGER_Z);
|
|
||||||
|
|
||||||
GuiButton screenShotBtn(0,0);
|
|
||||||
screenShotBtn.SetPosition(0,0);
|
|
||||||
screenShotBtn.SetTrigger(&trigZ);
|
|
||||||
|
|
||||||
promptWindow.Append(&dialogBoxImg);
|
promptWindow.Append(&dialogBoxImg);
|
||||||
promptWindow.Append(&titleTxt);
|
promptWindow.Append(&titleTxt);
|
||||||
promptWindow.Append(&msgTxt);
|
promptWindow.Append(&msgTxt);
|
||||||
promptWindow.Append(&screenShotBtn);
|
|
||||||
|
|
||||||
if (btn1Label)
|
if (btn1Label)
|
||||||
promptWindow.Append(&btn1);
|
promptWindow.Append(&btn1);
|
||||||
@ -726,12 +712,7 @@ int WindowPrompt(const char *title, const char *msg, const char *btn1Label,
|
|||||||
|
|
||||||
while (choice == -1) {
|
while (choice == -1) {
|
||||||
VIDEO_WaitVSync();
|
VIDEO_WaitVSync();
|
||||||
if (shutdown == 1) {
|
|
||||||
wiilight(0);
|
|
||||||
Sys_Shutdown();
|
|
||||||
}
|
|
||||||
if (reset == 1)
|
|
||||||
Sys_Reboot();
|
|
||||||
if (btn1.GetState() == STATE_CLICKED) {
|
if (btn1.GetState() == STATE_CLICKED) {
|
||||||
choice = 1;
|
choice = 1;
|
||||||
} else if (btn2.GetState() == STATE_CLICKED) {
|
} else if (btn2.GetState() == STATE_CLICKED) {
|
||||||
@ -746,12 +727,7 @@ int WindowPrompt(const char *title, const char *msg, const char *btn1Label,
|
|||||||
choice = 3;
|
choice = 3;
|
||||||
} else if (btn4.GetState() == STATE_CLICKED) {
|
} else if (btn4.GetState() == STATE_CLICKED) {
|
||||||
choice = 0;
|
choice = 0;
|
||||||
} else if (screenShotBtn.GetState() == STATE_CLICKED) {
|
}
|
||||||
gprintf("\n\tscreenShotBtn clicked");
|
|
||||||
screenShotBtn.ResetState();
|
|
||||||
ScreenShot();
|
|
||||||
gprintf("...It's easy, mmmmmmKay");
|
|
||||||
}
|
|
||||||
if (count>0)count--;
|
if (count>0)count--;
|
||||||
if (count==0) choice = 1;
|
if (count==0) choice = 1;
|
||||||
}
|
}
|
||||||
@ -978,12 +954,9 @@ int WindowExitPrompt()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (shutdown == 1) {
|
if (shutdown == 1)
|
||||||
wiilight(0);
|
wiilight(0);
|
||||||
Sys_Shutdown();
|
|
||||||
}
|
|
||||||
if (reset == 1)
|
|
||||||
Sys_Reboot();
|
|
||||||
if (btn1.GetState() == STATE_CLICKED) {
|
if (btn1.GetState() == STATE_CLICKED) {
|
||||||
choice = 1;
|
choice = 1;
|
||||||
btn1.SetEffect(EFFECT_SLIDE_TOP | EFFECT_SLIDE_OUT, 50);
|
btn1.SetEffect(EFFECT_SLIDE_TOP | EFFECT_SLIDE_OUT, 50);
|
||||||
@ -1138,12 +1111,6 @@ int GameWindowPrompt() {
|
|||||||
trigPlus.SetButtonOnlyTrigger(-1, WPAD_BUTTON_PLUS | WPAD_CLASSIC_BUTTON_PLUS, 0);
|
trigPlus.SetButtonOnlyTrigger(-1, WPAD_BUTTON_PLUS | WPAD_CLASSIC_BUTTON_PLUS, 0);
|
||||||
GuiTrigger trigMinus;
|
GuiTrigger trigMinus;
|
||||||
trigMinus.SetButtonOnlyTrigger(-1, WPAD_BUTTON_MINUS | WPAD_CLASSIC_BUTTON_MINUS, 0);
|
trigMinus.SetButtonOnlyTrigger(-1, WPAD_BUTTON_MINUS | WPAD_CLASSIC_BUTTON_MINUS, 0);
|
||||||
GuiTrigger trigZ;
|
|
||||||
trigZ.SetButtonOnlyTrigger(-1, WPAD_NUNCHUK_BUTTON_Z | WPAD_CLASSIC_BUTTON_ZL, PAD_TRIGGER_Z);
|
|
||||||
|
|
||||||
GuiButton screenShotBtn(0,0);
|
|
||||||
screenShotBtn.SetPosition(0,0);
|
|
||||||
screenShotBtn.SetTrigger(&trigZ);
|
|
||||||
|
|
||||||
if (CFG.widescreen)
|
if (CFG.widescreen)
|
||||||
snprintf(imgPath, sizeof(imgPath), "%swdialogue_box_startgame.png", CFG.theme_path);
|
snprintf(imgPath, sizeof(imgPath), "%swdialogue_box_startgame.png", CFG.theme_path);
|
||||||
@ -1274,7 +1241,6 @@ int GameWindowPrompt() {
|
|||||||
promptWindow.Append(&dialogBoxImg);
|
promptWindow.Append(&dialogBoxImg);
|
||||||
promptWindow.Append(&nameBtn);
|
promptWindow.Append(&nameBtn);
|
||||||
promptWindow.Append(&playcntTxt);
|
promptWindow.Append(&playcntTxt);
|
||||||
promptWindow.Append(&screenShotBtn);
|
|
||||||
promptWindow.Append(&btn2);
|
promptWindow.Append(&btn2);
|
||||||
if (!mountMethod)//stuff we don't show if it is a DVD mounted
|
if (!mountMethod)//stuff we don't show if it is a DVD mounted
|
||||||
{
|
{
|
||||||
@ -1295,7 +1261,7 @@ int GameWindowPrompt() {
|
|||||||
|
|
||||||
promptWindow.Append(&diskImg2);
|
promptWindow.Append(&diskImg2);
|
||||||
promptWindow.Append(&btn1);
|
promptWindow.Append(&btn1);
|
||||||
|
|
||||||
short changed = -1;
|
short changed = -1;
|
||||||
GuiImageData * diskCover = NULL;
|
GuiImageData * diskCover = NULL;
|
||||||
GuiImageData * diskCover2 = NULL;
|
GuiImageData * diskCover2 = NULL;
|
||||||
@ -1452,19 +1418,6 @@ int GameWindowPrompt() {
|
|||||||
|
|
||||||
diskImg.SetSpin(btn1.GetState() == STATE_SELECTED);
|
diskImg.SetSpin(btn1.GetState() == STATE_SELECTED);
|
||||||
diskImg2.SetSpin(btn1.GetState() == STATE_SELECTED);
|
diskImg2.SetSpin(btn1.GetState() == STATE_SELECTED);
|
||||||
if (shutdown == 1) { //for power button
|
|
||||||
promptWindow.SetEffect(EFFECT_SLIDE_TOP | EFFECT_SLIDE_OUT, 50);
|
|
||||||
mainWindow->SetState(STATE_DEFAULT);
|
|
||||||
while (promptWindow.GetEffect() > 0) usleep(50);
|
|
||||||
HaltGui();
|
|
||||||
mainWindow->Remove(&promptWindow);
|
|
||||||
ResumeGui();
|
|
||||||
wiilight(0);
|
|
||||||
Sys_Shutdown();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (reset == 1) //for reset button
|
|
||||||
Sys_Reboot();
|
|
||||||
|
|
||||||
if(gameSound)
|
if(gameSound)
|
||||||
{
|
{
|
||||||
@ -1544,12 +1497,6 @@ int GameWindowPrompt() {
|
|||||||
}
|
}
|
||||||
btnFavorite5.ResetState();
|
btnFavorite5.ResetState();
|
||||||
}
|
}
|
||||||
else if (screenShotBtn.GetState() == STATE_CLICKED) {
|
|
||||||
gprintf("\n\tscreenShotBtn clicked");
|
|
||||||
screenShotBtn.ResetState();
|
|
||||||
ScreenShot();
|
|
||||||
gprintf("...It's easy, mmmmmmKay");
|
|
||||||
}
|
|
||||||
// this next part is long because nobody could agree on what the left/right buttons should do
|
// this next part is long because nobody could agree on what the left/right buttons should do
|
||||||
else if ((btnRight.GetState() == STATE_CLICKED) && (Settings.xflip == no)) {//next game
|
else if ((btnRight.GetState() == STATE_CLICKED) && (Settings.xflip == no)) {//next game
|
||||||
promptWindow.SetEffect(EFFECT_SLIDE_RIGHT | EFFECT_SLIDE_OUT, 50);
|
promptWindow.SetEffect(EFFECT_SLIDE_RIGHT | EFFECT_SLIDE_OUT, 50);
|
||||||
@ -2768,7 +2715,7 @@ int ProgressUpdateWindow() {
|
|||||||
} else {
|
} else {
|
||||||
filesize = download_request("http://www.techjawa.com/usbloadergx/ULNR.file");//for some reason it didn't download completely when saved as a wad.
|
filesize = download_request("http://www.techjawa.com/usbloadergx/ULNR.file");//for some reason it didn't download completely when saved as a wad.
|
||||||
}
|
}
|
||||||
|
|
||||||
if (filesize > 0) {
|
if (filesize > 0) {
|
||||||
|
|
||||||
pfile = fopen(dolpath, "wb");//here we save the txt as a wad
|
pfile = fopen(dolpath, "wb");//here we save the txt as a wad
|
||||||
@ -2887,7 +2834,7 @@ int ProgressUpdateWindow() {
|
|||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
int ProgressUpdateWindow() {
|
int ProgressUpdateWindow() {
|
||||||
|
|
||||||
gprintf("\nProgressUpdateWindow(not full channel)");
|
gprintf("\nProgressUpdateWindow(not full channel)");
|
||||||
@ -3051,7 +2998,7 @@ int ProgressUpdateWindow() {
|
|||||||
promptWindow.Append(&progressbarOutlineImg);
|
promptWindow.Append(&progressbarOutlineImg);
|
||||||
promptWindow.Append(&prTxt);
|
promptWindow.Append(&prTxt);
|
||||||
msgTxt.SetTextf("%s Rev%i", tr("Update to"), newrev);
|
msgTxt.SetTextf("%s Rev%i", tr("Update to"), newrev);
|
||||||
|
|
||||||
s32 filesize;
|
s32 filesize;
|
||||||
if (Settings.beta_upgrades) {
|
if (Settings.beta_upgrades) {
|
||||||
char url[255];
|
char url[255];
|
||||||
@ -3569,14 +3516,6 @@ HBCWindowPrompt(const char *name, const char *coder, const char *version,
|
|||||||
btn2.SetAlignment(ALIGN_RIGHT, ALIGN_BOTTOM);
|
btn2.SetAlignment(ALIGN_RIGHT, ALIGN_BOTTOM);
|
||||||
btn2.SetPosition(-40, 2);
|
btn2.SetPosition(-40, 2);
|
||||||
|
|
||||||
GuiTrigger trigZ;
|
|
||||||
trigZ.SetButtonOnlyTrigger(-1, WPAD_NUNCHUK_BUTTON_Z | WPAD_CLASSIC_BUTTON_ZL, PAD_TRIGGER_Z);
|
|
||||||
|
|
||||||
GuiButton screenShotBtn(0,0);
|
|
||||||
screenShotBtn.SetPosition(0,0);
|
|
||||||
screenShotBtn.SetTrigger(&trigZ);
|
|
||||||
promptWindow.Append(&screenShotBtn);
|
|
||||||
|
|
||||||
promptWindow.Append(&dialogBoxImg);
|
promptWindow.Append(&dialogBoxImg);
|
||||||
if (strcmp(long_description,""))promptWindow.Append(&whiteBoxImg);
|
if (strcmp(long_description,""))promptWindow.Append(&whiteBoxImg);
|
||||||
if (strcmp(long_description,""))promptWindow.Append(&scrollbarImg);
|
if (strcmp(long_description,""))promptWindow.Append(&scrollbarImg);
|
||||||
@ -3603,23 +3542,15 @@ HBCWindowPrompt(const char *name, const char *coder, const char *version,
|
|||||||
|
|
||||||
while (choice == -1) {
|
while (choice == -1) {
|
||||||
VIDEO_WaitVSync();
|
VIDEO_WaitVSync();
|
||||||
if (shutdown == 1) {
|
|
||||||
|
if (shutdown == 1)
|
||||||
wiilight(0);
|
wiilight(0);
|
||||||
Sys_Shutdown();
|
|
||||||
}
|
|
||||||
if (reset == 1)
|
|
||||||
Sys_Reboot();
|
|
||||||
if (btn1.GetState() == STATE_CLICKED) {
|
if (btn1.GetState() == STATE_CLICKED) {
|
||||||
choice = 1;
|
choice = 1;
|
||||||
} else if (btn2.GetState() == STATE_CLICKED) {
|
} else if (btn2.GetState() == STATE_CLICKED) {
|
||||||
choice = 0;
|
choice = 0;
|
||||||
}
|
}
|
||||||
else if (screenShotBtn.GetState() == STATE_CLICKED) {
|
|
||||||
gprintf("\n\tscreenShotBtn clicked");
|
|
||||||
screenShotBtn.ResetState();
|
|
||||||
ScreenShot();
|
|
||||||
gprintf("...It's easy, mmmmmmKay");
|
|
||||||
}
|
|
||||||
else if ((arrowUpBtn.GetState()==STATE_CLICKED||arrowUpBtn.GetState()==STATE_HELD) ) {
|
else if ((arrowUpBtn.GetState()==STATE_CLICKED||arrowUpBtn.GetState()==STATE_HELD) ) {
|
||||||
if (long_descriptionTxt.GetFirstLine()>1)
|
if (long_descriptionTxt.GetFirstLine()>1)
|
||||||
long_descriptionTxt.SetFirstLine(long_descriptionTxt.GetFirstLine()-1);
|
long_descriptionTxt.SetFirstLine(long_descriptionTxt.GetFirstLine()-1);
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
#include "settings/cfg.h"
|
#include "settings/cfg.h"
|
||||||
#include "sys.h"
|
#include "sys.h"
|
||||||
#include "menu.h"
|
#include "menu.h"
|
||||||
|
#include "../menu/menus.h"
|
||||||
#include "audio.h"
|
#include "audio.h"
|
||||||
#include "wad/wad.h"
|
#include "wad/wad.h"
|
||||||
#include "xml/xml.h"
|
#include "xml/xml.h"
|
||||||
@ -37,14 +38,8 @@ u32 titleCnt;
|
|||||||
extern struct discHdr * gameList;
|
extern struct discHdr * gameList;
|
||||||
extern u32 gameCnt;
|
extern u32 gameCnt;
|
||||||
|
|
||||||
/*** Extern functions ***/
|
|
||||||
extern void ResumeGui();
|
|
||||||
extern void HaltGui();
|
|
||||||
|
|
||||||
/*** Extern variables ***/
|
/*** Extern variables ***/
|
||||||
extern GuiWindow * mainWindow;
|
extern GuiWindow * mainWindow;
|
||||||
extern u8 shutdown;
|
|
||||||
extern u8 reset;
|
|
||||||
extern u32 infilesize;
|
extern u32 infilesize;
|
||||||
extern wchar_t *gameFilter;
|
extern wchar_t *gameFilter;
|
||||||
|
|
||||||
@ -123,7 +118,7 @@ int TitleBrowser(u32 type) {
|
|||||||
char line[200];
|
char line[200];
|
||||||
char tmp[50];
|
char tmp[50];
|
||||||
snprintf(tmp,50," ");
|
snprintf(tmp,50," ");
|
||||||
|
|
||||||
//check if the content.bin is on the SD card for that game
|
//check if the content.bin is on the SD card for that game
|
||||||
//if there is content.bin,then the game is on the SDmenu and not the wii
|
//if there is content.bin,then the game is on the SDmenu and not the wii
|
||||||
sprintf(line,"SD:/private/wii/title/%s/content.bin",text);
|
sprintf(line,"SD:/private/wii/title/%s/content.bin",text);
|
||||||
@ -295,16 +290,8 @@ int TitleBrowser(u32 type) {
|
|||||||
wifiBtn.SetAlpha(80);
|
wifiBtn.SetAlpha(80);
|
||||||
wifiBtn.SetTrigger(&trigA);
|
wifiBtn.SetTrigger(&trigA);
|
||||||
|
|
||||||
GuiTrigger trigZ;
|
|
||||||
trigZ.SetButtonOnlyTrigger(-1, WPAD_NUNCHUK_BUTTON_Z | WPAD_CLASSIC_BUTTON_ZL, PAD_TRIGGER_Z);
|
|
||||||
|
|
||||||
GuiButton screenShotBtn(0,0);
|
|
||||||
screenShotBtn.SetPosition(0,0);
|
|
||||||
screenShotBtn.SetTrigger(&trigZ);
|
|
||||||
|
|
||||||
HaltGui();
|
HaltGui();
|
||||||
GuiWindow w(screenwidth, screenheight);
|
GuiWindow w(screenwidth, screenheight);
|
||||||
w.Append(&screenShotBtn);
|
|
||||||
w.Append(&settingsbackgroundbtn);
|
w.Append(&settingsbackgroundbtn);
|
||||||
w.Append(&titleTxt);
|
w.Append(&titleTxt);
|
||||||
w.Append(&cancelBtn);
|
w.Append(&cancelBtn);
|
||||||
@ -320,12 +307,7 @@ int TitleBrowser(u32 type) {
|
|||||||
while (!exit) {
|
while (!exit) {
|
||||||
VIDEO_WaitVSync();
|
VIDEO_WaitVSync();
|
||||||
|
|
||||||
if (shutdown == 1)
|
if (wifiBtn.GetState() == STATE_CLICKED) {
|
||||||
Sys_Shutdown();
|
|
||||||
if (reset == 1)
|
|
||||||
Sys_Reboot();
|
|
||||||
|
|
||||||
else if (wifiBtn.GetState() == STATE_CLICKED) {
|
|
||||||
|
|
||||||
ResumeNetworkWait();
|
ResumeNetworkWait();
|
||||||
wifiBtn.ResetState();
|
wifiBtn.ResetState();
|
||||||
@ -418,7 +400,7 @@ int TitleBrowser(u32 type) {
|
|||||||
char temp[50];
|
char temp[50];
|
||||||
char filepath[100];
|
char filepath[100];
|
||||||
u32 read = 0;
|
u32 read = 0;
|
||||||
|
|
||||||
//make sure there is a folder for this to be saved in
|
//make sure there is a folder for this to be saved in
|
||||||
struct stat st;
|
struct stat st;
|
||||||
snprintf(filepath, sizeof(filepath), "%s/wad/", bootDevice);
|
snprintf(filepath, sizeof(filepath), "%s/wad/", bootDevice);
|
||||||
@ -428,7 +410,7 @@ int TitleBrowser(u32 type) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
snprintf(filepath, sizeof(filepath), "%s/wad/tmp.tmp", bootDevice);
|
snprintf(filepath, sizeof(filepath), "%s/wad/tmp.tmp", bootDevice);
|
||||||
|
|
||||||
|
|
||||||
if (infilesize < MB_SIZE)
|
if (infilesize < MB_SIZE)
|
||||||
snprintf(filesizetxt, sizeof(filesizetxt), tr("Incoming file %0.2fKB"), infilesize/KB_SIZE);
|
snprintf(filesizetxt, sizeof(filesizetxt), tr("Incoming file %0.2fKB"), infilesize/KB_SIZE);
|
||||||
@ -512,9 +494,9 @@ int TitleBrowser(u32 type) {
|
|||||||
w.Remove(&wifiBtn);
|
w.Remove(&wifiBtn);
|
||||||
w.Remove(&optionBrowser3);
|
w.Remove(&optionBrowser3);
|
||||||
ResumeGui();
|
ResumeGui();
|
||||||
|
|
||||||
Wad_Install(file);
|
Wad_Install(file);
|
||||||
|
|
||||||
HaltGui();
|
HaltGui();
|
||||||
w.Append(&titleTxt);
|
w.Append(&titleTxt);
|
||||||
w.Append(&cancelBtn);
|
w.Append(&cancelBtn);
|
||||||
@ -547,12 +529,6 @@ int TitleBrowser(u32 type) {
|
|||||||
exit = true;
|
exit = true;
|
||||||
ret = -10;
|
ret = -10;
|
||||||
}
|
}
|
||||||
else if (screenShotBtn.GetState() == STATE_CLICKED) {
|
|
||||||
gprintf("\n\tscreenShotBtn clicked");
|
|
||||||
screenShotBtn.ResetState();
|
|
||||||
ScreenShot();
|
|
||||||
gprintf("...It's easy, mmmmmmKay");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CloseConnection();
|
CloseConnection();
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
#include "menu.h"
|
#include "menu.h"
|
||||||
|
#include "../menu/menus.h"
|
||||||
|
|
||||||
#include "listfiles.h"
|
#include "listfiles.h"
|
||||||
#include "language/gettext.h"
|
#include "language/gettext.h"
|
||||||
@ -27,15 +28,10 @@
|
|||||||
#include "libwiigui/gui.h"
|
#include "libwiigui/gui.h"
|
||||||
#include "sys.h"
|
#include "sys.h"
|
||||||
#include "filebrowser.h"
|
#include "filebrowser.h"
|
||||||
|
#include "../menu.h"
|
||||||
|
|
||||||
/*** Extern variables ***/
|
/*** Extern variables ***/
|
||||||
extern GuiWindow * mainWindow;
|
extern GuiWindow * mainWindow;
|
||||||
extern u8 shutdown;
|
|
||||||
extern u8 reset;
|
|
||||||
|
|
||||||
/*** Extern functions ***/
|
|
||||||
extern void ResumeGui();
|
|
||||||
extern void HaltGui();
|
|
||||||
|
|
||||||
static int curDevice = -1;
|
static int curDevice = -1;
|
||||||
static std::vector<BROWSERINFO> browsers;
|
static std::vector<BROWSERINFO> browsers;
|
||||||
@ -317,7 +313,7 @@ int BrowseDevice(char * Path, int Path_size, int Flags, FILTERCASCADE *Filter/*=
|
|||||||
folderBtn.SetImage(&folderImg);
|
folderBtn.SetImage(&folderImg);
|
||||||
folderBtn.SetTrigger(&trigA);
|
folderBtn.SetTrigger(&trigA);
|
||||||
folderBtn.SetEffectGrow();
|
folderBtn.SetEffectGrow();
|
||||||
|
|
||||||
char imgPath[100];
|
char imgPath[100];
|
||||||
snprintf(imgPath, sizeof(imgPath), "%sbutton_dialogue_box.png", CFG.theme_path);
|
snprintf(imgPath, sizeof(imgPath), "%sbutton_dialogue_box.png", CFG.theme_path);
|
||||||
GuiImageData btnOutline(imgPath, button_dialogue_box_png);
|
GuiImageData btnOutline(imgPath, button_dialogue_box_png);
|
||||||
@ -393,12 +389,6 @@ int BrowseDevice(char * Path, int Path_size, int Flags, FILTERCASCADE *Filter/*=
|
|||||||
while (menu == MENU_NONE) {
|
while (menu == MENU_NONE) {
|
||||||
VIDEO_WaitVSync();
|
VIDEO_WaitVSync();
|
||||||
|
|
||||||
if (shutdown == 1)
|
|
||||||
Sys_Shutdown();
|
|
||||||
|
|
||||||
if (reset == 1)
|
|
||||||
Sys_Reboot();
|
|
||||||
|
|
||||||
for (i=0; i<FILEBROWSERSIZE; i++) {
|
for (i=0; i<FILEBROWSERSIZE; i++) {
|
||||||
if (fileBrowser.fileList[i]->GetState() == STATE_CLICKED) {
|
if (fileBrowser.fileList[i]->GetState() == STATE_CLICKED) {
|
||||||
fileBrowser.fileList[i]->ResetState();
|
fileBrowser.fileList[i]->ResetState();
|
||||||
@ -486,7 +476,7 @@ int BrowseDevice(char * Path, int Path_size, int Flags, FILTERCASCADE *Filter/*=
|
|||||||
char oldfolder[100];
|
char oldfolder[100];
|
||||||
snprintf(newfolder, sizeof(newfolder), "%s%s", browser->rootdir, browser->dir);
|
snprintf(newfolder, sizeof(newfolder), "%s%s", browser->rootdir, browser->dir);
|
||||||
strcpy(oldfolder,newfolder);
|
strcpy(oldfolder,newfolder);
|
||||||
|
|
||||||
int result = OnScreenKeyboard(newfolder, sizeof(newfolder), strlen(browser->rootdir));
|
int result = OnScreenKeyboard(newfolder, sizeof(newfolder), strlen(browser->rootdir));
|
||||||
if ( result == 1 ) {
|
if ( result == 1 ) {
|
||||||
unsigned int len = strlen(newfolder);
|
unsigned int len = strlen(newfolder);
|
||||||
|
@ -19,22 +19,18 @@
|
|||||||
#include "gameinfo.h"
|
#include "gameinfo.h"
|
||||||
#include "usbloader/getentries.h"
|
#include "usbloader/getentries.h"
|
||||||
#include "../gecko.h"
|
#include "../gecko.h"
|
||||||
|
#include "../menu.h"
|
||||||
|
#include "../menu/menus.h"
|
||||||
|
|
||||||
|
|
||||||
/*** Extern variables ***/
|
/*** Extern variables ***/
|
||||||
extern GuiWindow * mainWindow;
|
extern GuiWindow * mainWindow;
|
||||||
extern GuiSound * bgMusic;
|
extern GuiSound * bgMusic;
|
||||||
extern u8 shutdown;
|
|
||||||
extern u8 reset;
|
|
||||||
extern struct gameXMLinfo gameinfo;
|
extern struct gameXMLinfo gameinfo;
|
||||||
extern struct gameXMLinfo gameinfo_reset;
|
extern struct gameXMLinfo gameinfo_reset;
|
||||||
extern u32 gameCnt;
|
extern u32 gameCnt;
|
||||||
extern struct discHdr * gameList;
|
extern struct discHdr * gameList;
|
||||||
|
|
||||||
/*** Extern functions ***/
|
|
||||||
extern void ResumeGui();
|
|
||||||
extern void HaltGui();
|
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* gameinfo
|
* gameinfo
|
||||||
@ -714,7 +710,7 @@ int showGameInfo(char *ID) {
|
|||||||
snprintf(linebuf, sizeof(linebuf), "%s:",tr("WiFi Features"));
|
snprintf(linebuf, sizeof(linebuf), "%s:",tr("WiFi Features"));
|
||||||
} else {
|
} else {
|
||||||
strcpy(linebuf,"");
|
strcpy(linebuf,"");
|
||||||
}
|
}
|
||||||
wifiTxt[0] = new GuiText(linebuf, 16, (GXColor) {0,0,0, 255});
|
wifiTxt[0] = new GuiText(linebuf, 16, (GXColor) {0,0,0, 255});
|
||||||
wifiTxt[0]->SetAlignment(ALIGN_LEFT, ALIGN_TOP);
|
wifiTxt[0]->SetAlignment(ALIGN_LEFT, ALIGN_TOP);
|
||||||
wifiTxt[0]->SetPosition(205,200+wifiY);
|
wifiTxt[0]->SetPosition(205,200+wifiY);
|
||||||
@ -781,13 +777,6 @@ int showGameInfo(char *ID) {
|
|||||||
|
|
||||||
gameinfoWindow.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_IN, 100);
|
gameinfoWindow.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_IN, 100);
|
||||||
|
|
||||||
GuiTrigger trigZ;
|
|
||||||
trigZ.SetButtonOnlyTrigger(-1, WPAD_NUNCHUK_BUTTON_Z | WPAD_CLASSIC_BUTTON_ZL, PAD_TRIGGER_Z);
|
|
||||||
|
|
||||||
GuiButton screenShotBtn(0,0);
|
|
||||||
screenShotBtn.SetPosition(0,0);
|
|
||||||
screenShotBtn.SetTrigger(&trigZ);
|
|
||||||
gameinfoWindow.Append(&screenShotBtn);
|
|
||||||
HaltGui();
|
HaltGui();
|
||||||
//mainWindow->SetState(STATE_DISABLED);
|
//mainWindow->SetState(STATE_DISABLED);
|
||||||
mainWindow->Append(&gameinfoWindow);
|
mainWindow->Append(&gameinfoWindow);
|
||||||
@ -799,13 +788,8 @@ int showGameInfo(char *ID) {
|
|||||||
while (choice == -1) {
|
while (choice == -1) {
|
||||||
|
|
||||||
VIDEO_WaitVSync();
|
VIDEO_WaitVSync();
|
||||||
if (shutdown == 1) {
|
|
||||||
wiilight(0);
|
|
||||||
Sys_Shutdown();
|
|
||||||
} else if (reset == 1)
|
|
||||||
Sys_Reboot();
|
|
||||||
|
|
||||||
else if ((backBtn.GetState()==STATE_CLICKED)||(backBtn.GetState()==STATE_HELD)) {
|
if ((backBtn.GetState()==STATE_CLICKED)||(backBtn.GetState()==STATE_HELD)) {
|
||||||
backBtn.ResetState();
|
backBtn.ResetState();
|
||||||
if (page==1) {
|
if (page==1) {
|
||||||
choice=1;
|
choice=1;
|
||||||
@ -816,13 +800,11 @@ int showGameInfo(char *ID) {
|
|||||||
gameinfoWindow2.Remove(&nextBtn);
|
gameinfoWindow2.Remove(&nextBtn);
|
||||||
gameinfoWindow2.Remove(&backBtn);
|
gameinfoWindow2.Remove(&backBtn);
|
||||||
gameinfoWindow2.Remove(&homeBtn);
|
gameinfoWindow2.Remove(&homeBtn);
|
||||||
gameinfoWindow2.Remove(&screenShotBtn);
|
|
||||||
gameinfoWindow2.SetVisible(false);
|
gameinfoWindow2.SetVisible(false);
|
||||||
gameinfoWindow.SetVisible(true);
|
gameinfoWindow.SetVisible(true);
|
||||||
gameinfoWindow.Append(&backBtn);
|
gameinfoWindow.Append(&backBtn);
|
||||||
gameinfoWindow.Append(&nextBtn);
|
gameinfoWindow.Append(&nextBtn);
|
||||||
gameinfoWindow.Append(&homeBtn);
|
gameinfoWindow.Append(&homeBtn);
|
||||||
gameinfoWindow.Append(&screenShotBtn);
|
|
||||||
mainWindow->Remove(&gameinfoWindow2);
|
mainWindow->Remove(&gameinfoWindow2);
|
||||||
ResumeGui();
|
ResumeGui();
|
||||||
page=1;
|
page=1;
|
||||||
@ -835,14 +817,12 @@ int showGameInfo(char *ID) {
|
|||||||
gameinfoWindow.Remove(&nextBtn);
|
gameinfoWindow.Remove(&nextBtn);
|
||||||
gameinfoWindow.Remove(&backBtn);
|
gameinfoWindow.Remove(&backBtn);
|
||||||
gameinfoWindow.Remove(&homeBtn);
|
gameinfoWindow.Remove(&homeBtn);
|
||||||
gameinfoWindow.Remove(&screenShotBtn);
|
|
||||||
gameinfoWindow.SetVisible(false);
|
gameinfoWindow.SetVisible(false);
|
||||||
gameinfoWindow2.SetVisible(true);
|
gameinfoWindow2.SetVisible(true);
|
||||||
coverImg->SetPosition(15,30);
|
coverImg->SetPosition(15,30);
|
||||||
gameinfoWindow2.Append(&nextBtn);
|
gameinfoWindow2.Append(&nextBtn);
|
||||||
gameinfoWindow2.Append(&backBtn);
|
gameinfoWindow2.Append(&backBtn);
|
||||||
gameinfoWindow2.Append(&homeBtn);
|
gameinfoWindow2.Append(&homeBtn);
|
||||||
gameinfoWindow2.Append(&screenShotBtn);
|
|
||||||
mainWindow->Append(&gameinfoWindow2);
|
mainWindow->Append(&gameinfoWindow2);
|
||||||
ResumeGui();
|
ResumeGui();
|
||||||
page=2;
|
page=2;
|
||||||
@ -851,13 +831,11 @@ int showGameInfo(char *ID) {
|
|||||||
gameinfoWindow2.Remove(&nextBtn);
|
gameinfoWindow2.Remove(&nextBtn);
|
||||||
gameinfoWindow2.Remove(&backBtn);
|
gameinfoWindow2.Remove(&backBtn);
|
||||||
gameinfoWindow2.Remove(&homeBtn);
|
gameinfoWindow2.Remove(&homeBtn);
|
||||||
gameinfoWindow2.Remove(&screenShotBtn);
|
|
||||||
gameinfoWindow2.SetVisible(false);
|
gameinfoWindow2.SetVisible(false);
|
||||||
gameinfoWindow.SetVisible(true);
|
gameinfoWindow.SetVisible(true);
|
||||||
gameinfoWindow.Append(&backBtn);
|
gameinfoWindow.Append(&backBtn);
|
||||||
gameinfoWindow.Append(&nextBtn);
|
gameinfoWindow.Append(&nextBtn);
|
||||||
gameinfoWindow.Append(&homeBtn);
|
gameinfoWindow.Append(&homeBtn);
|
||||||
gameinfoWindow.Append(&screenShotBtn);
|
|
||||||
mainWindow->Remove(&gameinfoWindow2);
|
mainWindow->Remove(&gameinfoWindow2);
|
||||||
ResumeGui();
|
ResumeGui();
|
||||||
page=1;
|
page=1;
|
||||||
@ -916,12 +894,6 @@ int showGameInfo(char *ID) {
|
|||||||
}
|
}
|
||||||
urlBtn.ResetState();
|
urlBtn.ResetState();
|
||||||
}
|
}
|
||||||
else if (screenShotBtn.GetState() == STATE_CLICKED) {
|
|
||||||
gprintf("\n\tscreenShotBtn clicked");
|
|
||||||
screenShotBtn.ResetState();
|
|
||||||
ScreenShot();
|
|
||||||
gprintf("...It's easy, mmmmmmKay");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (page==1) {
|
if (page==1) {
|
||||||
gameinfoWindow.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_OUT, 100);
|
gameinfoWindow.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_OUT, 100);
|
||||||
@ -1103,10 +1075,10 @@ bool save_XML_URL() { // save xml url as as txt file for people without wifi
|
|||||||
sleep(1);
|
sleep(1);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
char XMLurl[3540];
|
char XMLurl[3540];
|
||||||
build_XML_URL(XMLurl,sizeof(XMLurl));
|
build_XML_URL(XMLurl,sizeof(XMLurl));
|
||||||
|
|
||||||
fprintf(f, "# USB Loader Has Saved this file\n");
|
fprintf(f, "# USB Loader Has Saved this file\n");
|
||||||
fprintf(f, "# This URL was created based on your list of games and language settings.\n");
|
fprintf(f, "# This URL was created based on your list of games and language settings.\n");
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
#include "cheats/cheatmenu.h"
|
#include "cheats/cheatmenu.h"
|
||||||
#include "fatmounter.h"
|
#include "fatmounter.h"
|
||||||
#include "menu.h"
|
#include "menu.h"
|
||||||
|
#include "menu/menus.h"
|
||||||
#include "filelist.h"
|
#include "filelist.h"
|
||||||
#include "listfiles.h"
|
#include "listfiles.h"
|
||||||
#include "sys.h"
|
#include "sys.h"
|
||||||
@ -23,9 +24,6 @@
|
|||||||
|
|
||||||
#define MAXOPTIONS 13
|
#define MAXOPTIONS 13
|
||||||
|
|
||||||
/*** Extern functions ***/
|
|
||||||
extern void ResumeGui();
|
|
||||||
extern void HaltGui();
|
|
||||||
extern void titles_default();
|
extern void titles_default();
|
||||||
|
|
||||||
/*** Extern variables ***/
|
/*** Extern variables ***/
|
||||||
@ -34,8 +32,6 @@ extern GuiSound * bgMusic;
|
|||||||
extern GuiImage * bgImg;
|
extern GuiImage * bgImg;
|
||||||
extern GuiImageData * pointer[4];
|
extern GuiImageData * pointer[4];
|
||||||
extern GuiImageData * background;
|
extern GuiImageData * background;
|
||||||
extern u8 shutdown;
|
|
||||||
extern u8 reset;
|
|
||||||
extern u8 mountMethod;
|
extern u8 mountMethod;
|
||||||
extern struct discHdr *dvdheader;
|
extern struct discHdr *dvdheader;
|
||||||
extern PartList partitions;
|
extern PartList partitions;
|
||||||
@ -76,7 +72,7 @@ int MenuSettings()
|
|||||||
int opt_override = Settings.titlesOverride;
|
int opt_override = Settings.titlesOverride;
|
||||||
// backup partition index
|
// backup partition index
|
||||||
u8 settingspartitionold = Settings.partition;
|
u8 settingspartitionold = Settings.partition;
|
||||||
|
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
@ -537,7 +533,7 @@ int MenuSettings()
|
|||||||
|
|
||||||
snprintf(MainButtonText, sizeof(MainButtonText), "%s", tr("Theme Downloader"));
|
snprintf(MainButtonText, sizeof(MainButtonText), "%s", tr("Theme Downloader"));
|
||||||
MainButton1Txt.SetText(MainButtonText);
|
MainButton1Txt.SetText(MainButtonText);
|
||||||
snprintf(MainButtonText, sizeof(MainButtonText), "%s", tr(" "));
|
snprintf(MainButtonText, sizeof(MainButtonText), "%s", tr("Partition Format Menu"));
|
||||||
MainButton2Txt.SetText(MainButtonText);
|
MainButton2Txt.SetText(MainButtonText);
|
||||||
snprintf(MainButtonText, sizeof(MainButtonText), "%s", tr(" "));
|
snprintf(MainButtonText, sizeof(MainButtonText), "%s", tr(" "));
|
||||||
MainButton3Txt.SetText(MainButtonText);
|
MainButton3Txt.SetText(MainButtonText);
|
||||||
@ -557,6 +553,7 @@ int MenuSettings()
|
|||||||
w.Append(&GoRightBtn);
|
w.Append(&GoRightBtn);
|
||||||
w.Append(&GoLeftBtn);
|
w.Append(&GoLeftBtn);
|
||||||
w.Append(&MainButton1);
|
w.Append(&MainButton1);
|
||||||
|
w.Append(&MainButton2);
|
||||||
|
|
||||||
PageIndicatorBtn1.SetAlpha(50);
|
PageIndicatorBtn1.SetAlpha(50);
|
||||||
PageIndicatorBtn2.SetAlpha(50);
|
PageIndicatorBtn2.SetAlpha(50);
|
||||||
@ -611,10 +608,6 @@ int MenuSettings()
|
|||||||
{
|
{
|
||||||
VIDEO_WaitVSync ();
|
VIDEO_WaitVSync ();
|
||||||
|
|
||||||
if (shutdown == 1)
|
|
||||||
Sys_Shutdown();
|
|
||||||
if (reset == 1)
|
|
||||||
Sys_Reboot();
|
|
||||||
|
|
||||||
if ( pageToDisplay == 1 )
|
if ( pageToDisplay == 1 )
|
||||||
{
|
{
|
||||||
@ -658,12 +651,7 @@ int MenuSettings()
|
|||||||
|
|
||||||
returnhere = 1;
|
returnhere = 1;
|
||||||
|
|
||||||
if (shutdown == 1)
|
if (backBtn.GetState() == STATE_CLICKED)
|
||||||
Sys_Shutdown();
|
|
||||||
if (reset == 1)
|
|
||||||
Sys_Reboot();
|
|
||||||
|
|
||||||
else if (backBtn.GetState() == STATE_CLICKED)
|
|
||||||
{
|
{
|
||||||
backBtn.ResetState();
|
backBtn.ResetState();
|
||||||
exit = true;
|
exit = true;
|
||||||
@ -865,7 +853,7 @@ int MenuSettings()
|
|||||||
static const char *opts[settings_screensaver_max] = {trNOOP("OFF"),trNOOP("3 min"),trNOOP("5 min"),trNOOP("10 min"),trNOOP("20 min"),trNOOP("30 min"),trNOOP("1 hour")};
|
static const char *opts[settings_screensaver_max] = {trNOOP("OFF"),trNOOP("3 min"),trNOOP("5 min"),trNOOP("10 min"),trNOOP("20 min"),trNOOP("30 min"),trNOOP("1 hour")};
|
||||||
options2.SetValue(Idx,"%s",tr(opts[Settings.screensaver]));
|
options2.SetValue(Idx,"%s",tr(opts[Settings.screensaver]));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ret == ++Idx || firstRun)
|
if(ret == ++Idx || firstRun)
|
||||||
{
|
{
|
||||||
if(firstRun) options2.SetName(Idx, "%s",tr("Mark new games"));
|
if(firstRun) options2.SetName(Idx, "%s",tr("Mark new games"));
|
||||||
@ -920,12 +908,7 @@ int MenuSettings()
|
|||||||
{
|
{
|
||||||
VIDEO_WaitVSync ();
|
VIDEO_WaitVSync ();
|
||||||
|
|
||||||
if (shutdown == 1)
|
if (backBtn.GetState() == STATE_CLICKED)
|
||||||
Sys_Shutdown();
|
|
||||||
if (reset == 1)
|
|
||||||
Sys_Reboot();
|
|
||||||
|
|
||||||
else if (backBtn.GetState() == STATE_CLICKED)
|
|
||||||
{
|
{
|
||||||
backBtn.ResetState();
|
backBtn.ResetState();
|
||||||
exit = true;
|
exit = true;
|
||||||
@ -1010,7 +993,7 @@ int MenuSettings()
|
|||||||
else
|
else
|
||||||
options2.SetValue(Idx, "********");
|
options2.SetValue(Idx, "********");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ret == ++Idx || firstRun)
|
if (ret == ++Idx || firstRun)
|
||||||
{
|
{
|
||||||
if (firstRun) options2.SetName(Idx, "%s", tr("Partition"));
|
if (firstRun) options2.SetName(Idx, "%s", tr("Partition"));
|
||||||
@ -1022,23 +1005,23 @@ int MenuSettings()
|
|||||||
}
|
}
|
||||||
while (!IsValidPartition(partitions.pinfo[Settings.partition].fs_type, Settings.cios));
|
while (!IsValidPartition(partitions.pinfo[Settings.partition].fs_type, Settings.cios));
|
||||||
}
|
}
|
||||||
|
|
||||||
PartInfo pInfo = partitions.pinfo[Settings.partition];
|
PartInfo pInfo = partitions.pinfo[Settings.partition];
|
||||||
f32 partition_size = partitions.pentry[Settings.partition].size * (partitions.sector_size / GB_SIZE);
|
f32 partition_size = partitions.pentry[Settings.partition].size * (partitions.sector_size / GB_SIZE);
|
||||||
|
|
||||||
// Get the partition name and it's size in GB's
|
// Get the partition name and it's size in GB's
|
||||||
options2.SetValue(Idx,"%s%d (%.2fGB)", pInfo.fs_type == FS_TYPE_FAT32 ? "FAT" : pInfo.fs_type == FS_TYPE_NTFS ? "NTFS" : "WBFS",
|
options2.SetValue(Idx,"%s%d (%.2fGB)", pInfo.fs_type == FS_TYPE_FAT32 ? "FAT" : pInfo.fs_type == FS_TYPE_NTFS ? "NTFS" : "WBFS",
|
||||||
pInfo.index,
|
pInfo.index,
|
||||||
partition_size);
|
partition_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ret == ++Idx || firstRun)
|
if (ret == ++Idx || firstRun)
|
||||||
{
|
{
|
||||||
if (firstRun) options2.SetName(Idx, "%s", tr("FAT: Use directories"));
|
if (firstRun) options2.SetName(Idx, "%s", tr("FAT: Use directories"));
|
||||||
if (ret == Idx) {
|
if (ret == Idx) {
|
||||||
Settings.FatInstallToDir = Settings.FatInstallToDir == 0 ? 1 : 0;
|
Settings.FatInstallToDir = Settings.FatInstallToDir == 0 ? 1 : 0;
|
||||||
}
|
}
|
||||||
options2.SetValue(Idx, "%s", tr(opts_no_yes[Settings.FatInstallToDir]));
|
options2.SetValue(Idx, "%s", tr(opts_no_yes[Settings.FatInstallToDir]));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ret == ++Idx || firstRun)
|
if(ret == ++Idx || firstRun)
|
||||||
@ -1119,12 +1102,7 @@ int MenuSettings()
|
|||||||
{
|
{
|
||||||
VIDEO_WaitVSync ();
|
VIDEO_WaitVSync ();
|
||||||
|
|
||||||
if (shutdown == 1)
|
if (backBtn.GetState() == STATE_CLICKED)
|
||||||
Sys_Shutdown();
|
|
||||||
if (reset == 1)
|
|
||||||
Sys_Reboot();
|
|
||||||
|
|
||||||
else if (backBtn.GetState() == STATE_CLICKED)
|
|
||||||
{
|
{
|
||||||
backBtn.ResetState();
|
backBtn.ResetState();
|
||||||
exit = true;
|
exit = true;
|
||||||
@ -1167,7 +1145,7 @@ int MenuSettings()
|
|||||||
{
|
{
|
||||||
char entered[20];
|
char entered[20];
|
||||||
memset(entered, 0, 20);
|
memset(entered, 0, 20);
|
||||||
|
|
||||||
//password check to unlock Install,Delete and Format
|
//password check to unlock Install,Delete and Format
|
||||||
w.Remove(&optionBrowser2);
|
w.Remove(&optionBrowser2);
|
||||||
w.Remove(&backBtn);
|
w.Remove(&backBtn);
|
||||||
@ -1294,11 +1272,7 @@ int MenuSettings()
|
|||||||
|
|
||||||
bool returnhere = true;
|
bool returnhere = true;
|
||||||
|
|
||||||
if (shutdown == 1)
|
if (backBtn.GetState() == STATE_CLICKED)
|
||||||
Sys_Shutdown();
|
|
||||||
if (reset == 1)
|
|
||||||
Sys_Reboot();
|
|
||||||
else if (backBtn.GetState() == STATE_CLICKED)
|
|
||||||
{
|
{
|
||||||
backBtn.ResetState();
|
backBtn.ResetState();
|
||||||
exit = true;
|
exit = true;
|
||||||
@ -1474,12 +1448,8 @@ int MenuSettings()
|
|||||||
{
|
{
|
||||||
VIDEO_WaitVSync ();
|
VIDEO_WaitVSync ();
|
||||||
|
|
||||||
if (shutdown == 1)
|
|
||||||
Sys_Shutdown();
|
|
||||||
if (reset == 1)
|
|
||||||
Sys_Reboot();
|
|
||||||
|
|
||||||
else if (backBtn.GetState() == STATE_CLICKED)
|
if (backBtn.GetState() == STATE_CLICKED)
|
||||||
{
|
{
|
||||||
backBtn.ResetState();
|
backBtn.ResetState();
|
||||||
exit = true;
|
exit = true;
|
||||||
@ -1888,7 +1858,7 @@ int MenuSettings()
|
|||||||
}
|
}
|
||||||
options2.SetValue(Idx, "%s", Settings.BcaCodepath);
|
options2.SetValue(Idx, "%s", Settings.BcaCodepath);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ret == ++Idx || firstRun)
|
if(ret == ++Idx || firstRun)
|
||||||
{
|
{
|
||||||
if(firstRun) options2.SetName(Idx, "%s", tr("WIP Patches Path"));
|
if(firstRun) options2.SetName(Idx, "%s", tr("WIP Patches Path"));
|
||||||
@ -2048,6 +2018,20 @@ int MenuSettings()
|
|||||||
pageToDisplay = 0;
|
pageToDisplay = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (MainButton2.GetState() == STATE_CLICKED)
|
||||||
|
{
|
||||||
|
if(Settings.godmode == 1)
|
||||||
|
{
|
||||||
|
if (isInserted(bootDevice))
|
||||||
|
cfg_save_global();
|
||||||
|
menu = MENU_FORMAT;
|
||||||
|
pageToDisplay = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
WindowPrompt(tr("You can't access this menu!"), tr("Unlock the app first."), tr("OK"));
|
||||||
|
MainButton2.ResetState();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2146,7 +2130,7 @@ int MenuSettings()
|
|||||||
w.SetEffect(EFFECT_FADE, -20);
|
w.SetEffect(EFFECT_FADE, -20);
|
||||||
while (w.GetEffect()>0) usleep(50);
|
while (w.GetEffect()>0) usleep(50);
|
||||||
|
|
||||||
// if partition has changed, Reinitialize it
|
// if partition has changed, Reinitialize it
|
||||||
PartInfo pinfo = partitions.pinfo[Settings.partition];
|
PartInfo pinfo = partitions.pinfo[Settings.partition];
|
||||||
partitionEntry pentry = partitions.pentry[Settings.partition];
|
partitionEntry pentry = partitions.pentry[Settings.partition];
|
||||||
load_from_fs = pinfo.part_fs;
|
load_from_fs = pinfo.part_fs;
|
||||||
@ -2154,7 +2138,7 @@ int MenuSettings()
|
|||||||
WBFS_Close();
|
WBFS_Close();
|
||||||
WBFS_OpenPart(load_from_fs, pinfo.index, pentry.sector, pentry.size, (char *) &game_partition);
|
WBFS_OpenPart(load_from_fs, pinfo.index, pentry.sector, pentry.size, (char *) &game_partition);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if language has changed, reload titles
|
// if language has changed, reload titles
|
||||||
char opt_langnew[100];
|
char opt_langnew[100];
|
||||||
strcpy(opt_langnew,Settings.language_path);
|
strcpy(opt_langnew,Settings.language_path);
|
||||||
@ -2428,7 +2412,7 @@ int GameSettings(struct discHdr * header)
|
|||||||
iosChoice = i250;
|
iosChoice = i250;
|
||||||
else if (Settings.cios == ios223)
|
else if (Settings.cios == ios223)
|
||||||
iosChoice = i223;
|
iosChoice = i223;
|
||||||
else
|
else
|
||||||
iosChoice = i249;
|
iosChoice = i249;
|
||||||
parentalcontrolChoice = 0;
|
parentalcontrolChoice = 0;
|
||||||
fix002 = Settings.error002;
|
fix002 = Settings.error002;
|
||||||
@ -2449,11 +2433,6 @@ int GameSettings(struct discHdr * header)
|
|||||||
{
|
{
|
||||||
VIDEO_WaitVSync ();
|
VIDEO_WaitVSync ();
|
||||||
|
|
||||||
if (shutdown == 1)
|
|
||||||
Sys_Shutdown();
|
|
||||||
if (reset == 1)
|
|
||||||
Sys_Reboot();
|
|
||||||
|
|
||||||
if (MainButton1.GetState() == STATE_CLICKED)
|
if (MainButton1.GetState() == STATE_CLICKED)
|
||||||
{
|
{
|
||||||
w.Append(&saveBtn);
|
w.Append(&saveBtn);
|
||||||
@ -2489,10 +2468,6 @@ int GameSettings(struct discHdr * header)
|
|||||||
|
|
||||||
returnhere = 1;
|
returnhere = 1;
|
||||||
|
|
||||||
if (shutdown == 1)
|
|
||||||
Sys_Shutdown();
|
|
||||||
if (reset == 1)
|
|
||||||
Sys_Reboot();
|
|
||||||
if (backBtn.GetState() == STATE_CLICKED)
|
if (backBtn.GetState() == STATE_CLICKED)
|
||||||
{
|
{
|
||||||
backBtn.ResetState();
|
backBtn.ResetState();
|
||||||
@ -2762,10 +2737,6 @@ int GameSettings(struct discHdr * header)
|
|||||||
{
|
{
|
||||||
VIDEO_WaitVSync ();
|
VIDEO_WaitVSync ();
|
||||||
|
|
||||||
if (shutdown == 1)
|
|
||||||
Sys_Shutdown();
|
|
||||||
if (reset == 1)
|
|
||||||
Sys_Reboot();
|
|
||||||
if (backBtn.GetState() == STATE_CLICKED)
|
if (backBtn.GetState() == STATE_CLICKED)
|
||||||
{
|
{
|
||||||
backBtn.ResetState();
|
backBtn.ResetState();
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
#include "settings/cfg.h"
|
#include "settings/cfg.h"
|
||||||
#include "network/URL_List.h"
|
#include "network/URL_List.h"
|
||||||
#include "listfiles.h"
|
#include "listfiles.h"
|
||||||
|
#include "menu/menus.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "fatmounter.h"
|
#include "fatmounter.h"
|
||||||
#include "filelist.h"
|
#include "filelist.h"
|
||||||
@ -20,13 +21,6 @@
|
|||||||
/*** Extern variables ***/
|
/*** Extern variables ***/
|
||||||
extern GuiWindow * mainWindow;
|
extern GuiWindow * mainWindow;
|
||||||
extern GuiSound * bgMusic;
|
extern GuiSound * bgMusic;
|
||||||
extern u8 shutdown;
|
|
||||||
extern u8 reset;
|
|
||||||
|
|
||||||
/*** Extern functions ***/
|
|
||||||
extern void ResumeGui();
|
|
||||||
extern void HaltGui();
|
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* MenuOGG
|
* MenuOGG
|
||||||
@ -183,11 +177,6 @@ bool MenuOGG() {
|
|||||||
|
|
||||||
while (!returnhere) {
|
while (!returnhere) {
|
||||||
|
|
||||||
if (shutdown == 1)
|
|
||||||
Sys_Shutdown();
|
|
||||||
if (reset == 1)
|
|
||||||
Sys_Reboot();
|
|
||||||
|
|
||||||
if (backBtn.GetState() == STATE_CLICKED) {
|
if (backBtn.GetState() == STATE_CLICKED) {
|
||||||
if (nothingchanged == 1 && countoggs > 0) {
|
if (nothingchanged == 1 && countoggs > 0) {
|
||||||
if (strcmp("", Settings.oggload_path) && strcmp("notset", Settings.ogg_path)) {
|
if (strcmp("", Settings.oggload_path) && strcmp("notset", Settings.ogg_path)) {
|
||||||
@ -453,12 +442,7 @@ int MenuLanguageSelect() {
|
|||||||
|
|
||||||
while (!returnhere) {
|
while (!returnhere) {
|
||||||
|
|
||||||
if (shutdown == 1)
|
if (backBtn.GetState() == STATE_CLICKED) {
|
||||||
Sys_Shutdown();
|
|
||||||
else if (reset == 1)
|
|
||||||
Sys_Reboot();
|
|
||||||
|
|
||||||
else if (backBtn.GetState() == STATE_CLICKED) {
|
|
||||||
|
|
||||||
backBtn.ResetState();
|
backBtn.ResetState();
|
||||||
break;
|
break;
|
||||||
|
@ -366,7 +366,7 @@ void Global_Default(void) {
|
|||||||
Settings.partitions_to_install = install_game_only;
|
Settings.partitions_to_install = install_game_only;
|
||||||
Settings.fullcopy = 0;
|
Settings.fullcopy = 0;
|
||||||
Settings.beta_upgrades = 0;
|
Settings.beta_upgrades = 0;
|
||||||
|
|
||||||
memset(&Settings.parental, 0, sizeof(struct SParental));
|
memset(&Settings.parental, 0, sizeof(struct SParental));
|
||||||
|
|
||||||
char buf[0x4a];
|
char buf[0x4a];
|
||||||
@ -385,7 +385,11 @@ void Global_Default(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
char *cfg_get_title(u8 *id) {
|
char *cfg_get_title(u8 *id)
|
||||||
|
{
|
||||||
|
if(!id)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
for (i=0; i<num_title; i++) {
|
for (i=0; i<num_title; i++) {
|
||||||
if (memcmp(id, cfg_title[i].id, 4) == 0) {
|
if (memcmp(id, cfg_title[i].id, 4) == 0) {
|
||||||
@ -1850,7 +1854,7 @@ void CFG_Load(void) {
|
|||||||
// if GUI language is set to default Settings.language_path needs to remain "notset" (if the detected setting was kept detection wouldn't work next time)
|
// if GUI language is set to default Settings.language_path needs to remain "notset" (if the detected setting was kept detection wouldn't work next time)
|
||||||
if (langisdefault)
|
if (langisdefault)
|
||||||
sprintf(Settings.language_path, "notset");
|
sprintf(Settings.language_path, "notset");
|
||||||
|
|
||||||
Settings.godmode = (Settings.parental.enabled == 0 && (Settings.parentalcontrol == 0 || strlen(Settings.unlockCode) == 0)) ? 1 : 0;
|
Settings.godmode = (Settings.parental.enabled == 0 && (Settings.parentalcontrol == 0 || strlen(Settings.unlockCode) == 0)) ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
200
source/sys.cpp
200
source/sys.cpp
@ -14,10 +14,13 @@
|
|||||||
#include "fatmounter.h"
|
#include "fatmounter.h"
|
||||||
#include "sys.h"
|
#include "sys.h"
|
||||||
#include "wpad.h"
|
#include "wpad.h"
|
||||||
|
#include "menu/menus.h"
|
||||||
|
|
||||||
extern char game_partition[6];
|
extern char game_partition[6];
|
||||||
extern u8 load_from_fs;
|
extern u8 load_from_fs;
|
||||||
|
|
||||||
|
extern u8 hddState;
|
||||||
|
|
||||||
//Wiilight stuff
|
//Wiilight stuff
|
||||||
static vu32 *_wiilight_reg = (u32*)0xCD0000C0;
|
static vu32 *_wiilight_reg = (u32*)0xCD0000C0;
|
||||||
void wiilight(int enable) { // Toggle wiilight (thanks Bool for wiilight source)
|
void wiilight(int enable) { // Toggle wiilight (thanks Bool for wiilight source)
|
||||||
@ -68,44 +71,51 @@ void Sys_Reboot(void) {
|
|||||||
|
|
||||||
int Sys_ChangeIos(int ios) {
|
int Sys_ChangeIos(int ios) {
|
||||||
s32 prevIos = IOS_GetVersion();
|
s32 prevIos = IOS_GetVersion();
|
||||||
|
|
||||||
SDCard_deInit();
|
SDCard_deInit();
|
||||||
USBDevice_deInit();
|
if (hddState)
|
||||||
|
USBDevice_deInit();
|
||||||
|
|
||||||
WPAD_Flush(0);
|
WPAD_Flush(0);
|
||||||
WPAD_Disconnect(0);
|
WPAD_Disconnect(0);
|
||||||
WPAD_Shutdown();
|
WPAD_Shutdown();
|
||||||
|
if (hddState)
|
||||||
WDVD_Close();
|
{
|
||||||
|
WDVD_Close();
|
||||||
USBStorage_Deinit();
|
USBStorage_Deinit();
|
||||||
|
}
|
||||||
|
|
||||||
s32 ret = IOS_ReloadIOSsafe(ios);
|
s32 ret = IOS_ReloadIOSsafe(ios);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
ios = prevIos;
|
ios = prevIos;
|
||||||
}
|
}
|
||||||
|
|
||||||
SDCard_Init();
|
SDCard_Init();
|
||||||
|
|
||||||
if (ios == 222 || ios == 223) {
|
if (ios == 222 || ios == 223) {
|
||||||
load_ehc_module();
|
load_ehc_module();
|
||||||
}
|
}
|
||||||
USBDevice_Init();
|
|
||||||
|
if (hddState)
|
||||||
|
USBDevice_Init();
|
||||||
|
|
||||||
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);
|
||||||
|
|
||||||
WBFS_Init(WBFS_DEVICE_USB);
|
if (hddState)
|
||||||
Disc_Init();
|
{
|
||||||
|
WBFS_Init(WBFS_DEVICE_USB);
|
||||||
if (Sys_IsHermes()) {
|
Disc_Init();
|
||||||
WBFS_OpenNamed((char *) &game_partition);
|
|
||||||
} else {
|
if (Sys_IsHermes()) {
|
||||||
WBFS_Open();
|
WBFS_OpenNamed((char *) &game_partition);
|
||||||
}
|
} else {
|
||||||
|
WBFS_Open();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -114,17 +124,22 @@ int Sys_IosReload(int IOS) {
|
|||||||
|
|
||||||
//shutdown SD and USB before IOS Reload in DiscWait
|
//shutdown SD and USB before IOS Reload in DiscWait
|
||||||
SDCard_deInit();
|
SDCard_deInit();
|
||||||
USBDevice_deInit();
|
if (hddState)
|
||||||
|
USBDevice_deInit();
|
||||||
|
|
||||||
WPAD_Flush(0);
|
WPAD_Flush(0);
|
||||||
WPAD_Disconnect(0);
|
WPAD_Disconnect(0);
|
||||||
WPAD_Shutdown();
|
WPAD_Shutdown();
|
||||||
|
|
||||||
WDVD_Close();
|
if (hddState)
|
||||||
|
{
|
||||||
|
WDVD_Close();
|
||||||
|
USBStorage_Deinit();
|
||||||
|
}
|
||||||
|
|
||||||
USBStorage_Deinit();
|
ret = IOS_ReloadIOSsafe(IOS);
|
||||||
|
if (ret < 0) return ret;
|
||||||
if (IOS == 249 || IOS == 222 || IOS == 223) {
|
if ((IOS == 249 || IOS == 222 || IOS == 223) && hddState) {
|
||||||
for (int i = 0; i < 10; i++) {
|
for (int i = 0; i < 10; i++) {
|
||||||
ret = IOS_ReloadIOSsafe(IOS);
|
ret = IOS_ReloadIOSsafe(IOS);
|
||||||
if (ret < 0) return ret;
|
if (ret < 0) return ret;
|
||||||
@ -148,7 +163,8 @@ int Sys_IosReload(int IOS) {
|
|||||||
WPAD_SetVRes(WPAD_CHAN_ALL, screenwidth, screenheight);
|
WPAD_SetVRes(WPAD_CHAN_ALL, screenwidth, screenheight);
|
||||||
//reinitialize SD and USB
|
//reinitialize SD and USB
|
||||||
SDCard_Init();
|
SDCard_Init();
|
||||||
USBDevice_Init();
|
if (hddState)
|
||||||
|
USBDevice_Init();
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -228,34 +244,34 @@ s32 ios250rev = -69;
|
|||||||
s32 IOS_ReloadIOSsafe(int ios)
|
s32 IOS_ReloadIOSsafe(int ios)
|
||||||
{
|
{
|
||||||
if (ios==222)
|
if (ios==222)
|
||||||
{
|
{
|
||||||
if (ios222rev == -69)
|
if (ios222rev == -69)
|
||||||
ios222rev = getIOSrev(0x00000001000000dell);
|
ios222rev = getIOSrev(0x00000001000000dell);
|
||||||
|
|
||||||
if (ios222rev >= 0 && (ios222rev != 4 && ios222rev != 5))return -2;
|
if (ios222rev >= 0 && (ios222rev != 4 && ios222rev != 5))return -2;
|
||||||
}
|
}
|
||||||
else if (ios==223)
|
else if (ios==223)
|
||||||
{
|
{
|
||||||
if (ios223rev == -69)
|
if (ios223rev == -69)
|
||||||
ios223rev = getIOSrev(0x00000001000000dfll);
|
ios223rev = getIOSrev(0x00000001000000dfll);
|
||||||
|
|
||||||
if (ios223rev >= 0 && (ios223rev != 4 && ios223rev != 5))return -2;
|
if (ios223rev >= 0 && (ios223rev != 4 && ios223rev != 5))return -2;
|
||||||
}
|
}
|
||||||
else if (ios==249)
|
else if (ios==249)
|
||||||
{
|
{
|
||||||
if (ios249rev == -69)
|
if (ios249rev == -69)
|
||||||
ios249rev = getIOSrev(0x00000001000000f9ll);
|
ios249rev = getIOSrev(0x00000001000000f9ll);
|
||||||
|
|
||||||
if (ios249rev >= 0 && !(ios249rev>=9 && ios249rev<65280))return -2;
|
if (ios249rev >= 0 && !(ios249rev>=9 && ios249rev<65280))return -2;
|
||||||
}
|
}
|
||||||
else if (ios==250)
|
else if (ios==250)
|
||||||
{
|
{
|
||||||
if (ios250rev == -69)
|
if (ios250rev == -69)
|
||||||
ios250rev = getIOSrev(0x00000001000000fall);
|
ios250rev = getIOSrev(0x00000001000000fall);
|
||||||
|
|
||||||
if (ios250rev >= 0 && !(ios250rev>=9 && ios250rev<65280))return -2;
|
if (ios250rev >= 0 && !(ios250rev>=9 && ios250rev<65280))return -2;
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 r = IOS_ReloadIOS(ios);
|
s32 r = IOS_ReloadIOS(ios);
|
||||||
if (r >= 0) {
|
if (r >= 0) {
|
||||||
WII_Initialize();
|
WII_Initialize();
|
||||||
@ -263,6 +279,120 @@ s32 IOS_ReloadIOSsafe(int ios)
|
|||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
s32 CheckForCIOS()
|
||||||
|
{
|
||||||
|
gprintf("\n\tChecking for stub IOS");
|
||||||
|
s32 ret = -1;
|
||||||
|
s32 ios222rev = getIOSrev(0x00000001000000dell);
|
||||||
|
s32 ios249rev = getIOSrev(0x00000001000000f9ll);
|
||||||
|
|
||||||
|
//if we don't like either of the cIOS then scram
|
||||||
|
if (!(ios222rev==4 || ios222rev==5 || (ios249rev>=9 && ios249rev<65280)))
|
||||||
|
{
|
||||||
|
InitTextVideo();
|
||||||
|
printf("\x1b[2J");
|
||||||
|
if ((ios222rev < 0 && ios222rev != WII_EINSTALL) && (ios249rev < 0 && ios249rev != WII_EINSTALL)) {
|
||||||
|
printf("\n\n\n\tWARNING!");
|
||||||
|
printf("\n\tUSB Loader GX needs unstubbed cIOS 222 v4 or 249 v9+");
|
||||||
|
printf("\n\n\tWe cannot determine the versions on your system,\n\tsince you have no patched ios 36 or 236 installed.");
|
||||||
|
printf("\n\tTherefor, if loading of USB Loader GX fails, you\n\tprobably have installed the 4.2 update,");
|
||||||
|
printf("\n\tand you should go figure out how to get some cios action going on\n\tin your Wii.");
|
||||||
|
printf("\n\n\tThis message will show every time.");
|
||||||
|
sleep(5);
|
||||||
|
} else {
|
||||||
|
printf("\n\n\n\tERROR!");
|
||||||
|
printf("\n\tUSB Loader GX needs unstubbed cIOS 222 v4 or 249 v9+");
|
||||||
|
printf("\n\n\tI found \n\t\t222 = %d%s",ios222rev,ios222rev==65280?" (Stubbed by 4.2 update)":"");
|
||||||
|
printf("\n\t\t249 = %d%s",ios249rev,ios249rev==65280?" (Stubbed by 4.2 update)":"");
|
||||||
|
printf("\n\n\tGo figure out how to get some cIOS action going on\n\tin your Wii and come back and see me.");
|
||||||
|
|
||||||
|
sleep(15);
|
||||||
|
printf("\n\n\tBye");
|
||||||
|
|
||||||
|
USBDevice_deInit();
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("\n\tReloading ios 249...");
|
||||||
|
ret = IOS_ReloadIOSsafe(249);
|
||||||
|
|
||||||
|
printf("%d", ret);
|
||||||
|
|
||||||
|
if (ret < 0)
|
||||||
|
{
|
||||||
|
printf("\n\tIOS 249 failed, reloading ios 222...");
|
||||||
|
ret = IOS_ReloadIOSsafe(222);
|
||||||
|
printf("%d", ret);
|
||||||
|
if (ret < 0) {
|
||||||
|
printf("\n\tIOS 222 failed, reloading ios 250...");
|
||||||
|
ret = IOS_ReloadIOSsafe(250);
|
||||||
|
printf("%d", ret);
|
||||||
|
if (ret < 0) {
|
||||||
|
printf("\n\tERROR: cIOS could not be loaded!\n");
|
||||||
|
sleep(5);
|
||||||
|
SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//only for 222 loading ehc modules
|
||||||
|
printf("\n\tLoad ehc module");
|
||||||
|
load_ehc_module();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
int LoadAppCIOS()
|
||||||
|
{
|
||||||
|
s32 ret = 1;
|
||||||
|
/* Load Custom IOS */
|
||||||
|
if (Settings.cios == ios222 && IOS_GetVersion() != 222)
|
||||||
|
{
|
||||||
|
printf("\n\tReloading IOS to config setting (%d)...", ios222 ? 222 : 223);
|
||||||
|
SDCard_deInit();// unmount SD for reloading IOS
|
||||||
|
USBDevice_deInit();// unmount USB for reloading IOS
|
||||||
|
USBStorage_Deinit();
|
||||||
|
ret = IOS_ReloadIOSsafe(ios222 ? 222 : 223);
|
||||||
|
printf("%d", ret);
|
||||||
|
if (ret < 0)
|
||||||
|
{
|
||||||
|
Settings.cios = ios249;
|
||||||
|
IOS_ReloadIOSsafe(249);
|
||||||
|
}
|
||||||
|
|
||||||
|
SDCard_Init();
|
||||||
|
USBDevice_Init(); // and mount USB:/
|
||||||
|
if(ret >= 0)
|
||||||
|
load_ehc_module();
|
||||||
|
}
|
||||||
|
else if ((Settings.cios == ios249 && IOS_GetVersion() != 249) ||
|
||||||
|
(Settings.cios == ios250 && IOS_GetVersion() != 250))
|
||||||
|
{
|
||||||
|
printf("\n\tReloading IOS to config setting (%d)...", ios249 ? 249 : 250);
|
||||||
|
SDCard_deInit();// unmount SD for reloading IOS
|
||||||
|
USBDevice_deInit();// unmount USB for reloading IOS
|
||||||
|
USBStorage_Deinit();
|
||||||
|
ret = IOS_ReloadIOSsafe(ios249 ? 249 : 250);
|
||||||
|
printf("%d", ret);
|
||||||
|
if (ret < 0) {
|
||||||
|
Settings.cios = ios222;
|
||||||
|
ret = IOS_ReloadIOSsafe(222);
|
||||||
|
SDCard_Init();
|
||||||
|
load_ehc_module();
|
||||||
|
}
|
||||||
|
|
||||||
|
else SDCard_Init(); // now mount SD:/ //no need to keep mindlessly mounting and unmounting SD card
|
||||||
|
USBDevice_Init(); // and mount USB:/
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
void ScreenShot()
|
void ScreenShot()
|
||||||
|
@ -13,6 +13,8 @@ void Sys_LoadMenu(void);
|
|||||||
void Sys_BackToLoader(void);
|
void Sys_BackToLoader(void);
|
||||||
int Sys_ChangeIos(int ios);
|
int Sys_ChangeIos(int ios);
|
||||||
int Sys_IosReload(int IOS);
|
int Sys_IosReload(int IOS);
|
||||||
|
s32 CheckForCIOS();
|
||||||
|
int LoadAppCIOS();
|
||||||
bool Sys_IsHermes();
|
bool Sys_IsHermes();
|
||||||
s32 IOS_ReloadIOSsafe(int ios);
|
s32 IOS_ReloadIOSsafe(int ios);
|
||||||
void ScreenShot();
|
void ScreenShot();
|
||||||
|
@ -24,16 +24,10 @@
|
|||||||
#include "ZipFile.h"
|
#include "ZipFile.h"
|
||||||
#include "gecko.h"
|
#include "gecko.h"
|
||||||
|
|
||||||
/*** Extern functions ***/
|
|
||||||
extern void ResumeGui();
|
|
||||||
extern void HaltGui();
|
|
||||||
|
|
||||||
/*** Extern variables ***/
|
/*** Extern variables ***/
|
||||||
extern GuiWindow * mainWindow;
|
extern GuiWindow * mainWindow;
|
||||||
extern GuiSound * bgMusic;
|
extern GuiSound * bgMusic;
|
||||||
extern GuiImage * bgImg;
|
extern GuiImage * bgImg;
|
||||||
extern u8 shutdown;
|
|
||||||
extern u8 reset;
|
|
||||||
|
|
||||||
|
|
||||||
int DownloadTheme(const char *url, const char *title)
|
int DownloadTheme(const char *url, const char *title)
|
||||||
@ -245,11 +239,6 @@ static int Theme_Prompt(const char *title, const char *author, GuiImageData *thu
|
|||||||
{
|
{
|
||||||
VIDEO_WaitVSync();
|
VIDEO_WaitVSync();
|
||||||
|
|
||||||
if (shutdown == 1)
|
|
||||||
Sys_Shutdown();
|
|
||||||
else if (reset == 1)
|
|
||||||
Sys_Reboot();
|
|
||||||
|
|
||||||
if (downloadBtn.GetState() == STATE_CLICKED)
|
if (downloadBtn.GetState() == STATE_CLICKED)
|
||||||
{
|
{
|
||||||
int choice = WindowPrompt(tr("Do you want to download this theme?"), title, tr("Yes"), tr("Cancel"));
|
int choice = WindowPrompt(tr("Do you want to download this theme?"), title, tr("Yes"), tr("Cancel"));
|
||||||
@ -579,12 +568,7 @@ int Theme_Downloader()
|
|||||||
{
|
{
|
||||||
VIDEO_WaitVSync ();
|
VIDEO_WaitVSync ();
|
||||||
|
|
||||||
if (shutdown == 1)
|
if (wifiBtn.GetState() == STATE_CLICKED)
|
||||||
Sys_Shutdown();
|
|
||||||
else if (reset == 1)
|
|
||||||
Sys_Reboot();
|
|
||||||
|
|
||||||
else if (wifiBtn.GetState() == STATE_CLICKED)
|
|
||||||
{
|
{
|
||||||
Initialize_Network();
|
Initialize_Network();
|
||||||
wifiBtn.ResetState();
|
wifiBtn.ResetState();
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
#include "../prompts/TitleBrowser.h"
|
#include "../prompts/TitleBrowser.h"
|
||||||
|
|
||||||
|
#include "../gecko.h"
|
||||||
#include "wad/wad.h"
|
#include "wad/wad.h"
|
||||||
#include "xml/xml.h"
|
#include "xml/xml.h"
|
||||||
#include "../wad/title.h"
|
#include "../wad/title.h"
|
||||||
@ -50,9 +51,9 @@ static inline int wcsnicmp(const wchar_t *s1, const wchar_t *s2, int len)
|
|||||||
if (*s1++ == 0)
|
if (*s1++ == 0)
|
||||||
break;
|
break;
|
||||||
} while (--len != 0);
|
} while (--len != 0);
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@ -131,7 +132,7 @@ int __Menu_GetPrevFilter(int t, wchar_t* gameFilter, u32 gameFiltered, wchar_t *
|
|||||||
struct discHdr *buffer = NULL;
|
struct discHdr *buffer = NULL;
|
||||||
u32 cnt, len, i;
|
u32 cnt, len, i;
|
||||||
s32 ret;
|
s32 ret;
|
||||||
|
|
||||||
wchar_t *new_gameFilterPrev = wcsdup_new(gameFilter);
|
wchar_t *new_gameFilterPrev = wcsdup_new(gameFilter);
|
||||||
|
|
||||||
|
|
||||||
@ -182,8 +183,8 @@ int __Menu_GetPrevFilter(int t, wchar_t* gameFilter, u32 gameFiltered, wchar_t *
|
|||||||
{
|
{
|
||||||
// Check game rating in WiiTDB, since the default Wii parental control setting is enabled
|
// Check game rating in WiiTDB, since the default Wii parental control setting is enabled
|
||||||
s32 rating = GetRatingForGame((char *) header->id);
|
s32 rating = GetRatingForGame((char *) header->id);
|
||||||
|
|
||||||
if ((rating != -1 && rating > Settings.parental.rating) ||
|
if ((rating != -1 && rating > Settings.parental.rating) ||
|
||||||
(rating == -1 && get_pegi_block(header) > Settings.parental.rating))
|
(rating == -1 && get_pegi_block(header) > Settings.parental.rating))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
@ -193,7 +194,7 @@ int __Menu_GetPrevFilter(int t, wchar_t* gameFilter, u32 gameFiltered, wchar_t *
|
|||||||
wchar_t *wname = FreeTypeGX::charToWideChar(get_title(header));
|
wchar_t *wname = FreeTypeGX::charToWideChar(get_title(header));
|
||||||
if(wname) nameList.push_back(wname);
|
if(wname) nameList.push_back(wname);
|
||||||
}
|
}
|
||||||
|
|
||||||
NewTitles::Instance()->Save();
|
NewTitles::Instance()->Save();
|
||||||
|
|
||||||
/* delete buffer */
|
/* delete buffer */
|
||||||
@ -225,7 +226,7 @@ int __Menu_GetPrevFilter(int t, wchar_t* gameFilter, u32 gameFiltered, wchar_t *
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Get GameFilter NextList
|
* Get GameFilter NextList
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
int int_cmp(const void *a, const void *b) { return *((u32*)a)-*((u32*)b); }
|
int int_cmp(const void *a, const void *b) { return *((u32*)a)-*((u32*)b); }
|
||||||
|
|
||||||
int __Menu_GetGameFilter_NextList(discHdr *gameList, u32 gameCnt, wchar_t **PgameFilter, wchar_t **PgameFilterNextList)
|
int __Menu_GetGameFilter_NextList(discHdr *gameList, u32 gameCnt, wchar_t **PgameFilter, wchar_t **PgameFilterNextList)
|
||||||
@ -248,15 +249,15 @@ int __Menu_GetGameFilter_NextList(discHdr *gameList, u32 gameCnt, wchar_t **Pgam
|
|||||||
}
|
}
|
||||||
else if(wcslen(gameName) == filter_len)
|
else if(wcslen(gameName) == filter_len)
|
||||||
autofill = false; // no autofill when gameNameLen == filterLen
|
autofill = false; // no autofill when gameNameLen == filterLen
|
||||||
|
|
||||||
nextList[i] = nextFilterChar;
|
nextList[i] = nextFilterChar;
|
||||||
}
|
}
|
||||||
qsort(nextList, gameCnt, sizeof(u32), int_cmp);
|
qsort(nextList, gameCnt, sizeof(u32), int_cmp);
|
||||||
|
|
||||||
*PgameFilterNextList = new wchar_t[gameCnt+1];
|
*PgameFilterNextList = new wchar_t[gameCnt+1];
|
||||||
if(*PgameFilterNextList == NULL) goto error;
|
if(*PgameFilterNextList == NULL) goto error;
|
||||||
|
|
||||||
|
|
||||||
p = *PgameFilterNextList;
|
p = *PgameFilterNextList;
|
||||||
lastChar = 0;
|
lastChar = 0;
|
||||||
for(i=0; i<gameCnt; i++)
|
for(i=0; i<gameCnt; i++)
|
||||||
@ -274,14 +275,14 @@ int __Menu_GetGameFilter_NextList(discHdr *gameList, u32 gameCnt, wchar_t **Pgam
|
|||||||
{
|
{
|
||||||
wchar_t *newFilter = new wchar_t[filter_len + 2];
|
wchar_t *newFilter = new wchar_t[filter_len + 2];
|
||||||
if(newFilter == NULL) goto error;
|
if(newFilter == NULL) goto error;
|
||||||
|
|
||||||
wcscpy(newFilter, *PgameFilter);
|
wcscpy(newFilter, *PgameFilter);
|
||||||
wcscat(newFilter, *PgameFilterNextList);
|
wcscat(newFilter, *PgameFilterNextList);
|
||||||
delete [] *PgameFilter; *PgameFilter = newFilter;
|
delete [] *PgameFilter; *PgameFilter = newFilter;
|
||||||
delete [] *PgameFilterNextList; *PgameFilterNextList = NULL;
|
delete [] *PgameFilterNextList; *PgameFilterNextList = NULL;
|
||||||
return __Menu_GetGameFilter_NextList(gameList, gameCnt, PgameFilter, PgameFilterNextList);
|
return __Menu_GetGameFilter_NextList(gameList, gameCnt, PgameFilter, PgameFilterNextList);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
error:
|
error:
|
||||||
if(nextList) delete [] nextList;
|
if(nextList) delete [] nextList;
|
||||||
@ -306,7 +307,7 @@ int buildTitleList(int t, wchar_t* gameFilter, discHdr ** PgameList, u32 *PgameC
|
|||||||
|
|
||||||
ret = getTitles_TypeCount(typei, &num_titles);
|
ret = getTitles_TypeCount(typei, &num_titles);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = getTitles_Type(typei, titles, num_titles);
|
ret = getTitles_Type(typei, titles, num_titles);
|
||||||
@ -331,7 +332,7 @@ int buildTitleList(int t, wchar_t* gameFilter, discHdr ** PgameList, u32 *PgameC
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
memset(buffer, 0, len);
|
memset(buffer, 0, len);
|
||||||
|
|
||||||
sprintf(path,"%s/config/database.txt",bootDevice);
|
sprintf(path,"%s/config/database.txt",bootDevice);
|
||||||
f = fopen(path, "r");
|
f = fopen(path, "r");
|
||||||
|
|
||||||
@ -342,20 +343,20 @@ int buildTitleList(int t, wchar_t* gameFilter, discHdr ** PgameList, u32 *PgameC
|
|||||||
char text[15];
|
char text[15];
|
||||||
strcpy(name,"");//make sure name is empty
|
strcpy(name,"");//make sure name is empty
|
||||||
u8 found=0;
|
u8 found=0;
|
||||||
|
|
||||||
sprintf(text, "%s", titleText(i<num_titles?typei:0x00010002, i<num_titles?titles[i]:sys_titles[i-num_titles]));
|
sprintf(text, "%s", titleText(i<num_titles?typei:0x00010002, i<num_titles?titles[i]:sys_titles[i-num_titles]));
|
||||||
|
|
||||||
|
|
||||||
char line[200];
|
char line[200];
|
||||||
char tmp[50];
|
char tmp[50];
|
||||||
snprintf(tmp,50," ");
|
snprintf(tmp,50," ");
|
||||||
|
|
||||||
//check if the content.bin is on the SD card for that game
|
//check if the content.bin is on the SD card for that game
|
||||||
//if there is content.bin,then the game is on the SDmenu and not the wii
|
//if there is content.bin,then the game is on the SDmenu and not the wii
|
||||||
sprintf(line,"SD:/private/wii/title/%s/content.bin",text);
|
sprintf(line,"SD:/private/wii/title/%s/content.bin",text);
|
||||||
if (!checkfile(line))
|
if (!checkfile(line))
|
||||||
{
|
{
|
||||||
|
|
||||||
struct discHdr *header = &buffer[i];
|
struct discHdr *header = &buffer[i];
|
||||||
if (f) {
|
if (f) {
|
||||||
while (fgets(line, sizeof(line), f)) {
|
while (fgets(line, sizeof(line), f)) {
|
||||||
@ -393,7 +394,7 @@ int buildTitleList(int t, wchar_t* gameFilter, discHdr ** PgameList, u32 *PgameC
|
|||||||
header->id[4]='1';
|
header->id[4]='1';
|
||||||
header->id[5]=(i<num_titles?'1':'2');
|
header->id[5]=(i<num_titles?'1':'2');
|
||||||
//header->
|
//header->
|
||||||
|
|
||||||
//not using these filters right now, but i left them in just in case
|
//not using these filters right now, but i left them in just in case
|
||||||
// Filters
|
// Filters
|
||||||
/*if (Settings.fave) {
|
/*if (Settings.fave) {
|
||||||
@ -401,32 +402,32 @@ int buildTitleList(int t, wchar_t* gameFilter, discHdr ** PgameList, u32 *PgameC
|
|||||||
if (!game_num || game_num->favorite==0)
|
if (!game_num || game_num->favorite==0)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Settings.parentalcontrol && !Settings.godmode) {
|
if (Settings.parentalcontrol && !Settings.godmode) {
|
||||||
if (get_block(header) >= Settings.parentalcontrol)
|
if (get_block(header) >= Settings.parentalcontrol)
|
||||||
continue;
|
continue;
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
if(gameFilter && *gameFilter) {
|
/*if(gameFilter && *gameFilter) {
|
||||||
u32 filter_len = wcslen(gameFilter);
|
u32 filter_len = wcslen(gameFilter);
|
||||||
wchar_t *gameName = FreeTypeGX::charToWideChar(get_title(header));
|
wchar_t *gameName = FreeTypeGX::charToWideChar(get_title(header));
|
||||||
if (!gameName || wcsnicmp(gameName, gameFilter, filter_len)) {
|
if (!gameName || wcsnicmp(gameName, gameFilter, filter_len)) {
|
||||||
delete [] gameName;
|
delete [] gameName;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
if(i != cnt2)
|
if(i != cnt2)
|
||||||
buffer[cnt2] = buffer[i];
|
buffer[cnt2] = buffer[i];
|
||||||
cnt2++;
|
cnt2++;
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (f)fclose(f);
|
if (f)fclose(f);
|
||||||
|
|
||||||
Uninstall_FromTitle(TITLE_ID(1, 0));
|
Uninstall_FromTitle(TITLE_ID(1, 0));
|
||||||
ISFS_Deinitialize();
|
ISFS_Deinitialize();
|
||||||
|
|
||||||
if(cnt > cnt2)
|
if(cnt > cnt2)
|
||||||
{
|
{
|
||||||
cnt = cnt2;
|
cnt = cnt2;
|
||||||
@ -434,7 +435,7 @@ int buildTitleList(int t, wchar_t* gameFilter, discHdr ** PgameList, u32 *PgameC
|
|||||||
}
|
}
|
||||||
if (!buffer)
|
if (!buffer)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (Settings.sort==pcount) {
|
if (Settings.sort==pcount) {
|
||||||
qsort(buffer, cnt, sizeof(struct discHdr), __Menu_EntryCmpCount);
|
qsort(buffer, cnt, sizeof(struct discHdr), __Menu_EntryCmpCount);
|
||||||
} else if (Settings.fave) {
|
} else if (Settings.fave) {
|
||||||
@ -445,12 +446,12 @@ int buildTitleList(int t, wchar_t* gameFilter, discHdr ** PgameList, u32 *PgameC
|
|||||||
/*PgameList = buffer;
|
/*PgameList = buffer;
|
||||||
buffer = NULL;
|
buffer = NULL;
|
||||||
PgameCnt = cnt;*/
|
PgameCnt = cnt;*/
|
||||||
|
|
||||||
if(PgameList) *PgameList = buffer; else free(buffer);
|
if(PgameList) *PgameList = buffer; else free(buffer);
|
||||||
if(PgameCnt) *PgameCnt = cnt;
|
if(PgameCnt) *PgameCnt = cnt;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return cnt;
|
return cnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -469,7 +470,7 @@ int __Menu_GetGameList(int t, wchar_t* gameFilter, discHdr ** PgameList, u32 *Pg
|
|||||||
ret = WBFS_GetCount(&cnt);
|
ret = WBFS_GetCount(&cnt);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
//gprintf("\n WBFS_GetCount:%d",cnt);
|
||||||
/* Buffer length */
|
/* Buffer length */
|
||||||
len = sizeof(struct discHdr) * cnt;
|
len = sizeof(struct discHdr) * cnt;
|
||||||
|
|
||||||
@ -487,7 +488,7 @@ int __Menu_GetGameList(int t, wchar_t* gameFilter, discHdr ** PgameList, u32 *Pg
|
|||||||
if (buffer) free(buffer);
|
if (buffer) free(buffer);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (u32 i = 0; i < cnt; i++) {
|
for (u32 i = 0; i < cnt; i++) {
|
||||||
struct discHdr *header = &buffer[i];
|
struct discHdr *header = &buffer[i];
|
||||||
|
|
||||||
@ -506,7 +507,7 @@ int __Menu_GetGameList(int t, wchar_t* gameFilter, discHdr ** PgameList, u32 *Pg
|
|||||||
header->id[2]=='C'&&header->id[3]=='F'&&
|
header->id[2]=='C'&&header->id[3]=='F'&&
|
||||||
header->id[4]=='G'&&header->id[5]=='_')
|
header->id[4]=='G'&&header->id[5]=='_')
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (Settings.parentalcontrol && !Settings.godmode && t==0) {
|
if (Settings.parentalcontrol && !Settings.godmode && t==0) {
|
||||||
if (get_block(header) >= Settings.parentalcontrol)
|
if (get_block(header) >= Settings.parentalcontrol)
|
||||||
continue;
|
continue;
|
||||||
@ -517,13 +518,13 @@ int __Menu_GetGameList(int t, wchar_t* gameFilter, discHdr ** PgameList, u32 *Pg
|
|||||||
{
|
{
|
||||||
// Check game rating in WiiTDB, since the default Wii parental control setting is enabled
|
// Check game rating in WiiTDB, since the default Wii parental control setting is enabled
|
||||||
s32 rating = GetRatingForGame((char *) header->id);
|
s32 rating = GetRatingForGame((char *) header->id);
|
||||||
if ((rating != -1 && rating > Settings.parental.rating) ||
|
if ((rating != -1 && rating > Settings.parental.rating) ||
|
||||||
(rating == -1 && get_pegi_block(header) > Settings.parental.rating))
|
(rating == -1 && get_pegi_block(header) > Settings.parental.rating))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(gameFilter && *gameFilter && t==0) {
|
if(gameFilter && *gameFilter && t==0) {
|
||||||
u32 filter_len = wcslen(gameFilter);
|
u32 filter_len = wcslen(gameFilter);
|
||||||
wchar_t *gameName = FreeTypeGX::charToWideChar(get_title(header));
|
wchar_t *gameName = FreeTypeGX::charToWideChar(get_title(header));
|
||||||
@ -537,7 +538,7 @@ int __Menu_GetGameList(int t, wchar_t* gameFilter, discHdr ** PgameList, u32 *Pg
|
|||||||
cnt2++;
|
cnt2++;
|
||||||
}
|
}
|
||||||
NewTitles::Instance()->Save();
|
NewTitles::Instance()->Save();
|
||||||
|
|
||||||
if(cnt > cnt2)
|
if(cnt > cnt2)
|
||||||
{
|
{
|
||||||
cnt = cnt2;
|
cnt = cnt2;
|
||||||
@ -545,7 +546,7 @@ int __Menu_GetGameList(int t, wchar_t* gameFilter, discHdr ** PgameList, u32 *Pg
|
|||||||
}
|
}
|
||||||
if (!buffer)
|
if (!buffer)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (Settings.sort==pcount) {
|
if (Settings.sort==pcount) {
|
||||||
qsort(buffer, cnt, sizeof(struct discHdr), __Menu_EntryCmpCount);
|
qsort(buffer, cnt, sizeof(struct discHdr), __Menu_EntryCmpCount);
|
||||||
} else if (Settings.fave) {
|
} else if (Settings.fave) {
|
||||||
@ -557,18 +558,18 @@ int __Menu_GetGameList(int t, wchar_t* gameFilter, discHdr ** PgameList, u32 *Pg
|
|||||||
/* Set values */
|
/* Set values */
|
||||||
if(PgameList) *PgameList = buffer; else free(buffer);
|
if(PgameList) *PgameList = buffer; else free(buffer);
|
||||||
if(PgameCnt) *PgameCnt = cnt;
|
if(PgameCnt) *PgameCnt = cnt;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int __Menu_GetEntries(int t, const wchar_t* Filter) {
|
int __Menu_GetEntries(int t, const wchar_t* Filter) {
|
||||||
|
//gprintf("\n__Menu_GetEntries()");
|
||||||
/*if (mountMethod==3)
|
/*if (mountMethod==3)
|
||||||
{
|
{
|
||||||
return buildTitleList();
|
return buildTitleList();
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
|
|
||||||
u32 new_gameCnt = 0;
|
u32 new_gameCnt = 0;
|
||||||
struct discHdr *new_gameList = NULL;
|
struct discHdr *new_gameList = NULL;
|
||||||
wchar_t *new_gameFilter = NULL;
|
wchar_t *new_gameFilter = NULL;
|
||||||
@ -576,32 +577,50 @@ int __Menu_GetEntries(int t, const wchar_t* Filter) {
|
|||||||
wchar_t *new_gameFilterPrev = NULL;
|
wchar_t *new_gameFilterPrev = NULL;
|
||||||
|
|
||||||
new_gameFilter = wcsdup_new(Filter ? Filter : (gameFilter ? gameFilter : L"") );
|
new_gameFilter = wcsdup_new(Filter ? Filter : (gameFilter ? gameFilter : L"") );
|
||||||
if(new_gameFilter == NULL) return -1;
|
if(new_gameFilter == NULL)
|
||||||
|
{
|
||||||
|
//gprintf("\nnew_gameFilter == NULL");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
for(;;)
|
for(;;)
|
||||||
{
|
{
|
||||||
if (mountMethod==3)
|
if (mountMethod==3)
|
||||||
{if(buildTitleList(t, new_gameFilter, &new_gameList, &new_gameCnt) < 0)
|
{int butt =buildTitleList(t, new_gameFilter, &new_gameList, &new_gameCnt);
|
||||||
return -1;}
|
if (butt < 0)
|
||||||
|
{
|
||||||
else
|
gprintf("\nbutt:%d", butt);
|
||||||
{if(__Menu_GetGameList(t, new_gameFilter, &new_gameList, &new_gameCnt) < 0)
|
return -1;
|
||||||
return -1;}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(__Menu_GetGameList(t, new_gameFilter, &new_gameList, &new_gameCnt) < 0)
|
||||||
|
{
|
||||||
|
gprintf("\n__Menu_GetGameList(t, new_gameFilter, &new_gameList, &new_gameCnt) < 0");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if(new_gameCnt > 0 || new_gameFilter[0] == 0)
|
if(new_gameCnt > 0 || new_gameFilter[0] == 0)
|
||||||
|
{
|
||||||
|
//gprintf("\nnew_gameCnt:%d",new_gameCnt);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
new_gameFilter[wcslen(new_gameFilter)-1] = 0;
|
new_gameFilter[wcslen(new_gameFilter)-1] = 0;
|
||||||
}
|
}
|
||||||
|
if (mountMethod!=3)
|
||||||
|
{
|
||||||
|
/* init GameFilterNextList */
|
||||||
|
if(__Menu_GetGameFilter_NextList(new_gameList, new_gameCnt, &new_gameFilter, &new_gameFilterNextList) < 0)
|
||||||
|
goto error;
|
||||||
|
|
||||||
/* init GameFilterNextList */
|
/* init GameFilterPrev */
|
||||||
if(__Menu_GetGameFilter_NextList(new_gameList, new_gameCnt, &new_gameFilter, &new_gameFilterNextList) < 0)
|
if(__Menu_GetPrevFilter(t, new_gameFilter, new_gameCnt, &new_gameFilterPrev) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
}
|
||||||
/* init GameFilterPrev */
|
|
||||||
if(__Menu_GetPrevFilter(t, new_gameFilter, new_gameCnt, &new_gameFilterPrev) < 0)
|
|
||||||
goto error;
|
|
||||||
|
|
||||||
/* Set values */
|
/* Set values */
|
||||||
if(gameList) free(gameList);
|
if(gameList) free(gameList);
|
||||||
if(gameFilter) delete [] gameFilter;
|
if(gameFilter) delete [] gameFilter;
|
||||||
@ -610,14 +629,19 @@ int __Menu_GetEntries(int t, const wchar_t* Filter) {
|
|||||||
|
|
||||||
gameList = new_gameList;
|
gameList = new_gameList;
|
||||||
gameCnt = new_gameCnt;
|
gameCnt = new_gameCnt;
|
||||||
gameFilter = new_gameFilter;
|
gameFilter = new_gameFilter;
|
||||||
gameFilterNextList = new_gameFilterNextList;
|
gameFilterNextList = new_gameFilterNextList;
|
||||||
gameFilterPrev = new_gameFilterPrev;
|
gameFilterPrev = new_gameFilterPrev;
|
||||||
|
|
||||||
/* Reset variables */
|
|
||||||
|
/* Reset variables */
|
||||||
gameSelected = gameStart = 0;
|
gameSelected = gameStart = 0;
|
||||||
return 0;
|
//gprintf("\ncnt:%d", gameCnt);
|
||||||
|
|
||||||
|
|
||||||
|
return 0;
|
||||||
error: // clean up
|
error: // clean up
|
||||||
|
gprintf("\nERROR");
|
||||||
if(new_gameList) free(new_gameList);
|
if(new_gameList) free(new_gameList);
|
||||||
if(new_gameFilter) delete [] new_gameFilter;
|
if(new_gameFilter) delete [] new_gameFilter;
|
||||||
if(new_gameFilterNextList) delete [] new_gameFilterNextList;
|
if(new_gameFilterNextList) delete [] new_gameFilterNextList;
|
||||||
|
@ -30,6 +30,9 @@ int screenheight;
|
|||||||
int screenwidth;
|
int screenwidth;
|
||||||
u32 frameCount = 0;
|
u32 frameCount = 0;
|
||||||
|
|
||||||
|
extern bool textVideoInit;
|
||||||
|
extern bool geckoinit;
|
||||||
|
|
||||||
u8 * gameScreenTex = NULL; // a GX texture screen capture of the game
|
u8 * gameScreenTex = NULL; // a GX texture screen capture of the game
|
||||||
u8 * gameScreenTex2 = NULL; // a GX texture screen capture of the game (copy)
|
u8 * gameScreenTex2 = NULL; // a GX texture screen capture of the game (copy)
|
||||||
|
|
||||||
@ -198,6 +201,46 @@ InitVideo () {
|
|||||||
ResetVideo_Menu();
|
ResetVideo_Menu();
|
||||||
// Finally, the video is up and ready for use :)
|
// Finally, the video is up and ready for use :)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void InitTextVideo ()
|
||||||
|
{
|
||||||
|
unsigned int *xfb = NULL;
|
||||||
|
gprintf("\nInitTextVideo ()");
|
||||||
|
if (textVideoInit)
|
||||||
|
{
|
||||||
|
gprintf("...0");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
VIDEO_Init();
|
||||||
|
GXRModeObj *vmode = VIDEO_GetPreferredMode(NULL); // get default video mode
|
||||||
|
|
||||||
|
// widescreen fix
|
||||||
|
VIDEO_Configure (vmode);
|
||||||
|
|
||||||
|
// Allocate the video buffers
|
||||||
|
xfb = (u32 *) MEM_K0_TO_K1 (SYS_AllocateFramebuffer (vmode));
|
||||||
|
|
||||||
|
// A console is always useful while debugging
|
||||||
|
console_init (xfb, 20, 64, vmode->fbWidth, vmode->xfbHeight, vmode->fbWidth * 2);
|
||||||
|
|
||||||
|
// Clear framebuffers etc.
|
||||||
|
VIDEO_ClearFrameBuffer (vmode, xfb, COLOR_BLACK);
|
||||||
|
VIDEO_SetNextFramebuffer (xfb);
|
||||||
|
|
||||||
|
VIDEO_SetBlack (FALSE);
|
||||||
|
VIDEO_Flush ();
|
||||||
|
VIDEO_WaitVSync ();
|
||||||
|
if (vmode->viTVMode & VI_NON_INTERLACE)
|
||||||
|
VIDEO_WaitVSync ();
|
||||||
|
|
||||||
|
//send console output to the gecko
|
||||||
|
if (geckoinit)CON_EnableGecko(1, true);
|
||||||
|
textVideoInit = true;
|
||||||
|
gprintf("...1");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
static unsigned int *xfbDB = NULL;
|
static unsigned int *xfbDB = NULL;
|
||||||
|
|
||||||
void InitVideodebug () {
|
void InitVideodebug () {
|
||||||
@ -241,8 +284,8 @@ void StopGX() {
|
|||||||
*
|
*
|
||||||
* Renders everything current sent to GX, and flushes video
|
* Renders everything current sent to GX, and flushes video
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
void Menu_Render() {
|
void Menu_Render()
|
||||||
|
{
|
||||||
whichfb ^= 1; // flip framebuffer
|
whichfb ^= 1; // flip framebuffer
|
||||||
GX_SetZMode(GX_TRUE, GX_LEQUAL, GX_TRUE);
|
GX_SetZMode(GX_TRUE, GX_LEQUAL, GX_TRUE);
|
||||||
GX_SetColorUpdate(GX_TRUE);
|
GX_SetColorUpdate(GX_TRUE);
|
||||||
@ -492,6 +535,13 @@ void Menu_DrawTPLImg(f32 xpos, f32 ypos, f32 zpos, f32 width, f32 height, GXTexO
|
|||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
s32 TakeScreenshot(const char *path)
|
s32 TakeScreenshot(const char *path)
|
||||||
{
|
{
|
||||||
|
//check if it is possible to write
|
||||||
|
FILE *f = fopen(path, "wb");
|
||||||
|
if(!f)
|
||||||
|
return -1;
|
||||||
|
else
|
||||||
|
fclose(f);
|
||||||
|
|
||||||
gprintf("\nTakeScreenshot(%s)", path);
|
gprintf("\nTakeScreenshot(%s)", path);
|
||||||
IMGCTX ctx = PNGU_SelectImageFromDevice (path);
|
IMGCTX ctx = PNGU_SelectImageFromDevice (path);
|
||||||
s32 ret = PNGU_EncodeFromYCbYCr(ctx,vmode->fbWidth, vmode->efbHeight,xfb[whichfb],0);
|
s32 ret = PNGU_EncodeFromYCbYCr(ctx,vmode->fbWidth, vmode->efbHeight,xfb[whichfb],0);
|
||||||
@ -499,3 +549,4 @@ s32 TakeScreenshot(const char *path)
|
|||||||
gprintf(":%d", ret);
|
gprintf(":%d", ret);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
|
|
||||||
void InitVideo ();
|
void InitVideo ();
|
||||||
void InitVideodebug();
|
void InitVideodebug();
|
||||||
|
void InitTextVideo();
|
||||||
void StopGX();
|
void StopGX();
|
||||||
void ResetVideo_Menu();
|
void ResetVideo_Menu();
|
||||||
void Menu_Render();
|
void Menu_Render();
|
||||||
|
@ -8,22 +8,15 @@
|
|||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "video.h"
|
#include "video.h"
|
||||||
#include "wad.h"
|
#include "wad.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "prompts/PromptWindows.h"
|
#include "prompts/PromptWindows.h"
|
||||||
#include "libwiigui/gui.h"
|
#include "libwiigui/gui.h"
|
||||||
#include "language/gettext.h"
|
#include "language/gettext.h"
|
||||||
#include "menu.h"
|
#include "menu.h"
|
||||||
#include "filelist.h"
|
#include "filelist.h"
|
||||||
/*** Extern functions ***/
|
|
||||||
extern void ResumeGui();
|
|
||||||
extern void HaltGui();
|
|
||||||
/*** Extern variables ***/
|
/*** Extern variables ***/
|
||||||
extern GuiWindow * mainWindow;
|
extern GuiWindow * mainWindow;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* 'WAD Header' structure */
|
/* 'WAD Header' structure */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
/* Header length */
|
/* Header length */
|
||||||
@ -347,9 +340,9 @@ s32 Wad_Install(FILE *fp)
|
|||||||
snprintf(imgPath, sizeof(imgPath), "%s%d...",tr(">> Installing content #"),content->cid);
|
snprintf(imgPath, sizeof(imgPath), "%s%d...",tr(">> Installing content #"),content->cid);
|
||||||
msg4Txt.SetText(imgPath);
|
msg4Txt.SetText(imgPath);
|
||||||
// Install content data
|
// Install content data
|
||||||
while (idx < len) {
|
while (idx < len) {
|
||||||
|
|
||||||
//VIDEO_WaitVSync ();
|
//VIDEO_WaitVSync ();
|
||||||
|
|
||||||
u32 size;
|
u32 size;
|
||||||
|
|
||||||
@ -371,7 +364,7 @@ s32 Wad_Install(FILE *fp)
|
|||||||
// Increase variables
|
// Increase variables
|
||||||
idx += size;
|
idx += size;
|
||||||
offset += size;
|
offset += size;
|
||||||
|
|
||||||
//snprintf(imgPath, sizeof(imgPath), "%s%d (%d)...",tr(">> Installing content #"),content->cid,idx);
|
//snprintf(imgPath, sizeof(imgPath), "%s%d (%d)...",tr(">> Installing content #"),content->cid,idx);
|
||||||
|
|
||||||
//msg4Txt.SetText(imgPath);
|
//msg4Txt.SetText(imgPath);
|
||||||
|
Loading…
Reference in New Issue
Block a user