diff --git a/linker_scripts/us/symbol_addrs_code.txt b/linker_scripts/us/symbol_addrs_code.txt index c02b74b..901a32a 100644 --- a/linker_scripts/us/symbol_addrs_code.txt +++ b/linker_scripts/us/symbol_addrs_code.txt @@ -1448,11 +1448,11 @@ func_8004DF94 = 0x8004DF94; // type:func func_8004E304 = 0x8004E304; // type:func func_8004E810 = 0x8004E810; // type:func func_8004EBC8 = 0x8004EBC8; // type:func -func_8004EBF0 = 0x8004EBF0; // type:func +n_alSynSetPitch = 0x8004EBF0; // type:func n_alFxNew = 0x8004EC70; // type:func alN_PVoiceNew = 0x8004F084; // type:func n_alAuxBusPull = 0x8004F1B0; // type:func -func_8004F260 = 0x8004F260; // type:func +n_alSynSetFXMix = 0x8004F260; // type:func func_8004F2F0 = 0x8004F2F0; // type:func func_8004F350 = 0x8004F350; // type:func func_8004F4F8 = 0x8004F4F8; // type:func diff --git a/src/4F7F0.c b/src/4F7F0.c deleted file mode 100644 index bf81bb2..0000000 --- a/src/4F7F0.c +++ /dev/null @@ -1,37 +0,0 @@ -#include "global.h" -#include "n_synthInternals.h" - -struct UnkArray4 { - u32 unk0; - u32 unk4; - u16 unk8; - u16 unkA; - f32 unkC; - u32 unk10; - u32 unk14; - u32 unk18; - u32 unk1C; -}; -struct UnkStructUnk8 { - char filler[0x88]; - u32 unk88; -}; -struct UnkStruct8004EBF0 { - char filler[0x8]; - struct UnkStructUnk8* unk8; -}; - -void func_8004EBF0(struct UnkStruct8004EBF0* arg0, f32 arg1) { - struct UnkArray4* temp_v0; - - if (arg0->unk8 != NULL) { - temp_v0 = (struct UnkArray4*)__n_allocParam(); // TODO: Fix this - if (temp_v0 != NULL) { - temp_v0->unk4 = (s32)(n_syn->paramSamples + arg0->unk8->unk88); - temp_v0->unk8 = 7; - temp_v0->unkC = arg1; - temp_v0->unk0 = 0; - n_alEnvmixerParam(arg0->unk8, 3, temp_v0); - } - } -} diff --git a/src/4FE60.c b/src/4FE60.c deleted file mode 100644 index a34dfa5..0000000 --- a/src/4FE60.c +++ /dev/null @@ -1,5 +0,0 @@ -#include "global.h" - -#pragma GLOBAL_ASM("asm/us/nonmatchings/4FE60/func_8004F260.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/4FE60/func_8004F2F0.s") diff --git a/src/4FEF0.c b/src/4FEF0.c new file mode 100644 index 0000000..05e8aa8 --- /dev/null +++ b/src/4FEF0.c @@ -0,0 +1,4 @@ +#include "global.h" + + +#pragma GLOBAL_ASM("asm/us/nonmatchings/4FEF0/func_8004F2F0.s") diff --git a/src/libnaudio/n_synsetfxmix.c b/src/libnaudio/n_synsetfxmix.c new file mode 100644 index 0000000..b397e0e --- /dev/null +++ b/src/libnaudio/n_synsetfxmix.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 "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 + */ +#ifdef SAMPLE_ROUND + update->delta = SAMPLE184( n_syn->paramSamples + v->pvoice->offset); +#else + update->delta = n_syn->paramSamples + v->pvoice->offset; +#endif + update->type = AL_FILTER_SET_FXAMT; + if (fxmix > 127) + fxmix = 127; + update->data.i = fxmix; + update->next = 0; + + n_alEnvmixerParam(v->pvoice, AL_FILTER_ADD_UPDATE, update); + } +} + diff --git a/src/libnaudio/n_synsetpitch.c b/src/libnaudio/n_synsetpitch.c new file mode 100644 index 0000000..76b000f --- /dev/null +++ b/src/libnaudio/n_synsetpitch.c @@ -0,0 +1,51 @@ +/*==================================================================== + * + * 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 "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 + */ +#ifdef SAMPLE_ROUND + update->delta = SAMPLE184( n_syn->paramSamples + v->pvoice->offset); +#else + update->delta = n_syn->paramSamples + v->pvoice->offset; +#endif + update->type = AL_FILTER_SET_PITCH; + update->data.f = pitch; + update->next = 0; + + n_alEnvmixerParam(v->pvoice, AL_FILTER_ADD_UPDATE, update); + } +} + diff --git a/yamls/us/rom.yaml b/yamls/us/rom.yaml index 245b1c0..62591d5 100644 --- a/yamls/us/rom.yaml +++ b/yamls/us/rom.yaml @@ -103,10 +103,11 @@ - [0x4BDC0, c, 4BDC0] - [0x4CBC0, c, 4CBC0] - [0x4F410, c] - - [0x4F7F0, c] + - [0x4F7F0, c, libnaudio/n_synsetpitch] - [0x4F870, c, libnaudio/n_drvrNew] - [0x4FDB0, c, libnaudio/n_auxbus] - - [0x4FE60, c] + - [0x4FE60, c, libnaudio/n_synsetfxmix] + - [0x4FEF0, c] - [0x4FF50, c] - [0x50120, c] - [0x50860, c]