Decompile n_alSynFreeVoice

This commit is contained in:
Ryan Dwyer 2021-10-16 11:09:17 +10:00
parent dc0757e014
commit 407057db08
5 changed files with 33 additions and 62 deletions

View File

@ -93,6 +93,7 @@
build/ROMID/lib/naudio/n_synsetvol.o (section); \
build/ROMID/lib/lib_3cdc0.o (section); \
build/ROMID/lib/lib_3cef0.o (section); \
build/ROMID/lib/naudio/n_synfreevoice.o (section); \
build/ROMID/lib/naudio/n_seqplayer.o (section); \
build/ROMID/lib/lib_3e3e0.o (section); \
build/ROMID/lib/naudio/n_synsetfxparam.o (section); \

View File

@ -90,6 +90,7 @@
build/ROMID/lib/naudio/n_synsetvol.o (section); \
build/ROMID/lib/lib_3cdc0.o (section); \
build/ROMID/lib/lib_3cef0.o (section); \
build/ROMID/lib/naudio/n_synfreevoice.o (section); \
build/ROMID/lib/naudio/n_seqplayer.o (section); \
build/ROMID/lib/lib_3e3e0.o (section); \
build/ROMID/lib/naudio/n_synsetfxparam.o (section); \

View File

@ -90,6 +90,7 @@
build/ROMID/lib/naudio/n_synsetvol.o (section); \
build/ROMID/lib/lib_3cdc0.o (section); \
build/ROMID/lib/lib_3cef0.o (section); \
build/ROMID/lib/naudio/n_synfreevoice.o (section); \
build/ROMID/lib/naudio/n_seqplayer.o (section); \
build/ROMID/lib/lib_3e3e0.o (section); \
build/ROMID/lib/naudio/n_synsetfxparam.o (section); \

View File

@ -204,65 +204,3 @@ glabel n_alSynStopVoice
/* 3d198: 03e00008 */ jr $ra
/* 3d19c: 00000000 */ nop
);
GLOBAL_ASM(
glabel n_alSynFreeVoice
/* 3d1a0: 27bdffe0 */ addiu $sp,$sp,-32
/* 3d1a4: afbf0014 */ sw $ra,0x14($sp)
/* 3d1a8: afa40020 */ sw $a0,0x20($sp)
/* 3d1ac: 8fae0020 */ lw $t6,0x20($sp)
/* 3d1b0: 8dcf0008 */ lw $t7,0x8($t6)
/* 3d1b4: 11e00029 */ beqz $t7,.L0003d25c
/* 3d1b8: 00000000 */ nop
/* 3d1bc: 8fb80020 */ lw $t8,0x20($sp)
/* 3d1c0: 8f190008 */ lw $t9,0x8($t8)
/* 3d1c4: 8f280088 */ lw $t0,0x88($t9)
/* 3d1c8: 1100001f */ beqz $t0,.L0003d248
/* 3d1cc: 00000000 */ nop
/* 3d1d0: 0c00c541 */ jal __n_allocParam
/* 3d1d4: 00000000 */ nop
/* 3d1d8: afa2001c */ sw $v0,0x1c($sp)
/* 3d1dc: 8fa9001c */ lw $t1,0x1c($sp)
/* 3d1e0: 15200003 */ bnez $t1,.L0003d1f0
/* 3d1e4: 00000000 */ nop
/* 3d1e8: 1000001e */ b .L0003d264
/* 3d1ec: 00000000 */ nop
.L0003d1f0:
/* 3d1f0: 8fac0020 */ lw $t4,0x20($sp)
/* 3d1f4: 3c0a8006 */ lui $t2,%hi(n_syn)
/* 3d1f8: 8d4af114 */ lw $t2,%lo(n_syn)($t2)
/* 3d1fc: 8d8d0008 */ lw $t5,0x8($t4)
/* 3d200: 8fb8001c */ lw $t8,0x1c($sp)
/* 3d204: 8d4b001c */ lw $t3,0x1c($t2)
/* 3d208: 8dae0088 */ lw $t6,0x88($t5)
/* 3d20c: 016e7821 */ addu $t7,$t3,$t6
/* 3d210: af0f0004 */ sw $t7,0x4($t8)
/* 3d214: 8fb9001c */ lw $t9,0x1c($sp)
/* 3d218: a7200008 */ sh $zero,0x8($t9)
/* 3d21c: 8fa80020 */ lw $t0,0x20($sp)
/* 3d220: 8faa001c */ lw $t2,0x1c($sp)
/* 3d224: 8d090008 */ lw $t1,0x8($t0)
/* 3d228: ad49000c */ sw $t1,0xc($t2)
/* 3d22c: 8fac0020 */ lw $t4,0x20($sp)
/* 3d230: 24050003 */ addiu $a1,$zero,0x3
/* 3d234: 8fa6001c */ lw $a2,0x1c($sp)
/* 3d238: 0c00fc79 */ jal n_alEnvmixerParam
/* 3d23c: 8d840008 */ lw $a0,0x8($t4)
/* 3d240: 10000004 */ b .L0003d254
/* 3d244: 00000000 */ nop
.L0003d248:
/* 3d248: 8fad0020 */ lw $t5,0x20($sp)
/* 3d24c: 0c00c57d */ jal _n_freePVoice
/* 3d250: 8da40008 */ lw $a0,0x8($t5)
.L0003d254:
/* 3d254: 8fab0020 */ lw $t3,0x20($sp)
/* 3d258: ad600008 */ sw $zero,0x8($t3)
.L0003d25c:
/* 3d25c: 10000001 */ b .L0003d264
/* 3d260: 00000000 */ nop
.L0003d264:
/* 3d264: 8fbf0014 */ lw $ra,0x14($sp)
/* 3d268: 27bd0020 */ addiu $sp,$sp,0x20
/* 3d26c: 03e00008 */ jr $ra
/* 3d270: 00000000 */ nop
);

View File

@ -0,0 +1,30 @@
#include <ultraerror.h>
#include <os_internal.h>
#include <os.h>
#include "n_synthInternals.h"
void n_alSynFreeVoice(N_ALVoice *voice)
{
N_ALFreeParam *update;
ALFilter *f;
if (voice->pvoice) {
if (voice->pvoice->offset) { /* if voice was stolen */
update = (N_ALFreeParam *)__n_allocParam();
ALFailIf(update == 0, ERR_ALSYN_NO_UPDATE);
/*
* set voice data
*/
update->delta = n_syn->paramSamples + voice->pvoice->offset;
update->type = AL_FILTER_FREE_VOICE;
update->pvoice = voice->pvoice;
n_alEnvmixerParam(voice->pvoice, AL_FILTER_ADD_UPDATE, update);
} else {
_n_freePVoice( voice->pvoice);
}
voice->pvoice = 0;
}
}