1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-18 13:54:46 +00:00

Synthetic Waves Documentation (#1256)

* Synthetic wave documentation

* Better docs

* harmonicIndex

* More

* typo

* Complete the abi buffer docs

* Small change

* Revert change

* PR suggestions

* Missed one

* PR Feedback

* Better documents

* Well that was a silly copy-pasta mistake

* Typo

* Another comment

* Plural

* Make it more block-like

* Capitalization

* Add comments for gWaveSamples[8]

* Adjust comment

* More PR Suggestions

* PR Suggestions

* missed a phrasing

* PR Suggestions

* Update include/z64audio.h

Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>

Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
This commit is contained in:
engineer124 2022-06-20 21:55:01 -04:00 committed by GitHub
parent e7e2da86a8
commit 00b98027db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 168 additions and 98 deletions

View file

@ -153,8 +153,6 @@ AudioTask* func_800E5000(void) {
if (gAudioContext.resetStatus == 0) {
// msg = 0000RREE R = read pos, E = End Pos
while (osRecvMesg(gAudioContext.cmdProcQueueP, (OSMesg*)&sp4C, OS_MESG_NOBLOCK) != -1) {
if (1) {}
if (1) {}
if (1) {}
Audio_ProcessCmds(sp4C);
j++;
@ -166,9 +164,15 @@ AudioTask* func_800E5000(void) {
gAudioContext.curAbiCmdBuf =
AudioSynth_Update(gAudioContext.curAbiCmdBuf, &abiCmdCnt, currAiBuffer, gAudioContext.aiBufLengths[index]);
// Update audioRandom to the next random number
gAudioContext.audioRandom = (gAudioContext.audioRandom + gAudioContext.totalTaskCount) * osGetCount();
gAudioContext.audioRandom =
gAudioContext.aiBuffers[index][gAudioContext.totalTaskCount & 0xFF] + gAudioContext.audioRandom;
gAudioContext.audioRandom + gAudioContext.aiBuffers[index][gAudioContext.totalTaskCount & 0xFF];
// gWaveSamples[8] interprets compiled assembly code as s16 samples as a way to generate sound with noise.
// Start with the address of func_800E4FE0, and offset it by a random number between 0 - 0xFFF0
// Use the resulting address as the starting address to interpret an array of samples i.e. `s16 samples[]`
gWaveSamples[8] = (s16*)(((u8*)func_800E4FE0) + (gAudioContext.audioRandom & 0xFFF0));
index = gAudioContext.rspTaskIndex;