- Fixed Hermes rev5 issues (I think :))

- Added support for ciosx (yes, including FAT/NTFS) (As always, say thanks to oggzee for this)
- Fixed bug with game specific settings (which *could* end up using other settings than you expected)
- Removed fat_ffs for now (save game emulation might conflict with FAT/NTFS support, we have to test this)
- Maybe more, but I forgot them, I think
This commit is contained in:
e.bovendeur 2010-04-10 09:15:22 +00:00
parent 3f15f12ee5
commit 0e1ed4a3b3
33 changed files with 953 additions and 1086 deletions

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
<pd><ViewState><e p="gui\source\mload" x="false"></e><e p="gui\source\settings" x="false"></e><e p="gui\source\images" x="false"></e><e p="gui\source\libfat" x="false"></e><e p="gui\source\prompts" x="false"></e><e p="gui\source\banner" x="false"></e><e p="gui\source\cheats" x="false"></e><e p="gui\source\libntfs" x="false"></e><e p="gui\source\network" x="true"></e><e p="gui\source\fonts" x="false"></e><e p="gui\source\menu" x="false"></e><e p="gui\source\ramdisk" x="false"></e><e p="gui\source\sounds" x="false"></e><e p="gui\source\wad" x="false"></e><e p="gui" x="true"></e><e p="gui\source\homebrewboot" x="false"></e><e p="gui\source\language" x="false"></e><e p="gui\source" x="true"></e><e p="gui\source\libwbfs" x="false"></e><e p="gui\source\libwiigui" x="false"></e><e p="gui\source\patches" x="false"></e><e p="gui\source\themes" x="false"></e><e p="gui\source\memory" x="false"></e><e p="gui\source\unzip" x="false"></e><e p="gui\source\usbloader" x="false"></e><e p="gui\source\xml" x="false"></e></ViewState></pd> <pd><ViewState><e p="gui\source\mload" x="false"></e><e p="gui\source\settings" x="false"></e><e p="gui\source\images" x="false"></e><e p="gui\source\libfat" x="false"></e><e p="gui\source\prompts" x="false"></e><e p="gui\source\banner" x="false"></e><e p="gui\source\cheats" x="false"></e><e p="gui\source\libntfs" x="false"></e><e p="gui\source\network" x="false"></e><e p="gui\source\fonts" x="false"></e><e p="gui\source\menu" x="false"></e><e p="gui\source\ramdisk" x="false"></e><e p="gui\source\sounds" x="false"></e><e p="gui\source\wad" x="false"></e><e p="gui" x="true"></e><e p="gui\source\homebrewboot" x="false"></e><e p="gui\source\language" x="false"></e><e p="gui\source" x="true"></e><e p="gui\source\libwbfs" x="false"></e><e p="gui\source\libwiigui" x="false"></e><e p="gui\source\patches" x="false"></e><e p="gui\source\themes" x="false"></e><e p="gui\source\usbloader\wbfs" x="false"></e><e p="gui\source\memory" x="false"></e><e p="gui\source\unzip" x="false"></e><e p="gui\source\usbloader" x="true"></e><e p="gui\source\xml" x="false"></e></ViewState></pd>

View File

@ -31,3 +31,7 @@ void ShutdownAudio() {
ASND_Pause(1); ASND_Pause(1);
ASND_End(); ASND_End();
} }
extern "C" void StopAudio() {
ShutdownAudio();
}

View File

@ -95,21 +95,6 @@ static void BootUpProblems()
time_t endtime = time(0) + 30; time_t endtime = time(0) + 30;
do do
{ {
/*ret2 = IOS_ReloadIOSsafe(249);
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_deInit();
USBDevice_Init(); USBDevice_Init();
ret2 = WBFS_Init(WBFS_DEVICE_USB); ret2 = WBFS_Init(WBFS_DEVICE_USB);
@ -162,6 +147,7 @@ void InitTextVideo ()
} }
dbvideo=1; dbvideo=1;
VIDEO_Init(); VIDEO_Init();
// get default video mode // get default video mode
GXRModeObj *vmode = VIDEO_GetPreferredMode(NULL); GXRModeObj *vmode = VIDEO_GetPreferredMode(NULL);
@ -317,12 +303,7 @@ main(int argc, char *argv[])
} }
} }
} }
printf("\n\tInitialize sd card");
SDCard_Init();
printf("\n\tLoad ehc module");
load_ehc_module(); load_ehc_module();
printf("\n\tdeinit sd card");
SDCard_deInit();
} }
printf("\n\tInit wbfs..."); printf("\n\tInit wbfs...");
@ -334,22 +315,8 @@ main(int argc, char *argv[])
printf("\n\tYou have issues with a slow disc, or a difficult disc\n\tReloading 222..."); printf("\n\tYou have issues with a slow disc, or a difficult disc\n\tReloading 222...");
ret = IOS_ReloadIOSsafe(222); ret = IOS_ReloadIOSsafe(222);
printf("%d", ret); 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"); printf("\n\tLoad ehc module");
load_ehc_module(); load_ehc_module();
printf("\n\tdeinit sd card");
SDCard_deInit();
printf("\n\tInitialize wbfs..."); printf("\n\tInitialize wbfs...");
USBDevice_deInit(); USBDevice_deInit();
@ -407,65 +374,24 @@ main(int argc, char *argv[])
// gprintf("\n\tbootDevice = %s",bootDevice); // gprintf("\n\tbootDevice = %s",bootDevice);
/* Load Custom IOS */ /* Load Custom IOS */
if ((Settings.cios == ios222 && IOS_GetVersion() != 222) || if (Settings.cios != IOS_GetVersion())
(Settings.cios == ios223 && IOS_GetVersion() != 223))
{ {
printf("\n\tReloading IOS to config setting (%d)...", Settings.cios == ios222 ? 222 : 223); printf("\n\tReloading IOS to config setting (%d)...", ciosSetting2Cios(Settings.cios));
SDCard_deInit(); // unmount SD for reloading IOS if (Sys_IosReload(ciosSetting2Cios(Settings.cios)) < 0) {
USBDevice_deInit(); // unmount USB for reloading IOS int alt_ios = (Settings.cios == ios222 || Settings.cios == ios223) ? 249 : 222;
USBStorage2_Deinit(); ret = Sys_IosReload(alt_ios);
ret = IOS_ReloadIOSsafe(Settings.cios == 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:/
WBFS_Init(WBFS_DEVICE_USB);
} 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
USBStorage2_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) if (ret < 0)
{ {
printf("\nERROR: cIOS could not be loaded!"); printf("\nERROR: cIOS could not be loaded!");
sleep(5); sleep(5);
exit(0); 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()); SDCard_Init();
}
// printf("Sleeping for 5 seconds\n"); printf("\n\tcIOS = %u (Rev %u)",IOS_GetVersion(), IOS_GetRevision());
// sleep(5);
//if a ID was passed via args copy it and try to boot it after the partition is mounted //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. //its not really a headless mode. more like hairless.

View File

@ -25,9 +25,9 @@
#include "usbloader/getentries.h" #include "usbloader/getentries.h"
#include "wad/title.h" #include "wad/title.h"
#include "xml/xml.h" #include "xml/xml.h"
#include "audio.h"
#include "gecko.h" #include "gecko.h"
#include "menu.h" #include "menu.h"
#include "audio.h"
#include "sys.h" #include "sys.h"
#include "wpad.h" #include "wpad.h"
#include "settings/newtitles.h" #include "settings/newtitles.h"
@ -345,6 +345,7 @@ int MainMenu(int menu) {
delete coverImg; delete coverImg;
delete fontClock; delete fontClock;
delete fontSystem; delete fontSystem;
ShutdownAudio(); ShutdownAudio();
StopGX(); StopGX();
gettextCleanUp(); gettextCleanUp();
@ -414,7 +415,6 @@ int MainMenu(int menu) {
} }
} }
int ret = 0; int ret = 0;
header = (mountMethod?dvdheader:&gameList[gameSelected]); header = (mountMethod?dvdheader:&gameList[gameSelected]);
@ -433,48 +433,9 @@ int MainMenu(int menu) {
alternatedoloffset = game_cfg->alternatedolstart; alternatedoloffset = game_cfg->alternatedolstart;
} }
reloadblock = game_cfg->iosreloadblock; reloadblock = game_cfg->iosreloadblock;
} else {
videoChoice = Settings.video;
languageChoice = Settings.language;
ocarinaChoice = Settings.ocarina;
viChoice = Settings.vpatch;
if (Settings.cios == ios222) {
iosChoice = i222;
} else {
iosChoice = i249;
}
fix002 = Settings.error002;
countrystrings = Settings.patchcountrystrings;
if (!altdoldefault) {
alternatedol = off;
alternatedoloffset = 0;
}
reloadblock = off;
}
int ios2;
switch (iosChoice) {
case i249:
ios2 = 249;
break;
case i222:
ios2 = 222;
break;
case i223:
ios2 = 223;
break;
default:
ios2 = 249;
break;
} }
// When the selected ios is 249, and you're loading from FAT, reset ios to 222 int ios2 = ciosSetting2Cios(iosChoice);
if (load_from_fs != PART_FS_WBFS && ios2 == 249) {
ios2 = 222;
}
bool onlinefix = ShutdownWC24(); bool onlinefix = ShutdownWC24();
// You cannot reload ios when loading from fat // You cannot reload ios when loading from fat
@ -490,10 +451,6 @@ int MainMenu(int menu) {
ret = get_frag_list(header->id); ret = get_frag_list(header->id);
gprintf("%d\n", ret); gprintf("%d\n", ret);
gprintf("\nSetting fragment list...");
ret = set_frag_list(header->id);
gprintf("%d\n", ret);
ret = Disc_SetUSB(header->id); ret = Disc_SetUSB(header->id);
if (ret < 0) Sys_BackToLoader(); if (ret < 0) Sys_BackToLoader();
gprintf("\n\tUSB set to game"); gprintf("\n\tUSB set to game");

View File

@ -14,7 +14,7 @@
#include "main.h" #include "main.h"
void InitGUIThreads(void); void InitGUIThreads(void);
void ExitGUIThreads(void); extern "C" void ExitGUIThreads(void);
int MainMenu (int menuitem); int MainMenu (int menuitem);

View File

@ -0,0 +1,334 @@
#define size_dip_plugin_249 5276
unsigned char dip_plugin_249[5276] __attribute__((aligned (32)))={
0x7f, 0x45, 0x4c, 0x46, 0x01, 0x02, 0x01, 0x61, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x02, 0x00, 0x28, 0x00, 0x00, 0x00, 0x01, 0x13, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x00, 0x34, 0x00, 0x20, 0x00, 0x05, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0xa0, 0x00, 0xf0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0xa0,
0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x34, 0x00, 0xf0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0xd4, 0x00, 0xf0, 0x00, 0x00,
0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x08, 0x13, 0x70, 0x00, 0x00,
0x13, 0x70, 0x00, 0x00, 0x00, 0x00, 0x12, 0xa4, 0x00, 0x00, 0x12, 0xa4, 0x00, 0xf0, 0x00, 0x05,
0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x13, 0xac, 0x13, 0x70, 0x20, 0x00,
0x13, 0x70, 0x20, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x03, 0xc3, 0x00, 0x00, 0xf0, 0x00, 0x06,
0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x06,
0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x09, 0x13, 0x70, 0x00, 0x00,
0x00, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x10, 0x00,
0x00, 0x00, 0x00, 0x7f, 0x13, 0x73, 0xe3, 0x00, 0xe3, 0xa0, 0x00, 0x00, 0xe3, 0xa0, 0x10, 0x00,
0xe5, 0x9f, 0x30, 0x00, 0xe1, 0x2f, 0xff, 0x13, 0x13, 0x70, 0x03, 0x51, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb5, 0x00, 0x4b, 0x06, 0xb0, 0x89, 0x93, 0x00,
0x46, 0x68, 0x23, 0x00, 0x21, 0x00, 0x22, 0x00, 0x93, 0x01, 0x93, 0x02, 0xf0, 0x00, 0xf9, 0x1f,
0xb0, 0x09, 0xbd, 0x00, 0xe3, 0x00, 0x00, 0x00, 0xb5, 0x10, 0x1c, 0x03, 0x22, 0x20, 0x1c, 0x0c,
0x48, 0x09, 0x1c, 0x19, 0xf0, 0x01, 0xf8, 0xa0, 0x4a, 0x08, 0x23, 0x01, 0x68, 0x11, 0x42, 0x19,
0xd1, 0xfc, 0x2c, 0x00, 0xd0, 0x04, 0x1c, 0x20, 0x49, 0x03, 0x22, 0x20, 0xf0, 0x01, 0xf8, 0x94,
0x4b, 0x03, 0x68, 0x18, 0xbd, 0x10, 0x46, 0xc0, 0x0d, 0x00, 0x60, 0x00, 0x0d, 0x00, 0x60, 0x1c,
0x0d, 0x00, 0x60, 0x20, 0xb5, 0xf0, 0xb0, 0x8b, 0x1c, 0x07, 0x0a, 0xcb, 0x20, 0xa0, 0x1c, 0x0d,
0x92, 0x01, 0x93, 0x00, 0x02, 0x00, 0x26, 0x00, 0xac, 0x02, 0xe0, 0x17, 0x22, 0x20, 0x21, 0x00,
0x1c, 0x20, 0xf0, 0x01, 0xf8, 0xb9, 0x4b, 0x0c, 0x1c, 0x38, 0x60, 0x23, 0x23, 0x00, 0x60, 0x63,
0x60, 0xa3, 0x9b, 0x00, 0x1c, 0x29, 0x60, 0xe3, 0x9b, 0x01, 0x36, 0x01, 0x61, 0x23, 0xf0, 0x00,
0xed, 0x2a, 0x1c, 0x20, 0x1c, 0x39, 0x1c, 0x2a, 0xf0, 0x00, 0xf8, 0xd9, 0x2e, 0x0f, 0xd8, 0x01,
0x28, 0x00, 0xd1, 0xe3, 0xb0, 0x0b, 0xbd, 0xf0, 0xd0, 0x00, 0x00, 0x00, 0xb5, 0xf0, 0xb0, 0x83,
0x24, 0x80, 0x93, 0x01, 0x01, 0x24, 0x18, 0x53, 0x90, 0x00, 0x1c, 0x0f, 0x1c, 0x16, 0x42, 0xa3,
0xd9, 0x01, 0x24, 0x65, 0xe0, 0x07, 0x1c, 0x20, 0x21, 0x20, 0xf0, 0x00, 0xe8, 0x92, 0x1c, 0x05,
0x28, 0x00, 0xd1, 0x02, 0x24, 0x16, 0x42, 0x64, 0xe0, 0x0e, 0x1c, 0x21, 0x9a, 0x01, 0xf7, 0xff,
0xff, 0xb9, 0x1c, 0x04, 0x28, 0x00, 0xd1, 0x04, 0x19, 0xa9, 0x98, 0x00, 0x1c, 0x3a, 0xf0, 0x01,
0xf8, 0x3b, 0x1c, 0x28, 0xf0, 0x00, 0xe8, 0x88, 0xb0, 0x03, 0x1c, 0x20, 0xbd, 0xf0, 0x46, 0xc0,
0xb5, 0xf0, 0xb0, 0x87, 0x92, 0x02, 0x0a, 0x56, 0x23, 0xff, 0x22, 0x80, 0x01, 0x12, 0x03, 0xdb,
0x90, 0x05, 0x91, 0x04, 0x20, 0x00, 0x27, 0x00, 0x92, 0x00, 0x93, 0x03, 0xe0, 0x32, 0x9a, 0x04,
0x9b, 0x02, 0x02, 0x75, 0x1b, 0xd4, 0x42, 0xab, 0xd8, 0x01, 0x25, 0x00, 0xe0, 0x02, 0x9a, 0x02,
0x1b, 0x55, 0x00, 0xad, 0x9b, 0x05, 0x22, 0x80, 0x19, 0xdb, 0x1c, 0x18, 0x1c, 0x21, 0x01, 0x12,
0x93, 0x01, 0xf0, 0x00, 0xf8, 0x99, 0x28, 0x00, 0xd0, 0x01, 0x2d, 0x00, 0xd0, 0x0b, 0x9a, 0x00,
0x19, 0x2b, 0x42, 0x93, 0xd9, 0x00, 0x1b, 0x54, 0x98, 0x01, 0x1c, 0x21, 0x1c, 0x2a, 0x1c, 0x33,
0xf7, 0xff, 0xff, 0xa4, 0xe0, 0x0a, 0x9b, 0x03, 0x1c, 0x04, 0x42, 0x98, 0xd9, 0x01, 0x24, 0xff,
0x03, 0xe4, 0x98, 0x01, 0x1c, 0x21, 0x1c, 0x32, 0xf7, 0xff, 0xff, 0x6c, 0x19, 0x65, 0x0a, 0xed,
0x19, 0x76, 0x19, 0x3f, 0x9a, 0x04, 0x42, 0x97, 0xd3, 0xc9, 0xb0, 0x07, 0xbd, 0xf0, 0x46, 0xc0,
0xb5, 0xf0, 0xb0, 0x89, 0x1c, 0x0d, 0x1c, 0x06, 0x1c, 0x17, 0x46, 0x68, 0x22, 0x20, 0x21, 0x00,
0xf0, 0x01, 0xf8, 0x22, 0x4b, 0x07, 0x1c, 0x30, 0x1c, 0x29, 0x93, 0x00, 0x95, 0x01, 0x97, 0x02,
0xf0, 0x00, 0xec, 0x98, 0x1c, 0x31, 0x1c, 0x2a, 0x46, 0x68, 0xf0, 0x00, 0xf8, 0x48, 0xb0, 0x09,
0xbd, 0xf0, 0x46, 0xc0, 0xa8, 0x00, 0x00, 0x00, 0xb5, 0x10, 0xf7, 0xff, 0xff, 0xe1, 0xbd, 0x10,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe9, 0x2d, 0x40, 0x80, 0xe5, 0x9f, 0x70, 0x7c,
0xe5, 0x97, 0x70, 0x00, 0xeb, 0x00, 0x00, 0x13, 0xe8, 0xbd, 0x40, 0x80, 0xe1, 0x2f, 0xff, 0x1e,
0xe9, 0x2d, 0x40, 0x80, 0xe5, 0x9f, 0x70, 0x68, 0xe5, 0x97, 0x70, 0x00, 0xeb, 0x00, 0x00, 0x0d,
0xe8, 0xbd, 0x40, 0x80, 0xe1, 0x2f, 0xff, 0x1e, 0xe9, 0x2d, 0x40, 0x80, 0xe5, 0x9f, 0x70, 0x54,
0xe5, 0x97, 0x70, 0x00, 0xeb, 0x00, 0x00, 0x07, 0xe8, 0xbd, 0x40, 0x80, 0xe1, 0x2f, 0xff, 0x1e,
0xe9, 0x2d, 0x40, 0x80, 0xe5, 0x9f, 0x70, 0x40, 0xe5, 0x97, 0x70, 0x00, 0xeb, 0x00, 0x00, 0x01,
0xe8, 0xbd, 0x40, 0x80, 0xe1, 0x2f, 0xff, 0x1e, 0xe1, 0x2f, 0xff, 0x17, 0xb5, 0xf0, 0x46, 0x57,
0x46, 0x46, 0xb4, 0xc0, 0x68, 0x05, 0x46, 0x8a, 0x4b, 0x09, 0x68, 0x1b, 0x47, 0x18, 0xb5, 0xf0,
0x46, 0x5f, 0x46, 0x56, 0x46, 0x4d, 0x46, 0x44, 0xb4, 0xf0, 0x4b, 0x06, 0x68, 0x1b, 0x47, 0x18,
0x13, 0x70, 0x21, 0x14, 0x13, 0x70, 0x21, 0x20, 0x13, 0x70, 0x21, 0x24, 0x13, 0x70, 0x21, 0x28,
0x13, 0x70, 0x21, 0x18, 0x13, 0x70, 0x21, 0x1c, 0xb5, 0x30, 0x06, 0xc3, 0xd0, 0x01, 0x20, 0x00,
0xe0, 0x18, 0x4b, 0x0d, 0x42, 0x98, 0xd9, 0x01, 0x23, 0x00, 0xe0, 0x02, 0x23, 0xc0, 0x04, 0x5b,
0x1a, 0x1b, 0x4c, 0x0a, 0x19, 0x05, 0x4c, 0x0a, 0x42, 0xa5, 0xd8, 0x01, 0x4b, 0x09, 0x1a, 0x1b,
0x42, 0x93, 0xd2, 0x01, 0x20, 0x00, 0xe0, 0x03, 0x1c, 0x18, 0x42, 0x8b, 0xd9, 0x00, 0x1c, 0x08,
0x3a, 0x01, 0x43, 0x90, 0xbd, 0x30, 0x46, 0xc0, 0x01, 0x7f, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x00,
0x03, 0x61, 0x7f, 0xff, 0x13, 0x61, 0x80, 0x00, 0xb5, 0x70, 0x4c, 0x09, 0x1c, 0x05, 0x1c, 0x0e,
0x68, 0x20, 0x00, 0x91, 0x22, 0x00, 0xf0, 0x00, 0xeb, 0xd6, 0x28, 0x00, 0xdb, 0x07, 0x68, 0x20,
0x1c, 0x29, 0x1c, 0x32, 0xf0, 0x00, 0xeb, 0xc6, 0x28, 0x00, 0xdd, 0x00, 0x20, 0x00, 0xbd, 0x70,
0x13, 0x70, 0x20, 0x00, 0xb5, 0x10, 0x4b, 0x05, 0x68, 0x18, 0x28, 0x00, 0xdb, 0x01, 0xf0, 0x00,
0xeb, 0xb6, 0x4a, 0x02, 0x23, 0x01, 0x42, 0x5b, 0x60, 0x13, 0xbd, 0x10, 0x13, 0x70, 0x20, 0x00,
0xb5, 0x10, 0x21, 0x00, 0xf0, 0x00, 0xeb, 0xa6, 0x4b, 0x02, 0x60, 0x18, 0x28, 0x00, 0xdd, 0x00,
0x20, 0x00, 0xbd, 0x10, 0x13, 0x70, 0x20, 0x00, 0xb5, 0x10, 0x48, 0x06, 0xf0, 0x00, 0xeb, 0xea,
0x48, 0x05, 0xf0, 0x00, 0xfb, 0x15, 0x48, 0x05, 0x21, 0x00, 0x22, 0x00, 0xf0, 0x00, 0xfb, 0x18,
0x20, 0x00, 0xbd, 0x10, 0x13, 0x70, 0x20, 0xa8, 0x13, 0x70, 0x21, 0x00, 0x13, 0x70, 0x03, 0x79,
0xb5, 0x10, 0xf0, 0x00, 0xeb, 0xf6, 0xf0, 0x00, 0xeb, 0xfa, 0x1c, 0x04, 0x20, 0x01, 0x42, 0x40,
0xf0, 0x00, 0xeb, 0xf8, 0x4b, 0x04, 0x68, 0x58, 0xf0, 0x00, 0xf8, 0x08, 0x1c, 0x20, 0xf0, 0x00,
0xeb, 0xf2, 0x20, 0x00, 0xbd, 0x10, 0x46, 0xc0, 0x13, 0x70, 0x21, 0x00, 0xb5, 0x10, 0x4b, 0x41,
0x42, 0x98, 0xd0, 0x32, 0x42, 0x98, 0xd8, 0x03, 0x4b, 0x3f, 0x42, 0x98, 0xd1, 0x79, 0xe0, 0x06,
0x4b, 0x3e, 0x42, 0x98, 0xd0, 0x4f, 0x4b, 0x3e, 0x42, 0x98, 0xd1, 0x72, 0xe0, 0x4b, 0x48, 0x3d,
0x4c, 0x3d, 0x21, 0x04, 0x60, 0x04, 0xf0, 0x00, 0xeb, 0xc8, 0x4b, 0x3c, 0x48, 0x3c, 0x21, 0x04,
0x60, 0x03, 0xf0, 0x00, 0xeb, 0xc2, 0x48, 0x3b, 0x21, 0x04, 0x60, 0x04, 0xf0, 0x00, 0xeb, 0xbc,
0x4b, 0x39, 0x48, 0x3a, 0x21, 0x04, 0x60, 0x03, 0xf0, 0x00, 0xeb, 0xb6, 0x4b, 0x38, 0x4a, 0x39,
0x60, 0x1a, 0x4a, 0x39, 0x60, 0x5a, 0x4a, 0x39, 0x60, 0x9a, 0x4a, 0x39, 0x60, 0xda, 0x3a, 0x30,
0x61, 0x1a, 0x4a, 0x38, 0x61, 0x5a, 0x4a, 0x38, 0xe0, 0x4a, 0x48, 0x38, 0x4c, 0x2a, 0x21, 0x04,
0x60, 0x04, 0xf0, 0x00, 0xeb, 0xa2, 0x4b, 0x29, 0x48, 0x35, 0x21, 0x04, 0x60, 0x03, 0xf0, 0x00,
0xeb, 0x9c, 0x48, 0x34, 0x21, 0x04, 0x60, 0x04, 0xf0, 0x00, 0xeb, 0x96, 0x4b, 0x26, 0x48, 0x32,
0x21, 0x04, 0x60, 0x03, 0xf0, 0x00, 0xeb, 0x90, 0x4b, 0x25, 0x4a, 0x30, 0x60, 0x1a, 0x4a, 0x30,
0x60, 0x5a, 0x4a, 0x30, 0x60, 0x9a, 0x4a, 0x30, 0x60, 0xda, 0x3a, 0x2c, 0x61, 0x1a, 0x4a, 0x2f,
0x61, 0x5a, 0x4a, 0x2f, 0xe0, 0x24, 0x48, 0x17, 0x4c, 0x17, 0x21, 0x04, 0x60, 0x04, 0xf0, 0x00,
0xeb, 0x7c, 0x4b, 0x16, 0x48, 0x16, 0x21, 0x04, 0x60, 0x03, 0xf0, 0x00, 0xeb, 0x76, 0x48, 0x15,
0x21, 0x04, 0x60, 0x04, 0xf0, 0x00, 0xeb, 0x70, 0x4b, 0x13, 0x48, 0x14, 0x21, 0x04, 0x60, 0x03,
0xf0, 0x00, 0xeb, 0x6a, 0x4b, 0x12, 0x4a, 0x23, 0x60, 0x1a, 0x4a, 0x13, 0x60, 0x5a, 0x4a, 0x13,
0x60, 0x9a, 0x4a, 0x13, 0x60, 0xda, 0x3a, 0x30, 0x61, 0x1a, 0x4a, 0x1f, 0x61, 0x5a, 0x4a, 0x1f,
0x61, 0x9a, 0xbd, 0x10, 0x48, 0x88, 0xe1, 0x4c, 0x48, 0x77, 0x6f, 0x72, 0x49, 0x2a, 0xca, 0x9d,
0x4a, 0x26, 0x2a, 0xf5, 0x20, 0x20, 0x04, 0x00, 0x4b, 0x00, 0x47, 0x18, 0x13, 0x70, 0x05, 0x29,
0x20, 0x20, 0x04, 0x04, 0x20, 0x20, 0x0e, 0xf8, 0x13, 0x70, 0x06, 0x81, 0x20, 0x20, 0x0e, 0xfc,
0x13, 0x70, 0x21, 0x14, 0x20, 0x20, 0x2a, 0x71, 0x20, 0x20, 0x04, 0x0d, 0x20, 0x20, 0x0f, 0x05,
0x20, 0x20, 0x09, 0x6d, 0x20, 0x20, 0x38, 0x7d, 0x20, 0x22, 0xdd, 0x60, 0x20, 0x20, 0x03, 0xb8,
0x20, 0x20, 0x03, 0xbc, 0x20, 0x20, 0x0d, 0x2c, 0x20, 0x20, 0x0d, 0x30, 0x20, 0x20, 0x28, 0x75,
0x20, 0x20, 0x03, 0xc5, 0x20, 0x20, 0x0d, 0x39, 0x20, 0x20, 0x08, 0xc5, 0x20, 0x20, 0x36, 0x5d,
0x20, 0x22, 0xcd, 0xac, 0x20, 0x20, 0x29, 0x45, 0x20, 0x20, 0x37, 0x51, 0x20, 0x22, 0xcd, 0x60,
0xb5, 0x70, 0x68, 0x03, 0x68, 0xc2, 0x2b, 0x86, 0xd0, 0x1a, 0x2b, 0x86, 0xd8, 0x04, 0x2b, 0x79,
0xd0, 0x07, 0x2b, 0x7a, 0xd1, 0x2c, 0xe0, 0x0a, 0x2b, 0x88, 0xd0, 0x1b, 0x2b, 0x95, 0xd1, 0x27,
0xe0, 0x1f, 0x4b, 0x15, 0x68, 0x1a, 0x23, 0x1c, 0x42, 0x1a, 0xd1, 0x07, 0xe0, 0x20, 0x4b, 0x12,
0x24, 0x1c, 0x68, 0x1d, 0x42, 0x25, 0xd0, 0x1b, 0x69, 0x5b, 0x60, 0x13, 0x20, 0x01, 0xe0, 0x19,
0x4b, 0x0d, 0x22, 0x1c, 0x68, 0x1c, 0x42, 0x14, 0xd0, 0x12, 0x69, 0x5a, 0x21, 0x04, 0x43, 0x8a,
0x61, 0x5a, 0xe7, 0xf3, 0x4b, 0x08, 0x68, 0x1c, 0x23, 0x1c, 0x42, 0x1c, 0xd0, 0x08, 0x23, 0x02,
0xe7, 0xeb, 0x4b, 0x05, 0x68, 0x1c, 0x23, 0x1c, 0x42, 0x1c, 0xd0, 0x01, 0x23, 0x0a, 0xe7, 0xe4,
0xf7, 0xff, 0xfe, 0x64, 0xbd, 0x70, 0x46, 0xc0, 0x13, 0x70, 0x21, 0x30, 0xb5, 0x70, 0x4b, 0x17,
0x68, 0x5b, 0x2b, 0x01, 0xd0, 0x03, 0x2b, 0x02, 0xd1, 0x0a, 0x4b, 0x15, 0xe0, 0x00, 0x4b, 0x15,
0x42, 0x9a, 0xd3, 0x05, 0x4a, 0x14, 0x4b, 0x11, 0x20, 0xa0, 0x61, 0x1a, 0x02, 0x00, 0xe0, 0x1b,
0x4b, 0x0e, 0x68, 0xdd, 0x68, 0x9c, 0x68, 0x1b, 0x19, 0x2c, 0x18, 0xa2, 0x06, 0xdc, 0xd5, 0x02,
0xf0, 0x00, 0xfd, 0x2a, 0xe0, 0x10, 0x07, 0x1c, 0xd5, 0x02, 0xf7, 0xff, 0xfe, 0x85, 0xe0, 0x0b,
0x07, 0x5c, 0xd5, 0x02, 0xf0, 0x00, 0xfa, 0xd8, 0xe0, 0x06, 0x07, 0xdc, 0xd5, 0x02, 0xf7, 0xff,
0xfd, 0x97, 0xe0, 0x01, 0xf7, 0xff, 0xfd, 0xf8, 0xbd, 0x70, 0x46, 0xc0, 0x13, 0x70, 0x21, 0x30,
0x7e, 0xd3, 0x80, 0x00, 0x46, 0x09, 0x00, 0x00, 0x00, 0x05, 0x21, 0x00, 0xb5, 0x10, 0x20, 0x80,
0x01, 0x00, 0x21, 0x20, 0xf7, 0xff, 0xed, 0xfc, 0x1c, 0x04, 0x28, 0x00, 0xd0, 0x0f, 0x21, 0x80,
0x22, 0xa0, 0x01, 0x09, 0x05, 0xd2, 0xf7, 0xff, 0xff, 0xb9, 0x28, 0x00, 0xd0, 0x01, 0x23, 0x01,
0xe0, 0x00, 0x23, 0x02, 0x4a, 0x02, 0x1c, 0x20, 0x60, 0x53, 0xf7, 0xff, 0xed, 0xf6, 0xbd, 0x10,
0x13, 0x70, 0x21, 0x30, 0xb5, 0x10, 0x22, 0x00, 0x1c, 0x04,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a, 0x23, 0x1d, 0x42, 0x1a, 0xd0, 0x04, 0x1c, 0x30,
0x1c, 0x39, 0xf7, 0xff, 0xff, 0x3f, 0x1c, 0x04, 0x2c, 0x00, 0xd0, 0x00, 0xe0, 0xd5, 0xf7, 0xff,
0xff, 0x1d, 0xe0, 0xd2, 0x68, 0x23, 0x07, 0x9a, 0xd4, 0x00, 0xe0, 0xbd, 0x68, 0x41, 0x68, 0x82,
0xe0, 0x05, 0x68, 0x69, 0x68, 0xaa, 0x2b, 0xd0, 0xd1, 0x01, 0x02, 0xc9, 0x02, 0x52, 0x1c, 0x30,
0xe0, 0x02, 0x1c, 0x08, 0x22, 0x40, 0x1c, 0x39, 0xf7, 0xff, 0xfe, 0xd0, 0xe0, 0xb1, 0x68, 0x22,
0x23, 0x1d, 0x42, 0x1a, 0xd1, 0x00, 0xe0, 0xa7, 0x68, 0x43, 0x68, 0x82, 0x07, 0x9b, 0x43, 0x13,
0x4a, 0x56, 0x40, 0x13, 0x60, 0xe3, 0xe0, 0xaf, 0x68, 0x22, 0x23, 0x1d, 0x42, 0x1a, 0xd0, 0x00,
0xe0, 0xaa, 0xe0, 0x99, 0x68, 0x22, 0x23, 0x1d, 0x42, 0x1a, 0xd1, 0x00, 0xe0, 0x94, 0x4a, 0x50,
0x4b, 0x4d, 0x24, 0xa0, 0x61, 0x1a, 0x02, 0x24, 0xe0, 0x9f, 0x68, 0x21, 0x23, 0x1c, 0x42, 0x19,
0xd1, 0x00, 0xe0, 0x89, 0x60, 0x32, 0xe0, 0x97, 0x4b, 0x47, 0x22, 0x1c, 0x68, 0x19, 0x42, 0x11,
0xd1, 0x02, 0x69, 0x1b, 0x2b, 0x00, 0xd0, 0x7f, 0x4b, 0x43, 0x69, 0x1b, 0xe0, 0x45, 0x68, 0x43,
0x60, 0xa3, 0xe0, 0x89, 0x68, 0xa3, 0xe0, 0x40, 0x68, 0x43, 0x2b, 0x00, 0xd0, 0x03, 0x68, 0x22,
0x23, 0x02, 0x43, 0x13, 0xe0, 0x02, 0x68, 0x23, 0x22, 0x02, 0x43, 0x93, 0x60, 0x23, 0xe0, 0x7b,
0x68, 0x22, 0x23, 0x02, 0xe0, 0x30, 0x68, 0x46, 0xf0, 0x00, 0xf9, 0xb4, 0x68, 0x23, 0x22, 0x04,
0x43, 0x93, 0x60, 0x23, 0x2e, 0x00, 0xd0, 0x6f, 0x1c, 0x29, 0x1e, 0x70, 0x31, 0x08, 0xf0, 0x00,
0xf9, 0xb7, 0x1c, 0x04, 0x28, 0x00, 0xd1, 0x68, 0x4b, 0x2f, 0x22, 0x04, 0x68, 0x19, 0xe0, 0x16,
0x68, 0x22, 0x23, 0x04, 0xe0, 0x18, 0x68, 0x45, 0xf7, 0xff, 0xfd, 0x2c, 0x68, 0x23, 0x22, 0x08,
0x43, 0x93, 0x60, 0x23, 0x2d, 0x00, 0xd0, 0x57, 0x1c, 0x28, 0xf0, 0x00, 0xe9, 0x5c, 0xf7, 0xff,
0xfd, 0x2f, 0x1c, 0x04, 0x28, 0x00, 0xd1, 0x50, 0x4b, 0x23, 0x22, 0x08, 0x68, 0x19, 0x43, 0x0a,
0x60, 0x1a, 0xe0, 0x4a, 0x68, 0x22, 0x23, 0x08, 0x40, 0x13, 0x60, 0x33, 0xe0, 0x44, 0x68, 0x43,
0x68, 0x87, 0x93, 0x00, 0x68, 0xc5, 0xf0, 0x00, 0xfa, 0x8b, 0x68, 0x23, 0x22, 0x10, 0x43, 0x93,
0x60, 0x23, 0x2f, 0x00, 0xd0, 0x38, 0x9a, 0x00, 0x2a, 0x00, 0xd0, 0x35, 0x2d, 0x00, 0xd0, 0x33,
0x1c, 0x38, 0xf0, 0x00, 0xe9, 0x38, 0x1c, 0x2a, 0x1c, 0x01, 0x98, 0x00, 0xf0, 0x00, 0xfb, 0xc8,
0x60, 0x30, 0x28, 0x00, 0xdd, 0x28, 0x4b, 0x10, 0x22, 0x10, 0x68, 0x19, 0x43, 0x0a, 0x60, 0x1a,
0xe0, 0x22, 0x68, 0x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5,
0xe3, 0xa0, 0x00, 0x00, 0xee, 0x07, 0x0f, 0x15, 0xe1, 0x2f, 0xff, 0x1e, 0xee, 0x13, 0x0f, 0x10,
0xe1, 0x2f, 0xff, 0x1e, 0xee, 0x03, 0x0f, 0x10, 0xe1, 0x2f, 0xff, 0x1e, 0xef, 0x00, 0x00, 0xcc,
0xe1, 0x2f, 0xff, 0x1e, 0xe3, 0xc0, 0x01, 0x02, 0xe1, 0x2f, 0xff, 0x1e, 0xe3, 0x80, 0x01, 0x02,
0xe1, 0x2f, 0xff, 0x1e, 0x13, 0x70, 0x21, 0x00, 0xb5, 0x70, 0x4c, 0x13, 0x1c, 0x06, 0x68, 0x20,
0x23, 0x04, 0x62, 0x02, 0x1c, 0x02, 0x32, 0x20, 0x60, 0x02, 0x32, 0x20, 0xb0, 0x82, 0x64, 0x01,
0x60, 0x43, 0x60, 0x82, 0x60, 0xc3, 0x61, 0x41, 0x61, 0x06, 0x1c, 0x0d, 0x21, 0x44, 0xf7, 0xff,
0xef, 0xa6, 0x4b, 0x0a, 0x49, 0x0a, 0x68, 0x18, 0x68, 0x23, 0x22, 0x02, 0x93, 0x00, 0x23, 0x01,
0xf7, 0xff, 0xef, 0x70, 0x1c, 0x04, 0x28, 0x00, 0xd1, 0x03, 0x1c, 0x30, 0x1c, 0x29, 0xf7, 0xff,
0xef, 0x92, 0xb0, 0x02, 0x1c, 0x20, 0xbd, 0x70, 0x13, 0x70, 0x21, 0x4c, 0x13, 0x70, 0x20, 0x04,
0x57, 0x46, 0x53, 0x02, 0xb5, 0x10, 0x4b, 0x05, 0x68, 0x18, 0x28, 0x00, 0xdd, 0x01, 0xf7, 0xff,
0xef, 0x46, 0x4a, 0x02, 0x23, 0x01, 0x42, 0x5b, 0x60, 0x13, 0xbd, 0x10, 0x13, 0x70, 0x20, 0x04,
0xb5, 0x70, 0x4c, 0x18, 0xb0, 0x82, 0x68, 0x23, 0x1c, 0x05, 0x1c, 0x0e, 0x2b, 0x00, 0xd1, 0x09,
0x20, 0x44, 0x21, 0x20, 0xf7, 0xff, 0xea, 0xf4, 0x60, 0x20, 0x28, 0x00, 0xd1, 0x02, 0x20, 0x16,
0x42, 0x40, 0xe0, 0x1d, 0x4b, 0x10, 0x00, 0xad, 0x58, 0xe8, 0x21, 0x01, 0xf7, 0xff, 0xef, 0x22,
0x4d, 0x0e, 0x60, 0x28, 0x28, 0x00, 0xdb, 0x13, 0x4c, 0x0a, 0x1c, 0x31, 0x68, 0x20, 0x22, 0x06,
0x30, 0x20, 0xf0, 0x00, 0xfa, 0x99, 0x68, 0x23, 0x68, 0x28, 0x1c, 0x1a, 0x32, 0x20, 0x60, 0x1a,
0x22, 0x06, 0x60, 0x5a, 0x49, 0x06, 0x93, 0x00, 0x22, 0x01, 0x23, 0x00, 0xf7, 0xff, 0xef, 0x22,
0xb0, 0x02, 0xbd, 0x70, 0x13, 0x70, 0x21, 0x4c, 0x13, 0x70, 0x20, 0xa0, 0x13, 0x70, 0x20, 0x04,
0x57, 0x46, 0x53, 0x01, 0xb5, 0x10, 0x4c, 0x0e, 0xb0, 0x82, 0x68, 0x23, 0x2b, 0x00, 0xda, 0x14,
0x1c, 0x20, 0x30, 0x20, 0x21, 0x01, 0xf7, 0xff, 0xee, 0xf6, 0x60, 0x20, 0x28, 0x00, 0xda, 0x02,
0x20, 0x0b, 0x42, 0x40, 0xe0, 0x0a, 0x23, 0x00, 0x22, 0x00, 0x49, 0x06, 0x93, 0x00, 0xf7, 0xff,
0xef, 0x02, 0x4a, 0x05, 0x23, 0x80, 0x00, 0x9b, 0x60, 0x13, 0x20, 0x00, 0xb0, 0x02, 0xbd, 0x10,
0x13, 0x70, 0x20, 0x20, 0x55, 0x4d, 0x53, 0x01, 0x13, 0x70, 0x21, 0x60, 0xb5, 0x70, 0x4b, 0x1e,
0xb0, 0x82, 0x68, 0x1b, 0x2b, 0x00, 0xdb, 0x33, 0x4e, 0x1c, 0x1c, 0x33, 0x33, 0x40, 0x62, 0x33,
0x23, 0x04, 0x62, 0x73, 0x62, 0xf3, 0x68, 0x33, 0x64, 0x71, 0x43, 0x59, 0x64, 0x30, 0x1c, 0x34,
0x1c, 0x30, 0x30, 0x44, 0x34, 0x20, 0x62, 0xb0, 0x63, 0x32, 0x63, 0x71, 0x1c, 0x25, 0x36, 0x38,
0x68, 0x28, 0x68, 0x69, 0xf7, 0xff, 0xef, 0x02, 0x35, 0x08, 0x42, 0xb5, 0xd1, 0xf8, 0x4d, 0x0f,
0x21, 0x18, 0x35, 0x20, 0x1c, 0x28, 0xf7, 0xff, 0xee, 0xfa, 0x4b, 0x0b, 0x49, 0x0c, 0x68, 0x18,
0x22, 0x02, 0x23, 0x01, 0x95, 0x00, 0xf7, 0xff, 0xee, 0xc6, 0x28, 0x00, 0xdb, 0x08, 0x68, 0x20,
0x68, 0x61, 0xf7, 0xff, 0xee, 0xe8, 0x34, 0x08, 0x42, 0xb4, 0xd1, 0xf8, 0x20, 0x01, 0xe0, 0x00,
0x20, 0x00, 0xb0, 0x02, 0xbd, 0x70, 0x46, 0xc0, 0x13, 0x70, 0x20, 0x20, 0x13, 0x70, 0x21, 0x60,
0x55, 0x4d, 0x53, 0x03, 0xb5, 0x70, 0x4b, 0x1c, 0xb0, 0x82, 0x68, 0x1c, 0x2c, 0x00, 0xdb, 0x2f,
0x4e, 0x1a, 0x60, 0x30, 0x20, 0x04, 0x62, 0x70, 0x62, 0xf0, 0x68, 0x5b, 0x60, 0x71, 0x43, 0x59,
0x1d, 0x34, 0x62, 0xb4, 0x34, 0x1c, 0x62, 0x36, 0x63, 0x32, 0x63, 0x71, 0x1c, 0x25, 0x36, 0x38,
0x68, 0x28, 0x68, 0x69, 0xf7, 0xff, 0xee, 0xc2, 0x35, 0x08, 0x42, 0xb5, 0xd1, 0xf8, 0x4d, 0x0f,
0x21, 0x18, 0x35, 0x20, 0x1c, 0x28, 0xf7, 0xff, 0xee, 0xba, 0x4b, 0x0b, 0x21, 0x02, 0x68, 0x18,
0x22, 0x02, 0x23, 0x01, 0x95, 0x00, 0xf7, 0xff, 0xee, 0x86, 0x28, 0x00, 0xdb, 0x08, 0x68, 0x20,
0x68, 0x61, 0xf7, 0xff, 0xee, 0xa8, 0x34, 0x08, 0x42, 0xb4, 0xd1, 0xf8, 0x20, 0x01, 0xe0, 0x00,
0x20, 0x00, 0xb0, 0x02, 0xbd, 0x70, 0x46, 0xc0, 0x13, 0x70, 0x20, 0x60, 0x13, 0x70, 0x21, 0xc0,
0xb5, 0x10, 0x4c, 0x0e, 0xb0, 0x82, 0x68, 0x23, 0x2b, 0x00, 0xda, 0x13, 0x1c, 0x20, 0x30, 0x20,
0x21, 0x01, 0xf7, 0xff, 0xee, 0x50, 0x60, 0x20, 0x28, 0x00, 0xda, 0x02, 0x20, 0x0b, 0x42, 0x40,
0xe0, 0x09, 0x23, 0x00, 0x21, 0x01, 0x22, 0x00, 0x93, 0x00, 0xf7, 0xff, 0xee, 0x5c, 0x23, 0x80,
0x00, 0x9b, 0x60, 0x63, 0x20, 0x00, 0xb0, 0x02, 0xbd, 0x10, 0x46, 0xc0, 0x13, 0x70, 0x20, 0x60,
0x4b, 0x02, 0x22, 0x00, 0x60, 0x1a, 0x60, 0x5a, 0x60, 0x9a, 0x47, 0x70, 0x13, 0x70, 0x22, 0x00,
0xb5, 0xf0, 0x4d, 0x33, 0x24, 0xa0, 0xb0, 0x83, 0x0b, 0xcf, 0x00, 0xa4, 0x9e, 0x09, 0x60, 0xef,
0x42, 0xa7, 0xd9, 0x01, 0x4c, 0x2f, 0x60, 0xec, 0x4d, 0x2d, 0x4f, 0x2f, 0x68, 0xec, 0x46, 0x9c,
0x00, 0x64, 0x19, 0x3c, 0x89, 0xa4, 0x61, 0x2c, 0x61, 0x6c, 0x00, 0x67, 0x68, 0x45, 0x19, 0x3f,
0x00, 0xbf, 0x95, 0x00, 0x19, 0xc7, 0x18, 0x55, 0x37, 0x0c, 0x95, 0x01, 0xe0, 0x33, 0x68, 0x3d,
0x42, 0x8d, 0xd8, 0x17, 0x68, 0xbb, 0x18, 0xeb, 0x42, 0x8b, 0xd9, 0x2a, 0x4f, 0x20, 0x1b, 0x4d,
0x46, 0x63, 0x61, 0x7c, 0x61, 0xbd, 0x60, 0x19, 0x00, 0x63, 0x19, 0x1c, 0x00, 0xa4, 0x19, 0x00,
0x69, 0x03, 0x99, 0x08, 0x18, 0xeb, 0x60, 0x0b, 0x69, 0x43, 0x1b, 0x5d, 0x60, 0x35, 0x42, 0x95,
0xd9, 0x2b, 0xe0, 0x14, 0x9b, 0x01, 0x42, 0x9d, 0xd2, 0x13, 0x4f, 0x15, 0x46, 0x63, 0x1a, 0x69,
0x61, 0x7c, 0x61, 0xb9, 0x60, 0x1d, 0x00, 0x63, 0x19, 0x1c, 0x00, 0xa4, 0x19, 0x00, 0x69, 0x03,
0x9c, 0x08, 0x1a, 0x52, 0x60, 0x23, 0x69, 0x43, 0x60, 0x33, 0x42, 0x93, 0xd9, 0x15, 0x60, 0x32,
0xe0, 0x13, 0x34, 0x01, 0x37, 0x0c, 0x9d, 0x00, 0x42, 0xac, 0xd3, 0xc8, 0x4d, 0x08, 0x18, 0x51,
0x61, 0x6c, 0x68, 0x02, 0x46, 0x63, 0x42, 0x91, 0xd9, 0x02, 0x20, 0x02, 0x42, 0x40, 0xe0, 0x05,
0x60, 0x19, 0x99, 0x08, 0x23, 0x00, 0x60, 0x0b, 0x60, 0x33, 0x20, 0x00, 0xb0, 0x03, 0xbd, 0xf0,
0x13, 0x70, 0x27, 0x00, 0x00, 0x00, 0x02, 0x7f, 0x13, 0x70, 0x22, 0x00, 0xb5, 0xf0, 0xb0, 0x85,
0x1c, 0x07, 0x1c, 0x0e, 0x92, 0x03, 0x4c, 0x28, 0xe0, 0x47, 0x4a, 0x28, 0x4b, 0x28, 0x68, 0x50,
0x93, 0x00, 0x1c, 0x23, 0x33, 0x24, 0x93, 0x01, 0x1c, 0x39, 0x9a, 0x03, 0x4b, 0x25, 0xf7, 0xff,
0xff, 0x7f, 0x62, 0xa0,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0x90,
0x00, 0x9b, 0x42, 0x98, 0xd1, 0x01, 0x23, 0x00, 0x63, 0x93, 0x4c, 0x0d, 0x6b, 0xa3, 0x2b, 0x00,
0xd0, 0x10, 0x1c, 0x25, 0x35, 0x40, 0x1c, 0x08, 0x22, 0x01, 0x1c, 0x29, 0xf7, 0xff, 0xff, 0x7e,
0x4b, 0x08, 0x64, 0x18, 0x28, 0x00, 0xd1, 0x09, 0x6b, 0x61, 0x6b, 0xa2, 0x18, 0x69, 0x1c, 0x38,
0xf0, 0x00, 0xf8, 0xba, 0x4b, 0x02, 0x20, 0x00, 0x6b, 0x9b, 0x60, 0x33, 0xbd, 0xf8, 0x46, 0xc0,
0x13, 0x70, 0x27, 0x00, 0x13, 0x70, 0x29, 0x00, 0xb5, 0xf0, 0x4c, 0x1f, 0x1c, 0x07, 0x1c, 0x0d,
0x1c, 0x23, 0xb0, 0x83, 0x1c, 0x10, 0x1c, 0x16, 0x33, 0x44, 0x1c, 0x39, 0x1c, 0x2a, 0xf7, 0xff,
0xff, 0xbb, 0x90, 0x01, 0x64, 0xa0, 0x28, 0x00, 0xd1, 0x2a, 0x6c, 0x63, 0x08, 0x9a, 0x18, 0xff,
0x1a, 0xed, 0x4b, 0x16, 0x18, 0xb6, 0x42, 0x9d, 0xd9, 0x0f, 0x09, 0xf0, 0x0a, 0x6a, 0x64, 0xe0,
0x65, 0x22, 0x1c, 0x39, 0xf7, 0xff, 0xff, 0x4a, 0x64, 0xa0, 0x28, 0x00, 0xd1, 0x19, 0x6d, 0x23,
0x01, 0xda, 0x02, 0x5b, 0x18, 0xb6, 0x18, 0xff, 0x1a, 0xed, 0x2d, 0x00, 0xd0, 0x10, 0x4c, 0x0a,
0x1c, 0x30, 0x1c, 0x23, 0x33, 0x44, 0x1c, 0x39, 0x1c, 0x2a, 0xf7, 0xff, 0xff, 0x95, 0x64, 0xa0,
0x28, 0x00, 0xd1, 0x06, 0x6c, 0x63, 0x42, 0x9d, 0xd0, 0x03, 0x20, 0x05, 0x42, 0x40, 0xe0, 0x00,
0x98, 0x01, 0xb0, 0x03, 0xbd, 0xf0, 0x46, 0xc0, 0x13, 0x70, 0x29, 0x00, 0x00, 0x00, 0x01, 0xff,
0xb5, 0xf0, 0x4b, 0x32, 0x1c, 0x15, 0x68, 0x1a, 0xb0, 0x83, 0x1c, 0x06, 0x1c, 0x0f, 0x2a, 0x00,
0xd0, 0x03, 0x22, 0x00, 0x60, 0x1a, 0x60, 0x5a, 0x60, 0x9a, 0x1e, 0x73, 0x2b, 0x01, 0xd8, 0x4f,
0x2d, 0x00, 0xd0, 0x4d, 0x4b, 0x2a, 0x42, 0x9d, 0xd9, 0x01, 0x25, 0x02, 0xe0, 0x49, 0x4c, 0x29,
0x2e, 0x01, 0xd1, 0x02, 0xf7, 0xff, 0xfd, 0xce, 0xe0, 0x01, 0xf7, 0xff, 0xfe, 0x71, 0x4b, 0x25,
0x65, 0x60, 0x6d, 0x5a, 0x2a, 0x00, 0xd0, 0x01, 0x1c, 0x15, 0xe0, 0x3b, 0x4c, 0x1f, 0x33, 0x58,
0x60, 0x63, 0x60, 0xa6, 0x1c, 0x38, 0x1c, 0x29, 0xf7, 0xff, 0xec, 0xfc, 0x68, 0x60, 0x21, 0x00,
0x4a, 0x1b, 0xf0, 0x00, 0xf8, 0x79, 0x1c, 0x2a, 0x68, 0x60, 0x1c, 0x39, 0xf0, 0x00, 0xf8, 0x34,
0x1c, 0x38, 0x1c, 0x29, 0xf7, 0xff, 0xec, 0xf2, 0x21, 0xa0, 0x68, 0x60, 0x23, 0x00, 0x34, 0x0c,
0x22, 0x00, 0x00, 0x89, 0x03, 0xd6, 0x96, 0x01, 0xe0, 0x01, 0x04, 0x33, 0x0c, 0x1b, 0x00, 0x5e,
0x18, 0xf6, 0x00, 0xb6, 0x19, 0x86, 0x69, 0x77, 0x68, 0xf6, 0x46, 0xbc, 0x9f, 0x01, 0x44, 0x66,
0x42, 0xb7, 0xd3, 0x04, 0x68, 0x47, 0x1c, 0x5e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x40, 0x06, 0x0d, 0x3a, 0x01, 0x0e, 0x2d, 0x24, 0x03, 0xe0, 0x02, 0x2a, 0x00,
0xd0, 0x39, 0x3a, 0x01, 0x70, 0x1d, 0x33, 0x01, 0x42, 0x23, 0xd1, 0xf8, 0x2a, 0x03, 0xd9, 0x29,
0x25, 0xff, 0x40, 0x0d, 0x02, 0x2c, 0x43, 0x25, 0x04, 0x2c, 0x1c, 0x1e, 0x43, 0x25, 0x2a, 0x0f,
0xd9, 0x12, 0x1c, 0x16, 0x1c, 0x1c, 0x3e, 0x10, 0x60, 0x25, 0x60, 0x65, 0x60, 0xa5, 0x60, 0xe5,
0x34, 0x10, 0x2e, 0x0f, 0xd8, 0xf7, 0x3a, 0x10, 0x09, 0x16, 0x36, 0x01, 0x01, 0x36, 0x19, 0x9e,
0x23, 0x0f, 0x40, 0x1a, 0x2a, 0x03, 0xd9, 0x0c, 0x23, 0x00, 0x50, 0xf5, 0x33, 0x04, 0x1a, 0xd4,
0x2c, 0x03, 0xd8, 0xfa, 0x3a, 0x04, 0x08, 0x93, 0x33, 0x01, 0x00, 0x9b, 0x18, 0xf6, 0x23, 0x03,
0x40, 0x1a, 0x1c, 0x33, 0x2a, 0x00, 0xd0, 0x06, 0x06, 0x09, 0x0e, 0x0c, 0x21, 0x00, 0x54, 0x5c,
0x31, 0x01, 0x42, 0x8a, 0xd1, 0xfb, 0xbc, 0x70, 0xbc, 0x02, 0x47, 0x08, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2f, 0x64, 0x65, 0x76,
0x2f, 0x75, 0x73, 0x62, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2f, 0x64, 0x65, 0x76,
0x2f, 0x73, 0x64, 0x69, 0x6f, 0x2f, 0x73, 0x64, 0x68, 0x63, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x70, 0x20, 0xd6,
0x13, 0x70, 0x20, 0xe0, 0x24, 0x49, 0x4f, 0x53, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3a,
0x20, 0x44, 0x49, 0x50, 0x50, 0x3a, 0x20, 0x4d, 0x61, 0x72, 0x20, 0x20, 0x37, 0x20, 0x32, 0x30,
0x31, 0x30, 0x20, 0x31, 0x31, 0x3a, 0x35, 0x34, 0x3a, 0x32, 0x36, 0x20, 0x36, 0x34, 0x4d, 0x24,
0x0a, 0x00, 0x2f, 0x64, 0x65, 0x76, 0x2f, 0x75, 0x73, 0x62, 0x32, 0x00, 0x2f, 0x64, 0x65, 0x76,
0x2f, 0x73, 0x64, 0x69, 0x6f, 0x2f, 0x73, 0x64, 0x68, 0x63, 0x00, 0x00
};

View File

@ -0,0 +1,3 @@
#define size_dip_plugin_249 5276
extern unsigned char dip_plugin_249[5276];

View File

@ -1,291 +0,0 @@
/*
From Custom IOS Module (FAT)
Copyright (C) 2009 Waninkoko.
Copyright (C) 2010 Hermes.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "fatffs_util.h"
#include <string.h>
#include <sys/dir.h>
#include <sys/stat.h>
#include <stdio.h>
#include <malloc.h>
extern u32 nand_mode;
s32 FAT_DeleteDir(const char *dirpath)
{
DIR_ITER *dir;
s32 ret;
/* Open directory */
dir = diropen(dirpath);
if (!dir)
return -1;
/* Read entries */
for (;;) {
char filename[256], newpath[256];
struct stat filestat;
/* Read entry */
if (dirnext(dir, filename, &filestat))
break;
/* Non valid entry */
if (filename[0]=='.')
continue;
/* Generate entry path */
strcpy(newpath, dirpath);
strcat(newpath, "/");
strcat(newpath, filename);
/* Delete directory contents */
if (filestat.st_mode & S_IFDIR)
FAT_DeleteDir(newpath);
/* Delete object */
ret = remove(newpath);
/* Error */
if (ret != 0)
break;
}
/* Close directory */
dirclose(dir);
return 0;
}
static int global_error=0;
static char temp_read_buffer[16384] ATTRIBUTE_ALIGN(32);
s32 _FFS_to_FAT_Copy(const char *ffsdirpath, const char *fatdirpath)
{
int n;
u32 blocks, ionodes;
int pos=0;
char *list;
s32 ret;
u32 ionodes_temp;
if(ISFS_GetUsage(ffsdirpath, &blocks, &ionodes)) {global_error=-1;return -1;}
list= memalign(32, ionodes*13);
if(!list) {global_error=-2;return -2;}
if(ISFS_ReadDir(ffsdirpath, list , &ionodes)) {free(list);global_error=-3;return -3;}
if(ionodes) mkdir(fatdirpath, S_IRWXO | S_IRWXG | S_IRWXU);
/* Read entries */
for (n=0;n<ionodes;n++) {
char * filename;
char newffspath[256], newfatpath[256];
/* Read entry */
filename=&list[pos];
pos+=strlen(&list[pos])+1;
/* Non valid entry */
if (filename[0]=='.')
continue;
/* Generate entry path */
strcpy(newffspath, ffsdirpath);
strcat(newffspath, "/");
strcat(newffspath, filename);
strcpy(newfatpath, fatdirpath);
strcat(newfatpath, "/");
strcat(newfatpath, filename);
ret=ISFS_ReadDir(newffspath, NULL, &ionodes_temp);
if(ret==0) // it is a directory
{
_FFS_to_FAT_Copy(newffspath, newfatpath);
if(global_error) {free(list);return global_error;}
}
else // copy the file
{
int fd;
FILE *fp;
fd=ISFS_Open(newffspath, ISFS_OPEN_READ);
if(fd<0)
{
global_error=-4;
free(list);return global_error;
}
else
{
int len;
fp=fopen(newfatpath,"w");
if(!fd) {ISFS_Close(fd);global_error=-5;free(list);return global_error;}
len= ISFS_Seek(fd, 0, 2);
//if(len<0) {ISFS_Close(fd);global_error=-6;free(list);return global_error;}
ISFS_Seek(fd, 0, 0);
while(len>0)
{
ret=len; if(len>16384) ret=16384;
if(ISFS_Read(fd, temp_read_buffer, ret)!=ret)
{
global_error=-7;
break;
}
if(fwrite(temp_read_buffer, 1, ret, fp)!=ret)
{
global_error=-8;
break;
}
len-=ret;
}
fclose(fp);
ISFS_Close(fd);
if(global_error) {free(list);return global_error;}
}
}
}
free(list);
return 0;
}
s32 FFS_to_FAT_Copy(const char *ffsdirpath, const char *fatdirpath)
{
u32 blocks, ionodes;
int ret;
char create_dir[256];
ISFS_Initialize();
ret=ISFS_GetUsage(ffsdirpath, &blocks, &ionodes);
if(ret==0)
{
int n=0;
// creating the path directory
strcpy(create_dir, fatdirpath);
while(create_dir[n]!=0 && create_dir[n]!='/') n++;
if(create_dir[n]=='/') n++;
while(create_dir[n]!=0)
{
if(create_dir[n]=='/')
{
create_dir[n]=0;
mkdir(create_dir, S_IRWXO | S_IRWXG | S_IRWXU);
create_dir[n]='/';
}
n++;
}
global_error=0;
// copy files
_FFS_to_FAT_Copy(ffsdirpath, fatdirpath);
ret=global_error=0;
}
else ret=-101;
ISFS_Deinitialize();
return ret;
}
static char temp_cad[512];
void create_FAT_FFS_Directory(struct discHdr *header)
{
char device[2][4]={
"sd:",
"ud:"
};
if(!header) return;
sprintf((char *) temp_cad,"%s/nand%c", &device[(nand_mode & 2)!=0][0], (nand_mode & 0xc) ? 49+((nand_mode>>2) & 3) : '\0');
sprintf((char *) temp_cad+32,"%2.2x%2.2x%2.2x%2.2x", header->id[0], header->id[1], header->id[2], header->id[3]);
sprintf((char *) temp_cad+64,"%s/title/00010000/%s", temp_cad, temp_cad+32);
sprintf((char *) temp_cad+128,"%s/title/00010004/%s", temp_cad, temp_cad+32);
sprintf((char *) temp_cad+256,"/title/00010000/%s", temp_cad+32);
sprintf((char *) temp_cad+384,"/title/00010004/%s", temp_cad+32);
}
int test_FAT_game(char * directory)
{
DIR_ITER * dir=NULL;
dir= diropen(directory);
if(dir) {dirclose(dir);return 1;}
return 0;
}
char *get_FAT_directory1(void)
{
return temp_cad+64;
}
char *get_FAT_directory2(void)
{
return temp_cad+128;
}
char *get_FFS_directory1(void)
{
return temp_cad+256;
}
char *get_FFS_directory2(void)
{
return temp_cad+384;
}

View File

@ -1,24 +0,0 @@
#ifndef _FAT_UTIL_
#define _FAT_UTIL_
#include <gctypes.h>
#include "usbloader/disc.h"
s32 FAT_DeleteDir(const char *dirpath);
s32 FFS_to_FAT_Copy(const char *ffsdirpath, const char *fatdirpath);
void create_FAT_FFS_Directory(struct discHdr *header);
int test_FAT_game(char * directory);
char *get_FAT_directory1(void);
char *get_FAT_directory2(void);
char *get_FFS_directory1(void);
char *get_FFS_directory2(void);
#endif

View File

@ -484,115 +484,52 @@ return ret;
} }
/* int mload_get_version()
int load_ehc_module()
{ {
int is_ios=0; int ret;
FILE *fp; if(mload_init()<0) return -1;
ret = IOS_IoctlvFormat(hid, mload_fd, MLOAD_GET_MLOAD_VERSION, ":");
if(!external_ehcmodule) return ret;
{
fp=fopen("SD:/apps/usbloader_gx/ehcmodule.elf","rb");
if(fp==NULL)
fp=fopen("SD:/apps/usbloadergx/ehcmodule.elf","rb");
if(fp!=NULL)
{
fseek(fp, 0, SEEK_END);
size_external_ehcmodule = ftell(fp);
external_ehcmodule = memalign(32, size_external_ehcmodule);
if(!external_ehcmodule)
{fclose(fp);}
else
{
fseek(fp, 0, SEEK_SET);
if(fread(external_ehcmodule,1, size_external_ehcmodule ,fp)!=size_external_ehcmodule)
{free(external_ehcmodule); external_ehcmodule=NULL;}
fclose(fp);
}
}
} }
if(!external_ehcmodule)
/* IOS info structure */
typedef struct {
/* Syscall base */
u32 syscall;
/* Module versions */
u32 dipVersion;
u32 esVersion;
u32 ffsVersion;
u32 iopVersion;
} iosInfo;
int wanin_mload_get_IOS_base()
{ {
int ret;
iosInfo ios;
memset(&ios, 0, sizeof(ios));
if(mload_init()<0) return -1; if(mload_init()<0) return -1;
if (IOS_GetRevision() == 4) { ret= IOS_IoctlvFormat(hid, mload_fd, MLOAD_GET_IOS_BASE, ":d", &ios, sizeof(ios));
gprintf("Loading ehcmodule v4\n"); //printf("get_ios_base: %d %x\n", ret, ios.dipVersion);
mload_elf((void *) ehcmodule_frag_v4_bin, &my_data_elf); if (ret == 0) {
} else if (IOS_GetRevision() == 0) { // 0? Strange value for v5 ehcmodule switch(ios.dipVersion) {
gprintf("Loading ehcmodule v5\n"); case 0x48776F72: /* DIP: 07/11/08 14:34:26 */
mload_elf((void *) ehcmodule_frag_v5_bin, &my_data_elf); return 37;
case 0x4888E14C: /* DIP: 07/24/08 20:08:44 */
return 38;
case 0x4A262AF5: /* DIP: 06/03/09 07:49:09 */
return 57;
case 0x492ACA9D: /* DIP: 11/24/08 15:39:09 */
return 60;
} }
thread_id = mload_run_thread(my_data_elf.start, my_data_elf.stack, my_data_elf.size_stack, my_data_elf.prio);
if(thread_id < 0) return -1;
} }
else return ret;
{
if(mload_init()<0) return -1;
mload_elf((void *) external_ehcmodule, &my_data_elf);
thread_id = mload_run_thread(my_data_elf.start, my_data_elf.stack, my_data_elf.size_stack, my_data_elf.prio);
if(thread_id<0) return -1;
} }
usleep(350*1000);
// Test for IOS
mload_seek(0x20207c84, SEEK_SET);
mload_read(patch_datas, 4);
if(patch_datas[0]==0x6e657665)
{
is_ios=38;
}
else
{
is_ios=36;
}
if(is_ios==36)
{
// IOS 36
memcpy(ios_36, dip_plugin, 4); // copy the entry_point
memcpy((void *) dip_plugin, ios_36, 4*10); // copy the adresses from the array
mload_seek(0x1377E000, SEEK_SET); // copy dip_plugin in the starlet
mload_write(dip_plugin,size_dip_plugin);
// enables DIP plugin
mload_seek(0x20209040, SEEK_SET);
mload_write(ios_36, 4);
}
if(is_ios==38)
{
// IOS 38
memcpy(ios_38, dip_plugin, 4); // copy the entry_point
memcpy((void *) dip_plugin, ios_38, 4*10); // copy the adresses from the array
mload_seek(0x1377E000, SEEK_SET); // copy dip_plugin in the starlet
mload_write(dip_plugin,size_dip_plugin);
// enables DIP plugin
mload_seek(0x20208030, SEEK_SET);
mload_write(ios_38, 4);
}
mload_close();
return 0;
}
int patch_cios_data() {
patch_datas[0]=*((u32 *) (dip_plugin+16*4));
mload_set_ES_ioctlv_vector((void *) patch_datas[0]);
return 1;
}
*/

View File

@ -28,6 +28,8 @@
#define MLOAD_MLOAD_THREAD_ID 0x4D4C4400 #define MLOAD_MLOAD_THREAD_ID 0x4D4C4400
#define MLOAD_GET_IOS_BASE 0x4D4C4401 #define MLOAD_GET_IOS_BASE 0x4D4C4401
#define MLOAD_GET_MLOAD_VERSION 0x4D4C4402
#define MLOAD_LOAD_MODULE 0x4D4C4480 #define MLOAD_LOAD_MODULE 0x4D4C4480
#define MLOAD_RUN_MODULE 0x4D4C4481 #define MLOAD_RUN_MODULE 0x4D4C4481
#define MLOAD_RUN_THREAD 0x4D4C4482 #define MLOAD_RUN_THREAD 0x4D4C4482

View File

@ -1,12 +1,11 @@
#include "mload_modules.h" #include "mload_modules.h"
#include "ehcmodule_frag_v4_bin.h" #include "ehcmodule_frag_bin.h"
#include "ehcmodule_frag_v5_bin.h" #include "dip_plugin_249.h"
#include "sys.h"
#include "gecko.h" #include "gecko.h"
#define ALIGNED(x) __attribute__((aligned(x))) #define ALIGNED(x) __attribute__((aligned(x)))
#define DEBUG_MLOAD
/* Used for Hermes NAND emulation */ /* Used for Hermes NAND emulation */
int global_mount; int global_mount;
int sd_ok=0; int sd_ok=0;
@ -83,7 +82,6 @@ static u32 ios_60[16] ATTRIBUTE_ALIGN(32)=
0x20203750+1, // ios_printf (thumb) 0x20203750+1, // ios_printf (thumb)
}; };
u32 patch_datas[8] ATTRIBUTE_ALIGN(32); u32 patch_datas[8] ATTRIBUTE_ALIGN(32);
data_elf my_data_elf; data_elf my_data_elf;
@ -93,105 +91,19 @@ int size_external_ehcmodule=0;
static int my_thread_id=0; static int my_thread_id=0;
int load_ehc_module() int load_ehc_module_hermes()
{ {
int is_ios=0; int is_ios=0;
#if 0
FILE *fp;
// WARNING!!!: load external module suspended
if(sd_ok && !external_ehcmodule)
{
fp=fopen("sd:/apps/usbloader_gx/ehcmodule.elf","rb");
if(fp==NULL)
fp=fopen("sd:/apps/usbloadergx/ehcmodule.elf","rb");
if(fp!=0)
{
fseek(fp, 0, SEEK_END);
size_external_ehcmodule = ftell(fp);
external_ehcmodule= memalign(32, size_external_ehcmodule);
if(!external_ehcmodule)
{fclose(fp);}
else
{
fseek(fp, 0, SEEK_SET);
if(fread(external_ehcmodule,1, size_external_ehcmodule ,fp)!=size_external_ehcmodule)
{free(external_ehcmodule); external_ehcmodule=NULL;}
fclose(fp);
}
}
}
#endif
/*
if(mload_init()<0) return -1; if(mload_init()<0) return -1;
mload_elf((void *) logmodule, &my_data_elf); mload_elf((void *) ehcmodule_frag_bin, &my_data_elf);
my_thread_id= mload_run_thread(my_data_elf.start, my_data_elf.stack, my_data_elf.size_stack, my_data_elf.prio); my_thread_id= mload_run_thread(my_data_elf.start, my_data_elf.stack, my_data_elf.size_stack, my_data_elf.prio);
if(my_thread_id<0) return -1; if(my_thread_id<0) return -2;
*/
if(!external_ehcmodule)
{
#ifdef DEBUG_MLOAD
gprintf("before mload_init\n");
#endif
if(mload_init()<0) return -1;
#ifdef DEBUG_MLOAD
gprintf("after mload_init\n");
#endif
if (IOS_GetRevision() == 4) {
#ifdef DEBUG_MLOAD
gprintf("Loading ehcmodule v4\n");
#endif
mload_elf((void *) ehcmodule_frag_v4_bin, &my_data_elf);
} else if (IOS_GetRevision() == 65535) {
#ifdef DEBUG_MLOAD
gprintf("Loading ehcmodule v5\n");
#endif
mload_elf((void *) ehcmodule_frag_v5_bin, &my_data_elf);
} else {
return -2;
}
// mload_elf((void *) ehcmodule, &my_data_elf);
#ifdef DEBUG_MLOAD
gprintf("before mload_run_thread\n");
#endif
my_thread_id= mload_run_thread(my_data_elf.start, my_data_elf.stack, my_data_elf.size_stack, my_data_elf.prio);
if(my_thread_id<0) return -1;
//if(mload_module(ehcmodule, size_ehcmodule)<0) return -1;
}
else
{
//if(mload_module(external_ehcmodule, size_external_ehcmodule)<0) return -1;
if(mload_init()<0) return -1;
mload_elf((void *) external_ehcmodule, &my_data_elf);
my_thread_id= mload_run_thread(my_data_elf.start, my_data_elf.stack, my_data_elf.size_stack, my_data_elf.prio);
if(my_thread_id<0) return -1;
}
usleep(350*1000); usleep(350*1000);
// Test for IOS // Test for IOS
#if 0
mload_seek(0x20207c84, SEEK_SET);
mload_read(patch_datas, 32);
if(patch_datas[0]==0x6e657665 )
{
is_ios=38;
}
else
{
is_ios=36;
}
#endif
is_ios=mload_get_IOS_base(); is_ios=mload_get_IOS_base();
switch(is_ios) switch(is_ios)
@ -264,11 +176,39 @@ gprintf("before mload_init\n");
} }
mload_close();
return 0; return 0;
} }
int load_dip_249()
{
gprintf("load_dip_249\n");
int ret = -1;
if (is_ios_type(IOS_TYPE_WANIN) && IOS_GetRevision() >= 18)
{
gprintf("mload_init\n");
if(mload_init()<0) {
return -2;
}
gprintf("mload_module\n");
ret = mload_module(dip_plugin_249, size_dip_plugin_249);
gprintf("mload_close\n");
mload_close();
}
gprintf("mload done\n");
return ret;
}
int load_ehc_module()
{
if (is_ios_type(IOS_TYPE_HERMES))
return load_ehc_module_hermes();
else if (is_ios_type(IOS_TYPE_WANIN))
return load_dip_249();
return -1;
}
#if 0
#define IOCTL_FAT_MOUNTSD 0xF0 #define IOCTL_FAT_MOUNTSD 0xF0
#define IOCTL_FAT_UMOUNTSD 0xF1 #define IOCTL_FAT_UMOUNTSD 0xF1
#define IOCTL_FAT_MOUNTUSB 0xF2 #define IOCTL_FAT_MOUNTUSB 0xF2
@ -428,6 +368,8 @@ s32 ret;
return ret; return ret;
} }
#endif
void enable_ES_ioctlv_vector(void) void enable_ES_ioctlv_vector(void)
{ {
patch_datas[0]=*((u32 *) (dip_plugin+16*4)); patch_datas[0]=*((u32 *) (dip_plugin+16*4));
@ -463,11 +405,7 @@ void test_and_patch_for_port1()
u8 * ehc_data = NULL; u8 * ehc_data = NULL;
if (IOS_GetRevision() == 4) { ehc_data=search_for_ehcmodule_cfg((void *) ehcmodule_frag_bin, ehcmodule_frag_bin_size);
ehc_data=search_for_ehcmodule_cfg((void *) ehcmodule_frag_v4_bin, ehcmodule_frag_v4_bin_size);
} else if (IOS_GetRevision() == 65535) {
ehc_data=search_for_ehcmodule_cfg((void *) ehcmodule_frag_v5_bin, ehcmodule_frag_v5_bin_size);
}
if(ehc_data) if(ehc_data)
{ {

View File

@ -32,7 +32,7 @@
#include "fatmounter.h" #include "fatmounter.h"
#include "settings/cfg.h" #include "settings/cfg.h"
#include "mload/mload.h" #include "mload/mload.h"
#include "mload/dip_plugin.h" #include "mload/mload_modules.h"
#include "gecko.h" #include "gecko.h"
#include "patchcode.h" #include "patchcode.h"
@ -830,9 +830,7 @@ u32 do_bca_code(u8 *gameid)
} }
} }
mload_seek(*((u32 *) (dip_plugin+15*4)), SEEK_SET); // offset 15 (bca_data area) Set_DIP_BCA_Datas((u8 *) &bcaCode);
mload_write(bcaCode, 64);
mload_close();
} }
return 0; return 0;
} }

View File

@ -1772,14 +1772,6 @@ DiscWait(const char *title, const char *msg, const char *btn1Label, const char *
while (i >= 0) { while (i >= 0) {
VIDEO_WaitVSync(); VIDEO_WaitVSync();
timerTxt.SetTextf("%u %s", i,tr("seconds left")); timerTxt.SetTextf("%u %s", i,tr("seconds left"));
/* HaltGui();
if (Settings.cios == ios222) {
ret = IOS_ReloadIOS(222);
load_ehc_module();
} else {
ret = IOS_ReloadIOS(249);
}
ResumeGui();*/
sleep(1); sleep(1);
USBDevice_deInit(); USBDevice_deInit();
USBDevice_Init(); USBDevice_Init();

View File

@ -205,7 +205,7 @@ int TitleBrowser(u32 type) {
} }
} }
if (!found) { if (!found) {
if (getName00(name[i], TITLE_ID(0x00010002, sys_titles[i-num_titles]))>=0) if (getName00(name[i], TITLE_ID(0x00010002, sys_titles[i-num_titles]), 2)>=0)
found=2; found=2;
if (!found) { if (!found) {

View File

@ -47,20 +47,12 @@ static const char *opts_no_yes[settings_off_on_max] = {trNOOP("No"),trNOOP("Yes"
static const char *opts_off_on[settings_off_on_max] = {trNOOP("OFF"),trNOOP("ON") }; static const char *opts_off_on[settings_off_on_max] = {trNOOP("OFF"),trNOOP("ON") };
static const char *opts_videomode[settings_language_max][2] = {{"",trNOOP("Disc Default")},{trNOOP("System Default"),""},{trNOOP("AutoPatch"),""},{trNOOP("Force"), " PAL50"},{trNOOP("Force")," PAL60"},{trNOOP("Force")," NTSC"}}; static const char *opts_videomode[settings_language_max][2] = {{"",trNOOP("Disc Default")},{trNOOP("System Default"),""},{trNOOP("AutoPatch"),""},{trNOOP("Force"), " PAL50"},{trNOOP("Force")," PAL60"},{trNOOP("Force")," NTSC"}};
static const char *opts_language[settings_language_max] = {trNOOP("Console Default"),trNOOP("Japanese"),trNOOP("English"),trNOOP("German"),trNOOP("French"),trNOOP("Spanish"),trNOOP("Italian"),trNOOP("Dutch"),trNOOP("SChinese"),trNOOP("TChinese"),trNOOP("Korean")}; static const char *opts_language[settings_language_max] = {trNOOP("Console Default"),trNOOP("Japanese"),trNOOP("English"),trNOOP("German"),trNOOP("French"),trNOOP("Spanish"),trNOOP("Italian"),trNOOP("Dutch"),trNOOP("SChinese"),trNOOP("TChinese"),trNOOP("Korean")};
static const char *opts_cios[settings_ios_max] = {"IOS 249","IOS 222", "IOS 223", "IOS 250"}; static const char *opts_cios[settings_cios_max] = {"IOS 249","IOS 222", "IOS 223", "IOS 224", "IOS 250"};
static const char *opts_parentalcontrol[5] = {trNOOP("0 (Everyone)"),trNOOP("1 (Child 7+)"),trNOOP("2 (Teen 12+)"),trNOOP("3 (Mature 16+)"),trNOOP("4 (Adults Only 18+)")}; static const char *opts_parentalcontrol[5] = {trNOOP("0 (Everyone)"),trNOOP("1 (Child 7+)"),trNOOP("2 (Teen 12+)"),trNOOP("3 (Mature 16+)"),trNOOP("4 (Adults Only 18+)")};
static const char *opts_error002[settings_error002_max] = {trNOOP("No"),trNOOP("Yes"),trNOOP("Anti")}; static const char *opts_error002[settings_error002_max] = {trNOOP("No"),trNOOP("Yes"),trNOOP("Anti")};
static const char *opts_partitions[settings_partitions_max] = {trNOOP("Game partition"),trNOOP("All partitions"), trNOOP("Remove update")}; static const char *opts_partitions[settings_partitions_max] = {trNOOP("Game partition"),trNOOP("All partitions"), trNOOP("Remove update")};
static const char *opts_installdir[settings_installdir_max] = {trNOOP("None"), trNOOP("GAMEID_Gamename"), trNOOP("Gamename [GAMEID]")}; static const char *opts_installdir[settings_installdir_max] = {trNOOP("None"), trNOOP("GAMEID_Gamename"), trNOOP("Gamename [GAMEID]")};
bool IsValidPartition(int fs_type, int cios) {
if (cios == 249 || cios == 250) {
return fs_type == FS_TYPE_WBFS;
} else {
return fs_type == FS_TYPE_WBFS || fs_type == FS_TYPE_FAT32 || fs_type == FS_TYPE_NTFS;
}
}
/**************************************************************************** /****************************************************************************
* MenuSettings * MenuSettings
***************************************************************************/ ***************************************************************************/
@ -1003,9 +995,6 @@ int MenuSettings()
if (++Settings.cios >= settings_cios_max) { if (++Settings.cios >= settings_cios_max) {
Settings.cios = 0; Settings.cios = 0;
} }
if ((Settings.cios == 1 && ios222rev!=4) || (Settings.cios == 2 && ios223rev != 4)) {
WindowPrompt(tr("Hermes CIOS"),tr("USB Loader GX will only run with Hermes CIOS rev 4! Please make sure you have revision 4 installed!"),tr("OK"));
}
} }
if (Settings.godmode == 1) if (Settings.godmode == 1)
options2.SetValue(Idx, "%s", opts_cios[Settings.cios]); options2.SetValue(Idx, "%s", opts_cios[Settings.cios]);
@ -1017,13 +1006,8 @@ int MenuSettings()
{ {
if (firstRun) options2.SetName(Idx, "%s", tr("Partition")); if (firstRun) options2.SetName(Idx, "%s", tr("Partition"));
if (ret == Idx) { if (ret == Idx) {
// Select the next valid partition, even if that's the same one
do
{
Settings.partition = Settings.partition + 1 == partitions.num ? 0 : Settings.partition + 1; Settings.partition = Settings.partition + 1 == partitions.num ? 0 : Settings.partition + 1;
} }
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);
@ -2218,7 +2202,6 @@ int MenuSettings()
return menu; return menu;
} }
/******************************************************************************** /********************************************************************************
*Game specific settings *Game specific settings
*********************************************************************************/ *********************************************************************************/
@ -2438,9 +2421,8 @@ int GameSettings(struct discHdr * header)
mainWindow->Append(&w); mainWindow->Append(&w);
CFG_set_game_default();
if (game_cfg) {
if (game_cfg) { //if there are saved settings for this game use them
videoChoice = game_cfg->video; videoChoice = game_cfg->video;
languageChoice = game_cfg->language; languageChoice = game_cfg->language;
ocarinaChoice = game_cfg->ocarina; ocarinaChoice = game_cfg->ocarina;
@ -2454,35 +2436,11 @@ int GameSettings(struct discHdr * header)
reloadblock = game_cfg->iosreloadblock; reloadblock = game_cfg->iosreloadblock;
strlcpy(alternatedname, game_cfg->alternatedolname, sizeof(alternatedname)); strlcpy(alternatedname, game_cfg->alternatedolname, sizeof(alternatedname));
} }
else
{
videoChoice = Settings.video;
languageChoice = Settings.language;
ocarinaChoice = Settings.ocarina;
viChoice = Settings.vpatch;
if (Settings.cios == ios222)
iosChoice = i222;
else if (Settings.cios == ios250)
iosChoice = i250;
else if (Settings.cios == ios223)
iosChoice = i223;
else
iosChoice = i249;
parentalcontrolChoice = 0;
fix002 = Settings.error002;
countrystrings = Settings.patchcountrystrings;
alternatedol = off;
alternatedoloffset = 0;
reloadblock = off;
strcpy(alternatedname, "");
}
ResumeGui(); ResumeGui();
while (MainButton1.GetEffect() > 0) usleep(50); while (MainButton1.GetEffect() > 0) usleep(50);
while (menu == MENU_NONE) while (menu == MENU_NONE)
{ {
VIDEO_WaitVSync (); VIDEO_WaitVSync ();
@ -2633,7 +2591,7 @@ int GameSettings(struct discHdr * header)
if(ret == ++Idx || firstRun) if(ret == ++Idx || firstRun)
{ {
if(firstRun) options2.SetName(Idx, "IOS"); if(firstRun) options2.SetName(Idx, "IOS");
if(ret == Idx && ++iosChoice >= settings_ios_max) if(ret == Idx && ++iosChoice >= settings_cios_max)
iosChoice = 0; iosChoice = 0;
options2.SetValue(Idx,"%s",opts_cios[iosChoice]); options2.SetValue(Idx,"%s",opts_cios[iosChoice]);
} }
@ -2972,25 +2930,7 @@ int GameSettings(struct discHdr * header)
int choice1 = WindowPrompt(tr("Are you sure?"),0,tr("Yes"),tr("Cancel")); int choice1 = WindowPrompt(tr("Are you sure?"),0,tr("Yes"),tr("Cancel"));
if (choice1 == 1) if (choice1 == 1)
{ {
videoChoice = Settings.video; CFG_set_game_default();
viChoice = Settings.vpatch;
languageChoice = Settings.language;
ocarinaChoice = Settings.ocarina;
fix002 = Settings.error002;
countrystrings = Settings.patchcountrystrings;
alternatedol = off;
alternatedoloffset = 0;
reloadblock = off;
if (Settings.cios == ios222)
iosChoice = i222;
else if (Settings.cios == ios250)
iosChoice = i250;
else if (Settings.cios == ios223)
iosChoice = i223;
else
iosChoice = i249;
parentalcontrolChoice = 0;
strcpy(alternatedname, "");
CFG_forget_game_opt(header->id); CFG_forget_game_opt(header->id);
/* commented because the database language now depends on the main language setting, this could be enabled again if there is a separate language setting for the database /* commented because the database language now depends on the main language setting, this could be enabled again if there is a separate language setting for the database
// if default language is different than language from main settings, reload titles // if default language is different than language from main settings, reload titles
@ -3036,8 +2976,6 @@ int GameSettings(struct discHdr * header)
w.SetEffect(EFFECT_FADE, -20); w.SetEffect(EFFECT_FADE, -20);
while (w.GetEffect()>0) usleep(50); while (w.GetEffect()>0) usleep(50);
HaltGui(); HaltGui();
mainWindow->RemoveAll(); mainWindow->RemoveAll();

View File

@ -1258,7 +1258,6 @@ void cfg_parsearg(int argc, char **argv)
// PER-GAME SETTINGS // PER-GAME SETTINGS
// return existing or new // return existing or new
struct Game_CFG* cfg_get_game(u8 *id) { struct Game_CFG* cfg_get_game(u8 *id) {
struct Game_CFG *game = CFG_get_game_opt(id); struct Game_CFG *game = CFG_get_game_opt(id);
@ -1269,6 +1268,22 @@ struct Game_CFG* cfg_get_game(u8 *id) {
return game; return game;
} }
void CFG_set_game_default()
{
videoChoice = Settings.video;
viChoice = Settings.vpatch;
languageChoice = Settings.language;
ocarinaChoice = Settings.ocarina;
fix002 = Settings.error002;
countrystrings = Settings.patchcountrystrings;
alternatedol = off;
alternatedoloffset = 0;
reloadblock = off;
iosChoice = Settings.cios;
parentalcontrolChoice = 0;
strcpy(alternatedname, "");
}
// current options to game // current options to game
void cfg_set_game_opt(struct Game_CFG *game, u8 *id) { void cfg_set_game_opt(struct Game_CFG *game, u8 *id) {
strncpy((char*)game->id, (char*)id, 6); strncpy((char*)game->id, (char*)id, 6);
@ -1738,6 +1753,7 @@ struct Game_CFG* CFG_get_game_opt(u8 *id) {
return &cfg_game[i]; return &cfg_game[i];
} }
} }
CFG_set_game_default();
return NULL; return NULL;
} }
@ -1935,3 +1951,21 @@ void GetLanguageToLangCode(int *langid, char *langcode) {
break; break;
} }
} }
int ciosSetting2Cios(int setting)
{
switch (setting) {
case ios222:
return 222;
case ios223:
return 223;
case ios224:
return 224;
case ios250:
return 250;
case ios249:
default:
return 249;
}
}

View File

@ -239,6 +239,7 @@ extern "C" {
void CFG_Load(void); void CFG_Load(void);
struct Game_CFG* CFG_get_game_opt(u8 *id); struct Game_CFG* CFG_get_game_opt(u8 *id);
struct Game_NUM* CFG_get_game_num(u8 *id); struct Game_NUM* CFG_get_game_num(u8 *id);
void CFG_set_game_default();
bool CFG_save_game_opt(u8 *id); bool CFG_save_game_opt(u8 *id);
bool CFG_save_game_num(u8 *id); bool CFG_save_game_num(u8 *id);
bool CFG_reset_all_playcounters(); bool CFG_reset_all_playcounters();
@ -298,18 +299,11 @@ extern "C" {
settings_sinfo_max // always the last entry settings_sinfo_max // always the last entry
}; };
enum {
i249=0,
i222,
i223,
i250,
settings_ios_max // always the last entry
};
enum { enum {
ios249=0, ios249=0,
ios222, ios222,
ios223, ios223,
ios224,
ios250, ios250,
settings_cios_max // always the last entry settings_cios_max // always the last entry
}; };
@ -464,6 +458,8 @@ extern "C" {
void GetLanguageToLangCode(int *langid, char *langcode); void GetLanguageToLangCode(int *langid, char *langcode);
bool OpenXMLDatabase(char* xmlfilepath, char* argdblang, bool argJPtoEN, bool openfile, bool loadtitles, bool freemem); bool OpenXMLDatabase(char* xmlfilepath, char* argdblang, bool argJPtoEN, bool openfile, bool loadtitles, bool freemem);
int ciosSetting2Cios(int setting);
char *get_title(struct discHdr *header); char *get_title(struct discHdr *header);
char *cfg_get_title(u8 *id) ; char *cfg_get_title(u8 *id) ;
void title_set(char *id, char *title); void title_set(char *id, char *title);

View File

@ -2,15 +2,14 @@
#include <ogcsys.h> #include <ogcsys.h>
#include <unistd.h> #include <unistd.h>
#include "settings/cfg.h"
#include "usbloader/wdvd.h" #include "usbloader/wdvd.h"
#include "usbloader/usbstorage2.h" #include "usbloader/usbstorage2.h"
#include "usbloader/disc.h" #include "usbloader/disc.h"
#include "usbloader/wbfs.h" #include "usbloader/wbfs.h"
#include "usbloader/partition_usbloader.h" #include "usbloader/partition_usbloader.h"
#include "mload/mload_modules.h" #include "mload/mload_modules.h"
#include "video.h" // #include "menu.h"
#include "audio.h"
#include "menu.h"
#include "fatmounter.h" #include "fatmounter.h"
#include "sys.h" #include "sys.h"
#include "wpad.h" #include "wpad.h"
@ -18,8 +17,12 @@
extern char game_partition[6]; extern char game_partition[6];
extern u8 load_from_fs; extern u8 load_from_fs;
extern int screenheight;
extern int screenwidth;
//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)
u32 val = (*_wiilight_reg&~0x20); u32 val = (*_wiilight_reg&~0x20);
if (enable && Settings.wiilight) val |= 0x20; if (enable && Settings.wiilight) val |= 0x20;
@ -49,10 +52,14 @@ void Sys_Init(void) {
SYS_SetPowerCallback(__Sys_PowerCallback); SYS_SetPowerCallback(__Sys_PowerCallback);
} }
void ExitGUIThreads(void);
void StopAudio();
void StopGX();
static void _ExitApp() { static void _ExitApp() {
ExitGUIThreads(); ExitGUIThreads();
StopGX(); StopGX();
ShutdownAudio(); StopAudio();
UnmountNTFS(); UnmountNTFS();
SDCard_deInit(); SDCard_deInit();
@ -86,11 +93,8 @@ int Sys_ChangeIos(int ios) {
ios = prevIos; ios = prevIos;
} }
SDCard_Init();
if (ios == 222 || ios == 223) {
load_ehc_module(); load_ehc_module();
} SDCard_Init();
USBDevice_Init(); USBDevice_Init();
PAD_Init(); PAD_Init();
@ -101,7 +105,7 @@ int Sys_ChangeIos(int ios) {
WBFS_Init(WBFS_DEVICE_USB); WBFS_Init(WBFS_DEVICE_USB);
Disc_Init(); Disc_Init();
if (Sys_IsHermes()) { if (ios_supports_frag()) {
WBFS_OpenNamed((char *) &game_partition); WBFS_OpenNamed((char *) &game_partition);
} else { } else {
WBFS_Open(); WBFS_Open();
@ -125,11 +129,12 @@ int Sys_IosReload(int IOS) {
USBStorage2_Deinit(); USBStorage2_Deinit();
if (IOS == 249 || IOS == 222 || IOS == 223) { if (is_ios_type(IOS_TYPE_HERMES) || is_ios_type(IOS_TYPE_WANIN)) {
for (int i = 0; i < 10; i++) { int i;
for (i = 0; i < 10; i++) {
ret = IOS_ReloadIOSsafe(IOS); ret = IOS_ReloadIOSsafe(IOS);
if (ret < 0) return ret; if (ret < 0) return ret;
if (IOS == 222 || IOS == 223) load_ehc_module(); load_ehc_module();
ret = WBFS_Init(WBFS_DEVICE_USB); ret = WBFS_Init(WBFS_DEVICE_USB);
if (!(ret < 0)) break; if (!(ret < 0)) break;
sleep(1); sleep(1);
@ -137,9 +142,15 @@ int Sys_IosReload(int IOS) {
} }
if (ret>=0) { if (ret>=0) {
ret = Disc_Init(); ret = Disc_Init();
/*
if (ret>=0) { if (ret>=0) {
if (ios_supports_frag() && game_partition[0] != '\0') {
ret = WBFS_OpenNamed((char *) &game_partition);
} else {
ret = WBFS_Open(); ret = WBFS_Open();
} }
}
*/
} else Sys_BackToLoader(); } else Sys_BackToLoader();
} }
@ -209,13 +220,13 @@ bool Sys_IsHermes() {
return IOS_GetVersion() == 222 || IOS_GetVersion() == 223; return IOS_GetVersion() == 222 || IOS_GetVersion() == 223;
} }
#include "prompts/PromptWindows.h" // #include "prompts/PromptWindows.h"
void ShowMemInfo() { void ShowMemInfo() {
char buf[255]; char buf[255];
struct mallinfo mymallinfo = mallinfo(); struct mallinfo mymallinfo = mallinfo();
sprintf((char *) &buf,"Total: %d, Used: %d, Can be freed: %d", mymallinfo.arena/1024, mymallinfo.uordblks/1024, mymallinfo.keepcost/1024); sprintf((char *) &buf,"Total: %d, Used: %d, Can be freed: %d", mymallinfo.arena/1024, mymallinfo.uordblks/1024, mymallinfo.keepcost/1024);
WindowPrompt("Mem info", (char *) &buf, "OK"); // WindowPrompt("Mem info", (char *) &buf, "OK");
} }
@ -266,6 +277,8 @@ s32 IOS_ReloadIOSsafe(int ios)
#include <time.h> #include <time.h>
s32 TakeScreenshot(const char *path);
void ScreenShot() void ScreenShot()
{ {
time_t rawtime; time_t rawtime;
@ -281,3 +294,30 @@ void ScreenShot()
TakeScreenshot(buffer2); TakeScreenshot(buffer2);
} }
int get_ios_type()
{
switch (IOS_GetVersion()) {
case 249:
case 250:
return IOS_TYPE_WANIN;
case 222:
case 223:
if (IOS_GetRevision() == 1)
return IOS_TYPE_KWIIRK;
case 224:
return IOS_TYPE_HERMES;
}
return IOS_TYPE_UNK;
}
int is_ios_type(int type)
{
return (get_ios_type() == type);
}
int ios_supports_frag()
{
return ((is_ios_type(IOS_TYPE_HERMES) && IOS_GetRevision() >= 4) ||
(is_ios_type(IOS_TYPE_WANIN) && IOS_GetRevision() >= 18));
}

View File

@ -1,6 +1,10 @@
#ifndef _SYS_H_ #ifndef _SYS_H_
#define _SYS_H_ #define _SYS_H_
#ifdef __cplusplus
extern "C" {
#endif
void wiilight(int enable); void wiilight(int enable);
/* Prototypes */ /* Prototypes */
@ -23,5 +27,18 @@ extern s32 ios223rev;
extern s32 ios249rev; extern s32 ios249rev;
extern s32 ios250rev; extern s32 ios250rev;
#define IOS_TYPE_UNK 0
#define IOS_TYPE_WANIN 1
#define IOS_TYPE_HERMES 2
#define IOS_TYPE_KWIIRK 3
int get_ios_type();
int is_ios_type(int type);
int ios_supports_frag();
#ifdef __cplusplus
}
#endif
#endif #endif

View File

@ -13,6 +13,7 @@
#include "settings/cfg.h" #include "settings/cfg.h"
#include "gecko.h" #include "gecko.h"
#include "patches/wip.h" #include "patches/wip.h"
#include "sys.h"
extern bool geckoinit; extern bool geckoinit;
@ -251,7 +252,7 @@ void PretendThereIsADiscInTheDrive(void *buffer, u32 len)
/** Thanks to WiiPower **/ /** Thanks to WiiPower **/
bool NewSuperMarioBrosPatch(void *Address, int Size) bool NewSuperMarioBrosPatch(void *Address, int Size)
{ {
if (IOS_GetVersion() == 222 || IOS_GetVersion() == 223) return false; // Don't use this when using Hermes, it'll use the BCA fix instead... if (is_ios_type(IOS_TYPE_HERMES)) return false; // Don't use this when using Hermes, it'll use the BCA fix instead...
if (memcmp("SMNE", (char *)0x80000000, 4) == 0) if (memcmp("SMNE", (char *)0x80000000, 4) == 0)
{ {

View File

@ -8,13 +8,15 @@
#include "patches/fst.h" #include "patches/fst.h"
#include "apploader.h" #include "apploader.h"
#include "disc.h" #include "disc.h"
#include "video.h"
#include "wdvd.h" #include "wdvd.h"
#include "alternatedol.h" #include "alternatedol.h"
#include "memory.h" #include "memory.h"
#include "wbfs.h" #include "wbfs.h"
#include "../gecko.h" #include "gecko.h"
#include "../fatmounter.h" #include "fatmounter.h"
#include "sys.h"
#include "frag.h"
#include "usbstorage2.h"
/* Constants */ /* Constants */
#define PTABLE_OFFSET 0x40000 #define PTABLE_OFFSET 0x40000
@ -240,6 +242,7 @@ s32 Disc_Wait(void) {
} }
s32 Disc_SetUSB(const u8 *id) { s32 Disc_SetUSB(const u8 *id) {
if (is_ios_type(IOS_TYPE_HERMES)) {
u32 part = 0; u32 part = 0;
if (wbfs_part_fs) { if (wbfs_part_fs) {
part = wbfs_part_lba; part = wbfs_part_lba;
@ -247,10 +250,30 @@ s32 Disc_SetUSB(const u8 *id) {
part = wbfs_part_idx ? wbfs_part_idx - 1 : 0; part = wbfs_part_idx ? wbfs_part_idx - 1 : 0;
} }
int ret;
if (id && *id) {
ret = set_frag_list((u8 *) id);
} else {
ret = USBStorage_WBFS_SetFragList(NULL, 0);
}
if (ret) {
return ret;
}
/* Set USB mode */ /* Set USB mode */
return WDVD_SetUSBMode(id, part); return WDVD_SetUSBMode(id, part);
} }
if (WBFS_DEVICE_USB && wbfs_part_fs) {
gprintf("Setting frag list for wanin\n");
return set_frag_list((u8 *) id);
}
gprintf("Setting disc usb thing for wanin\n");
return WDVD_SetWBFSMode(WBFS_DEVICE_USB, (u8 *) id);
}
s32 Disc_ReadHeader(void *outbuf) { s32 Disc_ReadHeader(void *outbuf) {
/* Read disc header */ /* Read disc header */
return WDVD_UnencryptedRead(outbuf, sizeof(struct discHdr), 0); return WDVD_UnencryptedRead(outbuf, sizeof(struct discHdr), 0);

View File

@ -11,6 +11,9 @@
#include "usbstorage2.h" #include "usbstorage2.h"
#include "frag.h" #include "frag.h"
#include "utils.h" #include "utils.h"
#include "sys.h"
#include "wdvd.h"
#include "gecko.h"
FragList *frag_list = NULL; FragList *frag_list = NULL;
@ -152,27 +155,31 @@ int set_frag_list(u8 *id)
{ {
if (wbfs_part_fs == PART_FS_WBFS) return 0; if (wbfs_part_fs == PART_FS_WBFS) return 0;
if (frag_list == NULL) { if (frag_list == NULL) {
if (wbfs_part_fs == PART_FS_FAT) {
// fall back to old fat method
// printf("FAT: fallback to old method\n");
return 0;
}
// ntfs has no fallback, return error
return -1; return -1;
} }
// (+1 for header which is same size as fragment) // (+1 for header which is same size as fragment)
int size = sizeof(Fragment) * (frag_list->num + 1); int size = sizeof(Fragment) * (frag_list->num + 1);
int ret = USBStorage_WBFS_SetFragList(frag_list, size); int ret;
DCFlushRange(frag_list, size);
if (is_ios_type(IOS_TYPE_HERMES)) {
ret = USBStorage_WBFS_SetFragList(frag_list, size);
} else {
gprintf("Calling WDVD_SetFragList\n");
ret = WDVD_SetFragList(wbfsDev, frag_list, size);
}
if (ret) { if (ret) {
// printf("set_frag: %d\n", ret);
return ret; return ret;
} }
// verify id matches // verify id matches
char discid[8]; char discid[8];
memset(discid, 0, sizeof(discid)); memset(discid, 0, sizeof(discid));
ret = USBStorage_WBFS_Read(0, 6, discid); if (is_ios_type(IOS_TYPE_HERMES)) {
return 0; ret = USBStorage_WBFS_Read(0, 8, discid);
} else {
ret = WDVD_UnencryptedRead(discid, 8, 0);
}
return (memcmp(id, discid, 6) != 0) ? -1 : 0;
} }

View File

@ -50,8 +50,8 @@ distribution.
#define USB_IOCTL_WBFS_READ_DISC (WBFS_BASE+0x2) #define USB_IOCTL_WBFS_READ_DISC (WBFS_BASE+0x2)
#define USB_IOCTL_WBFS_READ_DIRECT_DISC (WBFS_BASE+0x3) #define USB_IOCTL_WBFS_READ_DIRECT_DISC (WBFS_BASE+0x3)
#define USB_IOCTL_WBFS_STS_DISC (WBFS_BASE+0x4) #define USB_IOCTL_WBFS_STS_DISC (WBFS_BASE+0x4)
#define USB_IOCTL_WBFS_SET_DEVICE (WBFS_BASE+0x50) #define USB_IOCTL_WBFS_SET_DEVICE (WBFS_BASE+0x14)
#define USB_IOCTL_WBFS_SET_FRAGLIST (WBFS_BASE+0x51) #define USB_IOCTL_WBFS_SET_FRAGLIST (WBFS_BASE+0x15)
#define UMS_HEAPSIZE 0x1000 //0x10000 #define UMS_HEAPSIZE 0x1000 //0x10000

View File

@ -11,7 +11,6 @@
#include "gecko.h" #include "gecko.h"
Wbfs *current = NULL; Wbfs *current = NULL;
#define DEBUG_WBFS
/* WBFS device */ /* WBFS device */
s32 wbfsDev = WBFS_MIN_DEVICE; s32 wbfsDev = WBFS_MIN_DEVICE;
@ -57,20 +56,11 @@ s32 WBFS_OpenPart(u32 part_fs, u32 part_idx, u32 part_lba, u32 part_size, char *
if (part_fs == PART_FS_FAT) { if (part_fs == PART_FS_FAT) {
current = new Wbfs_Fat(wbfsDev, part_lba, part_size); current = new Wbfs_Fat(wbfsDev, part_lba, part_size);
strcpy(wbfs_fs_drive, "USB:"); strcpy(wbfs_fs_drive, "USB:");
#ifdef DEBUG_WBFS
gprintf("\n\tCreated WBFS_Fat instance at lba: %d of size %d", part_lba, part_size);
#endif
} else if (part_fs == PART_FS_NTFS) { } else if (part_fs == PART_FS_NTFS) {
current = new Wbfs_Ntfs(wbfsDev, part_lba, part_size); current = new Wbfs_Ntfs(wbfsDev, part_lba, part_size);
strcpy(wbfs_fs_drive, "NTFS:"); strcpy(wbfs_fs_drive, "NTFS:");
#ifdef DEBUG_WBFS
gprintf("\n\tCreated WBFS_Ntfs instance at lba: %d of size %d", part_lba, part_size);
#endif
} else { } else {
current = new Wbfs_Wbfs(wbfsDev, part_lba, part_size); current = new Wbfs_Wbfs(wbfsDev, part_lba, part_size);
#ifdef DEBUG_WBFS
gprintf("\n\tCreated WBFS_Wbfs instance at lba: %d of size %d", part_lba, part_size);
#endif
} }
if (current->Open()) if (current->Open())
{ {

View File

@ -366,9 +366,6 @@ s32 Wbfs_Fat::GetHeadersCount()
dir_iter = diropen(path); dir_iter = diropen(path);
if (!dir_iter) return 0; if (!dir_iter) return 0;
dir_iter = diropen(path);
if (!dir_iter) return 0;
while (dirnext(dir_iter, fname, &st) == 0) { while (dirnext(dir_iter, fname, &st) == 0) {
//printf("found: %s\n", fname); Wpad_WaitButtonsCommon(); //printf("found: %s\n", fname); Wpad_WaitButtonsCommon();
if ((char)fname[0] == '.') continue; if ((char)fname[0] == '.') continue;

View File

@ -17,6 +17,7 @@
#define IOCTL_DI_OFFSET 0xD9 #define IOCTL_DI_OFFSET 0xD9
#define IOCTL_DI_DISC_BCA 0xDA #define IOCTL_DI_DISC_BCA 0xDA
#define IOCTL_DI_STOPMOTOR 0xE3 #define IOCTL_DI_STOPMOTOR 0xE3
#define IOCTL_DI_SETWBFSMODE 0xF4
#define IOCTL_DI_SETUSBMODE 0xF4 #define IOCTL_DI_SETUSBMODE 0xF4
#define IOCTL_DI_DISABLERESET 0xF6 #define IOCTL_DI_DISABLERESET 0xF6
@ -24,6 +25,10 @@
#define DI_SETWBFSMODE 0xfe #define DI_SETWBFSMODE 0xfe
#define DI_SETOFFSETBASE 0xf1 #define DI_SETOFFSETBASE 0xf1
#define IOCTL_DI_SETFRAG 0xF9
#define IOCTL_DI_GETMODE 0xFA
#define IOCTL_DI_HELLO 0xFB
/* Variables */ /* Variables */
static u32 inbuf[8] ATTRIBUTE_ALIGN(32); static u32 inbuf[8] ATTRIBUTE_ALIGN(32);
static u32 outbuf[8] ATTRIBUTE_ALIGN(32); static u32 outbuf[8] ATTRIBUTE_ALIGN(32);
@ -306,6 +311,27 @@ s32 WDVD_DisableReset(u8 val) {
return (ret == 1) ? 0 : -ret; return (ret == 1) ? 0 : -ret;
} }
s32 WDVD_SetWBFSMode(u32 mode, u8 *discid)
{
s32 ret;
memset(inbuf, 0, sizeof(inbuf));
/* Set USB mode */
inbuf[0] = IOCTL_DI_SETWBFSMODE << 24;
inbuf[1] = mode;
/* Copy disc ID */
if (discid)
memcpy(&inbuf[2], discid, 6);
ret = IOS_Ioctl(di_fd, IOCTL_DI_SETWBFSMODE, inbuf, sizeof(inbuf), outbuf, sizeof(outbuf));
if (ret < 0)
return ret;
return (ret == 1) ? 0 : -ret;
}
/** Hermes **/ /** Hermes **/
s32 WDVD_SetUSBMode(const u8 *id, s32 partition) { s32 WDVD_SetUSBMode(const u8 *id, s32 partition) {
s32 ret; s32 ret;
@ -319,10 +345,8 @@ s32 WDVD_SetUSBMode(const u8 *id, s32 partition) {
/* Copy ID */ /* Copy ID */
if (id) { if (id) {
memcpy(&inbuf[2], id, 6); memcpy(&inbuf[2], id, 6);
if (IOS_GetVersion() != 249) {
inbuf[5] = partition; inbuf[5] = partition;
} }
}
ret = IOS_Ioctl(di_fd, IOCTL_DI_SETUSBMODE, inbuf, sizeof(inbuf), outbuf, sizeof(outbuf)); ret = IOS_Ioctl(di_fd, IOCTL_DI_SETUSBMODE, inbuf, sizeof(inbuf), outbuf, sizeof(outbuf));
if (ret!=1) { if (ret!=1) {
@ -354,3 +378,25 @@ s32 WDVD_Read_Disc_BCA(void *buf)
return (ret == 1) ? 0 : -ret; return (ret == 1) ? 0 : -ret;
} }
s32 WDVD_SetFragList(int device, void *fraglist, int size)
{
s32 ret;
memset(inbuf, 0, sizeof(inbuf));
memset(outbuf, 0, sizeof(outbuf));
/* Set FRAG mode */
inbuf[0] = IOCTL_DI_SETFRAG << 24;
inbuf[1] = device;
inbuf[2] = (u32)fraglist;
inbuf[3] = size;
DCFlushRange(fraglist, size);
ret = IOS_Ioctl(di_fd, IOCTL_DI_SETFRAG, inbuf, sizeof(inbuf), outbuf, sizeof(outbuf));
if (ret < 0)
return ret;
return (ret == 1) ? 0 : -ret;
}

View File

@ -22,8 +22,10 @@ extern "C" {
s32 WDVD_WaitForDisc(void); s32 WDVD_WaitForDisc(void);
s32 WDVD_GetCoverStatus(u32 *); s32 WDVD_GetCoverStatus(u32 *);
s32 WDVD_DisableReset(u8); s32 WDVD_DisableReset(u8);
s32 WDVD_SetWBFSMode(u32, u8 *);
s32 WDVD_SetUSBMode(const u8 *, s32 partition); s32 WDVD_SetUSBMode(const u8 *, s32 partition);
s32 WDVD_Read_Disc_BCA(void *buf); s32 WDVD_Read_Disc_BCA(void *buf);
s32 WDVD_SetFragList(int device, void *fraglist, int size);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -13,7 +13,7 @@
void InitVideo (); void InitVideo ();
void InitVideodebug(); void InitVideodebug();
void StopGX(); extern "C" void StopGX();
void ResetVideo_Menu(); void ResetVideo_Menu();
void Menu_Render(); void Menu_Render();
void Menu_DrawImg(f32 xpos, f32 ypos, f32 zpos, f32 width, f32 height, u8 data[], void Menu_DrawImg(f32 xpos, f32 ypos, f32 zpos, f32 width, f32 height, u8 data[],
@ -21,7 +21,7 @@ void Menu_DrawImg(f32 xpos, f32 ypos, f32 zpos, f32 width, f32 height, u8 data[]
void Menu_DrawTPLImg(f32 xpos, f32 ypos, f32 zpos, f32 width, f32 height, GXTexObj *texObj, void Menu_DrawTPLImg(f32 xpos, f32 ypos, f32 zpos, f32 width, f32 height, GXTexObj *texObj,
f32 degrees, f32 scaleX, f32 scaleY, u8 alpha, int XX1, int YY1,int XX2, int YY2,int XX3, int YY3,int XX4, int YY4); f32 degrees, f32 scaleX, f32 scaleY, u8 alpha, int XX1, int YY1,int XX2, int YY2,int XX3, int YY3,int XX4, int YY4);
void Menu_DrawRectangle(f32 x, f32 y, f32 width, f32 height, GXColor color, u8 filled); void Menu_DrawRectangle(f32 x, f32 y, f32 width, f32 height, GXColor color, u8 filled);
s32 TakeScreenshot(const char *path); extern "C" s32 TakeScreenshot(const char *path);
extern int screenheight; extern int screenheight;
extern int screenwidth; extern int screenwidth;

View File

@ -42,7 +42,7 @@ extern "C" {
s32 getNameBN(char *name, u64 id); s32 getNameBN(char *name, u64 id);
// Get the name of a title from its 00000000.app in NAND // Get the name of a title from its 00000000.app in NAND
s32 getName00(char *name, u64 id, int lang = 2); s32 getName00(char *name, u64 id, int lang);
// Get string representation of lower title id // Get string representation of lower title id
char *titleText(u32 kind, u32 title); char *titleText(u32 kind, u32 title);