Decompile n_alSynSetFXMix

This commit is contained in:
Ryan Dwyer 2021-10-16 11:20:36 +10:00
parent 4a900ea079
commit 4040bfa7d9
8 changed files with 36 additions and 60 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_synsetfxmix.o (section); \
build/ROMID/lib/naudio/n_synstopvoice.o (section); \
build/ROMID/lib/naudio/n_synfreevoice.o (section); \
build/ROMID/lib/naudio/n_seqplayer.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_synsetfxmix.o (section); \
build/ROMID/lib/naudio/n_synstopvoice.o (section); \
build/ROMID/lib/naudio/n_synfreevoice.o (section); \
build/ROMID/lib/naudio/n_seqplayer.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_synsetfxmix.o (section); \
build/ROMID/lib/naudio/n_synstopvoice.o (section); \
build/ROMID/lib/naudio/n_synfreevoice.o (section); \
build/ROMID/lib/naudio/n_seqplayer.o (section); \

View File

@ -5,6 +5,5 @@
#include "types.h"
u32 func0003cef0(void);
void func0003d050(N_ALVoice *v, u8 arg1);
#endif

View File

@ -1575,7 +1575,7 @@ glabel var7005477c
/* 328e4: afa8007c */ sw $t0,0x7c($sp)
/* 328e8: 8fa40060 */ lw $a0,0x60($sp)
/* 328ec: 8fa5007c */ lw $a1,0x7c($sp)
/* 328f0: 0c00f414 */ jal func0003d050
/* 328f0: 0c00f414 */ jal n_alSynSetFXMix
/* 328f4: 2484000c */ addiu $a0,$a0,0xc
.L000328f8:
/* 328f8: 100001c7 */ b .L00033018
@ -1638,7 +1638,7 @@ glabel var7005477c
/* 329c0: afaf007c */ sw $t7,0x7c($sp)
/* 329c4: 8fa40060 */ lw $a0,0x60($sp)
/* 329c8: 8fa5007c */ lw $a1,0x7c($sp)
/* 329cc: 0c00f414 */ jal func0003d050
/* 329cc: 0c00f414 */ jal n_alSynSetFXMix
/* 329d0: 2484000c */ addiu $a0,$a0,0xc
.L000329d4:
/* 329d4: 10000190 */ b .L00033018
@ -2991,7 +2991,7 @@ glabel var7005477c
/* 33ec4: afa8007c */ sw $t0,0x7c($sp)
/* 33ec8: 8fa40060 */ lw $a0,0x60($sp)
/* 33ecc: 8fa5007c */ lw $a1,0x7c($sp)
/* 33ed0: 0c00f908 */ jal func0003d050
/* 33ed0: 0c00f908 */ jal n_alSynSetFXMix
/* 33ed4: 2484000c */ addiu $a0,$a0,0xc
.NB00033ed8:
/* 33ed8: 100001b3 */ beqz $zero,.NB000345a8
@ -3054,7 +3054,7 @@ glabel var7005477c
/* 33fa0: afad007c */ sw $t5,0x7c($sp)
/* 33fa4: 8fa40060 */ lw $a0,0x60($sp)
/* 33fa8: 8fa5007c */ lw $a1,0x7c($sp)
/* 33fac: 0c00f908 */ jal func0003d050
/* 33fac: 0c00f908 */ jal n_alSynSetFXMix
/* 33fb0: 2484000c */ addiu $a0,$a0,0xc
.NB00033fb4:
/* 33fb4: 1000017c */ beqz $zero,.NB000345a8

View File

@ -106,54 +106,3 @@ glabel n_alSynSetPitch
/* 3d048: 03e00008 */ jr $ra
/* 3d04c: 00000000 */ nop
);
GLOBAL_ASM(
glabel func0003d050
/* 3d050: 27bdffe0 */ addiu $sp,$sp,-32
/* 3d054: afbf0014 */ sw $ra,0x14($sp)
/* 3d058: afa40020 */ sw $a0,0x20($sp)
/* 3d05c: afa50024 */ sw $a1,0x24($sp)
/* 3d060: 8fae0020 */ lw $t6,0x20($sp)
/* 3d064: 8dcf0008 */ lw $t7,0x8($t6)
/* 3d068: 11e0001f */ beqz $t7,.L0003d0e8
/* 3d06c: 00000000 */ nop
/* 3d070: 0c00c541 */ jal __n_allocParam
/* 3d074: 00000000 */ nop
/* 3d078: afa2001c */ sw $v0,0x1c($sp)
/* 3d07c: 8fb8001c */ lw $t8,0x1c($sp)
/* 3d080: 17000003 */ bnez $t8,.L0003d090
/* 3d084: 00000000 */ nop
/* 3d088: 10000019 */ b .L0003d0f0
/* 3d08c: 00000000 */ nop
.L0003d090:
/* 3d090: 8fa90020 */ lw $t1,0x20($sp)
/* 3d094: 3c198006 */ lui $t9,%hi(n_syn)
/* 3d098: 8f39f114 */ lw $t9,%lo(n_syn)($t9)
/* 3d09c: 8d2a0008 */ lw $t2,0x8($t1)
/* 3d0a0: 8fad001c */ lw $t5,0x1c($sp)
/* 3d0a4: 8f28001c */ lw $t0,0x1c($t9)
/* 3d0a8: 8d4b0088 */ lw $t3,0x88($t2)
/* 3d0ac: 010b6021 */ addu $t4,$t0,$t3
/* 3d0b0: adac0004 */ sw $t4,0x4($t5)
/* 3d0b4: 8faf001c */ lw $t7,0x1c($sp)
/* 3d0b8: 240e0010 */ addiu $t6,$zero,0x10
/* 3d0bc: a5ee0008 */ sh $t6,0x8($t7)
/* 3d0c0: 93b80027 */ lbu $t8,0x27($sp)
/* 3d0c4: 8fb9001c */ lw $t9,0x1c($sp)
/* 3d0c8: af38000c */ sw $t8,0xc($t9)
/* 3d0cc: 8fa9001c */ lw $t1,0x1c($sp)
/* 3d0d0: ad200000 */ sw $zero,0x0($t1)
/* 3d0d4: 8faa0020 */ lw $t2,0x20($sp)
/* 3d0d8: 24050003 */ addiu $a1,$zero,0x3
/* 3d0dc: 8fa6001c */ lw $a2,0x1c($sp)
/* 3d0e0: 0c00fc79 */ jal n_alEnvmixerParam
/* 3d0e4: 8d440008 */ lw $a0,0x8($t2)
.L0003d0e8:
/* 3d0e8: 10000001 */ b .L0003d0f0
/* 3d0ec: 00000000 */ nop
.L0003d0f0:
/* 3d0f0: 8fbf0014 */ lw $ra,0x14($sp)
/* 3d0f4: 27bd0020 */ addiu $sp,$sp,0x20
/* 3d0f8: 03e00008 */ jr $ra
/* 3d0fc: 00000000 */ nop
);

View File

@ -326,7 +326,6 @@ void __n_CSPHandleNextSeqEvent(N_ALCSPlayer *seqp);
void func0003e3e0(N_ALVoice *v, f32 arg1);
u8 func0003d9cc(N_ALVoiceState *vs, N_ALCSPlayer *seqp);
void func0003d050(N_ALVoice *v, u8 arg1);
ALFxRef func0003e540(u8 arg0);
ALFxRef func0003e5b8(u8 arg0);
void func0003e674(ALFxRef fx, u8 arg1, void *param);
@ -441,7 +440,7 @@ ALMicroTime __n_CSPVoiceHandler(void *node)
seqp->unk80 = seqp->nextEvent.msg.evt18.unk04;
for (vs = seqp->vAllocHead; vs != 0; vs = vs->next) {
func0003d050(&vs->voice, func0003d9cc(vs, seqp));
n_alSynSetFXMix(&vs->voice, func0003d9cc(vs, seqp));
}
break;
@ -2510,7 +2509,7 @@ glabel var70054a74
/* 366b8: 000e7080 */ sll $t6,$t6,0x2
/* 366bc: 030e7821 */ addu $t7,$t8,$t6
/* 366c0: 91e5000a */ lbu $a1,0xa($t7)
/* 366c4: 0c00f414 */ jal func0003d050
/* 366c4: 0c00f414 */ jal n_alSynSetFXMix
/* 366c8: 24840004 */ addiu $a0,$a0,0x4
.L000366cc:
/* 366cc: 8fa800c8 */ lw $t0,0xc8($sp)
@ -5028,7 +5027,7 @@ glabel var70054a74
/* 366b8: 000e7080 */ sll $t6,$t6,0x2
/* 366bc: 030e7821 */ addu $t7,$t8,$t6
/* 366c0: 91e5000a */ lbu $a1,0xa($t7)
/* 366c4: 0c00f414 */ jal func0003d050
/* 366c4: 0c00f414 */ jal n_alSynSetFXMix
/* 366c8: 24840004 */ addiu $a0,$a0,0x4
.L000366cc:
/* 366cc: 8fa800c8 */ lw $t0,0xc8($sp)

View File

@ -0,0 +1,26 @@
#include <os_internal.h>
#include <ultraerror.h>
#include "n_synthInternals.h"
void n_alSynSetFXMix(N_ALVoice *v, u8 fxmix)
{
ALParam *update;
if (v->pvoice) {
/*
* get new update struct from the free list
*/
update = __n_allocParam();
ALFailIf(update == 0, ERR_ALSYN_NO_UPDATE);
/*
* set offset and fxmix data
*/
update->delta = n_syn->paramSamples + v->pvoice->offset;
update->type = AL_FILTER_SET_FXAMT;
update->data.i = fxmix;
update->next = 0;
n_alEnvmixerParam(v->pvoice, AL_FILTER_ADD_UPDATE, update);
}
}