]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
sndboard: add Unix host capture hooks
authorStefan Reinauer <stefan.reinauer@coreboot.org>
Wed, 3 Jun 2026 01:28:39 +0000 (18:28 -0700)
committerStefan Reinauer <stefan.reinauer@coreboot.org>
Thu, 4 Jun 2026 03:48:39 +0000 (20:48 -0700)
Include the Unix sound-board host hooks when building outside
Windows and route capture buffer operations through that backend.

Keep FM801 PCI helpers behind WITH_PCI so non-PCI Unix builds can
compile the shared sound-board source without pulling PCI state in.

sndboard.cpp

index 573d604e3b357187244ade0d3f793920d8caf3b5..fca7202d966dd5fbb21a876655a97e95d80331e4 100644 (file)
@@ -22,6 +22,9 @@
 #include "qemuvga/qemuaudio.h"
 #include "rommgr.h"
 #include "devices.h"
+#ifndef _WIN32
+#include "sndboard_host.h"
+#endif
 
 #define DEBUG_SNDDEV 0
 #define DEBUG_SNDDEV_READ 0
@@ -2437,6 +2440,8 @@ static struct fm801_data fm801;
 static bool fm801_active;
 static const int fm801_freq[16] = { 5500, 8000, 9600, 11025, 16000, 19200, 22050, 32000, 38400, 44100, 48000 };
 
+#ifdef WITH_PCI
+
 static void calculate_volume_fm801(void)
 {
        struct fm801_data *data = &fm801;
@@ -2832,6 +2837,8 @@ const struct pci_board solo1_pci_board =
        }
 };
 
+#endif
+
 static SWVoiceOut *qemu_voice_out;
 
 static bool audio_state_sndboard_qemu(int streamid, void *params)
@@ -3015,8 +3022,10 @@ static void sndboard_vsync(void)
 {
        if (snddev[0].snddev_active)
                sndboard_vsync_toccata(&snddev[0]);
+#ifdef WITH_PCI
        if (fm801_active)
                sndboard_vsync_fm801();
+#endif
        if (qemu_voice_out_active())
                sndboard_vsync_qemu();
 }
@@ -3025,8 +3034,10 @@ void sndboard_ext_volume(void)
 {
        if (snddev[0].snddev_active)
                calculate_volume_toccata(&snddev[0]);
+#ifdef WITH_PCI
        if (fm801_active)
                calculate_volume_fm801();
+#endif
        calculate_volume_qemu_all();
 }
 
@@ -3183,4 +3194,26 @@ Exit:;
        return false;
 }
 
+#else
+
+static uae_u8 *sndboard_get_buffer(int *frames)
+{
+       return unix_sndboard_get_buffer(frames);
+}
+
+static void sndboard_release_buffer(uae_u8 *buffer, int frames)
+{
+       unix_sndboard_release_buffer(buffer, frames);
+}
+
+static void sndboard_free_capture(void)
+{
+       unix_sndboard_free_capture();
+}
+
+static bool sndboard_init_capture(int freq)
+{
+       return unix_sndboard_init_capture(freq);
+}
+
 #endif