Decompile n_alSynSetPitch

This commit is contained in:
Ryan Dwyer 2021-10-16 11:33:08 +10:00
parent 4040bfa7d9
commit 54caa314cd
5 changed files with 30 additions and 51 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_synsetpitch.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); \

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_synsetpitch.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); \

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_synsetpitch.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); \

View File

@ -55,54 +55,3 @@ glabel func0003cef0
/* 3cf98: 03e00008 */ jr $ra
/* 3cf9c: 00000000 */ nop
);
GLOBAL_ASM(
glabel n_alSynSetPitch
/* 3cfa0: 27bdffe0 */ addiu $sp,$sp,-32
/* 3cfa4: afbf0014 */ sw $ra,0x14($sp)
/* 3cfa8: afa40020 */ sw $a0,0x20($sp)
/* 3cfac: afa50024 */ sw $a1,0x24($sp)
/* 3cfb0: 8fae0020 */ lw $t6,0x20($sp)
/* 3cfb4: 8dcf0008 */ lw $t7,0x8($t6)
/* 3cfb8: 11e0001f */ beqz $t7,.L0003d038
/* 3cfbc: 00000000 */ nop
/* 3cfc0: 0c00c541 */ jal __n_allocParam
/* 3cfc4: 00000000 */ nop
/* 3cfc8: afa2001c */ sw $v0,0x1c($sp)
/* 3cfcc: 8fb8001c */ lw $t8,0x1c($sp)
/* 3cfd0: 17000003 */ bnez $t8,.L0003cfe0
/* 3cfd4: 00000000 */ nop
/* 3cfd8: 10000019 */ b .L0003d040
/* 3cfdc: 00000000 */ nop
.L0003cfe0:
/* 3cfe0: 8fa90020 */ lw $t1,0x20($sp)
/* 3cfe4: 3c198006 */ lui $t9,%hi(n_syn)
/* 3cfe8: 8f39f114 */ lw $t9,%lo(n_syn)($t9)
/* 3cfec: 8d2a0008 */ lw $t2,0x8($t1)
/* 3cff0: 8fad001c */ lw $t5,0x1c($sp)
/* 3cff4: 8f28001c */ lw $t0,0x1c($t9)
/* 3cff8: 8d4b0088 */ lw $t3,0x88($t2)
/* 3cffc: 010b6021 */ addu $t4,$t0,$t3
/* 3d000: adac0004 */ sw $t4,0x4($t5)
/* 3d004: 8faf001c */ lw $t7,0x1c($sp)
/* 3d008: 240e0007 */ addiu $t6,$zero,0x7
/* 3d00c: a5ee0008 */ sh $t6,0x8($t7)
/* 3d010: c7a40024 */ lwc1 $f4,0x24($sp)
/* 3d014: 8fb8001c */ lw $t8,0x1c($sp)
/* 3d018: e704000c */ swc1 $f4,0xc($t8)
/* 3d01c: 8fb9001c */ lw $t9,0x1c($sp)
/* 3d020: af200000 */ sw $zero,0x0($t9)
/* 3d024: 8fa90020 */ lw $t1,0x20($sp)
/* 3d028: 24050003 */ addiu $a1,$zero,0x3
/* 3d02c: 8fa6001c */ lw $a2,0x1c($sp)
/* 3d030: 0c00fc79 */ jal n_alEnvmixerParam
/* 3d034: 8d240008 */ lw $a0,0x8($t1)
.L0003d038:
/* 3d038: 10000001 */ b .L0003d040
/* 3d03c: 00000000 */ nop
.L0003d040:
/* 3d040: 8fbf0014 */ lw $ra,0x14($sp)
/* 3d044: 27bd0020 */ addiu $sp,$sp,0x20
/* 3d048: 03e00008 */ jr $ra
/* 3d04c: 00000000 */ nop
);

View File

@ -0,0 +1,27 @@
#include <os_internal.h>
#include <ultraerror.h>
#include "n_synthInternals.h"
void n_alSynSetPitch(N_ALVoice *v, f32 pitch)
{
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 pitch data
*/
update->delta = n_syn->paramSamples + v->pvoice->offset;
update->type = AL_FILTER_SET_PITCH;
update->data.f = pitch;
update->next = 0;
n_alEnvmixerParam(v->pvoice, AL_FILTER_ADD_UPDATE, update);
}
}