*Added IOS223 support

NOTE: If your loader is rebooting when you try to start a game its because you initialized Network! Right now initializing the network by trying to update or trying to download covers/discimages the Loader has Issues with booting games. Try booting games directly without initializing the Network.
This commit is contained in:
dimok321 2009-06-12 11:50:14 +00:00
parent bc3d173ef4
commit d8298a73d9
10 changed files with 77 additions and 41 deletions

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
<pd><ViewState><e p="gui" x="true"></e><e p="gui\source\mxml" x="false"></e><e p="gui\source" x="true"></e><e p="gui\source\fonts" x="false"></e><e p="gui\source\images" x="false"></e><e p="gui\source\libwbfs" x="false"></e><e p="gui\source\libwiigui" x="true"></e><e p="gui\source\sounds" x="false"></e><e p="gui\source\unzip" x="false"></e></ViewState></pd> <pd><ViewState><e p="gui" x="true"></e><e p="gui\source\unzip" x="false"></e><e p="gui\source" x="true"></e><e p="gui\source\fonts" x="false"></e><e p="gui\source\images" x="false"></e><e p="gui\source\libwbfs" x="false"></e><e p="gui\source\libwiigui" x="true"></e><e p="gui\source\sounds" x="false"></e></ViewState></pd>

View File

@ -21,6 +21,7 @@
#include "partition.h" #include "partition.h"
#include "usbstorage.h" #include "usbstorage.h"
#include "getentries.h" #include "getentries.h"
#include "mload.h"
/*** Variables that are also used extern ***/ /*** Variables that are also used extern ***/
int cntMissFiles = 0; int cntMissFiles = 0;
@ -241,13 +242,13 @@ void WindowCredits()
i++; i++;
y+=24; y+=24;
sprintf(text, "Tantric %s LibWiiGui", LANGUAGE.awesometool); sprintf(text, "Waninkoko, Kwiirk & Hermes %s", LANGUAGE.theUSBLoaderandreleasingthesourcecode);
txt[i] = new GuiText(text); txt[i] = new GuiText(text);
txt[i]->SetAlignment(ALIGN_LEFT, ALIGN_TOP); txt[i]->SetPosition(100,y); txt[i]->SetAlignment(ALIGN_LEFT, ALIGN_TOP); txt[i]->SetPosition(100,y);
i++; i++;
y+=22; y+=22;
sprintf(text, "Waninkoko & Kwiirk %s", LANGUAGE.theUSBLoaderandreleasingthesourcecode); sprintf(text, "Tantric %s LibWiiGui", LANGUAGE.awesometool);
txt[i] = new GuiText(text); txt[i] = new GuiText(text);
txt[i]->SetAlignment(ALIGN_LEFT, ALIGN_TOP); txt[i]->SetPosition(100,y); txt[i]->SetAlignment(ALIGN_LEFT, ALIGN_TOP); txt[i]->SetPosition(100,y);
i++; i++;
@ -1487,13 +1488,16 @@ DiscWait(const char *title, const char *msg, const char *btn1Label, const char *
if(IsDeviceWait) { if(IsDeviceWait) {
while(i >= 0) while(i >= 0)
{ {
timerTxt.SetTextf("%u %s", i,LANGUAGE.secondsleft);
VIDEO_WaitVSync(); VIDEO_WaitVSync();
timerTxt.SetTextf("%u %s", i,LANGUAGE.secondsleft);
HaltGui();
if(Settings.cios == ios222) { if(Settings.cios == ios222) {
ret = Sys_IosReload(222); ret = IOS_ReloadIOS(222);
load_ehc_module();
} else { } else {
ret = Sys_IosReload(249); ret = IOS_ReloadIOS(249);
} }
ResumeGui();
sleep(1); sleep(1);
ret = WBFS_Init(WBFS_DEVICE_USB); ret = WBFS_Init(WBFS_DEVICE_USB);
if(ret>=0) if(ret>=0)

View File

@ -1799,6 +1799,7 @@ int GameSettings(struct discHdr * header)
if (iosChoice == i249) options3.SetValue(4,"249"); if (iosChoice == i249) options3.SetValue(4,"249");
else if (iosChoice == i222) options3.SetValue(4,"222"); else if (iosChoice == i222) options3.SetValue(4,"222");
else if (iosChoice == i223) options3.SetValue(4,"223");
if (parentalcontrolChoice == 0) options3.SetValue(5, LANGUAGE.Always); if (parentalcontrolChoice == 0) options3.SetValue(5, LANGUAGE.Always);
else if (parentalcontrolChoice == 1) options3.SetValue(5,"1"); else if (parentalcontrolChoice == 1) options3.SetValue(5,"1");
@ -1832,7 +1833,7 @@ int GameSettings(struct discHdr * header)
ocarinaChoice = (ocarinaChoice + 1) % 2; ocarinaChoice = (ocarinaChoice + 1) % 2;
break; break;
case 4: case 4:
iosChoice = (iosChoice + 1) % 2; iosChoice = (iosChoice + 1) % 3;
break; break;
case 5: case 5:
parentalcontrolChoice = (parentalcontrolChoice + 1) % 4; parentalcontrolChoice = (parentalcontrolChoice + 1) % 4;

View File

@ -235,6 +235,7 @@ enum {
enum { enum {
i249=0, i249=0,
i222, i222,
i223
}; };
enum { enum {

View File

@ -289,6 +289,8 @@ s32 Disc_BootPartition(u64 offset, u8 videoselected, u8 cheat, u8 vipatch, u8 pa
WPAD_Disconnect(0); WPAD_Disconnect(0);
WPAD_Shutdown(); WPAD_Shutdown();
WDVD_Close();
/* Shutdown IOS subsystems */ /* Shutdown IOS subsystems */
SYS_ResetSystem(SYS_SHUTDOWN, 0, 0); SYS_ResetSystem(SYS_SHUTDOWN, 0, 0);

View File

@ -196,7 +196,7 @@ snprintf(LANGUAGE.Save, sizeof(LANGUAGE.Save), "Save");
snprintf(LANGUAGE.SaveFailed, sizeof(LANGUAGE.SaveFailed), "Save Failed"); snprintf(LANGUAGE.SaveFailed, sizeof(LANGUAGE.SaveFailed), "Save Failed");
snprintf(LANGUAGE.Specialthanksto, sizeof(LANGUAGE.Specialthanksto), "Special thanks to:"); snprintf(LANGUAGE.Specialthanksto, sizeof(LANGUAGE.Specialthanksto), "Special thanks to:");
snprintf(LANGUAGE.For, sizeof(LANGUAGE.For), "for"); snprintf(LANGUAGE.For, sizeof(LANGUAGE.For), "for");
snprintf(LANGUAGE.theUSBLoaderandreleasingthesourcecode, sizeof(LANGUAGE.theUSBLoaderandreleasingthesourcecode), "for the USB Loader source code"); snprintf(LANGUAGE.theUSBLoaderandreleasingthesourcecode, sizeof(LANGUAGE.theUSBLoaderandreleasingthesourcecode), "for the USB Loader source");
snprintf(LANGUAGE.secondsleft, sizeof(LANGUAGE.secondsleft), "seconds left"); snprintf(LANGUAGE.secondsleft, sizeof(LANGUAGE.secondsleft), "seconds left");
snprintf(LANGUAGE.Setasbackgroundmusic, sizeof(LANGUAGE.Setasbackgroundmusic), "Set as backgroundmusic?"); snprintf(LANGUAGE.Setasbackgroundmusic, sizeof(LANGUAGE.Setasbackgroundmusic), "Set as backgroundmusic?");
snprintf(LANGUAGE.SelectthePartition, sizeof(LANGUAGE.SelectthePartition), "Select the Partition"); snprintf(LANGUAGE.SelectthePartition, sizeof(LANGUAGE.SelectthePartition), "Select the Partition");

View File

@ -113,6 +113,8 @@ main(int argc, char *argv[])
SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0); SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);
} }
if(Settings.cios == ios222) load_ehc_module();
SDCard_Init(); // now mount SD:/ SDCard_Init(); // now mount SD:/
USBDevice_Init(); // and mount USB:/ USBDevice_Init(); // and mount USB:/

View File

@ -33,6 +33,7 @@
#include "Settings.h" #include "Settings.h"
#include "gameinfo.h" #include "gameinfo.h"
#include "mload.h" #include "mload.h"
#include "usbstorage.h"
//#include "xml.h" /* XML - Lustar*/ //#include "xml.h" /* XML - Lustar*/
@ -1654,18 +1655,33 @@ static int MenuCheck()
LANGUAGE.Doyouwanttoretryfor30secs, LANGUAGE.Doyouwanttoretryfor30secs,
"cIOS249", "cIOS222", "cIOS249", "cIOS222",
LANGUAGE.BacktoWiiMenu, 0); LANGUAGE.BacktoWiiMenu, 0);
SDCard_deInit();
USBDevice_deInit();
WPAD_Flush(0);
WPAD_Disconnect(0);
WPAD_Shutdown();
if(ret2 == 1) { if(ret2 == 1) {
Settings.cios = ios249; Settings.cios = ios249;
} else if(ret2 == 2) { } else if(ret2 == 2) {
if(Settings.cios != ios222) if(Settings.cios != ios222)
{ {
HaltGui();
ret2 = Sys_IosReload(222); ret2 = Sys_IosReload(222);
if(ret2 < 0) if(ret2 < 0)
Sys_IosReload(249); Sys_IosReload(249);
if(ret2 < 0) ResumeGui();
if(ret2 < 0) {
Wpad_Init();
WPAD_SetDataFormat(WPAD_CHAN_ALL,WPAD_FMT_BTNS_ACC_IR);
WPAD_SetVRes(WPAD_CHAN_ALL, screenwidth, screenheight);
WindowPrompt(LANGUAGE.YoudonthavecIOS,LANGUAGE.LoadingincIOS,LANGUAGE.ok, 0,0,0); WindowPrompt(LANGUAGE.YoudonthavecIOS,LANGUAGE.LoadingincIOS,LANGUAGE.ok, 0,0,0);
else WPAD_Flush(0);
WPAD_Disconnect(0);
WPAD_Shutdown();
} else {
Settings.cios = ios222; Settings.cios = ios222;
load_ehc_module();
}
} }
} else { } else {
Sys_LoadMenu(); Sys_LoadMenu();
@ -1675,6 +1691,9 @@ static int MenuCheck()
//reinitialize SD and USB //reinitialize SD and USB
SDCard_Init(); SDCard_Init();
USBDevice_Init(); USBDevice_Init();
Wpad_Init();
WPAD_SetDataFormat(WPAD_CHAN_ALL,WPAD_FMT_BTNS_ACC_IR);
WPAD_SetVRes(WPAD_CHAN_ALL, screenwidth, screenheight);
} }
if (ret2 < 0) { if (ret2 < 0) {
WindowPrompt (LANGUAGE.Error,LANGUAGE.USBDevicenotfound, LANGUAGE.ok, 0,0,0); WindowPrompt (LANGUAGE.Error,LANGUAGE.USBDevicenotfound, LANGUAGE.ok, 0,0,0);
@ -1850,21 +1869,24 @@ int MainMenu(int menu)
ios2 = 222; ios2 = 222;
break; break;
case i223:
ios2 = 223;
break;
default: default:
ios2 = 249; ios2 = 249;
break; break;
} }
if(networkisinitialized == 1 || (iosChoice == i249 && Settings.cios == 1) || (iosChoice == i222 && Settings.cios == 0)) { if(iosChoice == i223 || networkisinitialized == 1
/*Needed for IOS Reload */ || (iosChoice == i249 && Settings.cios == 1)
ResumeGui(); || (iosChoice == i222 && Settings.cios == 0)) {
if(networkisinitialized == 1) ResumeGui();
ret = Sys_IosReload(ios2); ret = Sys_IosReload(ios2);
if(ret < 0) { if(ret < 0) {
Sys_IosReload(249); Sys_IosReload(249);
exit(0);
} }
} }
ret = Disc_SetUSB(header->id, GetPartition()); ret = Disc_SetUSB(header->id, GetPartition());
if(ret < 0) Sys_BackToLoader(); if(ret < 0) Sys_BackToLoader();
ret = Disc_Open(); ret = Disc_Open();
@ -1872,6 +1894,7 @@ int MainMenu(int menu)
SDCard_deInit(); SDCard_deInit();
USBDevice_deInit(); USBDevice_deInit();
USBStorage_Deinit();
u8 errorfixer002 = 0; u8 errorfixer002 = 0;
switch(fix002) switch(fix002)

View File

@ -1,5 +1,6 @@
#include <stdio.h> #include <stdio.h>
#include <ogcsys.h> #include <ogcsys.h>
#include <unistd.h>
#include "sys.h" #include "sys.h"
#include "wpad.h" #include "wpad.h"
@ -74,12 +75,14 @@ void Sys_Reboot(void)
int Sys_IosReload(int IOS) int Sys_IosReload(int IOS)
{ {
s32 ret; s32 ret = -1;
//shutdown SD and USB before IOS Reload in DiscWait //shutdown SD and USB before IOS Reload in DiscWait
SDCard_deInit(); SDCard_deInit();
USBDevice_deInit(); USBDevice_deInit();
mload_close();
WPAD_Flush(0); WPAD_Flush(0);
WPAD_Disconnect(0); WPAD_Disconnect(0);
WPAD_Shutdown(); WPAD_Shutdown();
@ -87,32 +90,32 @@ int Sys_IosReload(int IOS)
USBStorage_Deinit(); USBStorage_Deinit();
WDVD_Close(); WDVD_Close();
if(IOS == 249 || IOS == 222 || IOS == 223) {
for(int i = 0; i < 10; i++) {
ret = IOS_ReloadIOS(IOS); ret = IOS_ReloadIOS(IOS);
if(ret < 0) return ret;
if(IOS == 222) load_ehc_module(); if(IOS == 222 || IOS == 223) load_ehc_module();
PAD_Init();
Wpad_Init();
WPAD_SetDataFormat(WPAD_CHAN_ALL,WPAD_FMT_BTNS_ACC_IR);
WPAD_SetVRes(WPAD_CHAN_ALL, screenwidth, screenheight);
if(ret < 0) {
return ret;
}
if(IOS == 249 || IOS == 222) {
ret = WBFS_Init(WBFS_DEVICE_USB); ret = WBFS_Init(WBFS_DEVICE_USB);
if(ret>=0) if(!(ret < 0)) break;
{ sleep(1);
USBStorage_Deinit();
}
if(ret>=0) {
ret = Disc_Init(); ret = Disc_Init();
int i = 0; int i = 0;
if(ret>=0) if(ret>=0) {
for(i = 0; i < 4; i++) { for(i = 0; i < 4; i++) {
ret = WBFS_Open2(i); ret = WBFS_Open2(i);
if(ret == 0) break; if(ret == 0) break;
} }
} }
} else Sys_BackToLoader();
} }
PAD_Init();
Wpad_Init();
WPAD_SetDataFormat(WPAD_CHAN_ALL,WPAD_FMT_BTNS_ACC_IR);
WPAD_SetVRes(WPAD_CHAN_ALL, screenwidth, screenheight);
//reinitialize SD and USB //reinitialize SD and USB
SDCard_Init(); SDCard_Init();
USBDevice_Init(); USBDevice_Init();