Voodoo2 CMDFIFO fix and cleanup.

- Fixed probing the CMDFIFO with Voodoo output disabled (send FIFO wakeup
  directly, otherwise driven by vertical retrace).
- Use the CMDFIFO member 'enabled' instead of reading the fbiInit7 register bit.
- TODO: The Voodoo2 freeze when testing a Voodoo1 demo is still not fixed.
This commit is contained in:
Volker Ruppert 2017-09-03 17:32:49 +00:00
parent ec6281a828
commit e063d282ac

View File

@ -2475,7 +2475,11 @@ void cmdfifo_w(Bit32u fbi_offset, Bit32u data)
BX_LOCK(cmdfifo_mutex);
}
if (v->fbi.cmdfifo[0].depth >= v->fbi.cmdfifo[0].depth_needed) {
v->fbi.cmdfifo[0].cmd_ready = 1;
if (FBIINIT0_VGA_PASSTHRU(v->reg[fbiInit0].u)) {
v->fbi.cmdfifo[0].cmd_ready = 1;
} else {
fifo_set_event(&fifo_wakeup);
}
}
BX_UNLOCK(cmdfifo_mutex);
}
@ -2682,7 +2686,7 @@ void register_w_common(Bit32u offset, Bit32u data)
Bit32u chips = (offset>>8) & 0xf;
/* Voodoo 2 CMDFIFO handling */
if (FBIINIT7_CMDFIFO_ENABLE(v->reg[fbiInit7].u)) {
if (v->fbi.cmdfifo[0].enabled) {
if ((offset & 0x80000) > 0) {
if (!FBIINIT7_CMDFIFO_MEMORY_STORE(v->reg[fbiInit7].u)) {
BX_ERROR(("CMDFIFO-to-FIFO mode not supported yet"));
@ -2910,8 +2914,7 @@ Bit32u register_r(Bit32u offset)
BX_DEBUG(("Invalid attempt to read %s", v->regnames[regnum]));
return 0;
}
if ((FBIINIT7_CMDFIFO_ENABLE(v->reg[fbiInit7].u)) &&
((offset & 0x80000) > 0)) {
if (v->fbi.cmdfifo[0].enabled && ((offset & 0x80000) > 0)) {
BX_DEBUG(("Invalid attempt to read from CMDFIFO"));
return 0;
}