mirror of
https://github.com/wiiu-env/wut.git
synced 2024-12-13 18:41:52 +01:00
f281be50ab
RPL files are shared libraries (like a .dll file), as opposed to the RPX files which are executables (like a .exe file). Use rpl_main as defined in dynload.h like one would DllMain on Windows.
32 lines
400 B
ArmAsm
32 lines
400 B
ArmAsm
.extern main
|
|
.extern exit
|
|
.extern __init_wut
|
|
.extern __fini_wut
|
|
|
|
.global _start
|
|
_start:
|
|
stwu 1, -0x8(1)
|
|
stw 3, 0(1)
|
|
stw 4, 4(1)
|
|
cmpwi 3, 2
|
|
beq unload
|
|
|
|
load:
|
|
# Load
|
|
bl __fini_wut
|
|
bl __eabi
|
|
lwz 3, 0(1)
|
|
lwz 4, 4(1)
|
|
bl rpl_main
|
|
addi 1, 1, 0x8
|
|
blr
|
|
|
|
unload:
|
|
# Handle unload
|
|
lwz 3, 0(1)
|
|
lwz 4, 4(1)
|
|
bl rpl_main
|
|
bl __fini_wut
|
|
addi 1, 1, 0x8
|
|
b exit
|