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

@ -517,9 +517,9 @@ u8* func_800E5E84(s32 arg0, u32* arg1) {
return AudioLoad_GetFontsForSequence(arg0, arg1);
}
void func_800E5EA4(s32 arg0, u32* arg1, u32* arg2) {
*arg1 = gAudioContext.soundFonts[arg0].sampleBankId1;
*arg2 = gAudioContext.soundFonts[arg0].sampleBankId2;
void Audio_GetSampleBankIdsOfFont(s32 fontId, u32* sampleBankId1, u32* sampleBankId2) {
*sampleBankId1 = gAudioContext.soundFontList[fontId].sampleBankId1;
*sampleBankId2 = gAudioContext.soundFontList[fontId].sampleBankId2;
}
s32 func_800E5EDC(void) {
@ -784,7 +784,7 @@ s32 func_800E6590(s32 playerIdx, s32 arg1, s32 arg2) {
SequencePlayer* seqPlayer;
SequenceLayer* layer;
Note* note;
SoundFontSound* sound;
TunedSample* tunedSample;
s32 loopEnd;
s32 samplePos;
@ -806,11 +806,11 @@ s32 func_800E6590(s32 playerIdx, s32 arg1, s32 arg2) {
note = layer->note;
if (layer == note->playbackState.parentLayer) {
sound = note->noteSubEu.sound.soundFontSound;
if (sound == NULL) {
tunedSample = note->noteSubEu.tunedSample;
if (tunedSample == NULL) {
return 0;
}
loopEnd = sound->sample->loop->end;
loopEnd = tunedSample->sample->loop->end;
samplePos = note->synthesisState.samplePosInt;
return loopEnd - samplePos;
}
@ -834,7 +834,7 @@ s32 func_800E66C0(s32 arg0) {
NoteSubEu* temp_a3;
s32 i;
Note* note;
SoundFontSound* sound;
TunedSample* tunedSample;
phi_v1 = 0;
for (i = 0; i < gAudioContext.numNotes; i++) {
@ -844,11 +844,11 @@ s32 func_800E66C0(s32 arg0) {
temp_a3 = &note->noteSubEu;
if (temp_a2->adsr.action.s.state != 0) {
if (arg0 >= 2) {
sound = temp_a3->sound.soundFontSound;
if (sound == NULL || temp_a3->bitField1.isSyntheticWave) {
tunedSample = temp_a3->tunedSample;
if (tunedSample == NULL || temp_a3->bitField1.isSyntheticWave) {
continue;
}
if (sound->sample->medium == MEDIUM_RAM) {
if (tunedSample->sample->medium == MEDIUM_RAM) {
continue;
}
}