diff --git a/libraries/wutcrt/crt0_rpl.s b/libraries/wutcrt/crt0_rpl.s index 3bfcf61..a1b5366 100644 --- a/libraries/wutcrt/crt0_rpl.s +++ b/libraries/wutcrt/crt0_rpl.s @@ -5,9 +5,11 @@ .global _start _start: - stwu 1, -0x8(1) - stw 3, 0(1) - stw 4, 4(1) + stwu 1, -0x14(1) + mflr 0 + stw 0, 0x18(1) + stw 3, 0xC(1) + stw 4, 0x10(1) cmpwi 3, 2 beq unload @@ -15,17 +17,18 @@ load: # Load bl __init_wut bl __eabi - lwz 3, 0(1) - lwz 4, 4(1) + lwz 3, 0xC(1) + lwz 4, 0x10(1) bl rpl_main - addi 1, 1, 0x8 + addi 1, 1, 0x14 blr unload: # Handle unload - lwz 3, 0(1) - lwz 4, 4(1) + lwz 3, 0xC(1) + lwz 4, 0x10(1) bl rpl_main bl __fini_wut - addi 1, 1, 0x8 + addi 1, 1, 0x14 b exit + diff --git a/libraries/wutcrt/crt0_rpx.s b/libraries/wutcrt/crt0_rpx.s index 5952f2e..319bfde 100644 --- a/libraries/wutcrt/crt0_rpx.s +++ b/libraries/wutcrt/crt0_rpx.s @@ -5,15 +5,15 @@ .global _start _start: - stwu 1, -0x8(1) - stw 3, 0(1) - stw 4, 4(1) + stwu 1, -0x14(1) + mflr 0 + stw 0, 0x18(1) + stw 3, 0xC(1) + stw 4, 0x10(1) bl __init_wut - lwz 3, 0(1) - lwz 4, 4(1) + lwz 3, 0xC(1) + lwz 4, 0x10(1) bl main bl __fini_wut - # Calling __fini is leading to crashes! - # bl __fini - addi 1, 1, 0x8 + addi 1, 1, 0x14 b exit