From 3919e8b2a53c9de409237813f308b599e2b9c8c5 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Sat, 16 Nov 2019 13:13:33 +1000 Subject: [PATCH] Decompile func0f175f98, func0f175fc8 and func0f175ff0 --- ld/stage1.ld | 2 + src/game/game_175f90.c | 84 +++++++--------------------------- src/game/game_176000.c | 50 ++++++++++++++++++++ src/include/game/game_1668e0.h | 2 +- src/include/game/game_176000.h | 6 +++ src/include/library/library.h | 4 +- 6 files changed, 77 insertions(+), 71 deletions(-) create mode 100644 src/game/game_176000.c create mode 100644 src/include/game/game_176000.h diff --git a/ld/stage1.ld b/ld/stage1.ld index 43694e4cc..3107c27a4 100644 --- a/ld/stage1.ld +++ b/ld/stage1.ld @@ -107,6 +107,7 @@ SECTIONS src/game/game_16cfa0.o (.text); src/game/game_175f50.o (.text); src/game/game_175f90.o (.text); + src/game/game_176000.o (.text); src/game/game_176080.o (.text); src/game/game_176d70.o (.text); src/game/game_187770.o (.text); @@ -192,6 +193,7 @@ SECTIONS src/game/game_16cfa0.o (.rodata); src/game/game_175f50.o (.rodata); src/game/game_175f90.o (.rodata); + src/game/game_176000.o (.rodata); src/game/game_176080.o (.rodata); src/game/game_176d70.o (.rodata); src/game/game_187770.o (.rodata); diff --git a/src/game/game_175f90.c b/src/game/game_175f90.c index 10967af1b..bdde392aa 100644 --- a/src/game/game_175f90.c +++ b/src/game/game_175f90.c @@ -9,77 +9,25 @@ #include "game/game_175f50.h" #include "library/library.h" -const char var7f1b7c90[] = "Apr 6 2000 15:05:01"; -const char var7f1b7ca8[] = ""; -const char var7f1b7cac[] = ""; - void func0f175f90(void) { // empty } -GLOBAL_ASM( -glabel func0f175f98 -/* f175f98: 27bdffe8 */ addiu $sp,$sp,-24 -/* f175f9c: afbf0014 */ sw $ra,0x14($sp) -/* f175fa0: 0fc59ccc */ jal func0f167330 -/* f175fa4: 00000000 */ sll $zero,$zero,0x0 -/* f175fa8: 0c00494a */ jal func00012528 -/* f175fac: 24040005 */ addiu $a0,$zero,0x5 -/* f175fb0: 0fc59cbc */ jal func0f1672f0 -/* f175fb4: 24040005 */ addiu $a0,$zero,0x5 -/* f175fb8: 8fbf0014 */ lw $ra,0x14($sp) -/* f175fbc: 27bd0018 */ addiu $sp,$sp,0x18 -/* f175fc0: 03e00008 */ jr $ra -/* f175fc4: 00000000 */ sll $zero,$zero,0x0 -); +void func0f175f98(void) +{ + func0f167330(); + func00012528(5); + func0f1672f0(5); +} -GLOBAL_ASM( -glabel func0f175fc8 -/* f175fc8: 27bdffe8 */ addiu $sp,$sp,-24 -/* f175fcc: afbf0014 */ sw $ra,0x14($sp) -/* f175fd0: 0c004965 */ jal func00012594 -/* f175fd4: 24040005 */ addiu $a0,$zero,0x5 -/* f175fd8: 0fc59cbc */ jal func0f1672f0 -/* f175fdc: 24040005 */ addiu $a0,$zero,0x5 -/* f175fe0: 8fbf0014 */ lw $ra,0x14($sp) -/* f175fe4: 27bd0018 */ addiu $sp,$sp,0x18 -/* f175fe8: 03e00008 */ jr $ra -/* f175fec: 00000000 */ sll $zero,$zero,0x0 -/* f175ff0: 3c027f1b */ lui $v0,%hi(var7f1b7c90) -/* f175ff4: 03e00008 */ jr $ra -/* f175ff8: 24427c90 */ addiu $v0,$v0,%lo(var7f1b7c90) -/* f175ffc: 00000000 */ sll $zero,$zero,0x0 -/* f176000: 03e00008 */ jr $ra -/* f176004: 00801025 */ or $v0,$a0,$zero -/* f176008: afa50004 */ sw $a1,0x4($sp) -/* f17600c: afa60008 */ sw $a2,0x8($sp) -/* f176010: afa7000c */ sw $a3,0xc($sp) -/* f176014: 03e00008 */ jr $ra -/* f176018: 00801025 */ or $v0,$a0,$zero -/* f17601c: afa50004 */ sw $a1,0x4($sp) -/* f176020: afa60008 */ sw $a2,0x8($sp) -/* f176024: afa7000c */ sw $a3,0xc($sp) -/* f176028: 03e00008 */ jr $ra -/* f17602c: 00801025 */ or $v0,$a0,$zero -/* f176030: afa50004 */ sw $a1,0x4($sp) -/* f176034: afa60008 */ sw $a2,0x8($sp) -/* f176038: afa7000c */ sw $a3,0xc($sp) -/* f17603c: 03e00008 */ jr $ra -/* f176040: 00801025 */ or $v0,$a0,$zero -/* f176044: afa50004 */ sw $a1,0x4($sp) -/* f176048: afa60008 */ sw $a2,0x8($sp) -/* f17604c: afa7000c */ sw $a3,0xc($sp) -/* f176050: 03e00008 */ jr $ra -/* f176054: 00801025 */ or $v0,$a0,$zero -/* f176058: 03e00008 */ jr $ra -/* f17605c: e7ac0000 */ swc1 $f12,0x0($sp) -/* f176060: afa50004 */ sw $a1,0x4($sp) -/* f176064: afa60008 */ sw $a2,0x8($sp) -/* f176068: afa7000c */ sw $a3,0xc($sp) -/* f17606c: 03e00008 */ jr $ra -/* f176070: 00801025 */ or $v0,$a0,$zero -/* f176074: 03e00008 */ jr $ra -/* f176078: 00000000 */ sll $zero,$zero,0x0 -/* f17607c: 00000000 */ sll $zero,$zero,0x0 -); +void func0f175fc8(void) +{ + func00012594(5); + func0f1672f0(5); +} + +char *func0f175ff0(void) +{ + return "Apr 6 2000 15:05:01"; +} diff --git a/src/game/game_176000.c b/src/game/game_176000.c new file mode 100644 index 000000000..b369cb2ba --- /dev/null +++ b/src/game/game_176000.c @@ -0,0 +1,50 @@ +#include +#include "constants.h" +#include "gvars/gvars.h" +#include "setup/setup_000000.h" +#include "setup/setup_0160b0.h" +#include "setup/setup_020df0.h" +#include "types.h" +#include "game/game_1668e0.h" +#include "game/game_175f50.h" +#include "library/library.h" + +GLOBAL_ASM( +glabel func0f176000 +/* f176000: 03e00008 */ jr $ra +/* f176004: 00801025 */ or $v0,$a0,$zero +); + +GLOBAL_ASM( +glabel func0f176008 +/* f176008: afa50004 */ sw $a1,0x4($sp) +/* f17600c: afa60008 */ sw $a2,0x8($sp) +/* f176010: afa7000c */ sw $a3,0xc($sp) +/* f176014: 03e00008 */ jr $ra +/* f176018: 00801025 */ or $v0,$a0,$zero +/* f17601c: afa50004 */ sw $a1,0x4($sp) +/* f176020: afa60008 */ sw $a2,0x8($sp) +/* f176024: afa7000c */ sw $a3,0xc($sp) +/* f176028: 03e00008 */ jr $ra +/* f17602c: 00801025 */ or $v0,$a0,$zero +/* f176030: afa50004 */ sw $a1,0x4($sp) +/* f176034: afa60008 */ sw $a2,0x8($sp) +/* f176038: afa7000c */ sw $a3,0xc($sp) +/* f17603c: 03e00008 */ jr $ra +/* f176040: 00801025 */ or $v0,$a0,$zero +/* f176044: afa50004 */ sw $a1,0x4($sp) +/* f176048: afa60008 */ sw $a2,0x8($sp) +/* f17604c: afa7000c */ sw $a3,0xc($sp) +/* f176050: 03e00008 */ jr $ra +/* f176054: 00801025 */ or $v0,$a0,$zero +/* f176058: 03e00008 */ jr $ra +/* f17605c: e7ac0000 */ swc1 $f12,0x0($sp) +/* f176060: afa50004 */ sw $a1,0x4($sp) +/* f176064: afa60008 */ sw $a2,0x8($sp) +/* f176068: afa7000c */ sw $a3,0xc($sp) +/* f17606c: 03e00008 */ jr $ra +/* f176070: 00801025 */ or $v0,$a0,$zero +/* f176074: 03e00008 */ jr $ra +/* f176078: 00000000 */ sll $zero,$zero,0x0 +/* f17607c: 00000000 */ sll $zero,$zero,0x0 +); diff --git a/src/include/game/game_1668e0.h b/src/include/game/game_1668e0.h index 7befc39e2..c47a20bbd 100644 --- a/src/include/game/game_1668e0.h +++ b/src/include/game/game_1668e0.h @@ -27,7 +27,7 @@ u32 func0f167200(void); u32 func0f167280(void); u32 func0f167294(void); u32 func0f1672a8(void); -u32 func0f1672f0(void); +void func0f1672f0(s32 arg0); u32 func0f167330(void); u32 func0f167350(void); u32 func0f16793c(void); diff --git a/src/include/game/game_176000.h b/src/include/game/game_176000.h new file mode 100644 index 000000000..3f2322005 --- /dev/null +++ b/src/include/game/game_176000.h @@ -0,0 +1,6 @@ +#ifndef IN_GAME_GAME_176000_H +#define IN_GAME_GAME_176000_H +#include +#include "types.h" + +#endif diff --git a/src/include/library/library.h b/src/include/library/library.h index a31331a0e..28efdbb5b 100644 --- a/src/include/library/library.h +++ b/src/include/library/library.h @@ -106,8 +106,8 @@ u32 func00012324(void); s32 func000123c8(s32 arg0, s32 arg1, s32 arg2); u32 func00012430(void); u32 func000124d4(void); -u32 func00012528(void); -u32 func00012594(void); +void func00012528(s32 arg0); +void func00012594(s32 arg0); u32 func00012644(void); u32 func000127b8(void); u32 func00012ab0(void);