Allow adjusting the audio sample rate

This commit is contained in:
Ry 2022-07-27 18:32:04 -07:00
parent e2abb1c3f8
commit f4e70bff94

View File

@ -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