diff --git a/linker_scripts/us/symbol_addrs_code.txt b/linker_scripts/us/symbol_addrs_code.txt index cc7996a..d16600f 100644 --- a/linker_scripts/us/symbol_addrs_code.txt +++ b/linker_scripts/us/symbol_addrs_code.txt @@ -1468,7 +1468,7 @@ n_alSynAllocFX = 0x8004FDA0; // type:func func_8004FE00 = 0x8004FE00; // type:func func_8004FF20 = 0x8004FF20; // type:func n_alSynStartVoiceParams = 0x8004FF40; // type:func -func_80050020 = 0x80050020; // type:func +n_alSynFreeVoice = 0x80050020; // type:func n_alFxPull = 0x800500C0; // type:func n_alFxParamHdl = 0x800503A0; // type:func _n_loadOutputBuffer = 0x80050600; // type:func diff --git a/src/50C20.c b/src/50C20.c deleted file mode 100644 index 8ba3e0e..0000000 --- a/src/50C20.c +++ /dev/null @@ -1,3 +0,0 @@ -#include "global.h" - -#pragma GLOBAL_ASM("asm/us/nonmatchings/50C20/func_80050020.s") diff --git a/src/libnaudio/n_synfreevoice.c b/src/libnaudio/n_synfreevoice.c new file mode 100644 index 0000000..0445d13 --- /dev/null +++ b/src/libnaudio/n_synfreevoice.c @@ -0,0 +1,52 @@ +/*==================================================================== + * + * Copyright 1993, Silicon Graphics, Inc. + * All Rights Reserved. + * + * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, + * Inc.; the contents of this file may not be disclosed to third + * parties, copied or duplicated in any form, in whole or in part, + * without the prior written permission of Silicon Graphics, Inc. + * + * RESTRICTED RIGHTS LEGEND: + * Use, duplication or disclosure by the Government is subject to + * restrictions as set forth in subdivision (c)(1)(ii) of the Rights + * in Technical Data and Computer Software clause at DFARS + * 252.227-7013, and/or in similar or successor clauses in the FAR, + * DOD or NASA FAR Supplement. Unpublished - rights reserved under the + * Copyright Laws of the United States. + *====================================================================*/ +#include +#include + +#include +#include "n_synthInternals.h" + +void n_alSynFreeVoice(N_ALVoice *voice) +{ + ALFilter *f; + N_ALFreeParam *update; + + 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 + */ +#ifdef SAMPLE_ROUND + update->delta = SAMPLE184( n_syn->paramSamples + voice->pvoice->offset); +#else + update->delta = n_syn->paramSamples + voice->pvoice->offset; +#endif + 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; + } +} diff --git a/yamls/us/rom.yaml b/yamls/us/rom.yaml index 8850f50..cc7a4ac 100644 --- a/yamls/us/rom.yaml +++ b/yamls/us/rom.yaml @@ -116,7 +116,7 @@ - [0x509A0, c, libnaudio/n_synallocfx] - [0x50A00, c] - [0x50B40, c, libnaudio/n_synstartvoiceparam] - - [0x50C20, c] + - [0x50C20, c, libnaudio/n_synfreevoice] - [0x50CC0, c, libnaudio/n_reverb] - [0x51740, c] - [0x517A0, c] # yay0 audio decoder