-fixed bug in homebrew/plugin booting (plugins most

likely blackscreen in older revs)
-moved devolution loader (should fix ingame graphical errors)
This commit is contained in:
fix94.1 2012-07-19 18:19:28 +00:00
parent 4e9f70490c
commit 817a2b42d4
3 changed files with 19 additions and 16 deletions

View File

@ -127,7 +127,7 @@ void DML_New_WriteOptions()
// Devolution // Devolution
u8 *loader_bin = NULL; u8 *loader_bin = (u8*)0x93100000;
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)()
@ -157,8 +157,9 @@ void DEVO_SetOptions(const char *path, const char *partition, const char* loader
fseek(f, 0, SEEK_END); fseek(f, 0, SEEK_END);
u32 size = ftell(f); u32 size = ftell(f);
rewind(f); rewind(f);
loader_bin = (u8*)MEM2_alloc(size); memset(loader_bin, 0, size);
fread(loader_bin, 1, size, f); fread(loader_bin, 1, size, f);
DCFlushRange(loader_bin, size);
fclose(f); fclose(f);
} }
@ -232,16 +233,16 @@ void DEVO_SetOptions(const char *path, const char *partition, const char* loader
void DEVO_Boot() void DEVO_Boot()
{ {
// the Devolution blob has an ID string at offset 4 u32 cookie;
puts((const char*)loader_bin + 4); puts((const char*)loader_bin + 4);
gprintf("WiiFlow GC: Devolution initialized. Booting game...\n"); gprintf("WiiFlow GC: Devolution initialized. Booting game...\n");
/* Shutdown IOS subsystems */ /* cleaning up and load dol */
u32 level = IRQ_Disable(); SYS_ResetSystem(SYS_SHUTDOWN, 0, 0);
__IOS_ShutdownSubsystems(); _CPU_ISR_Disable(cookie);
__exception_closeall(); __exception_closeall();
DEVO_Entry(); DEVO_Entry();
IRQ_Restore(level); _CPU_ISR_Restore(cookie);
} }

View File

@ -147,16 +147,17 @@ int BootHomebrew(u64 chan_title)
memcpy(BOOTER_ADDR, app_booter_bin, app_booter_bin_size); memcpy(BOOTER_ADDR, app_booter_bin, app_booter_bin_size);
DCFlushRange(BOOTER_ADDR, app_booter_bin_size); DCFlushRange(BOOTER_ADDR, app_booter_bin_size);
entrypoint entry = (entrypoint)BOOTER_ADDR; entrypoint exeEntryPoint = (entrypoint)BOOTER_ADDR;
u32 cookie;
memmove(ARGS_ADDR, &args, sizeof(args)); memmove(ARGS_ADDR, &args, sizeof(args));
DCFlushRange(ARGS_ADDR, sizeof(args) + args.length); DCFlushRange(ARGS_ADDR, sizeof(args) + args.length);
/* Shutdown IOS subsystems */ /* cleaning up and load dol */
u32 level = IRQ_Disable(); SYS_ResetSystem(SYS_SHUTDOWN, 0, 0);
__IOS_ShutdownSubsystems(); _CPU_ISR_Disable(cookie);
__exception_closeall(); __exception_closeall();
entry(); exeEntryPoint();
IRQ_Restore(level); _CPU_ISR_Restore(cookie);
return 0; return 0;
} }

View File

@ -871,13 +871,13 @@ void CMenu::_launchGC(dir_discHdr *hdr, bool disc)
#ifndef DOLPHIN #ifndef DOLPHIN
USBStorage2_Deinit(); USBStorage2_Deinit();
USB_Deinitialize(); USB_Deinitialize();
SDHC_Init();
#endif #endif
GC_SetVideoMode(videoMode, videoSetting); GC_SetVideoMode(videoMode, videoSetting);
GC_SetLanguage(GClanguage); GC_SetLanguage(GClanguage);
if(loader == 2) if(loader == 2)
DEVO_Boot(); DEVO_Boot();
SDHC_Init();
DML_New_WriteOptions(); DML_New_WriteOptions();
WII_Initialize(); WII_Initialize();
if(WII_LaunchTitle(0x100000100LL) < 0) if(WII_LaunchTitle(0x100000100LL) < 0)
@ -887,7 +887,6 @@ void CMenu::_launchGC(dir_discHdr *hdr, bool disc)
void CMenu::_launchHomebrew(const char *filepath, vector<string> arguments) void CMenu::_launchHomebrew(const char *filepath, vector<string> arguments)
{ {
Nand::Instance()->Disable_Emu(); Nand::Instance()->Disable_Emu();
m_reload = true;
Channels channel; Channels channel;
u64 title = SYSTEM_MENU; u64 title = SYSTEM_MENU;
@ -906,9 +905,11 @@ void CMenu::_launchHomebrew(const char *filepath, vector<string> arguments)
AddBootArgument(filepath); AddBootArgument(filepath);
for(u32 i = 0; i < arguments.size(); ++i) for(u32 i = 0; i < arguments.size(); ++i)
AddBootArgument(arguments[i].c_str()); AddBootArgument(arguments[i].c_str());
#ifndef DOLPHIN #ifndef DOLPHIN
USBStorage2_Deinit(); USBStorage2_Deinit();
USB_Deinitialize(); USB_Deinitialize();
SDHC_Close();
#endif #endif
BootHomebrew(title); BootHomebrew(title);
} }