more synth functions

This commit is contained in:
M0liusX 2022-12-08 13:13:20 -06:00
parent 02b9b3d81f
commit 03d28f27b5
10 changed files with 1053 additions and 1 deletions

View File

@ -180,7 +180,14 @@ segments:
- [0x8B770, c, "../src/lib/2.0I/audio/syndelete"] # -O0
- [0x8B780, c, "../src/lib/2.0I/audio/synaddplayer"] # -O0
- [0x8B7D0, c, "../src/lib/2.0I/audio/synremoveplayer"] # -O0
- [0x8B870, c] # -O0?
- [0x8B870, c, "../src/lib/2.0I/audio/synfreevoice"] # -O0
- [0x8B910, c, "../src/lib/2.0I/audio/synallocvoice"] # -O0
- [0x8BAF0, c, "../src/lib/2.0I/audio/synstopvoice"] # -O0
- [0x8BB70, c, "../src/lib/2.0I/audio/synstartvoice"] # -O0
- [0x8BC10, c, "../src/lib/2.0I/audio/synsetpitch"] # -O0
- [0x8BCA0, c, "../src/lib/2.0I/audio/synsetvol"] # -O0
- [0x8BD60, c, "../src/lib/2.0I/audio/cents2ratio"] # -O0
- [0x8BDC0, c] # -O0?
- [0xA2080, c] # -O0?
- [0xA21C0, c] # -O0?
- [0xA29F0, c] # -O0?

621
src/8BDC0.c Normal file
View File

@ -0,0 +1,621 @@
#include "common.h"
INCLUDE_ASM(s32, "8BDC0", func_8008B1C0);
INCLUDE_ASM(s32, "8BDC0", func_8008B1D0);
INCLUDE_ASM(s32, "8BDC0", func_8008B270);
INCLUDE_ASM(s32, "8BDC0", func_8008B47C);
INCLUDE_ASM(s32, "8BDC0", func_8008B4B0);
INCLUDE_ASM(s32, "8BDC0", func_8008B4D0);
INCLUDE_ASM(s32, "8BDC0", func_8008B520);
INCLUDE_ASM(s32, "8BDC0", func_8008B560);
INCLUDE_ASM(s32, "8BDC0", func_8008B5A0);
INCLUDE_ASM(s32, "8BDC0", func_8008B600);
INCLUDE_ASM(s32, "8BDC0", func_8008B650);
INCLUDE_ASM(s32, "8BDC0", func_8008B6A0);
INCLUDE_ASM(s32, "8BDC0", func_8008B700);
INCLUDE_ASM(s32, "8BDC0", func_8008B89C);
INCLUDE_ASM(s32, "8BDC0", func_8008B950);
INCLUDE_ASM(s32, "8BDC0", func_8008BA10);
INCLUDE_ASM(s32, "8BDC0", func_8008BA70);
INCLUDE_ASM(s32, "8BDC0", func_8008BBEC);
INCLUDE_ASM(s32, "8BDC0", func_8008BC90);
INCLUDE_ASM(s32, "8BDC0", func_8008BD50);
INCLUDE_ASM(s32, "8BDC0", func_8008BE40);
INCLUDE_ASM(s32, "8BDC0", func_8008BEB0);
INCLUDE_ASM(s32, "8BDC0", func_8008BF50);
INCLUDE_ASM(s32, "8BDC0", func_8008BFA4);
INCLUDE_ASM(s32, "8BDC0", func_8008C010);
INCLUDE_ASM(s32, "8BDC0", bcopy);
INCLUDE_ASM(s32, "8BDC0", bzero);
INCLUDE_ASM(s32, "8BDC0", func_8008C400);
INCLUDE_ASM(s32, "8BDC0", func_8008C438);
INCLUDE_ASM(s32, "8BDC0", func_8008C45C);
INCLUDE_ASM(s32, "8BDC0", sprintf);
INCLUDE_ASM(s32, "8BDC0", func_8008C4E8);
INCLUDE_ASM(s32, "8BDC0", func_8008C520);
INCLUDE_ASM(s32, "8BDC0", func_8008C534);
INCLUDE_ASM(s32, "8BDC0", func_8008C550);
INCLUDE_ASM(s32, "8BDC0", func_8008C6C0);
INCLUDE_ASM(s32, "8BDC0", func_8008CB88);
INCLUDE_ASM(s32, "8BDC0", func_8008CBFC);
INCLUDE_ASM(s32, "8BDC0", func_8008CCFC);
INCLUDE_ASM(s32, "8BDC0", func_8008D558);
INCLUDE_ASM(s32, "8BDC0", func_8008D6E8);
INCLUDE_ASM(s32, "8BDC0", func_8008D778);
INCLUDE_ASM(s32, "8BDC0", func_8008D7B0);
INCLUDE_ASM(s32, "8BDC0", func_8008D934);
INCLUDE_ASM(s32, "8BDC0", func_8008DE08);
INCLUDE_ASM(s32, "8BDC0", func_8008DED8);
INCLUDE_ASM(s32, "8BDC0", func_8008E0D8);
INCLUDE_ASM(s32, "8BDC0", func_8008E900);
INCLUDE_ASM(s32, "8BDC0", func_8008E96C);
INCLUDE_ASM(s32, "8BDC0", func_8008E9BC);
INCLUDE_ASM(s32, "8BDC0", func_8008EA20);
INCLUDE_ASM(s32, "8BDC0", func_8008EA74);
INCLUDE_ASM(s32, "8BDC0", func_8008EB48);
INCLUDE_ASM(s32, "8BDC0", func_8008EBB8);
INCLUDE_ASM(s32, "8BDC0", func_8008EBD4);
INCLUDE_ASM(s32, "8BDC0", func_8008EC18);
INCLUDE_ASM(s32, "8BDC0", func_8008ED3C);
INCLUDE_ASM(s32, "8BDC0", func_8008EDEC);
INCLUDE_ASM(s32, "8BDC0", func_8008EE98);
INCLUDE_ASM(s32, "8BDC0", func_8008EEEC);
INCLUDE_ASM(s32, "8BDC0", func_8008EF6C);
INCLUDE_ASM(s32, "8BDC0", func_8008F020);
INCLUDE_ASM(s32, "8BDC0", func_8008F110);
INCLUDE_ASM(s32, "8BDC0", func_8008F150);
INCLUDE_ASM(s32, "8BDC0", alSynNew);
INCLUDE_ASM(s32, "8BDC0", func_8008F4BC);
INCLUDE_ASM(s32, "8BDC0", __allocParam);
INCLUDE_ASM(s32, "8BDC0", func_8008F698);
INCLUDE_ASM(s32, "8BDC0", func_8008F6B0);
INCLUDE_ASM(s32, "8BDC0", _freePVoice);
INCLUDE_ASM(s32, "8BDC0", func_8008F744);
INCLUDE_ASM(s32, "8BDC0", _timeToSamples);
INCLUDE_ASM(s32, "8BDC0", func_8008F7D8);
INCLUDE_ASM(s32, "8BDC0", func_8008F830);
INCLUDE_ASM(s32, "8BDC0", func_8008F950);
INCLUDE_ASM(s32, "8BDC0", func_8008FAD0);
INCLUDE_ASM(s32, "8BDC0", func_8008FB50);
INCLUDE_ASM(s32, "8BDC0", func_8008FCE8);
INCLUDE_ASM(s32, "8BDC0", func_8008FD70);
INCLUDE_ASM(s32, "8BDC0", func_8008FED8);
INCLUDE_ASM(s32, "8BDC0", func_8008FF80);
INCLUDE_ASM(s32, "8BDC0", func_80090120);
INCLUDE_ASM(s32, "8BDC0", func_800901A8);
INCLUDE_ASM(s32, "8BDC0", func_80090244);
INCLUDE_ASM(s32, "8BDC0", func_80090300);
INCLUDE_ASM(s32, "8BDC0", func_800904F0);
INCLUDE_ASM(s32, "8BDC0", func_80090550);
INCLUDE_ASM(s32, "8BDC0", func_800905B0);
INCLUDE_ASM(s32, "8BDC0", func_800906F4);
INCLUDE_ASM(s32, "8BDC0", func_80090940);
INCLUDE_ASM(s32, "8BDC0", func_80090C4C);
INCLUDE_ASM(s32, "8BDC0", func_80090D70);
INCLUDE_ASM(s32, "8BDC0", func_80090F1C);
INCLUDE_ASM(s32, "8BDC0", func_80090F90);
INCLUDE_ASM(s32, "8BDC0", func_80091120);
INCLUDE_ASM(s32, "8BDC0", func_80091230);
INCLUDE_ASM(s32, "8BDC0", func_80091428);
INCLUDE_ASM(s32, "8BDC0", func_80091500);
INCLUDE_ASM(s32, "8BDC0", func_80091600);
INCLUDE_ASM(s32, "8BDC0", func_80091A40);
INCLUDE_ASM(s32, "8BDC0", func_80091AA0);
INCLUDE_ASM(s32, "8BDC0", func_80091C40);
INCLUDE_ASM(s32, "8BDC0", func_80091CB0);
INCLUDE_ASM(s32, "8BDC0", func_80091E40);
INCLUDE_ASM(s32, "8BDC0", func_80091F10);
INCLUDE_ASM(s32, "8BDC0", func_80091FC0);
INCLUDE_ASM(s32, "8BDC0", func_80092050);
INCLUDE_ASM(s32, "8BDC0", func_800921F0);
INCLUDE_ASM(s32, "8BDC0", func_80092390);
INCLUDE_ASM(s32, "8BDC0", func_80092500);
INCLUDE_ASM(s32, "8BDC0", func_80092810);
INCLUDE_ASM(s32, "8BDC0", func_80092830);
INCLUDE_ASM(s32, "8BDC0", func_80092DBC);
INCLUDE_ASM(s32, "8BDC0", __osEnqueueAndYield);
INCLUDE_ASM(s32, "8BDC0", __osEnqueueThread);
INCLUDE_ASM(s32, "8BDC0", __osPopThread);
INCLUDE_ASM(s32, "8BDC0", __osDispatchThread);
INCLUDE_ASM(s32, "8BDC0", __osCleanupThread);
INCLUDE_ASM(s32, "8BDC0", osGetMemSize);
INCLUDE_ASM(s32, "8BDC0", osInitialize);
INCLUDE_ASM(s32, "8BDC0", func_80093468);
INCLUDE_ASM(s32, "8BDC0", __osDisableInt);
INCLUDE_ASM(s32, "8BDC0", __osRestoreInt);
INCLUDE_ASM(s32, "8BDC0", func_800935B0);
INCLUDE_ASM(s32, "8BDC0", func_80093660);
INCLUDE_ASM(s32, "8BDC0", guNormalize);
INCLUDE_ASM(s32, "8BDC0", func_80093770);
INCLUDE_ASM(s32, "8BDC0", osGetCount);
INCLUDE_ASM(s32, "8BDC0", func_80093790);
INCLUDE_ASM(s32, "8BDC0", __osProbeTLB);
INCLUDE_ASM(s32, "8BDC0", func_80093860);
INCLUDE_ASM(s32, "8BDC0", func_80093870);
INCLUDE_ASM(s32, "8BDC0", func_800938C0);
INCLUDE_ASM(s32, "8BDC0", func_80093920);
INCLUDE_ASM(s32, "8BDC0", func_800939C0);
INCLUDE_ASM(s32, "8BDC0", func_80093E04);
INCLUDE_ASM(s32, "8BDC0", func_800941A0);
INCLUDE_ASM(s32, "8BDC0", func_8009434C);
INCLUDE_ASM(s32, "8BDC0", func_800944D0);
INCLUDE_ASM(s32, "8BDC0", func_800945AC);
INCLUDE_ASM(s32, "8BDC0", func_800945E0);
INCLUDE_ASM(s32, "8BDC0", func_80094720);
INCLUDE_ASM(s32, "8BDC0", func_80094750);
INCLUDE_ASM(s32, "8BDC0", func_8009493C);
INCLUDE_ASM(s32, "8BDC0", func_80094A00);
INCLUDE_ASM(s32, "8BDC0", func_80094AE8);
INCLUDE_ASM(s32, "8BDC0", func_80094C50);
INCLUDE_ASM(s32, "8BDC0", func_80094CB8);
INCLUDE_ASM(s32, "8BDC0", func_80094D20);
INCLUDE_ASM(s32, "8BDC0", func_80094DB0);
INCLUDE_ASM(s32, "8BDC0", func_80094EC4);
INCLUDE_ASM(s32, "8BDC0", func_80094ECC);
INCLUDE_ASM(s32, "8BDC0", func_80094EE8);
INCLUDE_ASM(s32, "8BDC0", func_80094F04);
INCLUDE_ASM(s32, "8BDC0", func_80094F18);
INCLUDE_ASM(s32, "8BDC0", func_80094F48);
INCLUDE_ASM(s32, "8BDC0", func_80094F98);
INCLUDE_ASM(s32, "8BDC0", func_80094FF0);
INCLUDE_ASM(s32, "8BDC0", func_80095000);
INCLUDE_ASM(s32, "8BDC0", func_800950A0);
INCLUDE_ASM(s32, "8BDC0", func_800950C0);
INCLUDE_ASM(s32, "8BDC0", func_800950E0);
INCLUDE_ASM(s32, "8BDC0", func_800950F0);
INCLUDE_ASM(s32, "8BDC0", func_80095100);
INCLUDE_ASM(s32, "8BDC0", func_80095130);
INCLUDE_ASM(s32, "8BDC0", func_80095240);
INCLUDE_ASM(s32, "8BDC0", func_80095250);
INCLUDE_ASM(s32, "8BDC0", func_800952A4);
INCLUDE_ASM(s32, "8BDC0", func_80095310);
INCLUDE_ASM(s32, "8BDC0", func_80095340);
INCLUDE_ASM(s32, "8BDC0", bcmp);
INCLUDE_ASM(s32, "8BDC0", _Printf);
INCLUDE_ASM(s32, "8BDC0", func_800959E0);
INCLUDE_ASM(s32, "8BDC0", func_80095EA0);
INCLUDE_ASM(s32, "8BDC0", func_80095F44);
INCLUDE_ASM(s32, "8BDC0", func_800963DC);
INCLUDE_ASM(s32, "8BDC0", func_80096494);
INCLUDE_ASM(s32, "8BDC0", func_80096544);
INCLUDE_ASM(s32, "8BDC0", func_800965D0);
INCLUDE_ASM(s32, "8BDC0", func_8009662C);
INCLUDE_ASM(s32, "8BDC0", func_80096688);
INCLUDE_ASM(s32, "8BDC0", func_800966D0);
INCLUDE_ASM(s32, "8BDC0", func_80096BD0);
INCLUDE_ASM(s32, "8BDC0", func_80096CA4);
INCLUDE_ASM(s32, "8BDC0", func_80096F78);
INCLUDE_ASM(s32, "8BDC0", func_80097058);
INCLUDE_ASM(s32, "8BDC0", func_8009707C);
INCLUDE_ASM(s32, "8BDC0", func_800972FC);
INCLUDE_ASM(s32, "8BDC0", func_80097380);
INCLUDE_ASM(s32, "8BDC0", func_800976F4);
INCLUDE_ASM(s32, "8BDC0", func_80097708);
INCLUDE_ASM(s32, "8BDC0", func_800978F8);
INCLUDE_ASM(s32, "8BDC0", func_80097B10);
INCLUDE_ASM(s32, "8BDC0", func_80097C80);
INCLUDE_ASM(s32, "8BDC0", func_80097DF0);
INCLUDE_ASM(s32, "8BDC0", func_80097E8C);
INCLUDE_ASM(s32, "8BDC0", func_80097F20);
INCLUDE_ASM(s32, "8BDC0", func_80097FC8);
INCLUDE_ASM(s32, "8BDC0", func_80097FF0);
INCLUDE_ASM(s32, "8BDC0", func_80098024);
INCLUDE_ASM(s32, "8BDC0", func_80098068);
INCLUDE_ASM(s32, "8BDC0", func_80098354);
INCLUDE_ASM(s32, "8BDC0", func_800984B8);
INCLUDE_ASM(s32, "8BDC0", func_80098684);
INCLUDE_ASM(s32, "8BDC0", func_8009873C);
INCLUDE_ASM(s32, "8BDC0", func_80098A80);
INCLUDE_ASM(s32, "8BDC0", func_80098C80);
INCLUDE_ASM(s32, "8BDC0", func_80098EA0);
INCLUDE_ASM(s32, "8BDC0", func_80098F0C);
INCLUDE_ASM(s32, "8BDC0", func_80098F90);
INCLUDE_ASM(s32, "8BDC0", func_80099350);
INCLUDE_ASM(s32, "8BDC0", func_800994C0);
INCLUDE_ASM(s32, "8BDC0", func_80099630);
INCLUDE_ASM(s32, "8BDC0", func_80099A90);
INCLUDE_ASM(s32, "8BDC0", func_80099BE8);
INCLUDE_ASM(s32, "8BDC0", func_80099D50);
INCLUDE_ASM(s32, "8BDC0", func_80099E40);
INCLUDE_ASM(s32, "8BDC0", func_80099ED4);
INCLUDE_ASM(s32, "8BDC0", func_80099F60);
INCLUDE_ASM(s32, "8BDC0", func_80099FB0);
INCLUDE_ASM(s32, "8BDC0", func_8009A000);
INCLUDE_ASM(s32, "8BDC0", func_8009A050);
INCLUDE_ASM(s32, "8BDC0", func_8009A090);
INCLUDE_ASM(s32, "8BDC0", func_8009A0E0);
INCLUDE_ASM(s32, "8BDC0", func_8009A100);
INCLUDE_ASM(s32, "8BDC0", func_8009A120);
INCLUDE_ASM(s32, "8BDC0", func_8009A370);
INCLUDE_ASM(s32, "8BDC0", func_8009A7B0);
INCLUDE_ASM(s32, "8BDC0", func_8009A848);
INCLUDE_ASM(s32, "8BDC0", func_8009ADF0);
INCLUDE_ASM(s32, "8BDC0", func_8009AE74);
INCLUDE_ASM(s32, "8BDC0", func_8009AFB0);
INCLUDE_ASM(s32, "8BDC0", func_8009AFD0);
INCLUDE_ASM(s32, "8BDC0", func_8009B0A8);
INCLUDE_ASM(s32, "8BDC0", func_8009B150);
INCLUDE_ASM(s32, "8BDC0", func_8009B308);
INCLUDE_ASM(s32, "8BDC0", func_8009B420);
INCLUDE_ASM(s32, "8BDC0", func_8009B590);
INCLUDE_ASM(s32, "8BDC0", func_8009B618);
INCLUDE_ASM(s32, "8BDC0", func_8009B674);
INCLUDE_ASM(s32, "8BDC0", func_8009B6F0);
INCLUDE_ASM(s32, "8BDC0", func_8009B770);
INCLUDE_ASM(s32, "8BDC0", func_8009B810);
INCLUDE_ASM(s32, "8BDC0", func_8009B840);
INCLUDE_ASM(s32, "8BDC0", func_8009B848);
INCLUDE_ASM(s32, "8BDC0", func_8009B850);
INCLUDE_ASM(s32, "8BDC0", func_8009B960);
INCLUDE_ASM(s32, "8BDC0", func_8009BA30);
INCLUDE_ASM(s32, "8BDC0", func_8009BAA4);
INCLUDE_ASM(s32, "8BDC0", func_8009BAD8);
INCLUDE_ASM(s32, "8BDC0", func_8009BBD4);
INCLUDE_ASM(s32, "8BDC0", func_8009BCA0);
INCLUDE_ASM(s32, "8BDC0", func_8009BE10);
INCLUDE_ASM(s32, "8BDC0", func_8009BE30);
INCLUDE_ASM(s32, "8BDC0", func_8009BE70);
INCLUDE_ASM(s32, "8BDC0", func_8009BF90);
INCLUDE_ASM(s32, "8BDC0", func_8009C090);
INCLUDE_ASM(s32, "8BDC0", func_8009C0A0);
INCLUDE_ASM(s32, "8BDC0", func_8009C100);
INCLUDE_ASM(s32, "8BDC0", func_8009C160);
INCLUDE_ASM(s32, "8BDC0", func_8009C240);
INCLUDE_ASM(s32, "8BDC0", HuGuLookAtF);
INCLUDE_ASM(s32, "8BDC0", func_8009C6E0);
INCLUDE_ASM(s32, "8BDC0", func_8009C770);
INCLUDE_ASM(s32, "8BDC0", func_8009CD20);
INCLUDE_ASM(s32, "8BDC0", func_8009CDB0);
INCLUDE_ASM(s32, "8BDC0", func_8009D840);
INCLUDE_ASM(s32, "8BDC0", func_8009D920);
INCLUDE_ASM(s32, "8BDC0", func_8009DAD0);
INCLUDE_ASM(s32, "8BDC0", func_8009DB50);
INCLUDE_ASM(s32, "8BDC0", func_8009DD10);
INCLUDE_ASM(s32, "8BDC0", func_8009DD90);
INCLUDE_ASM(s32, "8BDC0", func_8009DFF0);
INCLUDE_ASM(s32, "8BDC0", func_8009E060);
INCLUDE_ASM(s32, "8BDC0", func_8009E360);
INCLUDE_ASM(s32, "8BDC0", func_8009E7E0);
INCLUDE_ASM(s32, "8BDC0", func_8009E8F0);
INCLUDE_ASM(s32, "8BDC0", func_8009EA40);
INCLUDE_ASM(s32, "8BDC0", func_8009EB50);
INCLUDE_ASM(s32, "8BDC0", func_8009ECB0);
INCLUDE_ASM(s32, "8BDC0", func_8009EEC0);
INCLUDE_ASM(s32, "8BDC0", func_8009F2D0);
INCLUDE_ASM(s32, "8BDC0", func_8009F530);
INCLUDE_ASM(s32, "8BDC0", func_8009F9B0);
INCLUDE_ASM(s32, "8BDC0", func_8009FD40);
INCLUDE_ASM(s32, "8BDC0", func_800A0270);
INCLUDE_ASM(s32, "8BDC0", func_800A03B0);
INCLUDE_ASM(s32, "8BDC0", func_800A0730);
INCLUDE_ASM(s32, "8BDC0", func_800A07A0);
INCLUDE_ASM(s32, "8BDC0", func_800A0810);
INCLUDE_ASM(s32, "8BDC0", func_800A0890);
INCLUDE_ASM(s32, "8BDC0", func_800A0900);
INCLUDE_ASM(s32, "8BDC0", func_800A0970);
INCLUDE_ASM(s32, "8BDC0", func_800A09D0);
INCLUDE_ASM(s32, "8BDC0", func_800A0A20);
INCLUDE_ASM(s32, "8BDC0", func_800A0B90);
INCLUDE_ASM(s32, "8BDC0", func_800A0D00);
INCLUDE_ASM(s32, "8BDC0", func_800A0D50);
INCLUDE_ASM(s32, "8BDC0", func_800A0DA0);
INCLUDE_ASM(s32, "8BDC0", func_800A0E00);
INCLUDE_ASM(s32, "8BDC0", func_800A0E80);
INCLUDE_ASM(s32, "8BDC0", func_800A0F00);
INCLUDE_ASM(s32, "8BDC0", func_800A0F70);
INCLUDE_ASM(s32, "8BDC0", func_800A1010);
INCLUDE_ASM(s32, "8BDC0", func_800A10C0);
INCLUDE_ASM(s32, "8BDC0", func_800A1190);
INCLUDE_ASM(s32, "8BDC0", func_800A1200);
INCLUDE_ASM(s32, "8BDC0", func_800A1250);
INCLUDE_ASM(s32, "8BDC0", func_800A1320);
INCLUDE_ASM(s32, "8BDC0", func_800A13C0);

View File

@ -0,0 +1,33 @@
/*
* alCents2Ratio()
*
* Calculates the pitch shift ratio from the number of cents according to
* ratio = 2^(cents/1200)
*
* This is accurate to within one cent for ratios up and octave and down
* two ocataves.
*/
#include <libaudio.h>
f32 alCents2Ratio(s32 cents)
{
f32 x;
f32 ratio = 1.0f;
if (cents >= 0) {
x = 1.00057779f; /* 2^(1/1200) */
} else {
x = 0.9994225441f; /* 2^(-1/1200) */
cents = -cents;
}
while (cents) {
if (cents & 1)
ratio *= x;
x *= x;
cents >>= 1;
}
return ratio;
}

View File

@ -0,0 +1,132 @@
/*====================================================================
* synallocvoice.c
*
* Copyright 1995, 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 <os_internal.h>
#include <ultraerror.h>
#include "synthInternals.h"
s32 _allocatePVoice(ALSynth *drvr, PVoice **pvoice, s16 priority);
s32 alSynAllocVoice(ALSynth *drvr, ALVoice *voice, ALVoiceConfig *vc)
{
PVoice *pvoice = 0;
ALFilter *f;
ALParam *update;
s32 stolen;
#ifdef _DEBUG
/* need two updates if voice is stolen */
if (drvr->paramList == 0) {
__osError(ERR_ALSYN_NO_UPDATE, 0);
return 0;
} else if (drvr->paramList->next == 0) {
__osError(ERR_ALSYN_NO_UPDATE, 0);
return 0;
}
#endif
voice->priority = vc->priority;
voice->unityPitch = vc->unityPitch;
voice->table = 0;
voice->fxBus = vc->fxBus;
voice->state = AL_STOPPED;
voice->pvoice = 0;
stolen = _allocatePVoice(drvr, &pvoice, vc->priority);
if (pvoice) { /* if we were able to allocate a voice */
f = pvoice->channelKnob;
if (stolen) {
pvoice->offset = 512;
pvoice->vvoice->pvoice = 0; /* zero stolen voice */
/*
* ramp down stolen voice
*/
update = __allocParam();
update->delta = drvr->paramSamples;
update->type = AL_FILTER_SET_VOLUME;
update->data.i = 0;
update->moredata.i = pvoice->offset - 64;
(*f->setParam)(f, AL_FILTER_ADD_UPDATE, update);
/*
* stop stolen voice
*/
update = __allocParam();
if (update) {
update->delta = drvr->paramSamples + pvoice->offset;
update->type = AL_FILTER_STOP_VOICE;
update->next = 0;
(*f->setParam)(f, AL_FILTER_ADD_UPDATE, update);
} else {
#ifdef _DEBUG
__osError(ERR_ALSYN_NO_UPDATE, 0);
#endif
}
} else {
pvoice->offset = 0;
}
pvoice->vvoice = voice; /* assign new voice */
voice->pvoice = pvoice;
}
return (pvoice != 0);
}
s32 _allocatePVoice(ALSynth *drvr, PVoice **pvoice, s16 priority)
{
ALLink *dl;
PVoice *pv;
s32 stolen = 0;
if ((dl = drvr->pLameList.next) != 0) { /* check the lame list first */
*pvoice = (PVoice *) dl;
alUnlink(dl);
alLink(dl, &drvr->pAllocList);
} else if ((dl = drvr->pFreeList.next) != 0) { /* from the free list */
*pvoice = (PVoice *) dl;
alUnlink(dl);
alLink(dl, &drvr->pAllocList);
} else { /* steal one */
for (dl = drvr->pAllocList.next; dl != 0; dl = dl->next) {
pv = (PVoice *)dl;
/*
* if it is lower priority and not already stolen, keep it
* as a candidate for stealing
*/
if ((pv->vvoice->priority <= priority) && (pv->offset == 0)) {
*pvoice = pv;
priority = pv->vvoice->priority;
stolen = 1;
}
}
}
return stolen;
}

View File

@ -0,0 +1,54 @@
/*====================================================================
* synfreevoice.c
*
* Copyright 1995, 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 <ultraerror.h>
#include <os_internal.h>
#include "synthInternals.h"
#include <os.h>
void alSynFreeVoice(ALSynth *drvr, ALVoice *voice)
{
ALFilter *f;
ALFreeParam *update;
if (voice->pvoice) {
if (voice->pvoice->offset) { /* if voice was stolen */
update = (ALFreeParam *)__allocParam();
ALFailIf(update == 0, ERR_ALSYN_NO_UPDATE);
/*
* set voice data
*/
update->delta = drvr->paramSamples + voice->pvoice->offset;
update->type = AL_FILTER_FREE_VOICE;
update->pvoice = voice->pvoice;
f = voice->pvoice->channelKnob;
(*f->setParam)(f, AL_FILTER_ADD_UPDATE, update);
} else {
_freePVoice(drvr, voice->pvoice);
}
voice->pvoice = 0;
}
}

View File

@ -0,0 +1,50 @@
/*====================================================================
* synsetpitch.c
*
* Copyright 1995, 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 "synthInternals.h"
#include <os_internal.h>
#include <ultraerror.h>
void alSynSetPitch(ALSynth *synth, ALVoice *v, f32 pitch)
{
ALParam *update;
ALFilter *f;
if (v->pvoice) {
/*
* get new update struct from the free list
*/
update = __allocParam();
ALFailIf(update == 0, ERR_ALSYN_NO_UPDATE);
/*
* set offset and pitch data
*/
update->delta = synth->paramSamples + v->pvoice->offset;
update->type = AL_FILTER_SET_PITCH;
update->data.f = pitch;
update->next = 0;
f = v->pvoice->channelKnob;
(*f->setParam)(f, AL_FILTER_ADD_UPDATE, update);
}
}

View File

@ -0,0 +1,50 @@
/*====================================================================
* synsetvol.c
*
* Copyright 1995, 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 "synthInternals.h"
#include <os_internal.h>
#include <ultraerror.h>
void alSynSetVol(ALSynth *synth, ALVoice *v, s16 volume, ALMicroTime t)
{
ALParam *update;
ALFilter *f;
if (v->pvoice) {
/*
* get new update struct from the free list
*/
update = __allocParam();
ALFailIf(update == 0, ERR_ALSYN_NO_UPDATE);
/*
* set offset and volume data
*/
update->delta = synth->paramSamples + v->pvoice->offset;
update->type = AL_FILTER_SET_VOLUME;
update->data.i = volume;
update->moredata.i = _timeToSamples(synth, t);
update->next = 0;
f = v->pvoice->channelKnob;
(*f->setParam)(f, AL_FILTER_ADD_UPDATE, update);
}
}

View File

@ -0,0 +1,48 @@
/*====================================================================
* synstartvoice.c
*
* Copyright 1995, 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 "synthInternals.h"
#include <os_internal.h>
#include <ultraerror.h>
void alSynStartVoice(ALSynth *synth, ALVoice *v, ALWaveTable *table)
{
ALStartParam *update;
ALFilter *f;
if (v->pvoice) {
update = (ALStartParam *)__allocParam();
ALFailIf(update == 0, ERR_ALSYN_NO_UPDATE);
/*
* send the start message to the motion control filter
*/
update->delta = synth->paramSamples + v->pvoice->offset;
update->type = AL_FILTER_START_VOICE;
update->wave = table;
update->next = 0;
update->unity = v->unityPitch;
f = v->pvoice->channelKnob;
(*f->setParam)(f, AL_FILTER_ADD_UPDATE, update);
}
}

View File

@ -0,0 +1,44 @@
/*====================================================================
* synstopvoice.c
*
* Copyright 1995, 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 "synthInternals.h"
#include <os_internal.h>
#include <ultraerror.h>
void alSynStopVoice(ALSynth *synth, ALVoice *v)
{
ALParam *update;
ALFilter *f;
if (v->pvoice) {
update = __allocParam();
ALFailIf(update == 0, ERR_ALSYN_NO_UPDATE);
update->delta = synth->paramSamples + v->pvoice->offset;
update->type = AL_FILTER_STOP_VOICE;
update->next = 0;
f = v->pvoice->channelKnob;
(*f->setParam)(f, AL_FILTER_ADD_UPDATE, update);
}
}

View File

@ -254,8 +254,21 @@ alSynDelete = 0x8008AB70;
alSynAddPlayer = 0x8008AB80;
alSynRemovePlayer = 0x8008ABD0;
alSynFreeVoice = 0x8008AC70;
alSynAllocVoice = 0x8008AD10;
_allocatePVoice = 0x8008AE38;
alSynStopVoice = 0x8008AEF0;
alSynStartVoice = 0x8008AF70;
alSynSetPitch = 0x8008B010;
alSynSetVol = 0x8008B0A0;
alCents2Ratio = 0x8008B160;
alSynNew = 0x8008F1F0;
__allocParam = 0x8008F66C;
_freePVoice = 0x8008F704;
_timeToSamples = 0x8008F78C;
sinf = 0x80088060;
cosf = 0x800855C0;
__libm_qnan_f = 0x800CC6B0;