mirror of
https://github.com/Fledge68/WiiFlow_Lite.git
synced 2024-11-30 15:14:18 +01:00
-update wiiflow stub (thanks alot to megazig for it!)
-devolution will now return to wiiflow using the hidden channel -added megazig to thanks list -allocating memory for devolution instead of using a fixed position (seems to work just fine now)
This commit is contained in:
parent
e16c2f566e
commit
e1406a5921
BIN
data/stub.bin
BIN
data/stub.bin
Binary file not shown.
@ -32,7 +32,7 @@
|
|||||||
Celtiore, Jiiwah, FluffyKiwi, Roku93, Yardape8000, \
|
Celtiore, Jiiwah, FluffyKiwi, Roku93, Yardape8000, \
|
||||||
Spayrosam, Bluescreen81, Chappy23, fledge68, \
|
Spayrosam, Bluescreen81, Chappy23, fledge68, \
|
||||||
BlindDude, Bubba, DJTaz, OggZee, entropy, \
|
BlindDude, Bubba, DJTaz, OggZee, entropy, \
|
||||||
Usptactical, WiiPower, Hermes, Spidy1000, \
|
Usptactical, WiiPower, Hermes, Spidy1000, megazig, \
|
||||||
Dimok, Kovani, Drexyl, DvZ, Etheboss, stfour, \
|
Dimok, Kovani, Drexyl, DvZ, Etheboss, stfour, \
|
||||||
GaiaKnight, nibb, NJ7, Plasma, Pakatus, giantpune, \
|
GaiaKnight, nibb, NJ7, Plasma, Pakatus, giantpune, \
|
||||||
wolf, ravmn, spidercaleb, Ziggy34, xFede, \
|
wolf, ravmn, spidercaleb, Ziggy34, xFede, \
|
||||||
|
@ -141,7 +141,7 @@ void DML_New_WriteOptions()
|
|||||||
|
|
||||||
|
|
||||||
// Devolution
|
// Devolution
|
||||||
u8 *loader_bin = (u8*)0x93100000;
|
u8 *loader_bin = NULL;
|
||||||
extern void __exception_closeall();
|
extern void __exception_closeall();
|
||||||
static gconfig *DEVO_CONFIG = (gconfig*)0x80000020;
|
static gconfig *DEVO_CONFIG = (gconfig*)0x80000020;
|
||||||
#define DEVO_Entry() ((void(*)(void))loader_bin)()
|
#define DEVO_Entry() ((void(*)(void))loader_bin)()
|
||||||
@ -167,7 +167,7 @@ bool DEVO_Installed(const char* path)
|
|||||||
|
|
||||||
void DEVO_ShowReport(void)
|
void DEVO_ShowReport(void)
|
||||||
{
|
{
|
||||||
gprintf("\n%.72s\n\n", (char *)0x93100004);
|
gprintf("%s\n", (char*)loader_bin + 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DEVO_SetOptions(const char *isopath, const char *partition, const char *loader, const char *gameID, bool memcard_emu)
|
void DEVO_SetOptions(const char *isopath, const char *partition, const char *loader, const char *gameID, bool memcard_emu)
|
||||||
@ -177,20 +177,22 @@ void DEVO_SetOptions(const char *isopath, const char *partition, const char *loa
|
|||||||
snprintf(loader_path, sizeof(loader_path), "%s/loader.bin", loader);
|
snprintf(loader_path, sizeof(loader_path), "%s/loader.bin", loader);
|
||||||
FILE *f = fopen(loader_path, "rb");
|
FILE *f = fopen(loader_path, "rb");
|
||||||
if(f)
|
if(f)
|
||||||
{
|
{
|
||||||
gprintf("Read devolution loader: \"%s\"\n", loader_path);
|
gprintf("Read Devolution Loader: \"%s\"\n", loader_path);
|
||||||
fseek(f, 0, SEEK_END);
|
fseek(f, 0, SEEK_END);
|
||||||
u32 size = ftell(f);
|
u32 size = ftell(f);
|
||||||
rewind(f);
|
rewind(f);
|
||||||
memset(loader_bin, 0, size);
|
loader_bin = malloc(size);
|
||||||
fread(loader_bin, 1, size, f);
|
fread(loader_bin, 1, size, f);
|
||||||
DCFlushRange(loader_bin, size);
|
|
||||||
fclose(f);
|
fclose(f);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
gprintf("Uh oh!! What now?\n");
|
{
|
||||||
|
gprintf("Devolution loader.bin not found!\n");
|
||||||
DEVO_ShowReport();
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
DEVO_ShowReport();
|
||||||
|
|
||||||
//start writing cfg to mem
|
//start writing cfg to mem
|
||||||
struct stat st;
|
struct stat st;
|
||||||
@ -199,7 +201,7 @@ void DEVO_SetOptions(const char *isopath, const char *partition, const char *loa
|
|||||||
|
|
||||||
stat(isopath, &st);
|
stat(isopath, &st);
|
||||||
f = fopen(isopath, "rb");
|
f = fopen(isopath, "rb");
|
||||||
gprintf("Read iso file: \"%s\"\n", isopath);
|
gprintf("Read ISO File: \"%s\"\n", isopath);
|
||||||
fread((u8*)0x80000000, 1, 32, f);
|
fread((u8*)0x80000000, 1, 32, f);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
|
||||||
@ -214,16 +216,16 @@ void DEVO_SetOptions(const char *isopath, const char *partition, const char *loa
|
|||||||
strcpy(iso2path, isopath);
|
strcpy(iso2path, isopath);
|
||||||
char *ptz = (char *)NULL;
|
char *ptz = (char *)NULL;
|
||||||
ptz = strstr(iso2path, "game.iso");
|
ptz = strstr(iso2path, "game.iso");
|
||||||
if(ptz != NULL)
|
if(ptz != NULL)
|
||||||
strncpy(ptz, "gam1.iso", 8);
|
strncpy(ptz, "gam1.iso", 8);
|
||||||
|
|
||||||
f = fopen(iso2path, "rb");
|
f = fopen(iso2path, "rb");
|
||||||
if(f)
|
if(f)
|
||||||
{
|
{
|
||||||
gprintf("Found 2nd iso file for multi DVD game: \"%s\"\n", iso2path);
|
gprintf("Found 2nd iso file for multi DVD game: \"%s\"\n", iso2path);
|
||||||
stat(iso2path, &st);
|
stat(iso2path, &st);
|
||||||
DEVO_CONFIG->disc2_cluster = st.st_ino;
|
DEVO_CONFIG->disc2_cluster = st.st_ino;
|
||||||
fclose(f);
|
fclose(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
// make sure these directories exist, they are required for Devolution to function correctly
|
// make sure these directories exist, they are required for Devolution to function correctly
|
||||||
@ -281,8 +283,6 @@ void DEVO_SetOptions(const char *isopath, const char *partition, const char *loa
|
|||||||
void DEVO_Boot()
|
void DEVO_Boot()
|
||||||
{
|
{
|
||||||
u32 cookie;
|
u32 cookie;
|
||||||
puts((const char*)loader_bin + 4);
|
|
||||||
gprintf("WiiFlow GC: Devolution initialized. Booting game...\n");
|
|
||||||
|
|
||||||
/* cleaning up and load dol */
|
/* cleaning up and load dol */
|
||||||
SYS_ResetSystem(SYS_SHUTDOWN, 0, 0);
|
SYS_ResetSystem(SYS_SHUTDOWN, 0, 0);
|
||||||
|
@ -28,9 +28,6 @@ u32 buffer_size = 0;
|
|||||||
|
|
||||||
static vector<string> Arguments;
|
static vector<string> Arguments;
|
||||||
|
|
||||||
static u32 stubtitlepositions[8] = { 0x80001bf2, 0x80001bf3, 0x80001c06, 0x80001c07,
|
|
||||||
0x80001bfa, 0x80001bfb, 0x80001c0a, 0x80001c0b };
|
|
||||||
|
|
||||||
bool IsDollZ (u8 *buff)
|
bool IsDollZ (u8 *buff)
|
||||||
{
|
{
|
||||||
u8 dollz_stamp[] = {0x3C};
|
u8 dollz_stamp[] = {0x3C};
|
||||||
@ -109,37 +106,18 @@ static int SetupARGV(struct __argv * args)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void writeStub(u64 chan_title)
|
void writeStub()
|
||||||
{
|
{
|
||||||
u8 i;
|
|
||||||
u32 digit;
|
|
||||||
char title[2][9];
|
|
||||||
snprintf(title[0], sizeof(title[0]), "%08x", TITLE_UPPER(chan_title));
|
|
||||||
snprintf(title[1], sizeof(title[1]), "%08x", TITLE_LOWER(chan_title));
|
|
||||||
|
|
||||||
/* Clear potential homebrew channel stub */
|
/* Clear potential homebrew channel stub */
|
||||||
memset((void*)0x80001800, 0, 0x1800);
|
memset((void*)0x80001800, 0, 0x1800);
|
||||||
|
|
||||||
/* Copy our own stub into memory */
|
/* Copy our own stub into memory */
|
||||||
memcpy((void*)0x80001800, stub_bin, stub_bin_size);
|
memcpy((void*)0x80001800, stub_bin, stub_bin_size);
|
||||||
|
|
||||||
/* Write in the Title ID we got */
|
|
||||||
for(i = 0; i < 4; i++)
|
|
||||||
{
|
|
||||||
sscanf(&title[0][i*2], "%02x", &digit);
|
|
||||||
//gprintf("%x\n", digit);
|
|
||||||
*(vu8*)stubtitlepositions[i] = digit;
|
|
||||||
sscanf(&title[1][i*2], "%02x", &digit);
|
|
||||||
//gprintf("%x\n", digit);
|
|
||||||
*(vu8*)stubtitlepositions[i+4] = digit;
|
|
||||||
}
|
|
||||||
|
|
||||||
DCFlushRange((void*)0x80001800, stub_bin_size);
|
DCFlushRange((void*)0x80001800, stub_bin_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
int BootHomebrew(u64 chan_title)
|
int BootHomebrew()
|
||||||
{
|
{
|
||||||
writeStub(chan_title);
|
|
||||||
struct __argv args;
|
struct __argv args;
|
||||||
if (!IsDollZ(EXECUTE_ADDR))
|
if (!IsDollZ(EXECUTE_ADDR))
|
||||||
SetupARGV(&args);
|
SetupARGV(&args);
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
#ifndef _BOOTHOMEBREW_H_
|
#ifndef _BOOTHOMEBREW_H_
|
||||||
#define _BOOTHOMEBREW_H_
|
#define _BOOTHOMEBREW_H_
|
||||||
|
|
||||||
int BootHomebrew(u64 chan_title);
|
int BootHomebrew();
|
||||||
void AddBootArgument(const char * arg);
|
void AddBootArgument(const char * arg);
|
||||||
int LoadHomebrew(const char * filepath);
|
int LoadHomebrew(const char * filepath);
|
||||||
|
void writeStub();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -876,8 +876,10 @@ void CMenu::_launchGC(dir_discHdr *hdr, bool disc)
|
|||||||
GC_SetVideoMode(videoMode, videoSetting);
|
GC_SetVideoMode(videoMode, videoSetting);
|
||||||
GC_SetLanguage(GClanguage);
|
GC_SetLanguage(GClanguage);
|
||||||
if(loader == 2)
|
if(loader == 2)
|
||||||
|
{
|
||||||
|
writeStub();
|
||||||
DEVO_Boot();
|
DEVO_Boot();
|
||||||
|
}
|
||||||
DML_New_WriteOptions();
|
DML_New_WriteOptions();
|
||||||
WII_Initialize();
|
WII_Initialize();
|
||||||
if(WII_LaunchTitle(0x100000100LL) < 0)
|
if(WII_LaunchTitle(0x100000100LL) < 0)
|
||||||
@ -888,11 +890,6 @@ void CMenu::_launchHomebrew(const char *filepath, vector<string> arguments)
|
|||||||
{
|
{
|
||||||
Nand::Instance()->Disable_Emu();
|
Nand::Instance()->Disable_Emu();
|
||||||
|
|
||||||
Channels channel;
|
|
||||||
u64 title = SYSTEM_MENU;
|
|
||||||
if(channel.GetRequestedIOS(RETURN_CHANNEL) != 0)
|
|
||||||
title = RETURN_CHANNEL;
|
|
||||||
|
|
||||||
m_gcfg1.save(true);
|
m_gcfg1.save(true);
|
||||||
m_gcfg2.save(true);
|
m_gcfg2.save(true);
|
||||||
m_cat.save(true);
|
m_cat.save(true);
|
||||||
@ -911,7 +908,8 @@ void CMenu::_launchHomebrew(const char *filepath, vector<string> arguments)
|
|||||||
USBStorage2_Deinit();
|
USBStorage2_Deinit();
|
||||||
USB_Deinitialize();
|
USB_Deinitialize();
|
||||||
#endif
|
#endif
|
||||||
BootHomebrew(title);
|
writeStub();
|
||||||
|
BootHomebrew();
|
||||||
}
|
}
|
||||||
|
|
||||||
int CMenu::_loadIOS(u8 gameIOS, int userIOS, string id, bool emu_channel)
|
int CMenu::_loadIOS(u8 gameIOS, int userIOS, string id, bool emu_channel)
|
||||||
|
Loading…
Reference in New Issue
Block a user