Some small changes for the Voodoo Banshee emulation.

- Also set the "Banshee busy" flag if one of the CMDFIFOs is busy.
- Fixed CMDFIFO error message condition.
- Tiled source pitch is only used for screen-to-screen operations.
This commit is contained in:
Volker Ruppert 2017-12-24 10:15:34 +00:00
parent 2cbe839deb
commit 625f3cf6f5
2 changed files with 17 additions and 14 deletions

View File

@ -1986,17 +1986,10 @@ void bx_voodoo_c::banshee_blt_reg_write(Bit8u reg, Bit32u value)
case blt_srcBaseAddr:
BLT.src_base = BLT.reg[reg] & v->fbi.mask;
BLT.src_tiled = BLT.reg[reg] >> 31;
BLT.src_pitch = BLT.reg[blt_srcFormat] & 0x3fff;
if (BLT.src_tiled) {
BLT.src_pitch *= 128;
}
break;
case blt_srcFormat:
BLT.src_fmt = (BLT.reg[reg] >> 16) & 0x0f;
BLT.src_pitch = BLT.reg[reg] & 0x3fff;
if (BLT.src_tiled) {
BLT.src_pitch *= 128;
}
break;
case blt_pattern0Alias:
BLT.cpat[0][0] = value & 0xff;
@ -2522,7 +2515,7 @@ void bx_voodoo_c::banshee_blt_screen_to_screen()
Bit8u *src_ptr = &v->fbi.ram[BLT.src_base];
Bit8u *dst_ptr = &v->fbi.ram[BLT.dst_base];
Bit8u dpxsize = (BLT.dst_fmt > 1) ? (BLT.dst_fmt - 1) : 1;
int spitch = BLT.src_pitch;
int spitch;
int dpitch = BLT.dst_pitch;
int x0, x1, y0, y1, w, h;
@ -2542,6 +2535,11 @@ void bx_voodoo_c::banshee_blt_screen_to_screen()
BX_UNLOCK(render_mutex);
return;
}
if (BLT.src_tiled) {
spitch = BLT.src_pitch * 128;
} else {
spitch = BLT.src_pitch;
}
if (BLT.y_dir) {
spitch *= -1;
dpitch *= -1;
@ -2560,7 +2558,7 @@ void bx_voodoo_c::banshee_blt_screen_to_screen_pattern()
Bit8u *pat_ptr = &BLT.cpat[0][0];
Bit8u *src_ptr1, *dst_ptr1, *pat_ptr1, *pat_ptr2 = NULL;
int dpxsize = (BLT.dst_fmt > 1) ? (BLT.dst_fmt - 1) : 1;
int spitch = BLT.src_pitch;
int spitch;
int dpitch = BLT.dst_pitch;
bx_bool patmono = (BLT.reg[blt_command] >> 13) & 1;
bx_bool patrow0 = (BLT.reg[blt_commandExtra] & 0x08) > 0;
@ -2587,6 +2585,11 @@ void bx_voodoo_c::banshee_blt_screen_to_screen_pattern()
BX_UNLOCK(render_mutex);
return;
}
if (BLT.src_tiled) {
spitch = BLT.src_pitch * 128;
} else {
spitch = BLT.src_pitch;
}
if (BLT.x_dir) {
dpxsize *= -1;
}

View File

@ -2724,7 +2724,7 @@ void cmdfifo_process(cmdfifo_info *f)
regaddr <<= 2;
w0 = 0;
wn = nwords;
if ((disbytes > 0) && (disbytes != 0x0c) && (disbytes != 0xc0)) {
if ((disbytes > 0) && (disbytes != 0x30) && (disbytes != 0xc0)) {
BX_ERROR(("CMDFIFO packet type 5: byte disable not complete yet (dest code = 0)"));
}
if ((disbytes & 0xf0) > 0) {
@ -3121,7 +3121,7 @@ Bit32u register_r(Bit32u offset)
result |= 1 << 8;
/* bit 9 is overall busy */
if (v->pci.op_pending || v->banshee.blt.busy)
if (v->pci.op_pending)
result |= 1 << 9;
if (v->type == VOODOO_2) {
@ -3151,15 +3151,15 @@ Bit32u register_r(Bit32u offset)
{
/* bit 10 is 2D busy */
if (v->banshee.blt.busy)
result |= 1 << 10;
result |= 3 << 9;
/* bit 11 is cmd FIFO 0 busy */
if (v->fbi.cmdfifo[0].enabled && v->fbi.cmdfifo[0].depth > 0)
result |= 1 << 11;
result |= 5 << 9;
/* bit 12 is cmd FIFO 1 busy */
if (v->fbi.cmdfifo[1].enabled && v->fbi.cmdfifo[1].depth > 0)
result |= 1 << 12;
result |= 9 << 9;
}
/* bits 30:28 are the number of pending swaps */