(Wii) updated launcher code

This commit is contained in:
Toad King 2012-08-05 18:36:03 -04:00
parent abc16197d8
commit 07ae3a873c
1 changed files with 13 additions and 10 deletions

View File

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