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

Restructuring SoundFont Structs (#1277)

* Document fontData relocation

* Fix

* More cleanup

* typo

* sample -> sampleHeader

* Revert name

* Just a little more

* Another comment change

* Fix Drum

* fix

* K0BASE

* Update relocs

* consistency

* clearer phrasing

* Fix

* PR/Discord Suggestions

* typo

* Revert Sound Font Sample Struct for another PR

* Missed a function

* Organize structs, tuned samples

* New sound effects struct

* fix func name

* wave samples

* consistency

* Fix

* More suggestions

* PR Suggestions

* sample bank reloc

* Revert header description

* better text

* SoundFount Relocation: some cleanup (#6)

* `fontDataStartAddr` for relocation, `fontData` for reading data (`AudioLoad_RelocateFont`)

* Comment "cleanup" in `AudioLoad_RelocateFont`

* Comment "cleanup" in `AudioLoad_RelocateSample`

* Cleanup cast and compares to 0 (offsets) / NULL (pointers)

* Cleanup

* soundFont info

* Revert waveSamples

* cleanup

* Plural

* PR suggestions

* A few name changes and suggestions

* small changes

* Drop Info on SoundFont

* Missed some

* One more function change

Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
This commit is contained in:
engineer124 2022-06-19 07:31:08 -07:00 committed by GitHub
parent 849fdbf9ea
commit 38de9405e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 254 additions and 246 deletions

View file

@ -687,7 +687,7 @@ Acmd* AudioSynth_DoOneAudioUpdate(s16* aiBuf, s32 aiBufLen, Acmd* cmd, s32 updat
Acmd* AudioSynth_ProcessNote(s32 noteIndex, NoteSubEu* noteSubEu, NoteSynthesisState* synthState, s16* aiBuf,
s32 aiBufLen, Acmd* cmd, s32 updateIndex) {
s32 pad1[3];
SoundFontSample* sample;
Sample* sample;
AdpcmLoop* loopInfo;
s32 nSamplesUntilLoopEnd;
s32 nSamplesInThisIteration;
@ -778,7 +778,7 @@ Acmd* AudioSynth_ProcessNote(s32 noteIndex, NoteSubEu* noteSubEu, NoteSynthesisS
noteSamplesDmemAddrBeforeResampling = DMEM_UNCOMPRESSED_NOTE + (synthState->samplePosInt * 2);
synthState->samplePosInt += nSamplesToLoad;
} else {
sample = noteSubEu->sound.soundFontSound->sample;
sample = noteSubEu->tunedSample->sample;
loopInfo = sample->loop;
loopEndPos = loopInfo->end;
sampleAddr = (u32)sample->sampleAddr;
@ -812,7 +812,7 @@ Acmd* AudioSynth_ProcessNote(s32 noteIndex, NoteSubEu* noteSubEu, NoteSynthesisS
if (1) {}
if (1) {}
if (1) {}
nEntries = 16 * sample->book->order * sample->book->npredictors;
nEntries = 16 * sample->book->order * sample->book->numPredictors;
aLoadADPCM(cmd++, nEntries, gAudioContext.curLoadedBook);
}
}
@ -917,7 +917,7 @@ Acmd* AudioSynth_ProcessNote(s32 noteIndex, NoteSubEu* noteSubEu, NoteSynthesisS
}
if (synthState->restart) {
aSetLoop(cmd++, sample->loop->state);
aSetLoop(cmd++, sample->loop->predictorState);
flags = A_LOOP;
synthState->restart = false;
}
@ -1195,7 +1195,7 @@ Acmd* AudioSynth_LoadWaveSamples(Acmd* cmd, NoteSubEu* noteSubEu, NoteSynthesisS
gWaveSamples[8] += nSamplesToLoad * 2;
return cmd;
} else {
aLoadBuffer(cmd++, noteSubEu->sound.samples, DMEM_UNCOMPRESSED_NOTE, 0x80);
aLoadBuffer(cmd++, noteSubEu->samples, DMEM_UNCOMPRESSED_NOTE, 0x80);
if (unk6 != 0) {
samplePosInt = (samplePosInt * D_801304C0[unk6 >> 2]) / D_801304C0[unk6 & 3];
}