diff --git a/loader/source/global.c b/loader/source/global.c index ce528fbb2..ffc0e4090 100644 --- a/loader/source/global.c +++ b/loader/source/global.c @@ -25,7 +25,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include #include #include -#include +#include +#include #include #include #include @@ -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); diff --git a/loader/source/jmp813.S b/loader/source/jmp813.S index 23354caa9..8ac6af17f 100644 --- a/loader/source/jmp813.S +++ b/loader/source/jmp813.S @@ -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 diff --git a/loader/source/main.c b/loader/source/main.c index 97df3db74..923d16f77 100644 --- a/loader/source/main.c +++ b/loader/source/main.c @@ -21,11 +21,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include #include #include -#include +#include +#include #include #include #include #include +#include #include #include @@ -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); diff --git a/multidol/apploader.c b/multidol/apploader.c index ed3a3f4d9..7dd27ec52 100644 --- a/multidol/apploader.c +++ b/multidol/apploader.c @@ -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;