From b449f6f31038d26c4f5b6bff618fd7cb9d0b7856 Mon Sep 17 00:00:00 2001 From: OBattler Date: Mon, 30 Dec 2024 18:55:10 +0100 Subject: [PATCH] Sound Blaster PnP: Ignore IDE PnP changes if IDE is not present, fixes #5077. --- src/include/86box/snd_sb.h | 1 + src/sound/snd_sb.c | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/include/86box/snd_sb.h b/src/include/86box/snd_sb.h index 70fcff387..33467cf25 100644 --- a/src/include/86box/snd_sb.h +++ b/src/include/86box/snd_sb.h @@ -182,6 +182,7 @@ typedef struct sb_t { void *gameport; int pnp; + int has_ide; uint8_t pos_regs[8]; uint8_t pnp_rom[512]; diff --git a/src/sound/snd_sb.c b/src/sound/snd_sb.c index 5919418d7..8db328fa9 100644 --- a/src/sound/snd_sb.c +++ b/src/sound/snd_sb.c @@ -2181,7 +2181,8 @@ sb_16_pnp_config_changed(const uint8_t ld, isapnp_device_config_t *config, void break; case 1: /* IDE */ - ide_pnp_config_changed(0, config, (void *) 3); + if (sb->has_ide) + ide_pnp_config_changed(0, config, (void *) 3); break; case 2: /* Reserved (16) / WaveTable (32+) */ @@ -3338,6 +3339,8 @@ sb_16_pnp_init(UNUSED(const device_t *info)) if (info->local != SB_16_PNP_NOIDE) { device_add(&ide_qua_pnp_device); other_ide_present++; + + sb->has_ide = 1; } const char *pnp_rom_file = NULL; @@ -3671,6 +3674,8 @@ sb_awe32_pnp_init(const device_t *info) if ((info->local != SB_AWE64_VALUE) && (info->local != SB_AWE64_NOIDE) && (info->local != SB_AWE64_GOLD)) { device_add(&ide_qua_pnp_device); other_ide_present++; + + sb->has_ide = 1; } const char *pnp_rom_file = NULL; @@ -3849,6 +3854,8 @@ ess_x688_init(UNUSED(const device_t *info)) ide_set_side(4, ide_side); ide_set_irq(4, ide_irq); other_ide_present++; + + ess->has_ide = 1; } return ess; @@ -3907,6 +3914,8 @@ ess_x688_pnp_init(UNUSED(const device_t *info)) device_add(&ide_qua_pnp_device); other_ide_present++; + ess->has_ide = 1; + const char *pnp_rom_file = NULL; uint16_t pnp_rom_len = 512; switch (info->local) {