mirror of
https://github.com/Fledge68/WiiFlow_Lite.git
synced 2024-12-28 12:51:52 +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, \
|
||||
Spayrosam, Bluescreen81, Chappy23, fledge68, \
|
||||
BlindDude, Bubba, DJTaz, OggZee, entropy, \
|
||||
Usptactical, WiiPower, Hermes, Spidy1000, \
|
||||
Usptactical, WiiPower, Hermes, Spidy1000, megazig, \
|
||||
Dimok, Kovani, Drexyl, DvZ, Etheboss, stfour, \
|
||||
GaiaKnight, nibb, NJ7, Plasma, Pakatus, giantpune, \
|
||||
wolf, ravmn, spidercaleb, Ziggy34, xFede, \
|
||||
|
@ -141,7 +141,7 @@ void DML_New_WriteOptions()
|
||||
|
||||
|
||||
// Devolution
|
||||
u8 *loader_bin = (u8*)0x93100000;
|
||||
u8 *loader_bin = NULL;
|
||||
extern void __exception_closeall();
|
||||
static gconfig *DEVO_CONFIG = (gconfig*)0x80000020;
|
||||
#define DEVO_Entry() ((void(*)(void))loader_bin)()
|
||||
@ -167,7 +167,7 @@ bool DEVO_Installed(const char* path)
|
||||
|
||||
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)
|
||||
@ -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);
|
||||
FILE *f = fopen(loader_path, "rb");
|
||||
if(f)
|
||||
{
|
||||
gprintf("Read devolution loader: \"%s\"\n", loader_path);
|
||||
{
|
||||
gprintf("Read Devolution Loader: \"%s\"\n", loader_path);
|
||||
fseek(f, 0, SEEK_END);
|
||||
u32 size = ftell(f);
|
||||
rewind(f);
|
||||
memset(loader_bin, 0, size);
|
||||
loader_bin = malloc(size);
|
||||
fread(loader_bin, 1, size, f);
|
||||
DCFlushRange(loader_bin, size);
|
||||
fclose(f);
|
||||
}
|
||||
else
|
||||
gprintf("Uh oh!! What now?\n");
|
||||
|
||||
DEVO_ShowReport();
|
||||
{
|
||||
gprintf("Devolution loader.bin not found!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
DEVO_ShowReport();
|
||||
|
||||
//start writing cfg to mem
|
||||
struct stat st;
|
||||
@ -199,7 +201,7 @@ void DEVO_SetOptions(const char *isopath, const char *partition, const char *loa
|
||||
|
||||
stat(isopath, &st);
|
||||
f = fopen(isopath, "rb");
|
||||
gprintf("Read iso file: \"%s\"\n", isopath);
|
||||
gprintf("Read ISO File: \"%s\"\n", isopath);
|
||||
fread((u8*)0x80000000, 1, 32, f);
|
||||
fclose(f);
|
||||
|
||||
@ -214,16 +216,16 @@ void DEVO_SetOptions(const char *isopath, const char *partition, const char *loa
|
||||
strcpy(iso2path, isopath);
|
||||
char *ptz = (char *)NULL;
|
||||
ptz = strstr(iso2path, "game.iso");
|
||||
if(ptz != NULL)
|
||||
if(ptz != NULL)
|
||||
strncpy(ptz, "gam1.iso", 8);
|
||||
|
||||
|
||||
f = fopen(iso2path, "rb");
|
||||
if(f)
|
||||
{
|
||||
gprintf("Found 2nd iso file for multi DVD game: \"%s\"\n", iso2path);
|
||||
stat(iso2path, &st);
|
||||
DEVO_CONFIG->disc2_cluster = st.st_ino;
|
||||
fclose(f);
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
// 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()
|
||||
{
|
||||
u32 cookie;
|
||||
puts((const char*)loader_bin + 4);
|
||||
gprintf("WiiFlow GC: Devolution initialized. Booting game...\n");
|
||||
|
||||
/* cleaning up and load dol */
|
||||
SYS_ResetSystem(SYS_SHUTDOWN, 0, 0);
|
||||
|
@ -28,9 +28,6 @@ u32 buffer_size = 0;
|
||||
|
||||
static vector<string> Arguments;
|
||||
|
||||
static u32 stubtitlepositions[8] = { 0x80001bf2, 0x80001bf3, 0x80001c06, 0x80001c07,
|
||||
0x80001bfa, 0x80001bfb, 0x80001c0a, 0x80001c0b };
|
||||
|
||||
bool IsDollZ (u8 *buff)
|
||||
{
|
||||
u8 dollz_stamp[] = {0x3C};
|
||||
@ -109,37 +106,18 @@ static int SetupARGV(struct __argv * args)
|
||||
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 */
|
||||
memset((void*)0x80001800, 0, 0x1800);
|
||||
|
||||
/* Copy our own stub into memory */
|
||||
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);
|
||||
}
|
||||
|
||||
int BootHomebrew(u64 chan_title)
|
||||
int BootHomebrew()
|
||||
{
|
||||
writeStub(chan_title);
|
||||
struct __argv args;
|
||||
if (!IsDollZ(EXECUTE_ADDR))
|
||||
SetupARGV(&args);
|
||||
|
@ -1,8 +1,9 @@
|
||||
#ifndef _BOOTHOMEBREW_H_
|
||||
#define _BOOTHOMEBREW_H_
|
||||
|
||||
int BootHomebrew(u64 chan_title);
|
||||
int BootHomebrew();
|
||||
void AddBootArgument(const char * arg);
|
||||
int LoadHomebrew(const char * filepath);
|
||||
void writeStub();
|
||||
|
||||
#endif
|
||||
|
@ -876,8 +876,10 @@ void CMenu::_launchGC(dir_discHdr *hdr, bool disc)
|
||||
GC_SetVideoMode(videoMode, videoSetting);
|
||||
GC_SetLanguage(GClanguage);
|
||||
if(loader == 2)
|
||||
{
|
||||
writeStub();
|
||||
DEVO_Boot();
|
||||
|
||||
}
|
||||
DML_New_WriteOptions();
|
||||
WII_Initialize();
|
||||
if(WII_LaunchTitle(0x100000100LL) < 0)
|
||||
@ -888,11 +890,6 @@ void CMenu::_launchHomebrew(const char *filepath, vector<string> arguments)
|
||||
{
|
||||
Nand::Instance()->Disable_Emu();
|
||||
|
||||
Channels channel;
|
||||
u64 title = SYSTEM_MENU;
|
||||
if(channel.GetRequestedIOS(RETURN_CHANNEL) != 0)
|
||||
title = RETURN_CHANNEL;
|
||||
|
||||
m_gcfg1.save(true);
|
||||
m_gcfg2.save(true);
|
||||
m_cat.save(true);
|
||||
@ -911,7 +908,8 @@ void CMenu::_launchHomebrew(const char *filepath, vector<string> arguments)
|
||||
USBStorage2_Deinit();
|
||||
USB_Deinitialize();
|
||||
#endif
|
||||
BootHomebrew(title);
|
||||
writeStub();
|
||||
BootHomebrew();
|
||||
}
|
||||
|
||||
int CMenu::_loadIOS(u8 gameIOS, int userIOS, string id, bool emu_channel)
|
||||
|
Loading…
Reference in New Issue
Block a user