Memory FIFO fix: 16-bit write support for the FBI video memory was missing.

This commit is contained in:
Volker Ruppert 2017-09-03 20:51:37 +00:00
parent e063d282ac
commit c1d5947a80
3 changed files with 21 additions and 7 deletions

View File

@ -178,12 +178,18 @@ BX_THREAD_FUNC(fifo_thread, indata)
BX_UNLOCK(fifo_mutex);
}
break;
case FIFO_WR_FBI:
lfb_w(offset, data, 0xffffffff);
break;
case FIFO_WR_TEX:
texture_w(offset, data);
break;
case FIFO_WR_FBI_32:
lfb_w(offset, data, 0xffffffff);
break;
case FIFO_WR_FBI_16L:
lfb_w(offset, data, 0x0000ffff);
break;
case FIFO_WR_FBI_16H:
lfb_w(offset, data, 0xffff0000);
break;
}
}
if (v->fbi.cmdfifo[0].enabled) {

View File

@ -1775,9 +1775,11 @@ bx_bool fifo_wait_for_event(fifo_event_t *fifo_ev)
/* fifo content defines */
#define FIFO_TYPES (7 << 29)
#define FIFO_WR_REG (1 << 29)
#define FIFO_WR_FBI (2 << 29)
#define FIFO_WR_TEX (4 << 29)
#define FIFO_WR_REG (1 << 29)
#define FIFO_WR_TEX (2 << 29)
#define FIFO_WR_FBI_32 (3 << 29)
#define FIFO_WR_FBI_16L (4 << 29)
#define FIFO_WR_FBI_16H (5 << 29)
BX_CPP_INLINE void fifo_reset(fifo_state *f)
{

View File

@ -3126,7 +3126,13 @@ void voodoo_w(Bit32u offset, Bit32u data, Bit32u mask)
}
} else {
if (v->fbi.fifo.enabled) {
fifo_add(&v->fbi.fifo, FIFO_WR_FBI | offset, data);
if (mask == 0xffffffff) {
fifo_add(&v->fbi.fifo, FIFO_WR_FBI_32 | offset, data);
} else if (mask & 1) {
fifo_add(&v->fbi.fifo, FIFO_WR_FBI_16L | offset, data);
} else {
fifo_add(&v->fbi.fifo, FIFO_WR_FBI_16H | offset, data);
}
} else {
lfb_w(offset, data, mask);
}