From f4e70bff94c9002622be66d2d9c5ea23c2dd69eb Mon Sep 17 00:00:00 2001 From: Ry Date: Wed, 27 Jul 2022 18:32:04 -0700 Subject: [PATCH] Allow adjusting the audio sample rate --- audio.asm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/audio.asm b/audio.asm index 394e543..96a7c72 100644 --- a/audio.asm +++ b/audio.asm @@ -16,6 +16,7 @@ const OLD_BUFFER_SWAP_VECTOR: 0x01FFFF09 ; inputs: ; r0: pointer to audio clip ; r1: length of audio clip in bytes (must be a multiple of 32768 bytes) +; r2: audio sample rate ; outputs: ; none play_audio: @@ -40,9 +41,9 @@ play_audio: ; so set it to 0xFF so that it becomes zero when checked for the first time mov.8 [CURRENT_BUFFER], 0xFF - ; enable audio playback + ; enable audio playback and set sample rate mov r0, 0x80000600 - out r0, 1 + out r0, r2 pop r1 pop r0