From 0aa695c070174998af70a7b20dabb494252e55d1 Mon Sep 17 00:00:00 2001 From: OBattler Date: Thu, 25 Apr 2024 10:55:07 +0200 Subject: [PATCH] Matrox FIFO status fix. --- src/video/vid_mga.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/video/vid_mga.c b/src/video/vid_mga.c index aec571356..fdbb2e411 100644 --- a/src/video/vid_mga.c +++ b/src/video/vid_mga.c @@ -1562,14 +1562,14 @@ mystique_ctrl_read_b(uint32_t addr, void *priv) switch (addr & 0x3fff) { case REG_FIFOSTATUS: fifocount = FIFO_SIZE - FIFO_ENTRIES; - if (fifocount > 64) - fifocount = 64; + if (fifocount > (mystique->type <= MGA_1064SG ? 32 : 64)) + fifocount = (mystique->type <= MGA_1064SG ? 32 : 64); ret = fifocount; break; case REG_FIFOSTATUS + 1: if (FIFO_EMPTY) ret |= 2; - else if (FIFO_ENTRIES >= 64) + else if (FIFO_ENTRIES >= (mystique->type <= MGA_1064SG ? 32 : 64)) ret |= 1; break; case REG_FIFOSTATUS + 2: @@ -1583,6 +1583,10 @@ mystique_ctrl_read_b(uint32_t addr, void *priv) ret |= REG_STATUS_VSYNCSTS; if (ret & 1) mystique->softrap_status_read = 1; + if (mystique->softrap_status_read == 0 && !(ret & 1)) { + mystique->softrap_status_read = 1; + ret |= 1; + } break; case REG_STATUS + 1: ret = (mystique->status >> 8) & 0xff;