From b609065bc47b6279514464c5bcb5ed4c65b6ec13 Mon Sep 17 00:00:00 2001 From: Dan Sumorok Date: Sat, 22 Jun 2013 12:43:41 -0400 Subject: [PATCH] Always start sound. --- BasiliskII/src/uae_cpu/basilisk_glue.cpp | 27 ++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/BasiliskII/src/uae_cpu/basilisk_glue.cpp b/BasiliskII/src/uae_cpu/basilisk_glue.cpp index 84ed137e..7a333e61 100644 --- a/BasiliskII/src/uae_cpu/basilisk_glue.cpp +++ b/BasiliskII/src/uae_cpu/basilisk_glue.cpp @@ -460,6 +460,33 @@ extern void io_write(uaecptr addr, uae_u32 b, int width_bits) { default: break; } + + if(soundRunning == 0) { + int32 depthA = fifoInA - fifoWriteA; + + soundRunning = 1; + downsample = 0; + + if(zeros[0] == 0) { + memset(zeros, 128, sizeof(zeros)); + } + + asc_init(22050); + + ascBufferSize = asc_get_buffer_size(); + + if(depthA >= ascBufferSize) { + asc_process_samples(&fifoA[fifoWriteA % fifoCapacity], + ascBufferSize); + fifoWriteA += ascBufferSize; + underrun = 0; + } else { + underrun = 1; + asc_process_samples(zeros, ascBufferSize); + } + + } + } }