Skip to content

Commit

Permalink
Apply workaround for old loaders
Browse files Browse the repository at this point in the history
Add IPC buffer fallback just in case
  • Loading branch information
Extrems committed Feb 18, 2025
1 parent 75b2420 commit b397d95
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions libogc/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ extern u8 __isIPL[];
extern u8 __Arena1Lo[], __Arena1Hi[];
#if defined(HW_RVL)
extern u8 __Arena2Lo[], __Arena2Hi[];
extern u8 __ipcbufferLo[], __ipcbufferHi[];
#endif

u8 *__argvArena1Lo = (u8*)0xdeadbeef;
Expand Down Expand Up @@ -459,6 +460,8 @@ static void __sysarena_init(void)
if (__argvArena1Lo != (u8*)0xdeadbeef) __myArena1Lo = __argvArena1Lo;
#if defined(HW_DOL)
if (__myArena1Lo == NULL) __myArena1Lo = *(void**)0x80000030;
if (__myArena1Hi == NULL) __myArena1Hi = *(void**)0x80000038;
if (__myArena1Hi == NULL) __myArena1Hi = *(void**)0x800000EC;
if (__myArena1Hi == NULL) __myArena1Hi = *(void**)0x80000034;
#elif defined(HW_RVL)
if (__myArena1Lo == NULL) __myArena1Lo = *(void**)0x8000310C;
Expand Down Expand Up @@ -487,6 +490,11 @@ static void __ipcbuffer_init(void)
{
__ipcbufferlo = *(void**)0x80003130;
__ipcbufferhi = *(void**)0x80003134;

if((__ipcbufferhi - __ipcbufferlo) == 0) {
__ipcbufferlo = __ipcbufferLo;
__ipcbufferhi = __ipcbufferHi;
}
}
#endif

Expand Down

0 comments on commit b397d95

Please sign in to comment.