(Wii) updated launcher code

This commit is contained in:
Toad King 2012-08-05 18:36:03 -04:00
parent abc16197d8
commit 07ae3a873c

View File

@ -26,7 +26,8 @@
#elif defined(_XBOX)
#include <xtl.h>
#elif defined(GEKKO)
#include <ogc/machine/processor.h>
#include <fat.h>
#include <ogc/lwp_threads.h>
#include "exec/dol.h"
#endif
@ -67,7 +68,6 @@ void rarch_console_exec(const char *path)
cellSysmoduleUnloadModule(CELL_SYSMODULE_SYSUTIL_NP);
cellSysmoduleUnloadModule(CELL_SYSMODULE_NET);
#elif defined(GEKKO)
uint32_t level;
FILE * fp = fopen(path, "rb");
if (fp == NULL)
{
@ -77,18 +77,21 @@ void rarch_console_exec(const char *path)
fseek(fp, 0, SEEK_END);
size_t size = ftell(fp);
fseek(fp, 0, SEEK_SET);
u8 *mem = (u8 *)0x92000000; // should be safe for this small program to use
uint8_t *mem = (uint8_t *)0x92000000; // should be safe for this small program to use
fread(mem, 1, size, fp);
fclose(fp);
#ifdef HW_RVL
fatUnmount("sd:");
fatUnmount("usb:");
#endif
fatUnmount("carda:");
fatUnmount("cardb:");
void (*ep)() = (void(*)())load_dol_image(mem);
RARCH_LOG("jumping to 0x%08X\n", (unsigned int)ep);
RARCH_LOG("jumping to 0x%08X\n", (uint32_t)ep);
__IOS_ShutdownSubsystems();
_CPU_ISR_Disable (level);
__exception_closeall ();
RARCH_LOG("__exception_closeall() done. Jumping to ep now...\n");
ep();
_CPU_ISR_Restore (level);
SYS_ResetSystem(SYS_SHUTDOWN,0,0);
__lwp_thread_stopmultitasking(ep);
#else
RARCH_WARN("External loading of executables is not supported for this platform.\n");
#endif