From 6795507776c602b10fbfe19ee162e40e75fae008 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Sat, 27 Mar 2021 23:21:36 +1000 Subject: [PATCH] Decompile _freePVoice --- src/include/PR/synthInternals.h | 2 +- src/include/lib/lib_30ce0.h | 1 - src/lib/lib_30ce0.c | 28 ++++++++-------------------- src/lib/lib_3cef0.c | 2 +- src/lib/lib_3e8c0.c | 2 +- 5 files changed, 11 insertions(+), 24 deletions(-) diff --git a/src/include/PR/synthInternals.h b/src/include/PR/synthInternals.h index 8f28e56c8..6e73f4c1f 100755 --- a/src/include/PR/synthInternals.h +++ b/src/include/PR/synthInternals.h @@ -326,7 +326,7 @@ typedef struct PVoice_s { */ ALParam *__allocParam(void); void __freeParam(ALParam *param); -void _freePVoice(ALSynth *drvr, PVoice *pvoice); +void _freePVoice(PVoice *pvoice); void _collectPVoices(void); s32 _timeToSamples(ALSynth *ALSynth, s32 micros); diff --git a/src/include/lib/lib_30ce0.h b/src/include/lib/lib_30ce0.h index c05100df6..b3c2a0d5b 100644 --- a/src/include/lib/lib_30ce0.h +++ b/src/include/lib/lib_30ce0.h @@ -5,7 +5,6 @@ #include "types.h" u32 func00030ce0(void); -u32 func000315f4(void); u32 func00031634(void); u32 func00031698(void); u32 func000316d0(void); diff --git a/src/lib/lib_30ce0.c b/src/lib/lib_30ce0.c index 18ee69b7c..602ae906e 100644 --- a/src/lib/lib_30ce0.c +++ b/src/lib/lib_30ce0.c @@ -594,26 +594,14 @@ void _collectPVoices(void) } } -GLOBAL_ASM( -glabel func000315f4 -/* 315f4: 27bdffe8 */ addiu $sp,$sp,-24 -/* 315f8: afbf0014 */ sw $ra,0x14($sp) -/* 315fc: afa40018 */ sw $a0,0x18($sp) -/* 31600: 0c00c5e9 */ jal alUnlink -/* 31604: 8fa40018 */ lw $a0,0x18($sp) -/* 31608: 3c058006 */ lui $a1,%hi(alGlobals) -/* 3160c: 8ca5f114 */ lw $a1,%lo(alGlobals)($a1) -/* 31610: 8fa40018 */ lw $a0,0x18($sp) -/* 31614: 0c00c5dc */ jal alLink -/* 31618: 24a50014 */ addiu $a1,$a1,20 -/* 3161c: 10000001 */ b .L00031624 -/* 31620: 00000000 */ nop -.L00031624: -/* 31624: 8fbf0014 */ lw $ra,0x14($sp) -/* 31628: 27bd0018 */ addiu $sp,$sp,0x18 -/* 3162c: 03e00008 */ jr $ra -/* 31630: 00000000 */ nop -); +void _freePVoice(PVoice *pvoice) +{ + /* + * move the voice from the allocated list to the lame list + */ + alUnlink((ALLink *)pvoice); + alLink((ALLink *)pvoice, &alGlobals->drvr.pLameList); +} GLOBAL_ASM( glabel func00031634 diff --git a/src/lib/lib_3cef0.c b/src/lib/lib_3cef0.c index 41175cb38..982df0f12 100644 --- a/src/lib/lib_3cef0.c +++ b/src/lib/lib_3cef0.c @@ -253,7 +253,7 @@ glabel func0003d1a0 /* 3d244: 00000000 */ nop .L0003d248: /* 3d248: 8fad0020 */ lw $t5,0x20($sp) -/* 3d24c: 0c00c57d */ jal func000315f4 +/* 3d24c: 0c00c57d */ jal _freePVoice /* 3d250: 8da40008 */ lw $a0,0x8($t5) .L0003d254: /* 3d254: 8fab0020 */ lw $t3,0x20($sp) diff --git a/src/lib/lib_3e8c0.c b/src/lib/lib_3e8c0.c index e7624520c..e06d73409 100644 --- a/src/lib/lib_3e8c0.c +++ b/src/lib/lib_3e8c0.c @@ -6051,7 +6051,7 @@ glabel func0003e8c0 /* 3f008: 8d0c000c */ lw $t4,0xc($t0) /* 3f00c: ad800088 */ sw $zero,0x88($t4) /* 3f010: 8fb80020 */ lw $t8,0x20($sp) -/* 3f014: 0c00c57d */ jal func000315f4 +/* 3f014: 0c00c57d */ jal _freePVoice /* 3f018: 8f04000c */ lw $a0,0xc($t8) /* 3f01c: 1000003c */ b .L0003f110 /* 3f020: 00000000 */ nop