From c98ad84171f06147318d11f45b29adb83fa5f89d Mon Sep 17 00:00:00 2001 From: OBattler Date: Wed, 25 Dec 2024 20:25:25 +0100 Subject: [PATCH] SB: Fix CT1475 even port read and return 0xFF on it and ports 227h and 22Bh which are tested for noise by OS/2 Warp 4.0, fixes the OS/2 Warp 4.0 hang on SB PNP's and AWE 32. --- src/sound/snd_sb.c | 7 +++---- src/sound/snd_sb_dsp.c | 8 ++++++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/sound/snd_sb.c b/src/sound/snd_sb.c index 0ecc39bd5..05cd16d0f 100644 --- a/src/sound/snd_sb.c +++ b/src/sound/snd_sb.c @@ -1177,12 +1177,11 @@ sb_ct1745_mixer_read(uint16_t addr, void *priv) const sb_ct1745_mixer_t *mixer = &sb->mixer_sb16; uint8_t ret = 0xff; - if (!(addr & 1)) - ret = mixer->index; - sb_log("sb_ct1745: received register READ: %02X\t%02X\n", mixer->index, mixer->regs[mixer->index]); - if ((mixer->index >= 0x30) && (mixer->index <= 0x47)) + if (!(addr & 1)) + ret = 0xff /*mixer->index*/; + else if ((mixer->index >= 0x30) && (mixer->index <= 0x47)) ret = mixer->regs[mixer->index]; else { switch (mixer->index) { diff --git a/src/sound/snd_sb_dsp.c b/src/sound/snd_sb_dsp.c index 0063f0ae7..2cabde8cc 100644 --- a/src/sound/snd_sb_dsp.c +++ b/src/sound/snd_sb_dsp.c @@ -1938,6 +1938,14 @@ sb_read(uint16_t a, void *priv) } else ret = 0xff; break; + case 0x7: + case 0xB: + /* + These two ports are tested for random noise by OS/2 Warp 4.0, so + return 0xff to get through said test. + */ + ret = 0xff; + break; case 0xA: /* Read data */ if (dsp->mpu && dsp->uart_midi) ret = MPU401_ReadData(dsp->mpu);