summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKiritoDv <kiritodev01@gmail.com>2025-02-03 17:18:21 -0600
committerKiritoDv <kiritodev01@gmail.com>2025-02-03 17:18:21 -0600
commit09144f75430b15e471a489ce56ce17a3eecb0c42 (patch)
tree541ee47487298a5b3722eb16a5d4c1b145e67890
parent3a9ee8ae382d2fa513e1e2dc5157b9f379f33c72 (diff)
Rewritten this thingimpl/louist
-rw-r--r--src/audio/audio_synthesis.c22
1 files changed, 4 insertions, 18 deletions
diff --git a/src/audio/audio_synthesis.c b/src/audio/audio_synthesis.c
index 93cb7b1b..af3348c0 100644
--- a/src/audio/audio_synthesis.c
+++ b/src/audio/audio_synthesis.c
@@ -1036,26 +1036,12 @@ Acmd* AudioSynth_ProcessNote(s32 noteIndex, NoteSubEu* noteSub, NoteSynthesisSta
goto skip;
case CODEC_S16:
- aClearBuffer(cmd, DMEM_UNCOMPRESSED_NOTE, (numSamplesToLoadAdj + 16) * 2);
+ aLoadBuffer(aList++, OS_K0_TO_PHYSICAL(bookSample->sampleAddr + synthState->samplePosInt * 2), DMEM_UNCOMPRESSED_NOTE,
+ (numSamplesToLoadAdj + SAMPLES_PER_FRAME) * 2);
flags = A_CONTINUE;
skipBytes = 0;
- numSamplesProcessed += numSamplesToLoadAdj;
- aligned = numSamplesToLoadAdj;
- size_t bytesToRead;
-
- if (((synthState->samplePosInt * 2) + (numSamplesToLoadAdj + 16) * 2) <
- bookSample->size) {
- bytesToRead = (numSamplesToLoadAdj + 16) * 2;
- } else {
- bytesToRead = bookSample->size - (synthState->samplePosInt * 2);
- }
- // @port [Custom audio]
- // TLDR samples are loaded async and might be null the first time they are played.
- // See note in AudioSampleFactory.cpp
- if ((void*) sampleAddr != NULL) {
- aLoadBuffer(cmd++, sampleAddr + (synthState->samplePosInt * 2), DMEM_UNCOMPRESSED_NOTE,
- bytesToRead);
- }
+ numSamplesProcessed = numSamplesToLoadAdj;
+ dmemUncompressedAddrOffset1 = numSamplesToLoadAdj;
goto skip;
}