mirror of
https://github.com/wiiu-env/WiiUModuleSystem.git
synced 2026-08-22 08:24:04 -05:00
Implement WUMS 0.2
This commit is contained in:
@@ -1,3 +1,27 @@
|
||||
int main(int argc, char** argv){
|
||||
int main(int argc, char **argv) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern __attribute__((weak)) void __wut_socket_init_devoptab();
|
||||
extern __attribute__((weak)) void __wut_socket_fini_devoptab();
|
||||
|
||||
static int __wut_socket_devoptab_added = 0;
|
||||
|
||||
extern void socket_lib_init();
|
||||
|
||||
void __attribute__((weak)) __init_wut_socket() {
|
||||
if(!&__wut_socket_init_devoptab) return;
|
||||
if (!__wut_socket_devoptab_added) {
|
||||
socket_lib_init();
|
||||
__wut_socket_init_devoptab();
|
||||
__wut_socket_devoptab_added = 1;
|
||||
}
|
||||
}
|
||||
|
||||
void __attribute__((weak)) __fini_wut_socket() {
|
||||
if(!&__wut_socket_init_devoptab || !&__wut_socket_fini_devoptab) return;
|
||||
if (__wut_socket_devoptab_added) {
|
||||
__wut_socket_fini_devoptab();
|
||||
__wut_socket_devoptab_added = 0;
|
||||
}
|
||||
}
|
||||
@@ -1,24 +1,7 @@
|
||||
.extern main
|
||||
.extern exit
|
||||
.extern __init_wut
|
||||
.extern __fini_wut
|
||||
|
||||
.section .crt0, "ax", @progbits
|
||||
|
||||
.global __wums_start
|
||||
__wums_start:
|
||||
stwu 1, -0x28(1)
|
||||
mflr 0
|
||||
stw 0, 0x2C(1)
|
||||
stw 31, 0x24(1)
|
||||
or 31, 1, 1
|
||||
stw 3, 0x18(31)
|
||||
stw 4, 0x1C(31)
|
||||
bl __init_wut
|
||||
lwz 4, 0x1C(31)
|
||||
lwz 3, 0x18(31)
|
||||
bl main
|
||||
addi 11, 31, 0x28
|
||||
lwz 0, 0x4(11)
|
||||
mtlr 0
|
||||
lwz 31, -0x4(11)
|
||||
or 1, 11, 11
|
||||
blr
|
||||
b main
|
||||
Reference in New Issue
Block a user