From 43ca65bf04d052608a527d4678e85ef215232ad2 Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Wed, 19 Nov 2025 17:15:45 -0300 Subject: [PATCH] AC97 Codec: Devbranch some non-working stuff --- CMakeLists.txt | 1 + src/include/86box/snd_ac97.h | 2 ++ src/sound/CMakeLists.txt | 4 ++++ src/sound/snd_ac97_codec.c | 4 ++++ src/sound/sound.c | 2 ++ 5 files changed, 13 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2f6c18af0..3004b3711 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -186,6 +186,7 @@ cmake_dependent_option(WACOM "Wacom Input Devices" cmake_dependent_option(XL24 "ATI VGA Wonder XL24 (ATI-28800-6)" ON "DEV_BRANCH" OFF) cmake_dependent_option(NETSWITCH "Network Switch Support" ON "DEV_BRANCH" OFF) cmake_dependent_option(VFIO "Virtual Function I/O" ON "DEV_BRANCH" OFF) +cmake_dependent_option(SOFTMODEM "AC'97 Softmodem" ON "DEV_BRANCH" OFF) # Ditto but for Qt if(QT) diff --git a/src/include/86box/snd_ac97.h b/src/include/86box/snd_ac97.h index d8f2f6953..0bad4efa0 100644 --- a/src/include/86box/snd_ac97.h +++ b/src/include/86box/snd_ac97.h @@ -166,7 +166,9 @@ extern const device_t stac9721_device; extern const device_t tr28023_device; extern const device_t w83971d_device; extern const device_t wm9701a_device; +#ifdef USE_SOFTMODEM extern const device_t si3036_device; +#endif extern const device_t ac97_via_device; #endif diff --git a/src/sound/CMakeLists.txt b/src/sound/CMakeLists.txt index ccb54ab19..a6a9b691a 100644 --- a/src/sound/CMakeLists.txt +++ b/src/sound/CMakeLists.txt @@ -192,6 +192,10 @@ if(OPL4ML) target_compile_definitions(snd PRIVATE USE_OPL4ML) target_sources(snd PRIVATE midi_opl4.c midi_opl4_yrw801.c) endif() + +if(SOFTMODEM) + target_compile_definitions(snd PRIVATE USE_SOFTMODEM) +endif() find_package(PkgConfig) pkg_check_modules(SERIALPORT libserialport) diff --git a/src/sound/snd_ac97_codec.c b/src/sound/snd_ac97_codec.c index 04abab305..071356873 100644 --- a/src/sound/snd_ac97_codec.c +++ b/src/sound/snd_ac97_codec.c @@ -114,6 +114,7 @@ static const struct { .reset_flags = AC97_DAC_18B | AC97_ADC_18B, .pcsr_mask = 0x3f }, +#ifdef USE_SOFTMODEM { .device = &si3036_device, .misc_flags = AC97_MODEM | AC97_GAIN_3B, @@ -124,6 +125,7 @@ static const struct { .gpo_mask = 0xfc3f, .vendor_regs = (const ac97_vendor_reg_t[]) {{0, 0x5a, 0x0142, 0x0000}, {0, 0x5c, 0xf010, 0xfefd}, {0, 0x5e, 0x004c, 0x0000}, {0, 0x62, 0x0000, 0x01f8}, {0, 0x64, 0x0080, 0x0000}, {0}} } +#endif // clang-format on }; @@ -958,6 +960,7 @@ const device_t wm9701a_device = { .config = NULL }; +#ifdef USE_SOFTMODEM const device_t si3036_device = { .name = "Silicon Laboratories Si3036 Modem", .internal_name = "si3036", @@ -971,3 +974,4 @@ const device_t si3036_device = { .force_redraw = NULL, .config = NULL }; +#endif diff --git a/src/sound/sound.c b/src/sound/sound.c index 94a11ad00..4d9675441 100644 --- a/src/sound/sound.c +++ b/src/sound/sound.c @@ -187,7 +187,9 @@ static const SOUND_CARD sound_cards[] = { /* AC97 */ { &ad1881_device }, { &cs4297a_device }, +#ifdef USE_SOFTMODEM { &si3036_device }, +#endif { NULL } // clang-format on };