Skip to content

Commit 155c5cb

Browse files
committed
restore gamecube rebootstub
1 parent 25d8b3d commit 155c5cb

1 file changed

Lines changed: 6 additions & 10 deletions

File tree

libogc/system.c

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ distribution.
3232
#include <stdlib.h>
3333
#include <string.h>
3434
#include <stdio.h>
35+
#include <unistd.h>
36+
3537
#include <malloc.h>
3638
#include <time.h>
3739
#include <sys/iosupport.h>
@@ -262,16 +264,8 @@ static __inline__ void __lwp_syswd_free(alarm_st *alarm)
262264
__lwp_objmgr_free(&sys_alarm_objects,&alarm->object);
263265
}
264266

265-
#ifdef HW_DOL
266267
#define SOFTRESET_ADR *((vu32*)0xCC003024)
267-
void __reload(void) { SOFTRESET_ADR=0; }
268268

269-
void __syscall_exit(int status)
270-
{
271-
SYS_ResetSystem(SYS_SHUTDOWN,0,0);
272-
__lwp_thread_stopmultitasking(__reload);
273-
}
274-
#else
275269
static void (*reload)(void) = (void(*)(void))0x80001800;
276270

277271
static bool __stub_found(void)
@@ -297,10 +291,12 @@ void __syscall_exit(int status)
297291
SYS_ResetSystem(SYS_SHUTDOWN,0,0);
298292
__lwp_thread_stopmultitasking(reload);
299293
}
294+
#ifdef HW_DOL
295+
SOFTRESET_ADR=0;
296+
#else
300297
SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);
301-
}
302-
303298
#endif
299+
}
304300

305301

306302
void __syscall_malloc_lock(struct _reent *ptr) {

0 commit comments

Comments
 (0)