diff --git a/.github/workflows/cmake_linux.yml b/.github/workflows/cmake_linux.yml
index 73ae94969..83672974f 100644
--- a/.github/workflows/cmake_linux.yml
+++ b/.github/workflows/cmake_linux.yml
@@ -106,7 +106,7 @@ jobs:
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build build
- name: Run sonar-scanner
-# if: 0
+ if: 0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
diff --git a/src/device.c b/src/device.c
index 2f5a3cdad..9a904f550 100644
--- a/src/device.c
+++ b/src/device.c
@@ -493,14 +493,26 @@ device_get_name(const device_t *dev, int bus, char *name)
sbus = (dev->flags & DEVICE_AT) ? "ISA16" : "ISA";
else if (dev->flags & DEVICE_CBUS)
sbus = "C-BUS";
+ else if (dev->flags & DEVICE_PCMCIA)
+ sbus = "PCMCIA";
else if (dev->flags & DEVICE_MCA)
sbus = "MCA";
+ else if (dev->flags & DEVICE_HIL)
+ sbus = "HP HIL";
else if (dev->flags & DEVICE_EISA)
sbus = "EISA";
+ else if (dev->flags & DEVICE_AT32)
+ sbus = "AT/32";
+ else if (dev->flags & DEVICE_OLB)
+ sbus = "OLB";
else if (dev->flags & DEVICE_VLB)
sbus = "VLB";
else if (dev->flags & DEVICE_PCI)
sbus = "PCI";
+ else if (dev->flags & DEVICE_CARDBUS)
+ sbus = "CARDBUS";
+ else if (dev->flags & DEVICE_USB)
+ sbus = "USB";
else if (dev->flags & DEVICE_AGP)
sbus = "AGP";
else if (dev->flags & DEVICE_AC97)
@@ -767,13 +779,16 @@ device_is_valid(const device_t *device, int m)
if ((device->flags & DEVICE_ATKBC) && !machine_has_bus(m, MACHINE_BUS_ISA16) && !machine_has_bus(m, MACHINE_BUS_DM_KBC))
return 0;
+ if ((device->flags & DEVICE_PS2) && !machine_has_bus(m, MACHINE_BUS_PS2_PORTS))
+ return 0;
+
if ((device->flags & DEVICE_ISA) && !machine_has_bus(m, MACHINE_BUS_ISA))
return 0;
if ((device->flags & DEVICE_CBUS) && !machine_has_bus(m, MACHINE_BUS_CBUS))
return 0;
- if ((device->flags & DEVICE_PCMCIA) && !machine_has_bus(m, MACHINE_BUS_PCMCIA))
+ if ((device->flags & DEVICE_PCMCIA) && !machine_has_bus(m, MACHINE_BUS_PCMCIA) && !machine_has_bus(m, MACHINE_BUS_ISA))
return 0;
if ((device->flags & DEVICE_MCA) && !machine_has_bus(m, MACHINE_BUS_MCA))
@@ -785,6 +800,9 @@ device_is_valid(const device_t *device, int m)
if ((device->flags & DEVICE_EISA) && !machine_has_bus(m, MACHINE_BUS_EISA))
return 0;
+ if ((device->flags & DEVICE_AT32) && !machine_has_bus(m, MACHINE_BUS_AT32))
+ return 0;
+
if ((device->flags & DEVICE_OLB) && !machine_has_bus(m, MACHINE_BUS_OLB))
return 0;
@@ -794,7 +812,7 @@ device_is_valid(const device_t *device, int m)
if ((device->flags & DEVICE_PCI) && !machine_has_bus(m, MACHINE_BUS_PCI))
return 0;
- if ((device->flags & DEVICE_CARDBUS) && !machine_has_bus(m, MACHINE_BUS_CARDBUS))
+ if ((device->flags & DEVICE_CARDBUS) && !machine_has_bus(m, MACHINE_BUS_CARDBUS) && !machine_has_bus(m, MACHINE_BUS_PCI))
return 0;
if ((device->flags & DEVICE_USB) && !machine_has_bus(m, MACHINE_BUS_USB))
@@ -803,9 +821,6 @@ device_is_valid(const device_t *device, int m)
if ((device->flags & DEVICE_AGP) && !machine_has_bus(m, MACHINE_BUS_AGP))
return 0;
- if ((device->flags & DEVICE_PS2) && !machine_has_bus(m, MACHINE_BUS_PS2_PORTS))
- return 0;
-
if ((device->flags & DEVICE_AC97) && !machine_has_bus(m, MACHINE_BUS_AC97))
return 0;
diff --git a/src/disk/hdc_ide_w83769f.c b/src/disk/hdc_ide_w83769f.c
index c2b053814..608d7a8a7 100644
--- a/src/disk/hdc_ide_w83769f.c
+++ b/src/disk/hdc_ide_w83769f.c
@@ -458,3 +458,17 @@ const device_t ide_w83769f_pci_34_device = {
.config = NULL
};
+const device_t ide_w83769f_pci_single_channel_device = {
+ .name = "Winbond W83769F PCI (Single Channel)",
+ .internal_name = "ide_w83769f_pci_single_channel",
+ .flags = DEVICE_PCI,
+ .local = 0x200b4,
+ .init = w83769f_init,
+ .close = w83769f_close,
+ .reset = w83769f_reset,
+ { .available = NULL },
+ .speed_changed = NULL,
+ .force_redraw = NULL,
+ .config = NULL
+};
+
diff --git a/src/include/86box/hdc.h b/src/include/86box/hdc.h
index 48235bb1e..a3b667e2e 100644
--- a/src/include/86box/hdc.h
+++ b/src/include/86box/hdc.h
@@ -89,6 +89,7 @@ extern const device_t ide_w83769f_vlb_device; /* Winbond W8376
extern const device_t ide_w83769f_vlb_34_device; /* Winbond W83769F VLB (Port 34h) */
extern const device_t ide_w83769f_pci_device; /* Winbond W83769F PCI */
extern const device_t ide_w83769f_pci_34_device; /* Winbond W83769F PCI (Port 34h) */
+extern const device_t ide_w83769f_pci_single_channel_device; /* Winbond W83769F PCI (Only primary channel) */
extern const device_t ide_ter_device;
extern const device_t ide_ter_pnp_device;
diff --git a/src/include/86box/machine.h b/src/include/86box/machine.h
index e07843c05..1398be532 100644
--- a/src/include/86box/machine.h
+++ b/src/include/86box/machine.h
@@ -641,6 +641,7 @@ extern int machine_at_valuepointp60_init(const machine_t *);
extern int machine_at_revenge_init(const machine_t *);
extern int machine_at_586is_init(const machine_t *);
extern int machine_at_pb520r_init(const machine_t *);
+extern int machine_at_m5pi_init(const machine_t *);
extern int machine_at_excalibur_init(const machine_t *);
diff --git a/src/include/86box/snd_sb.h b/src/include/86box/snd_sb.h
index 33467cf25..a85f1515c 100644
--- a/src/include/86box/snd_sb.h
+++ b/src/include/86box/snd_sb.h
@@ -11,9 +11,11 @@
* Authors: Sarah Walker,
* Miran Grca,
* TheCollector1995,
+ * Jasmine Iwanek,
*
* Copyright 2008-2018 Sarah Walker.
* Copyright 2016-2018 Miran Grca.
+ * Copyright 2024-2025 Jasmine Iwanek.
*/
#ifndef SOUND_SND_SB_H
@@ -196,6 +198,12 @@ typedef struct sb_t {
void (*opl_mix)(void*, double*, double*);
} sb_t;
+typedef struct goldfinch_t {
+ emu8k_t emu8k;
+
+ uint8_t pnp_rom[512];
+} goldfinch_t;
+
extern void sb_ct1345_mixer_write(uint16_t addr, uint8_t val, void *priv);
extern uint8_t sb_ct1345_mixer_read(uint16_t addr, void *priv);
extern void sb_ct1345_mixer_reset(sb_t *sb);
diff --git a/src/include/86box/sound.h b/src/include/86box/sound.h
index 9029b336d..e5ae227fd 100644
--- a/src/include/86box/sound.h
+++ b/src/include/86box/sound.h
@@ -158,6 +158,7 @@ extern const device_t sb_16_pnp_ide_device;
extern const device_t sb_16_compat_device;
extern const device_t sb_16_compat_nompu_device;
extern const device_t sb_16_reply_mca_device;
+extern const device_t sb_goldfinch_device;
extern const device_t sb_32_pnp_device;
extern const device_t sb_awe32_device;
extern const device_t sb_awe32_pnp_device;
diff --git a/src/machine/m_at_socket4.c b/src/machine/m_at_socket4.c
index 5fb245038..c3213f1ac 100644
--- a/src/machine/m_at_socket4.c
+++ b/src/machine/m_at_socket4.c
@@ -354,6 +354,36 @@ machine_at_pb520r_init(const machine_t *model)
return ret;
}
+int
+machine_at_m5pi_init(const machine_t *model)
+{
+ int ret;
+
+ ret = bios_load_linear_inverted("roms/machines/m5pi/M5PI10R.BIN",
+ 0x000e0000, 131072, 0);
+
+ if (bios_only || !ret)
+ return ret;
+
+ machine_at_common_init(model);
+
+ pci_init(PCI_CONFIG_TYPE_2 | PCI_NO_IRQ_STEERING);
+ pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
+ pci_register_slot(0x01, PCI_CARD_IDE, 0, 0, 0, 0);
+ pci_register_slot(0x0f, PCI_CARD_NORMAL, 1, 2, 3, 4);
+ pci_register_slot(0x0c, PCI_CARD_NORMAL, 2, 3, 4, 1);
+ pci_register_slot(0x0b, PCI_CARD_NORMAL, 3, 4, 1, 2);
+ pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
+ device_add(&i430lx_device);
+ device_add(&sio_zb_device);
+ device_add(&keyboard_ps2_phoenix_device);
+ device_add(&ide_w83769f_pci_single_channel_device);
+ device_add(&fdc37c665_ide_sec_device);
+ device_add(&intel_flash_bxt_ami_device);
+
+ return ret;
+}
+
int
machine_at_excalibur_init(const machine_t *model)
{
diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c
index 8286a07c8..ad0844cdc 100644
--- a/src/machine/machine_table.c
+++ b/src/machine/machine_table.c
@@ -9366,6 +9366,46 @@ const machine_t machines[] = {
.snd_device = NULL,
.net_device = NULL
},
+ /* The M5Pi appears to have a Phoenix MultiKey KBC firmware according to photos. */
+ {
+ .name = "[i430LX] Micronics M5Pi",
+ .internal_name = "m5pi",
+ .type = MACHINE_TYPE_SOCKET4,
+ .chipset = MACHINE_CHIPSET_INTEL_430LX,
+ .init = machine_at_m5pi_init,
+ .p1_handler = NULL,
+ .gpio_handler = NULL,
+ .available_flag = MACHINE_AVAILABLE,
+ .gpio_acpi_handler = NULL,
+ .cpu = {
+ .package = CPU_PKG_SOCKET4,
+ .block = CPU_BLOCK_NONE,
+ .min_bus = 60000000,
+ .max_bus = 66666667,
+ .min_voltage = 5000,
+ .max_voltage = 5000,
+ .min_multi = MACHINE_MULTIPLIER_FIXED,
+ .max_multi = MACHINE_MULTIPLIER_FIXED
+ },
+ .bus_flags = MACHINE_PCI,
+ .flags = MACHINE_IDE_DUAL | MACHINE_APM,
+ .ram = {
+ .min = 2048,
+ .max = 131072,
+ .step = 2048
+ },
+ .nvrmask = 127,
+ .kbc_device = NULL,
+ .kbc_p1 = 0xff,
+ .gpio = 0xffffffff,
+ .gpio_acpi = 0xffffffff,
+ .device = NULL,
+ .fdc_device = NULL,
+ .sio_device = NULL,
+ .vid_device = NULL,
+ .snd_device = NULL,
+ .net_device = NULL
+ },
/* OPTi 596/597 */
/* This uses an AMI KBC firmware in PS/2 mode (it sends command A5 with the
diff --git a/src/qt/qt_main.cpp b/src/qt/qt_main.cpp
index d18894bf6..c602b9ea1 100644
--- a/src/qt/qt_main.cpp
+++ b/src/qt/qt_main.cpp
@@ -163,8 +163,7 @@ kbd_handle(uint16_t scancode, uint16_t flags)
We use scan code 0xFFFF to mean a mapping that
has a prefix other than E0 and that is not E1 1D,
which is, for our purposes, invalid. */
-
- /* Translate right CTRL to left ALT if the user has so
+ /* Translate right CTRL to left ALT if the user has so
chosen. */
if ((scancode == 0x11d) && rctrl_is_lalt)
scancode = 0x038;
@@ -173,18 +172,8 @@ kbd_handle(uint16_t scancode, uint16_t flags)
it's not an invalid scan code. */
if (scancode != 0xFFFF)
keyboard_input(!(flags & LLKHF_UP), scancode);
-}
-
-static LRESULT CALLBACK
-input_LowLevelKeyboardProc(int nCode, WPARAM wParam, LPARAM lParam)
-{
- LPKBDLLHOOKSTRUCT lpKdhs = (LPKBDLLHOOKSTRUCT) lParam;
-
- kbd_handle(lpKdhs->scanCode & 0x00ff, lpKdhs->flags);
main_window->checkFullscreenHotkey();
-
- return CallNextHookEx(NULL, nCode, wParam, lParam);
}
static LRESULT CALLBACK
@@ -194,44 +183,38 @@ emu_LowLevelKeyboardProc(int nCode, WPARAM wParam, LPARAM lParam)
/* Checks if CTRL was pressed. */
BOOL bCtrlDown = GetAsyncKeyState (VK_CONTROL) >> ((sizeof(SHORT) * 8) - 1);
+ if ((GetForegroundWindow() == ((HWND) main_window->winId())) && !(lpKdhs->scanCode & 0xff00))
+ kbd_handle(lpKdhs->scanCode, lpKdhs->flags);
+
if ((nCode < 0) || (nCode != HC_ACTION) || (!mouse_capture && !video_fullscreen))
return CallNextHookEx(NULL, nCode, wParam, lParam);
else if ((lpKdhs->scanCode == 0x01) && (lpKdhs->flags & LLKHF_ALTDOWN) &&
- !(lpKdhs->flags & (LLKHF_UP | LLKHF_EXTENDED))) {
- kbd_handle(lpKdhs->scanCode & 0x00ff, lpKdhs->flags);
+ !(lpKdhs->flags & (LLKHF_UP | LLKHF_EXTENDED)))
return TRUE;
- } else if ((lpKdhs->scanCode == 0x01) && bCtrlDown && !(lpKdhs->flags & (LLKHF_UP | LLKHF_EXTENDED))) {
- kbd_handle(lpKdhs->scanCode & 0x00ff, lpKdhs->flags);
+ else if ((lpKdhs->scanCode == 0x01) && bCtrlDown && !(lpKdhs->flags & (LLKHF_UP | LLKHF_EXTENDED)))
return TRUE;
- } else if ((lpKdhs->scanCode == 0x0f) && (lpKdhs->flags & LLKHF_ALTDOWN) &&
- !(lpKdhs->flags & (LLKHF_UP | LLKHF_EXTENDED))) {
- kbd_handle(lpKdhs->scanCode & 0x00ff, lpKdhs->flags);
+ else if ((lpKdhs->scanCode == 0x0f) && (lpKdhs->flags & LLKHF_ALTDOWN) &&
+ !(lpKdhs->flags & (LLKHF_UP | LLKHF_EXTENDED)))
return TRUE;
- } else if ((lpKdhs->scanCode == 0x0f) && bCtrlDown && !(lpKdhs->flags & (LLKHF_UP | LLKHF_EXTENDED))) {
- kbd_handle(lpKdhs->scanCode & 0x00ff, lpKdhs->flags);
+ else if ((lpKdhs->scanCode == 0x0f) && bCtrlDown && !(lpKdhs->flags & (LLKHF_UP | LLKHF_EXTENDED)))
return TRUE;
- } else if ((lpKdhs->scanCode == 0x39) && (lpKdhs->flags & LLKHF_ALTDOWN) &&
- !(lpKdhs->flags & (LLKHF_UP | LLKHF_EXTENDED))) {
- kbd_handle(lpKdhs->scanCode & 0x00ff, lpKdhs->flags);
+ else if ((lpKdhs->scanCode == 0x39) && (lpKdhs->flags & LLKHF_ALTDOWN) &&
+ !(lpKdhs->flags & (LLKHF_UP | LLKHF_EXTENDED)))
return TRUE;
- } else if ((lpKdhs->scanCode == 0x3e) && (lpKdhs->flags & LLKHF_ALTDOWN) &&
- !(lpKdhs->flags & (LLKHF_UP | LLKHF_EXTENDED))) {
- kbd_handle(lpKdhs->scanCode & 0x00ff, lpKdhs->flags);
+ else if ((lpKdhs->scanCode == 0x3e) && (lpKdhs->flags & LLKHF_ALTDOWN) &&
+ !(lpKdhs->flags & (LLKHF_UP | LLKHF_EXTENDED)))
return TRUE;
- } else if ((lpKdhs->scanCode == 0x49) && bCtrlDown && !(lpKdhs->flags & LLKHF_UP)) {
- kbd_handle(lpKdhs->scanCode & 0x00ff, lpKdhs->flags);
+ else if ((lpKdhs->scanCode == 0x49) && bCtrlDown && !(lpKdhs->flags & LLKHF_UP))
return TRUE;
- } else if ((lpKdhs->scanCode >= 0x5b) && (lpKdhs->scanCode <= 0x5d) && (lpKdhs->flags & LLKHF_EXTENDED)) {
- kbd_handle(lpKdhs->scanCode & 0x00ff, lpKdhs->flags);
+ else if ((lpKdhs->scanCode >= 0x5b) && (lpKdhs->scanCode <= 0x5d) && (lpKdhs->flags & LLKHF_EXTENDED))
return TRUE;
- } else
+ else
return CallNextHookEx(NULL, nCode, wParam, lParam);
}
#endif
#ifdef Q_OS_WINDOWS
static HHOOK llhook = NULL;
-static HHOOK llihook = NULL;
#endif
void
@@ -494,12 +477,17 @@ main(int argc, char *argv[])
});
}
+ /* Force raw input if a debugger is present. */
+ if (IsDebuggerPresent()) {
+ pclog("WARNING: Debugged detected, forcing raw input\n");
+ raw_input = 1;
+ }
+
/* Setup raw input */
auto rawInputFilter = WindowsRawInputFilter::Register(main_window);
if (rawInputFilter) {
app.installNativeEventFilter(rawInputFilter.get());
- if (raw_input)
- main_window->setSendKeyboardInput(false);
+ main_window->setSendKeyboardInput(false);
}
#endif
@@ -561,10 +549,7 @@ main(int argc, char *argv[])
#ifdef Q_OS_WINDOWS
if (!raw_input) {
llhook = SetWindowsHookEx(WH_KEYBOARD_LL, emu_LowLevelKeyboardProc, NULL, 0);
- llihook = SetWindowsHookEx(WH_KEYBOARD_LL, input_LowLevelKeyboardProc, NULL, GetCurrentThreadId());
atexit([] () -> void {
- if (llihook)
- UnhookWindowsHookEx(llihook);
if (llhook)
UnhookWindowsHookEx(llhook);
});
diff --git a/src/sound/snd_sb.c b/src/sound/snd_sb.c
index df0547fdc..8ac27882b 100644
--- a/src/sound/snd_sb.c
+++ b/src/sound/snd_sb.c
@@ -1,23 +1,21 @@
/*
- * 86Box A hypervisor and IBM PC system emulator that specializes in
- * running old operating systems and software designed for IBM
- * PC systems and compatibles from 1981 through fairly recent
- * system designs based on the PCI bus.
+ * 86Box A hypervisor and IBM PC system emulator that specializes in
+ * running old operating systems and software designed for IBM
+ * PC systems and compatibles from 1981 through fairly recent
+ * system designs based on the PCI bus.
*
- * This file is part of the 86Box distribution.
+ * This file is part of the 86Box distribution.
*
- * Sound Blaster emulation.
+ * Sound Blaster emulation.
*
+ * Authors: Sarah Walker,
+ * Miran Grca,
+ * TheCollector1995,
+ * Jasmine Iwanek,
*
- *
- * Authors: Sarah Walker,
- * Miran Grca,
- * TheCollector1995,
- * Jasmine Iwanek,
- *
- * Copyright 2008-2020 Sarah Walker.
- * Copyright 2016-2020 Miran Grca.
- * Copyright 2024 Jasmine Iwanek.
+ * Copyright 2008-2020 Sarah Walker.
+ * Copyright 2016-2020 Miran Grca.
+ * Copyright 2024-2025 Jasmine Iwanek.
*/
#include
#include
@@ -64,6 +62,7 @@
#define PNP_ROM_SB_VIBRA16C "roms/sound/creative/CT4180 PnP.BIN"
#define PNP_ROM_SB_VIBRA16CL "roms/sound/creative/CT4100 PnP.BIN"
#define PNP_ROM_SB_VIBRA16XV "roms/sound/creative/CT4170 PnP.BIN"
+#define PNP_ROM_SB_GOLDFINCH "roms/sound/creative/CT1920 PnP.BIN"
#define PNP_ROM_SB_32_PNP "roms/sound/creative/CT3600 PnP.BIN"
#define PNP_ROM_SB_AWE32_PNP "roms/sound/creative/CT3980 PnP.BIN"
#define PNP_ROM_SB_AWE64_VALUE "roms/sound/creative/CT4520 PnP.BIN"
@@ -509,6 +508,28 @@ sb_get_music_buffer_sb16_awe32(int32_t *buffer, const int len, void *priv)
sb->opl.reset_buffer(sb->opl.priv);
}
+// TODO: Goldfinch
+static void
+sb_get_wavetable_buffer_goldfinch(int32_t *buffer, const int len, void *priv)
+{
+ goldfinch_t *goldfinch = (goldfinch_t *) priv;
+
+ emu8k_update(&goldfinch->emu8k);
+
+ for (int c = 0; c < len * 2; c += 2) {
+ double out_l = 0.0;
+ double out_r = 0.0;
+
+ out_l += ((double) goldfinch->emu8k.buffer[c]);
+ out_r += ((double) goldfinch->emu8k.buffer[c + 1]);
+
+ buffer[c] += (int32_t) out_l;
+ buffer[c + 1] += (int32_t) out_r;
+ }
+
+ goldfinch->emu8k.pos = 0;
+}
+
static void
sb_get_wavetable_buffer_sb16_awe32(int32_t *buffer, const int len, void *priv)
{
@@ -2217,6 +2238,21 @@ sb_vibra16_pnp_config_changed(const uint8_t ld, isapnp_device_config_t *config,
}
}
+static void
+goldfinch_pnp_config_changed(const uint8_t ld, isapnp_device_config_t *config, void *priv)
+{
+ goldfinch_t *goldfinch = (goldfinch_t *) priv;
+
+ switch (ld) {
+ default:
+ break;
+
+ case 0: /* WaveTable */
+ emu8k_change_addr(&goldfinch->emu8k, (config->activate && (config->io[0].base != ISAPNP_IO_DISABLED)) ? config->io[0].base : 0);
+ break;
+ }
+}
+
static void
sb_awe32_pnp_config_changed(const uint8_t ld, isapnp_device_config_t *config, void *priv)
{
@@ -3550,6 +3586,12 @@ sb_awe32_available(void)
return rom_present(EMU8K_ROM_PATH);
}
+static int
+sb_goldfinch_available(void)
+{
+ return sb_awe32_available() && rom_present(PNP_ROM_SB_GOLDFINCH);
+}
+
static int
sb_32_pnp_available(void)
{
@@ -3659,6 +3701,54 @@ sb_awe32_init(UNUSED(const device_t *info))
return sb;
}
+static void *
+sb_goldfinch_init(const device_t *info)
+{
+ goldfinch_t *goldfinch = malloc(sizeof(goldfinch_t));
+ int onboard_ram = device_get_config_int("onboard_ram");
+
+ memset(goldfinch, 0x00, sizeof(goldfinch_t));
+
+ wavetable_add_handler(sb_get_wavetable_buffer_goldfinch, goldfinch);
+
+ emu8k_init(&goldfinch->emu8k, 0, onboard_ram);
+
+ const char *pnp_rom_file = NULL;
+ switch (info->local) {
+ case 0:
+ pnp_rom_file = PNP_ROM_SB_GOLDFINCH;
+ break;
+
+ default:
+ break;
+ }
+
+ uint8_t *pnp_rom = NULL;
+ if (pnp_rom_file) {
+ FILE *fp = rom_fopen(pnp_rom_file, "rb");
+ uint16_t pnp_rom_len = 256;
+ if (fp) {
+ if (fread(goldfinch->pnp_rom, 1, pnp_rom_len, fp) == pnp_rom_len)
+ pnp_rom = goldfinch->pnp_rom;
+ fclose(fp);
+ }
+ }
+
+ switch (info->local) {
+ case 0:
+ isapnp_add_card(pnp_rom, sizeof(goldfinch->pnp_rom), goldfinch_pnp_config_changed,
+ NULL, NULL, NULL, goldfinch);
+ break;
+
+ default:
+ break;
+ }
+
+ emu8k_change_addr(&goldfinch->emu8k, 0);
+
+ return goldfinch;
+}
+
static void *
sb_awe32_pnp_init(const device_t *info)
{
@@ -4054,6 +4144,16 @@ sb_close(void *priv)
free(sb);
}
+static void
+sb_goldfinch_close(void *priv)
+{
+ goldfinch_t *goldfinch = (goldfinch_t *) priv;
+
+ emu8k_close(&goldfinch->emu8k);
+
+ free(goldfinch);
+}
+
static void
sb_awe32_close(void *priv)
{
@@ -4765,6 +4865,54 @@ static const device_config_t sb_16_pnp_config[] = {
{ .name = "", .description = "", .type = CONFIG_END }
};
+static const device_config_t sb_goldfinch_config[] = {
+ {
+ .name = "onboard_ram",
+ .description = "Memory size",
+ .type = CONFIG_SELECTION,
+ .default_string = "",
+ .default_int = 0,
+ .file_filter = "",
+ .spinner = { 0 },
+ .selection = {
+ {
+ .description = "None",
+ .value = 0
+ },
+ {
+ .description = "512 KB",
+ .value = 512
+ },
+ {
+ .description = "1 MB",
+ .value = 1024
+ },
+ {
+ .description = "2 MB",
+ .value = 2048
+ },
+ {
+ .description = "4 MB",
+ .value = 4096
+ },
+ {
+ .description = "8 MB",
+ .value = 8192
+ },
+ {
+ .description = "16 MB",
+ .value = 16384
+ },
+ {
+ .description = "28 MB",
+ .value = 28672
+ },
+ { .description = "" }
+ }
+ },
+ { .name = "", .description = "", .type = CONFIG_END }
+};
+
static const device_config_t sb_32_pnp_config[] = {
{
.name = "onboard_ram",
@@ -5922,6 +6070,20 @@ const device_t sb_16_compat_nompu_device = {
.config = NULL
};
+const device_t sb_goldfinch_device = {
+ .name = "Creative EMU8000 PnP (Goldfinch)",
+ .internal_name = "sb_goldfinch",
+ .flags = DEVICE_ISA | DEVICE_AT,
+ .local = 0,
+ .init = sb_goldfinch_init,
+ .close = sb_goldfinch_close,
+ .reset = NULL,
+ .available = sb_goldfinch_available,
+ .speed_changed = NULL,
+ .force_redraw = NULL,
+ .config = sb_goldfinch_config
+};
+
const device_t sb_32_pnp_device = {
.name = "Sound Blaster 32 PnP",
.internal_name = "sb32_pnp",
diff --git a/src/sound/sound.c b/src/sound/sound.c
index 06f38d125..b1762eaff 100644
--- a/src/sound/sound.c
+++ b/src/sound/sound.c
@@ -123,6 +123,7 @@ static const SOUND_CARD sound_cards[] = {
{ &sb_16_device },
{ &sb_16_pnp_device },
{ &sb_16_pnp_ide_device },
+ { &sb_goldfinch_device },
{ &sb_32_pnp_device },
{ &sb_awe32_device },
{ &sb_awe32_pnp_device },