diff --git a/data/ehcmodule_frag_v4.bin b/data/ehcmodule_frag_v4.bin
deleted file mode 100644
index 869e15cf..00000000
Binary files a/data/ehcmodule_frag_v4.bin and /dev/null differ
diff --git a/data/ehcmodule_frag_v5.bin b/data/ehcmodule_frag_v5.bin
deleted file mode 100644
index 894727ea..00000000
Binary files a/data/ehcmodule_frag_v5.bin and /dev/null differ
diff --git a/gui.pnproj b/gui.pnproj
index 49873f17..98741a09 100644
--- a/gui.pnproj
+++ b/gui.pnproj
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/gui.pnps b/gui.pnps
index 37a2c6da..e62a4311 100644
--- a/gui.pnps
+++ b/gui.pnps
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/source/audio.cpp b/source/audio.cpp
index b8e301ad..afbc67ce 100644
--- a/source/audio.cpp
+++ b/source/audio.cpp
@@ -31,3 +31,7 @@ void ShutdownAudio() {
ASND_Pause(1);
ASND_End();
}
+
+extern "C" void StopAudio() {
+ ShutdownAudio();
+}
diff --git a/source/main.cpp b/source/main.cpp
index c79c7117..70df64ab 100644
--- a/source/main.cpp
+++ b/source/main.cpp
@@ -95,21 +95,6 @@ static void BootUpProblems()
time_t endtime = time(0) + 30;
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_Init();
ret2 = WBFS_Init(WBFS_DEVICE_USB);
@@ -162,7 +147,8 @@ void InitTextVideo ()
}
dbvideo=1;
VIDEO_Init();
- // get default video mode
+
+ // get default video mode
GXRModeObj *vmode = VIDEO_GetPreferredMode(NULL);
// widescreen fix
@@ -293,7 +279,7 @@ main(int argc, char *argv[])
if (ret < 0)
{
- printf("\n\tIOS 249 failed, reloading ios 222...");
+ printf("\n\tIOS 249 failed, reloading ios 222...");
ret = IOS_ReloadIOSsafe(222);
printf("%d", ret);
@@ -317,12 +303,7 @@ main(int argc, char *argv[])
}
}
}
- printf("\n\tInitialize sd card");
- SDCard_Init();
- printf("\n\tLoad ehc module");
- load_ehc_module();
- printf("\n\tdeinit sd card");
- SDCard_deInit();
+ load_ehc_module();
}
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...");
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();
@@ -407,66 +374,25 @@ main(int argc, char *argv[])
// gprintf("\n\tbootDevice = %s",bootDevice);
/* Load Custom IOS */
- if ((Settings.cios == ios222 && IOS_GetVersion() != 222) ||
- (Settings.cios == ios223 && IOS_GetVersion() != 223))
- {
- printf("\n\tReloading IOS to config setting (%d)...", Settings.cios == ios222 ? 222 : 223);
- SDCard_deInit(); // unmount SD for reloading IOS
- USBDevice_deInit(); // unmount USB for reloading IOS
- USBStorage2_Deinit();
- ret = IOS_ReloadIOSsafe(Settings.cios == ios222 ? 222 : 223);
- printf("%d", ret);
+ if (Settings.cios != IOS_GetVersion())
+ {
+ printf("\n\tReloading IOS to config setting (%d)...", ciosSetting2Cios(Settings.cios));
+ if (Sys_IosReload(ciosSetting2Cios(Settings.cios)) < 0) {
+ int alt_ios = (Settings.cios == ios222 || Settings.cios == ios223) ? 249 : 222;
+ ret = Sys_IosReload(alt_ios);
+
+ if (ret < 0)
+ {
+ printf("\nERROR: cIOS could not be loaded!");
+ sleep(5);
+ exit(0);
+ }
+ }
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)
- {
- 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])
diff --git a/source/menu.cpp b/source/menu.cpp
index 215bf1b8..657bf22c 100644
--- a/source/menu.cpp
+++ b/source/menu.cpp
@@ -25,9 +25,9 @@
#include "usbloader/getentries.h"
#include "wad/title.h"
#include "xml/xml.h"
-#include "audio.h"
#include "gecko.h"
#include "menu.h"
+#include "audio.h"
#include "sys.h"
#include "wpad.h"
#include "settings/newtitles.h"
@@ -345,6 +345,7 @@ int MainMenu(int menu) {
delete coverImg;
delete fontClock;
delete fontSystem;
+
ShutdownAudio();
StopGX();
gettextCleanUp();
@@ -414,7 +415,6 @@ int MainMenu(int menu) {
}
}
-
int ret = 0;
header = (mountMethod?dvdheader:&gameList[gameSelected]);
@@ -433,48 +433,9 @@ int MainMenu(int menu) {
alternatedoloffset = game_cfg->alternatedolstart;
}
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
- if (load_from_fs != PART_FS_WBFS && ios2 == 249) {
- ios2 = 222;
- }
+
+ int ios2 = ciosSetting2Cios(iosChoice);
bool onlinefix = ShutdownWC24();
// You cannot reload ios when loading from fat
@@ -490,10 +451,6 @@ int MainMenu(int menu) {
ret = get_frag_list(header->id);
gprintf("%d\n", ret);
- gprintf("\nSetting fragment list...");
- ret = set_frag_list(header->id);
- gprintf("%d\n", ret);
-
ret = Disc_SetUSB(header->id);
if (ret < 0) Sys_BackToLoader();
gprintf("\n\tUSB set to game");
diff --git a/source/menu.h b/source/menu.h
index 0ffb3a75..eec2b7df 100644
--- a/source/menu.h
+++ b/source/menu.h
@@ -14,7 +14,7 @@
#include "main.h"
void InitGUIThreads(void);
-void ExitGUIThreads(void);
+extern "C" void ExitGUIThreads(void);
int MainMenu (int menuitem);
diff --git a/source/mload/dip_plugin_249.c b/source/mload/dip_plugin_249.c
new file mode 100644
index 00000000..22ef3def
--- /dev/null
+++ b/source/mload/dip_plugin_249.c
@@ -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, 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8a, 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,
+ 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,
+ 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, 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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, 0x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 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, 0x28, 0x00, 0xd1, 0x3c, 0x69, 0xe2, 0x1b, 0xd2, 0x62, 0xe2, 0x2a, 0x00,
+ 0xd0, 0x0b, 0x02, 0x52, 0x1c, 0x30, 0x21, 0x00, 0xf0, 0x00, 0xf9, 0x66, 0x6a, 0xe3, 0x02, 0x5a,
+ 0x18, 0xb6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, 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
+};
diff --git a/source/mload/dip_plugin_249.h b/source/mload/dip_plugin_249.h
new file mode 100644
index 00000000..1138a27f
--- /dev/null
+++ b/source/mload/dip_plugin_249.h
@@ -0,0 +1,3 @@
+#define size_dip_plugin_249 5276
+
+extern unsigned char dip_plugin_249[5276];
diff --git a/source/mload/fatffs_util.c b/source/mload/fatffs_util.c
deleted file mode 100644
index 27b5a072..00000000
--- a/source/mload/fatffs_util.c
+++ /dev/null
@@ -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
-
-#include
-#include
-#include
-#include
-
-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;n0)
- {
- 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;
-}
diff --git a/source/mload/fatffs_util.h b/source/mload/fatffs_util.h
deleted file mode 100644
index c438776b..00000000
--- a/source/mload/fatffs_util.h
+++ /dev/null
@@ -1,24 +0,0 @@
-#ifndef _FAT_UTIL_
-#define _FAT_UTIL_
-
-#include
-
-#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
diff --git a/source/mload/mload.c b/source/mload/mload.c
index 709b5067..612009c7 100644
--- a/source/mload/mload.c
+++ b/source/mload/mload.c
@@ -484,115 +484,52 @@ return ret;
}
-/*
-int load_ehc_module()
+int mload_get_version()
{
- int is_ios=0;
- FILE *fp;
-
- if(!external_ehcmodule)
- {
-
- 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)
- {
- if(mload_init()<0) return -1;
-
- if (IOS_GetRevision() == 4) {
- gprintf("Loading ehcmodule v4\n");
- mload_elf((void *) ehcmodule_frag_v4_bin, &my_data_elf);
- } else if (IOS_GetRevision() == 0) { // 0? Strange value for v5 ehcmodule
- gprintf("Loading ehcmodule v5\n");
- mload_elf((void *) ehcmodule_frag_v5_bin, &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;
- }
- else
- {
- 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 ret;
+ if(mload_init()<0) return -1;
+ ret = IOS_IoctlvFormat(hid, mload_fd, MLOAD_GET_MLOAD_VERSION, ":");
+ return ret;
}
-int patch_cios_data() {
- patch_datas[0]=*((u32 *) (dip_plugin+16*4));
- mload_set_ES_ioctlv_vector((void *) patch_datas[0]);
- return 1;
+
+
+/* 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;
+
+ ret= IOS_IoctlvFormat(hid, mload_fd, MLOAD_GET_IOS_BASE, ":d", &ios, sizeof(ios));
+ //printf("get_ios_base: %d %x\n", ret, ios.dipVersion);
+ if (ret == 0) {
+ switch(ios.dipVersion) {
+ case 0x48776F72: /* DIP: 07/11/08 14:34:26 */
+ 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;
+ }
+ }
+ return ret;
}
-*/
-
-
diff --git a/source/mload/mload.h b/source/mload/mload.h
index b360faf6..a5d1f56b 100644
--- a/source/mload/mload.h
+++ b/source/mload/mload.h
@@ -28,6 +28,8 @@
#define MLOAD_MLOAD_THREAD_ID 0x4D4C4400
#define MLOAD_GET_IOS_BASE 0x4D4C4401
+#define MLOAD_GET_MLOAD_VERSION 0x4D4C4402
+
#define MLOAD_LOAD_MODULE 0x4D4C4480
#define MLOAD_RUN_MODULE 0x4D4C4481
#define MLOAD_RUN_THREAD 0x4D4C4482
diff --git a/source/mload/mload_modules.c b/source/mload/mload_modules.c
index a1090d51..a13164da 100644
--- a/source/mload/mload_modules.c
+++ b/source/mload/mload_modules.c
@@ -1,12 +1,11 @@
#include "mload_modules.h"
-#include "ehcmodule_frag_v4_bin.h"
-#include "ehcmodule_frag_v5_bin.h"
+#include "ehcmodule_frag_bin.h"
+#include "dip_plugin_249.h"
+#include "sys.h"
#include "gecko.h"
#define ALIGNED(x) __attribute__((aligned(x)))
-#define DEBUG_MLOAD
-
/* Used for Hermes NAND emulation */
int global_mount;
int sd_ok=0;
@@ -83,7 +82,6 @@ static u32 ios_60[16] ATTRIBUTE_ALIGN(32)=
0x20203750+1, // ios_printf (thumb)
};
-
u32 patch_datas[8] ATTRIBUTE_ALIGN(32);
data_elf my_data_elf;
@@ -93,105 +91,19 @@ int size_external_ehcmodule=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;
- 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);
- if(my_thread_id<0) return -1;
- */
-
- 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;
- }
+ if(my_thread_id<0) return -2;
usleep(350*1000);
// 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();
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_UMOUNTSD 0xF1
#define IOCTL_FAT_MOUNTUSB 0xF2
@@ -428,6 +368,8 @@ s32 ret;
return ret;
}
+#endif
+
void enable_ES_ioctlv_vector(void)
{
patch_datas[0]=*((u32 *) (dip_plugin+16*4));
@@ -463,11 +405,7 @@ void test_and_patch_for_port1()
u8 * ehc_data = NULL;
- if (IOS_GetRevision() == 4) {
- 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);
- }
+ ehc_data=search_for_ehcmodule_cfg((void *) ehcmodule_frag_bin, ehcmodule_frag_bin_size);
if(ehc_data)
{
diff --git a/source/patches/fst.c b/source/patches/fst.c
index d243a503..8ac1dc57 100644
--- a/source/patches/fst.c
+++ b/source/patches/fst.c
@@ -32,7 +32,7 @@
#include "fatmounter.h"
#include "settings/cfg.h"
#include "mload/mload.h"
-#include "mload/dip_plugin.h"
+#include "mload/mload_modules.h"
#include "gecko.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)
- mload_write(bcaCode, 64);
- mload_close();
+ Set_DIP_BCA_Datas((u8 *) &bcaCode);
}
return 0;
}
diff --git a/source/prompts/PromptWindows.cpp b/source/prompts/PromptWindows.cpp
index 8433cde0..4536fe8a 100644
--- a/source/prompts/PromptWindows.cpp
+++ b/source/prompts/PromptWindows.cpp
@@ -1772,14 +1772,6 @@ DiscWait(const char *title, const char *msg, const char *btn1Label, const char *
while (i >= 0) {
VIDEO_WaitVSync();
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);
USBDevice_deInit();
USBDevice_Init();
diff --git a/source/prompts/TitleBrowser.cpp b/source/prompts/TitleBrowser.cpp
index ba08b19a..35d7f6dc 100644
--- a/source/prompts/TitleBrowser.cpp
+++ b/source/prompts/TitleBrowser.cpp
@@ -205,7 +205,7 @@ int TitleBrowser(u32 type) {
}
}
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;
if (!found) {
diff --git a/source/settings/Settings.cpp b/source/settings/Settings.cpp
index 29e899b5..8639f9bc 100644
--- a/source/settings/Settings.cpp
+++ b/source/settings/Settings.cpp
@@ -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_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_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_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_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
***************************************************************************/
@@ -1003,9 +995,6 @@ int MenuSettings()
if (++Settings.cios >= settings_cios_max) {
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)
options2.SetValue(Idx, "%s", opts_cios[Settings.cios]);
@@ -1017,12 +1006,7 @@ int MenuSettings()
{
if (firstRun) options2.SetName(Idx, "%s", tr("Partition"));
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;
- }
- while (!IsValidPartition(partitions.pinfo[Settings.partition].fs_type, Settings.cios));
+ Settings.partition = Settings.partition + 1 == partitions.num ? 0 : Settings.partition + 1;
}
PartInfo pInfo = partitions.pinfo[Settings.partition];
@@ -2216,8 +2200,7 @@ int MenuSettings()
ResumeGui();
return menu;
- }
-
+}
/********************************************************************************
*Game specific settings
@@ -2438,9 +2421,8 @@ int GameSettings(struct discHdr * header)
mainWindow->Append(&w);
-
-
- if (game_cfg) { //if there are saved settings for this game use them
+ CFG_set_game_default();
+ if (game_cfg) {
videoChoice = game_cfg->video;
languageChoice = game_cfg->language;
ocarinaChoice = game_cfg->ocarina;
@@ -2454,35 +2436,11 @@ int GameSettings(struct discHdr * header)
reloadblock = game_cfg->iosreloadblock;
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();
while (MainButton1.GetEffect() > 0) usleep(50);
-
-
while (menu == MENU_NONE)
{
VIDEO_WaitVSync ();
@@ -2633,7 +2591,7 @@ int GameSettings(struct discHdr * header)
if(ret == ++Idx || firstRun)
{
if(firstRun) options2.SetName(Idx, "IOS");
- if(ret == Idx && ++iosChoice >= settings_ios_max)
+ if(ret == Idx && ++iosChoice >= settings_cios_max)
iosChoice = 0;
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"));
if (choice1 == 1)
{
- videoChoice = Settings.video;
- 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_set_game_default();
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
// 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);
while (w.GetEffect()>0) usleep(50);
-
-
HaltGui();
mainWindow->RemoveAll();
diff --git a/source/settings/cfg.c b/source/settings/cfg.c
index e66fc208..d054d8cd 100644
--- a/source/settings/cfg.c
+++ b/source/settings/cfg.c
@@ -1258,7 +1258,6 @@ void cfg_parsearg(int argc, char **argv)
// PER-GAME SETTINGS
-
// return existing or new
struct Game_CFG* cfg_get_game(u8 *id) {
struct Game_CFG *game = CFG_get_game_opt(id);
@@ -1269,6 +1268,22 @@ struct Game_CFG* cfg_get_game(u8 *id) {
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
void cfg_set_game_opt(struct Game_CFG *game, u8 *id) {
strncpy((char*)game->id, (char*)id, 6);
@@ -1738,6 +1753,7 @@ struct Game_CFG* CFG_get_game_opt(u8 *id) {
return &cfg_game[i];
}
}
+ CFG_set_game_default();
return NULL;
}
@@ -1935,3 +1951,21 @@ void GetLanguageToLangCode(int *langid, char *langcode) {
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;
+ }
+
+}
diff --git a/source/settings/cfg.h b/source/settings/cfg.h
index 9f01df53..fec6f489 100644
--- a/source/settings/cfg.h
+++ b/source/settings/cfg.h
@@ -239,6 +239,7 @@ extern "C" {
void CFG_Load(void);
struct Game_CFG* CFG_get_game_opt(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_num(u8 *id);
bool CFG_reset_all_playcounters();
@@ -298,18 +299,11 @@ extern "C" {
settings_sinfo_max // always the last entry
};
- enum {
- i249=0,
- i222,
- i223,
- i250,
- settings_ios_max // always the last entry
- };
-
enum {
ios249=0,
ios222,
ios223,
+ ios224,
ios250,
settings_cios_max // always the last entry
};
@@ -464,6 +458,8 @@ extern "C" {
void GetLanguageToLangCode(int *langid, char *langcode);
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 *cfg_get_title(u8 *id) ;
void title_set(char *id, char *title);
diff --git a/source/sys.cpp b/source/sys.c
similarity index 79%
rename from source/sys.cpp
rename to source/sys.c
index 68abdfc8..59899d14 100644
--- a/source/sys.cpp
+++ b/source/sys.c
@@ -1,283 +1,323 @@
-#include
-#include
-#include
-
-#include "usbloader/wdvd.h"
-#include "usbloader/usbstorage2.h"
-#include "usbloader/disc.h"
-#include "usbloader/wbfs.h"
-#include "usbloader/partition_usbloader.h"
-#include "mload/mload_modules.h"
-#include "video.h"
-#include "audio.h"
-#include "menu.h"
-#include "fatmounter.h"
-#include "sys.h"
-#include "wpad.h"
-
-extern char game_partition[6];
-extern u8 load_from_fs;
-
-//Wiilight stuff
-static vu32 *_wiilight_reg = (u32*)0xCD0000C0;
-void wiilight(int enable) { // Toggle wiilight (thanks Bool for wiilight source)
- u32 val = (*_wiilight_reg&~0x20);
- if (enable && Settings.wiilight) val |= 0x20;
- *_wiilight_reg=val;
-}
-
-/* Variables */
-u8 shutdown = 0;
-u8 reset = 0;
-
-void __Sys_ResetCallback(void) {
- /* Reboot console */
- reset = 1;
-}
-
-void __Sys_PowerCallback(void) {
- /* Poweroff console */
- shutdown = 1;
-}
-
-void Sys_Init(void) {
- /* Initialize video subsytem */
- //VIDEO_Init();
-
- /* Set RESET/POWER button callback */
- SYS_SetResetCallback(__Sys_ResetCallback);
- SYS_SetPowerCallback(__Sys_PowerCallback);
-}
-
-static void _ExitApp() {
- ExitGUIThreads();
- StopGX();
- ShutdownAudio();
-
- UnmountNTFS();
- SDCard_deInit();
- USBDevice_deInit();
- mload_set_ES_ioctlv_vector(NULL);
- mload_close();
-}
-
-void Sys_Reboot(void) {
- /* Restart console */
- _ExitApp();
- STM_RebootSystem();
-}
-
-int Sys_ChangeIos(int ios) {
- s32 prevIos = IOS_GetVersion();
-
- SDCard_deInit();
- USBDevice_deInit();
-
- WPAD_Flush(0);
- WPAD_Disconnect(0);
- WPAD_Shutdown();
-
- WDVD_Close();
-
- USBStorage2_Deinit();
-
- s32 ret = IOS_ReloadIOSsafe(ios);
- if (ret < 0) {
- ios = prevIos;
- }
-
- SDCard_Init();
-
- if (ios == 222 || ios == 223) {
- load_ehc_module();
- }
- USBDevice_Init();
-
- PAD_Init();
- Wpad_Init();
- WPAD_SetDataFormat(WPAD_CHAN_ALL,WPAD_FMT_BTNS_ACC_IR);
- WPAD_SetVRes(WPAD_CHAN_ALL, screenwidth, screenheight);
-
- WBFS_Init(WBFS_DEVICE_USB);
- Disc_Init();
-
- if (Sys_IsHermes()) {
- WBFS_OpenNamed((char *) &game_partition);
- } else {
- WBFS_Open();
- }
-
- return ret;
-}
-
-int Sys_IosReload(int IOS) {
- s32 ret = -1;
-
- //shutdown SD and USB before IOS Reload in DiscWait
- SDCard_deInit();
- USBDevice_deInit();
-
- WPAD_Flush(0);
- WPAD_Disconnect(0);
- WPAD_Shutdown();
-
- WDVD_Close();
-
- USBStorage2_Deinit();
-
- if (IOS == 249 || IOS == 222 || IOS == 223) {
- for (int i = 0; i < 10; i++) {
- ret = IOS_ReloadIOSsafe(IOS);
- if (ret < 0) return ret;
- if (IOS == 222 || IOS == 223) load_ehc_module();
- ret = WBFS_Init(WBFS_DEVICE_USB);
- if (!(ret < 0)) break;
- sleep(1);
- USBStorage2_Deinit();
- }
- if (ret>=0) {
- ret = Disc_Init();
- if (ret>=0) {
- ret = WBFS_Open();
- }
- } 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
- SDCard_Init();
- USBDevice_Init();
-
- return ret;
-}
-
-#define ShutdownToDefault 0
-#define ShutdownToIdle 1
-#define ShutdownToStandby 2
-
-static void _Sys_Shutdown(int SHUTDOWN_MODE) {
- _ExitApp();
- WPAD_Flush(0);
- WPAD_Disconnect(0);
- WPAD_Shutdown();
-
- /* Poweroff console */
- if ((CONF_GetShutdownMode() == CONF_SHUTDOWN_IDLE && SHUTDOWN_MODE != ShutdownToStandby) || SHUTDOWN_MODE == ShutdownToIdle) {
- s32 ret;
-
- /* Set LED mode */
- ret = CONF_GetIdleLedMode();
- if (ret >= 0 && ret <= 2)
- STM_SetLedMode(ret);
-
- /* Shutdown to idle */
- STM_ShutdownToIdle();
- } else {
- /* Shutdown to standby */
- STM_ShutdownToStandby();
- }
-}
-void Sys_Shutdown(void) {
- _Sys_Shutdown(ShutdownToDefault);
-}
-void Sys_ShutdownToIdel(void) {
- _Sys_Shutdown(ShutdownToIdle);
-}
-void Sys_ShutdownToStandby(void) {
- _Sys_Shutdown(ShutdownToStandby);
-}
-
-void Sys_LoadMenu(void) {
- _ExitApp();
- /* Return to the Wii system menu */
- SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);
-}
-
-void Sys_BackToLoader(void) {
- if (*((u32*) 0x80001800)) {
- _ExitApp();
- exit(0);
- }
- // Channel Version
- Sys_LoadMenu();
-}
-
-bool Sys_IsHermes() {
- return IOS_GetVersion() == 222 || IOS_GetVersion() == 223;
-}
-
-#include "prompts/PromptWindows.h"
-
-void ShowMemInfo() {
- char buf[255];
- struct mallinfo mymallinfo = mallinfo();
- 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");
-}
-
-
-#include "wad/title.h"
-
-s32 ios222rev = -69;
-s32 ios223rev = -69;
-s32 ios249rev = -69;
-s32 ios250rev = -69;
-
-s32 IOS_ReloadIOSsafe(int ios)
-{
- if (ios==222)
- {
- if (ios222rev == -69)
- ios222rev = getIOSrev(0x00000001000000dell);
-
- if (ios222rev > 0 && (ios222rev != 4 && ios222rev != 5))return -2;
- }
- else if (ios==223)
- {
- if (ios223rev == -69)
- ios223rev = getIOSrev(0x00000001000000dfll);
-
- if (ios223rev > 0 && (ios223rev != 4 && ios223rev != 5))return -2;
- }
- else if (ios==249)
- {
- if (ios249rev == -69)
- ios249rev = getIOSrev(0x00000001000000f9ll);
-
- if (ios249rev >= 0 && !(ios249rev>=9 && ios249rev<65280))return -2;
- }
- else if (ios==250)
- {
- if (ios250rev == -69)
- ios250rev = getIOSrev(0x00000001000000fall);
-
- if (ios250rev >= 0 && !(ios250rev>=9 && ios250rev<65280))return -2;
- }
-
- s32 r = IOS_ReloadIOS(ios);
- if (r >= 0) {
- WII_Initialize();
- }
- return r;
-}
-
-#include
-
-void ScreenShot()
-{
- time_t rawtime;
- struct tm * timeinfo;
- char buffer [80];
- char buffer2 [80];
-
- time ( &rawtime );
- timeinfo = localtime ( &rawtime );
- //USBLoader_GX_ScreenShot-Month_Day_Hour_Minute_Second_Year.png
- strftime (buffer,80,"USBLoader_GX_ScreenShot-%b%d%H%M%S%y.png",timeinfo);
- sprintf(buffer2, "%s/config/%s", bootDevice, buffer);
-
- TakeScreenshot(buffer2);
-}
+#include
+#include
+#include
+
+#include "settings/cfg.h"
+#include "usbloader/wdvd.h"
+#include "usbloader/usbstorage2.h"
+#include "usbloader/disc.h"
+#include "usbloader/wbfs.h"
+#include "usbloader/partition_usbloader.h"
+#include "mload/mload_modules.h"
+// #include "menu.h"
+#include "fatmounter.h"
+#include "sys.h"
+#include "wpad.h"
+
+extern char game_partition[6];
+extern u8 load_from_fs;
+
+extern int screenheight;
+extern int screenwidth;
+
+//Wiilight stuff
+static vu32 *_wiilight_reg = (u32*)0xCD0000C0;
+
+void wiilight(int enable) { // Toggle wiilight (thanks Bool for wiilight source)
+ u32 val = (*_wiilight_reg&~0x20);
+ if (enable && Settings.wiilight) val |= 0x20;
+ *_wiilight_reg=val;
+}
+
+/* Variables */
+u8 shutdown = 0;
+u8 reset = 0;
+
+void __Sys_ResetCallback(void) {
+ /* Reboot console */
+ reset = 1;
+}
+
+void __Sys_PowerCallback(void) {
+ /* Poweroff console */
+ shutdown = 1;
+}
+
+void Sys_Init(void) {
+ /* Initialize video subsytem */
+ //VIDEO_Init();
+
+ /* Set RESET/POWER button callback */
+ SYS_SetResetCallback(__Sys_ResetCallback);
+ SYS_SetPowerCallback(__Sys_PowerCallback);
+}
+
+void ExitGUIThreads(void);
+void StopAudio();
+void StopGX();
+
+static void _ExitApp() {
+ ExitGUIThreads();
+ StopGX();
+ StopAudio();
+
+ UnmountNTFS();
+ SDCard_deInit();
+ USBDevice_deInit();
+ mload_set_ES_ioctlv_vector(NULL);
+ mload_close();
+}
+
+void Sys_Reboot(void) {
+ /* Restart console */
+ _ExitApp();
+ STM_RebootSystem();
+}
+
+int Sys_ChangeIos(int ios) {
+ s32 prevIos = IOS_GetVersion();
+
+ SDCard_deInit();
+ USBDevice_deInit();
+
+ WPAD_Flush(0);
+ WPAD_Disconnect(0);
+ WPAD_Shutdown();
+
+ WDVD_Close();
+
+ USBStorage2_Deinit();
+
+ s32 ret = IOS_ReloadIOSsafe(ios);
+ if (ret < 0) {
+ ios = prevIos;
+ }
+
+ load_ehc_module();
+ SDCard_Init();
+ USBDevice_Init();
+
+ PAD_Init();
+ Wpad_Init();
+ WPAD_SetDataFormat(WPAD_CHAN_ALL,WPAD_FMT_BTNS_ACC_IR);
+ WPAD_SetVRes(WPAD_CHAN_ALL, screenwidth, screenheight);
+
+ WBFS_Init(WBFS_DEVICE_USB);
+ Disc_Init();
+
+ if (ios_supports_frag()) {
+ WBFS_OpenNamed((char *) &game_partition);
+ } else {
+ WBFS_Open();
+ }
+
+ return ret;
+}
+
+int Sys_IosReload(int IOS) {
+ s32 ret = -1;
+
+ //shutdown SD and USB before IOS Reload in DiscWait
+ SDCard_deInit();
+ USBDevice_deInit();
+
+ WPAD_Flush(0);
+ WPAD_Disconnect(0);
+ WPAD_Shutdown();
+
+ WDVD_Close();
+
+ USBStorage2_Deinit();
+
+ if (is_ios_type(IOS_TYPE_HERMES) || is_ios_type(IOS_TYPE_WANIN)) {
+ int i;
+ for (i = 0; i < 10; i++) {
+ ret = IOS_ReloadIOSsafe(IOS);
+ if (ret < 0) return ret;
+ load_ehc_module();
+ ret = WBFS_Init(WBFS_DEVICE_USB);
+ if (!(ret < 0)) break;
+ sleep(1);
+ USBStorage2_Deinit();
+ }
+ if (ret>=0) {
+ ret = Disc_Init();
+/*
+ if (ret>=0) {
+ if (ios_supports_frag() && game_partition[0] != '\0') {
+ ret = WBFS_OpenNamed((char *) &game_partition);
+ } else {
+ ret = WBFS_Open();
+ }
+ }
+*/
+ } 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
+ SDCard_Init();
+ USBDevice_Init();
+
+ return ret;
+}
+
+#define ShutdownToDefault 0
+#define ShutdownToIdle 1
+#define ShutdownToStandby 2
+
+static void _Sys_Shutdown(int SHUTDOWN_MODE) {
+ _ExitApp();
+ WPAD_Flush(0);
+ WPAD_Disconnect(0);
+ WPAD_Shutdown();
+
+ /* Poweroff console */
+ if ((CONF_GetShutdownMode() == CONF_SHUTDOWN_IDLE && SHUTDOWN_MODE != ShutdownToStandby) || SHUTDOWN_MODE == ShutdownToIdle) {
+ s32 ret;
+
+ /* Set LED mode */
+ ret = CONF_GetIdleLedMode();
+ if (ret >= 0 && ret <= 2)
+ STM_SetLedMode(ret);
+
+ /* Shutdown to idle */
+ STM_ShutdownToIdle();
+ } else {
+ /* Shutdown to standby */
+ STM_ShutdownToStandby();
+ }
+}
+void Sys_Shutdown(void) {
+ _Sys_Shutdown(ShutdownToDefault);
+}
+void Sys_ShutdownToIdel(void) {
+ _Sys_Shutdown(ShutdownToIdle);
+}
+void Sys_ShutdownToStandby(void) {
+ _Sys_Shutdown(ShutdownToStandby);
+}
+
+void Sys_LoadMenu(void) {
+ _ExitApp();
+ /* Return to the Wii system menu */
+ SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);
+}
+
+void Sys_BackToLoader(void) {
+ if (*((u32*) 0x80001800)) {
+ _ExitApp();
+ exit(0);
+ }
+ // Channel Version
+ Sys_LoadMenu();
+}
+
+bool Sys_IsHermes() {
+ return IOS_GetVersion() == 222 || IOS_GetVersion() == 223;
+}
+
+// #include "prompts/PromptWindows.h"
+
+void ShowMemInfo() {
+ char buf[255];
+ struct mallinfo mymallinfo = mallinfo();
+ 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");
+}
+
+
+#include "wad/title.h"
+
+s32 ios222rev = -69;
+s32 ios223rev = -69;
+s32 ios249rev = -69;
+s32 ios250rev = -69;
+
+s32 IOS_ReloadIOSsafe(int ios)
+{
+ if (ios==222)
+ {
+ if (ios222rev == -69)
+ ios222rev = getIOSrev(0x00000001000000dell);
+
+ if (ios222rev > 0 && (ios222rev != 4 && ios222rev != 5))return -2;
+ }
+ else if (ios==223)
+ {
+ if (ios223rev == -69)
+ ios223rev = getIOSrev(0x00000001000000dfll);
+
+ if (ios223rev > 0 && (ios223rev != 4 && ios223rev != 5))return -2;
+ }
+ else if (ios==249)
+ {
+ if (ios249rev == -69)
+ ios249rev = getIOSrev(0x00000001000000f9ll);
+
+ if (ios249rev >= 0 && !(ios249rev>=9 && ios249rev<65280))return -2;
+ }
+ else if (ios==250)
+ {
+ if (ios250rev == -69)
+ ios250rev = getIOSrev(0x00000001000000fall);
+
+ if (ios250rev >= 0 && !(ios250rev>=9 && ios250rev<65280))return -2;
+ }
+
+ s32 r = IOS_ReloadIOS(ios);
+ if (r >= 0) {
+ WII_Initialize();
+ }
+ return r;
+}
+
+#include
+
+s32 TakeScreenshot(const char *path);
+
+void ScreenShot()
+{
+ time_t rawtime;
+ struct tm * timeinfo;
+ char buffer [80];
+ char buffer2 [80];
+
+ time ( &rawtime );
+ timeinfo = localtime ( &rawtime );
+ //USBLoader_GX_ScreenShot-Month_Day_Hour_Minute_Second_Year.png
+ strftime (buffer,80,"USBLoader_GX_ScreenShot-%b%d%H%M%S%y.png",timeinfo);
+ sprintf(buffer2, "%s/config/%s", bootDevice, buffer);
+
+ 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));
+}
diff --git a/source/sys.h b/source/sys.h
index 2ee89d1b..7fd68b56 100644
--- a/source/sys.h
+++ b/source/sys.h
@@ -1,6 +1,10 @@
#ifndef _SYS_H_
#define _SYS_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void wiilight(int enable);
/* Prototypes */
@@ -23,5 +27,18 @@ extern s32 ios223rev;
extern s32 ios249rev;
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
diff --git a/source/usbloader/apploader.c b/source/usbloader/apploader.c
index e7c8280c..68b55ceb 100644
--- a/source/usbloader/apploader.c
+++ b/source/usbloader/apploader.c
@@ -13,6 +13,7 @@
#include "settings/cfg.h"
#include "gecko.h"
#include "patches/wip.h"
+#include "sys.h"
extern bool geckoinit;
@@ -251,7 +252,7 @@ void PretendThereIsADiscInTheDrive(void *buffer, u32 len)
/** Thanks to WiiPower **/
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)
{
diff --git a/source/usbloader/disc.c b/source/usbloader/disc.c
index 9446b441..876e9e7f 100644
--- a/source/usbloader/disc.c
+++ b/source/usbloader/disc.c
@@ -8,13 +8,15 @@
#include "patches/fst.h"
#include "apploader.h"
#include "disc.h"
-#include "video.h"
#include "wdvd.h"
#include "alternatedol.h"
#include "memory.h"
#include "wbfs.h"
-#include "../gecko.h"
-#include "../fatmounter.h"
+#include "gecko.h"
+#include "fatmounter.h"
+#include "sys.h"
+#include "frag.h"
+#include "usbstorage2.h"
/* Constants */
#define PTABLE_OFFSET 0x40000
@@ -240,15 +242,36 @@ s32 Disc_Wait(void) {
}
s32 Disc_SetUSB(const u8 *id) {
- u32 part = 0;
- if (wbfs_part_fs) {
- part = wbfs_part_lba;
- } else {
- part = wbfs_part_idx ? wbfs_part_idx - 1 : 0;
+ if (is_ios_type(IOS_TYPE_HERMES)) {
+ u32 part = 0;
+ if (wbfs_part_fs) {
+ part = wbfs_part_lba;
+ } else {
+ 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 */
+ 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);
}
- /* Set USB mode */
- return WDVD_SetUSBMode(id, part);
+ gprintf("Setting disc usb thing for wanin\n");
+ return WDVD_SetWBFSMode(WBFS_DEVICE_USB, (u8 *) id);
}
s32 Disc_ReadHeader(void *outbuf) {
diff --git a/source/usbloader/frag.c b/source/usbloader/frag.c
index c30c009b..c9053482 100644
--- a/source/usbloader/frag.c
+++ b/source/usbloader/frag.c
@@ -11,6 +11,9 @@
#include "usbstorage2.h"
#include "frag.h"
#include "utils.h"
+#include "sys.h"
+#include "wdvd.h"
+#include "gecko.h"
FragList *frag_list = NULL;
@@ -152,27 +155,31 @@ int set_frag_list(u8 *id)
{
if (wbfs_part_fs == PART_FS_WBFS) return 0;
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;
}
// (+1 for header which is same size as fragment)
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) {
-// printf("set_frag: %d\n", ret);
return ret;
}
// verify id matches
char discid[8];
memset(discid, 0, sizeof(discid));
- ret = USBStorage_WBFS_Read(0, 6, discid);
- return 0;
+ if (is_ios_type(IOS_TYPE_HERMES)) {
+ ret = USBStorage_WBFS_Read(0, 8, discid);
+ } else {
+ ret = WDVD_UnencryptedRead(discid, 8, 0);
+ }
+ return (memcmp(id, discid, 6) != 0) ? -1 : 0;
}
diff --git a/source/usbloader/usbstorage2.c b/source/usbloader/usbstorage2.c
index 989d9c5a..ba6be032 100644
--- a/source/usbloader/usbstorage2.c
+++ b/source/usbloader/usbstorage2.c
@@ -50,8 +50,8 @@ distribution.
#define USB_IOCTL_WBFS_READ_DISC (WBFS_BASE+0x2)
#define USB_IOCTL_WBFS_READ_DIRECT_DISC (WBFS_BASE+0x3)
#define USB_IOCTL_WBFS_STS_DISC (WBFS_BASE+0x4)
-#define USB_IOCTL_WBFS_SET_DEVICE (WBFS_BASE+0x50)
-#define USB_IOCTL_WBFS_SET_FRAGLIST (WBFS_BASE+0x51)
+#define USB_IOCTL_WBFS_SET_DEVICE (WBFS_BASE+0x14)
+#define USB_IOCTL_WBFS_SET_FRAGLIST (WBFS_BASE+0x15)
#define UMS_HEAPSIZE 0x1000 //0x10000
diff --git a/source/usbloader/wbfs.cpp b/source/usbloader/wbfs.cpp
index 6d9e58b5..7eb1eb61 100644
--- a/source/usbloader/wbfs.cpp
+++ b/source/usbloader/wbfs.cpp
@@ -11,7 +11,6 @@
#include "gecko.h"
Wbfs *current = NULL;
-#define DEBUG_WBFS
/* WBFS 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) {
current = new Wbfs_Fat(wbfsDev, part_lba, part_size);
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) {
current = new Wbfs_Ntfs(wbfsDev, part_lba, part_size);
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 {
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())
{
diff --git a/source/usbloader/wbfs/wbfs_fat.cpp b/source/usbloader/wbfs/wbfs_fat.cpp
index be539ebe..e3957f64 100644
--- a/source/usbloader/wbfs/wbfs_fat.cpp
+++ b/source/usbloader/wbfs/wbfs_fat.cpp
@@ -366,9 +366,6 @@ s32 Wbfs_Fat::GetHeadersCount()
dir_iter = diropen(path);
if (!dir_iter) return 0;
- dir_iter = diropen(path);
- if (!dir_iter) return 0;
-
while (dirnext(dir_iter, fname, &st) == 0) {
//printf("found: %s\n", fname); Wpad_WaitButtonsCommon();
if ((char)fname[0] == '.') continue;
diff --git a/source/usbloader/wdvd.c b/source/usbloader/wdvd.c
index 2143ad79..5b0d65aa 100644
--- a/source/usbloader/wdvd.c
+++ b/source/usbloader/wdvd.c
@@ -17,6 +17,7 @@
#define IOCTL_DI_OFFSET 0xD9
#define IOCTL_DI_DISC_BCA 0xDA
#define IOCTL_DI_STOPMOTOR 0xE3
+#define IOCTL_DI_SETWBFSMODE 0xF4
#define IOCTL_DI_SETUSBMODE 0xF4
#define IOCTL_DI_DISABLERESET 0xF6
@@ -24,6 +25,10 @@
#define DI_SETWBFSMODE 0xfe
#define DI_SETOFFSETBASE 0xf1
+#define IOCTL_DI_SETFRAG 0xF9
+#define IOCTL_DI_GETMODE 0xFA
+#define IOCTL_DI_HELLO 0xFB
+
/* Variables */
static u32 inbuf[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;
}
+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 **/
s32 WDVD_SetUSBMode(const u8 *id, s32 partition) {
s32 ret;
@@ -319,9 +345,7 @@ s32 WDVD_SetUSBMode(const u8 *id, s32 partition) {
/* Copy ID */
if (id) {
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));
@@ -354,3 +378,25 @@ s32 WDVD_Read_Disc_BCA(void *buf)
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;
+}
diff --git a/source/usbloader/wdvd.h b/source/usbloader/wdvd.h
index 0f7848ff..43ca0760 100644
--- a/source/usbloader/wdvd.h
+++ b/source/usbloader/wdvd.h
@@ -22,8 +22,10 @@ extern "C" {
s32 WDVD_WaitForDisc(void);
s32 WDVD_GetCoverStatus(u32 *);
s32 WDVD_DisableReset(u8);
+ s32 WDVD_SetWBFSMode(u32, u8 *);
s32 WDVD_SetUSBMode(const u8 *, s32 partition);
s32 WDVD_Read_Disc_BCA(void *buf);
+ s32 WDVD_SetFragList(int device, void *fraglist, int size);
#ifdef __cplusplus
}
diff --git a/source/video.h b/source/video.h
index 205f9950..9679f765 100644
--- a/source/video.h
+++ b/source/video.h
@@ -13,7 +13,7 @@
void InitVideo ();
void InitVideodebug();
-void StopGX();
+extern "C" void StopGX();
void ResetVideo_Menu();
void Menu_Render();
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,
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);
-s32 TakeScreenshot(const char *path);
+extern "C" s32 TakeScreenshot(const char *path);
extern int screenheight;
extern int screenwidth;
diff --git a/source/wad/title.h b/source/wad/title.h
index 7086e34a..6685cf3b 100644
--- a/source/wad/title.h
+++ b/source/wad/title.h
@@ -42,7 +42,7 @@ extern "C" {
s32 getNameBN(char *name, u64 id);
// 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
char *titleText(u32 kind, u32 title);