Decompile n_alInit

This commit is contained in:
Ryan Dwyer
2021-03-28 23:31:52 +10:00
parent 2337528e3b
commit 51b19d3bd7
7 changed files with 19 additions and 39 deletions
+1
View File
@@ -83,6 +83,7 @@ $(B_DIR)/lib/ultra/libc/llcvt.o: MIPSISET := -mips3 -32
# it introduces a race condition when using make -j because they create a
# temporary include-stdin.u file during compilation.
# For these files, see their explicit targets towards the end of this file.
$(B_DIR)/lib/lib_2fba0.o: OPT_LVL := -g
$(B_DIR)/lib/lib_30ce0.o: OPT_LVL := -g
$(B_DIR)/lib/lib_3a100.o: OPT_LVL := -g
$(B_DIR)/lib/lib_3d280.o: OPT_LVL := -g
+1 -1
View File
@@ -85,7 +85,7 @@ extern u16 *var8005f044;
extern u32 var8005f048;
extern u32 var8005f0a8;
extern u32 var8005f108;
extern u32 var8005f110;
extern ALGlobals *var8005f110;
extern ALGlobals *alGlobals;
extern u32 var8005f120;
extern u32 var8005f124;
+1 -1
View File
@@ -4,6 +4,6 @@
#include "data.h"
#include "types.h"
u32 func0002fba0(void);
void n_alInit(ALGlobals *g, ALSynConfig *c);
#endif
+1 -1
View File
@@ -4,6 +4,6 @@
#include "data.h"
#include "types.h"
u32 func00030ce0(void);
void n_alSynNew(ALSynConfig *c);
#endif
+2 -2
View File
@@ -829,7 +829,7 @@ glabel amgrCreate
.PF00008fac:
/* 8fac: 3c048009 */ lui $a0,0x8009
/* 8fb0: 24841dd0 */ addiu $a0,$a0,0x1dd0
/* 8fb4: 0c00bd28 */ jal func0002fba0
/* 8fb4: 0c00bd28 */ jal n_alInit
/* 8fb8: 02002825 */ move $a1,$s0
/* 8fbc: 00002025 */ move $a0,$zero
/* 8fc0: 0c00c13f */ jal func00030bfc
@@ -1283,7 +1283,7 @@ glabel amgrCreate
.L0000907c:
/* 907c: 3c048009 */ lui $a0,%hi(g_AudioManager+0x2b8)
/* 9080: 24841880 */ addiu $a0,$a0,%lo(g_AudioManager+0x2b8)
/* 9084: 0c00bee8 */ jal func0002fba0
/* 9084: 0c00bee8 */ jal n_alInit
/* 9088: 00e02825 */ or $a1,$a3,$zero
/* 908c: 00002025 */ or $a0,$zero,$zero
/* 9090: 0c00c2ff */ jal func00030bfc
+12 -33
View File
@@ -6,43 +6,22 @@
#include "data.h"
#include "types.h"
u32 var8005f110 = 0;
ALGlobals *var8005f110 = NULL;
ALGlobals *alGlobals = NULL;
u32 var8005f118 = 0;
u32 var8005f11c = 0;
GLOBAL_ASM(
glabel func0002fba0
/* 2fba0: 27bdffe8 */ addiu $sp,$sp,-24
/* 2fba4: afbf0014 */ sw $ra,0x14($sp)
/* 2fba8: afa40018 */ sw $a0,0x18($sp)
/* 2fbac: afa5001c */ sw $a1,0x1c($sp)
/* 2fbb0: 3c0e8006 */ lui $t6,%hi(var8005f110)
/* 2fbb4: 8dcef110 */ lw $t6,%lo(var8005f110)($t6)
/* 2fbb8: 15c0000e */ bnez $t6,.L0002fbf4
/* 2fbbc: 00000000 */ nop
/* 2fbc0: 8faf0018 */ lw $t7,0x18($sp)
/* 2fbc4: 3c018006 */ lui $at,%hi(var8005f110)
/* 2fbc8: ac2ff110 */ sw $t7,%lo(var8005f110)($at)
/* 2fbcc: 3c188006 */ lui $t8,%hi(alGlobals)
/* 2fbd0: 8f18f114 */ lw $t8,%lo(alGlobals)($t8)
/* 2fbd4: 17000007 */ bnez $t8,.L0002fbf4
/* 2fbd8: 00000000 */ nop
/* 2fbdc: 3c198006 */ lui $t9,%hi(var8005f110)
/* 2fbe0: 8f39f110 */ lw $t9,%lo(var8005f110)($t9)
/* 2fbe4: 3c018006 */ lui $at,%hi(alGlobals)
/* 2fbe8: ac39f114 */ sw $t9,%lo(alGlobals)($at)
/* 2fbec: 0c00c338 */ jal func00030ce0
/* 2fbf0: 8fa4001c */ lw $a0,0x1c($sp)
.L0002fbf4:
/* 2fbf4: 10000001 */ b .L0002fbfc
/* 2fbf8: 00000000 */ nop
.L0002fbfc:
/* 2fbfc: 8fbf0014 */ lw $ra,0x14($sp)
/* 2fc00: 27bd0018 */ addiu $sp,$sp,0x18
/* 2fc04: 03e00008 */ jr $ra
/* 2fc08: 00000000 */ nop
);
void n_alInit(ALGlobals *g, ALSynConfig *c)
{
if (!var8005f110) {
var8005f110 = g;
if (!alGlobals) {
alGlobals = var8005f110;
n_alSynNew(c);
}
}
}
GLOBAL_ASM(
glabel alClose
+1 -1
View File
@@ -10,7 +10,7 @@
#include "types.h"
GLOBAL_ASM(
glabel func00030ce0
glabel n_alSynNew
/* 30ce0: 27bdffc0 */ addiu $sp,$sp,-64
/* 30ce4: afbf001c */ sw $ra,0x1c($sp)
/* 30ce8: afa40040 */ sw $a0,0x40($sp)