From d30929d20cee377a7321fe8b92c60d4622cb6908 Mon Sep 17 00:00:00 2001 From: Sonic Dreamcaster Date: Thu, 30 Jan 2025 23:29:47 -0300 Subject: [PATCH] jp audio in progress --- src/audio/audio_load.c | 3 ++- src/audio/audio_synthesis.c | 12 +++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/audio/audio_load.c b/src/audio/audio_load.c index 9db564e8..1d0a6fb9 100644 --- a/src/audio/audio_load.c +++ b/src/audio/audio_load.c @@ -906,7 +906,8 @@ static const char devstr40[] = "===Block LPS end\n"; s32 AudioLoad_SlowLoadSample(s32 fontId, u8 instId, s8* status) { Sample* sample; AudioSlowLoad* slowLoad; - + + *status = SLOW_LOAD_DONE; sample = AudioLoad_GetFontSample(fontId, instId); return 0; diff --git a/src/audio/audio_synthesis.c b/src/audio/audio_synthesis.c index 008c3b3b..558c8c0e 100644 --- a/src/audio/audio_synthesis.c +++ b/src/audio/audio_synthesis.c @@ -579,10 +579,10 @@ s32 func_8000967C(s32 length, s16* ramAddr, UnkStruct_800097A8* arg2) { u8* func_800097A8(Sample* sample, s32 length, u32 flags, UnkStruct_800097A8* arg3) { // @port: We don't need to do a dma call - return sample->sampleAddr; + // return sample->sampleAddr; s32 pad1; SampleDma* pad2; - SampleDma* sp1C; + SampleDma* sp1C = NULL; if (flags == A_INIT) { arg3->unk_0 = (s16*) sample->sampleAddr; @@ -894,6 +894,7 @@ Acmd* AudioSynth_ProcessNote(s32 noteIndex, NoteSubEu* noteSub, NoteSynthesisSta s16 addr; s32 samplesRemaining; s32 numSamplesToDecode; + uintptr_t buffAddr; currentBook = NULL; note = &gNotes[noteIndex]; @@ -1022,7 +1023,12 @@ Acmd* AudioSynth_ProcessNote(s32 noteIndex, NoteSubEu* noteSub, NoteSynthesisSta sampleDmaStart = 0; break; - case CODEC_S16_INMEMORY: + case CODEC_S16_INMEMORY: + buffAddr = func_800097A8(bookSample, numSamplesToLoadAdj, flags, + &synthState->synthesisBuffers->unk_40); + aLoadBuffer(aList++, OS_K0_TO_PHYSICAL(buffAddr), DMEM_UNCOMPRESSED_NOTE, + (numSamplesToLoadAdj + SAMPLES_PER_FRAME) * 2); + flags = A_CONTINUE; skipBytes = 0; numSamplesProcessed = numSamplesToLoadAdj; dmemUncompressedAddrOffset1 = numSamplesToLoadAdj;