Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions loader/source/global.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <ogc/dsp.h>
#include <ogc/es.h>
#include <ogc/gx_struct.h>
#include <ogc/lwp_threads.h>
#include <ogc/lwp.h>
#include <ogc/machine/processor.h>
#include <ogc/system.h>
#include <ogc/video.h>
#include <ogc/wiilaunch.h>
Expand Down Expand Up @@ -292,7 +293,7 @@ void ExitToLoader(int ret)
VIDEO_WaitVSync();
//This whole exit routine is basically equal to the game exit stub
if(*(vu32*)0x80001804 == 0x53545542 && *(vu32*)0x80001808 == 0x48415858) //stubhaxx
__lwp_thread_stopmultitasking(stub);
stub();
__ES_Init(); //make sure this is back open
u32 numviews;
STACK_ALIGN(tikview,views,4,32);
Expand Down
12 changes: 2 additions & 10 deletions loader/source/jmp813.S
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@

.extern __InitBATS
.extern __InitPS
.extern __InitFPRS
.extern __InitCache
.extern __InitSystem
.extern PPCEarlyInit

.globl _jmp813
_jmp813:
bl __InitBATS # Initialize BATs to a clear and known state
bl PPCEarlyInit
bl __initRegisters # Initialize the General Purpose Registers
bl __InitPS # Initialize Paired Singles
bl __InitFPRS # Initialize the FPR's
bl __InitCache # Initialize the system caches
bl __InitSystem # Initialize more cache aspects, clear a few SPR's, and disable interrupts.
lis r3, 0x8130
mtlr r3
blr
Expand Down
10 changes: 7 additions & 3 deletions loader/source/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <gccore.h>
#include <sys/param.h>
#include <ogc/lwp_watchdog.h>
#include <ogc/lwp_threads.h>
#include <ogc/lwp.h>
#include <ogc/machine/processor.h>
#include <wiiuse/wpad.h>
#include <wiidrc/wiidrc.h>
#include <wupc/wupc.h>
#include <di/di.h>
#include <stdlib.h>
#include <unistd.h>
#include <locale.h>

Expand Down Expand Up @@ -1641,8 +1643,10 @@ int main(int argc, char **argv)

write16(0xD8B420A, 0); //disable MEMPROT again after reload
//u32 level = IRQ_Disable();
__exception_closeall();
__lwp_thread_closeall();
/* DO the equivalent of the now removed __exception_closeall(): */
PPCIrqUnlockByMsr(MSR_FP | MSR_RI);
PPCExcptInit();
/* TODO: figure out how to replace this: __lwp_thread_closeall(); */

DVDStartCache(); //waits for kernel start
DCInvalidateRange((void*)0x90000000, 0x1000000);
Expand Down
2 changes: 1 addition & 1 deletion multidol/apploader.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
typedef int (*app_main)(char **dst, u32 *size, u32 *offset);
typedef void (*app_init)(int (*report)(const char *fmt, ...));
typedef void *(*app_final)();
typedef void (*app_entry)(void (**init)(int (*report)(const char *fmt, ...)), int (**main)(), void *(**final)());
typedef void (*app_entry)(void (**init)(int (*report)(const char *fmt, ...)), app_main *main, void *(**final)());

static u8 *appldr = (u8*)0x81200000;
static struct _TGCInfo *TGCInfo = (struct _TGCInfo*)0x930031E0;
Expand Down