From 2390d2d2aed44378db78d4334028d29caee0b4ff Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Sat, 13 Jan 2024 13:38:19 +0600 Subject: [PATCH] MGA: Do not reset DWORD expected counter while SOFTRAP read is still pending Fixes Matrox Simple Interface games without breaking Windows 2000 drivers --- src/video/vid_mga.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/video/vid_mga.c b/src/video/vid_mga.c index f84464bc1..44a33db2e 100644 --- a/src/video/vid_mga.c +++ b/src/video/vid_mga.c @@ -2186,7 +2186,10 @@ mystique_ctrl_write_b(uint32_t addr, uint8_t val, void *priv) thread_wait_mutex(mystique->dma.lock); WRITE8(addr, mystique->dma.primaddress, val); mystique->dma.pri_state = 0; - mystique->dma.words_expected = 0; + if (mystique->dma.state == DMA_STATE_IDLE && !(mystique->softrap_pending || mystique->endprdmasts_pending || !mystique->softrap_status_read)) { + mystique->dma.words_expected = 0; + } + mystique->dma.state = DMA_STATE_IDLE; thread_release_mutex(mystique->dma.lock); break;