Matrox FIFO status fix.

This commit is contained in:
OBattler
2024-04-25 10:55:07 +02:00
parent d740a8c164
commit 0aa695c070

View File

@@ -1562,14 +1562,14 @@ mystique_ctrl_read_b(uint32_t addr, void *priv)
switch (addr & 0x3fff) { switch (addr & 0x3fff) {
case REG_FIFOSTATUS: case REG_FIFOSTATUS:
fifocount = FIFO_SIZE - FIFO_ENTRIES; fifocount = FIFO_SIZE - FIFO_ENTRIES;
if (fifocount > 64) if (fifocount > (mystique->type <= MGA_1064SG ? 32 : 64))
fifocount = 64; fifocount = (mystique->type <= MGA_1064SG ? 32 : 64);
ret = fifocount; ret = fifocount;
break; break;
case REG_FIFOSTATUS + 1: case REG_FIFOSTATUS + 1:
if (FIFO_EMPTY) if (FIFO_EMPTY)
ret |= 2; ret |= 2;
else if (FIFO_ENTRIES >= 64) else if (FIFO_ENTRIES >= (mystique->type <= MGA_1064SG ? 32 : 64))
ret |= 1; ret |= 1;
break; break;
case REG_FIFOSTATUS + 2: case REG_FIFOSTATUS + 2:
@@ -1583,6 +1583,10 @@ mystique_ctrl_read_b(uint32_t addr, void *priv)
ret |= REG_STATUS_VSYNCSTS; ret |= REG_STATUS_VSYNCSTS;
if (ret & 1) if (ret & 1)
mystique->softrap_status_read = 1; mystique->softrap_status_read = 1;
if (mystique->softrap_status_read == 0 && !(ret & 1)) {
mystique->softrap_status_read = 1;
ret |= 1;
}
break; break;
case REG_STATUS + 1: case REG_STATUS + 1:
ret = (mystique->status >> 8) & 0xff; ret = (mystique->status >> 8) & 0xff;