Some small changes for Banshee/Voodoo3.
- Fixed start address for the gui screen update in 3D overlay mode. - Small optimization for drawing transparent monochrome bitmaps. - In the restore case start the fifo thread in after_restore_state(). - Report unimplemented colorkey feature (test case missing). - TODO: issues in some Windows guests still not fixed.
This commit is contained in:
parent
843e7ea557
commit
8d607c4886
@ -317,6 +317,7 @@ void bx_banshee_c::after_restore_state(void)
|
||||
update_timing();
|
||||
theVoodooVga->banshee_update_mode();
|
||||
}
|
||||
start_fifo_thread();
|
||||
// TODO
|
||||
}
|
||||
|
||||
@ -1208,6 +1209,11 @@ void bx_banshee_c::blt_reg_write(Bit8u reg, Bit32u value)
|
||||
blt_launch_area_setup();
|
||||
}
|
||||
break;
|
||||
case blt_commandExtra:
|
||||
if ((value & 0x03) > 0) {
|
||||
BX_ERROR(("colorkey feature not supported yet"));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if ((reg >= 0x20) && (reg < 0x40)) {
|
||||
blt_launch_area_write(value);
|
||||
@ -1678,8 +1684,7 @@ void bx_banshee_c::blt_screen_to_screen()
|
||||
Bit8u *src_ptr1, *dst_ptr1;
|
||||
Bit8u pxpack = (BLT.reg[blt_srcFormat] >> 22) & 3;
|
||||
Bit8u dpxsize = (BLT.dst_fmt > 1) ? (BLT.dst_fmt - 1) : 1;
|
||||
Bit8u dstcolor[4];
|
||||
Bit8u *srccolor;
|
||||
Bit8u *color;
|
||||
int spitch;
|
||||
int dpitch = BLT.dst_pitch;
|
||||
int ncols, nrows, x0, x1, y0, y1, w, h;
|
||||
@ -1723,16 +1728,15 @@ void bx_banshee_c::blt_screen_to_screen()
|
||||
smask = 0x80 >> (x0 & 7);
|
||||
ncols = w;
|
||||
do {
|
||||
memcpy(dstcolor, dst_ptr1, dpxsize);
|
||||
set = (*src_ptr1 & smask) > 0;
|
||||
if (set) {
|
||||
srccolor = &BLT.fgcolor[0];
|
||||
} else if (BLT.transp) {
|
||||
srccolor = dstcolor;
|
||||
color = &BLT.fgcolor[0];
|
||||
} else {
|
||||
srccolor = &BLT.bgcolor[0];
|
||||
color = &BLT.bgcolor[0];
|
||||
}
|
||||
if (set || !BLT.transp) {
|
||||
BLT.rop_fn(dst_ptr1, color, dpitch, dpxsize, dpxsize, 1);
|
||||
}
|
||||
BLT.rop_fn(dst_ptr1, srccolor, dpitch, dpxsize, dpxsize, 1);
|
||||
smask >>= 1;
|
||||
if (smask == 0) {
|
||||
src_ptr1++;
|
||||
@ -1961,8 +1965,8 @@ void bx_banshee_c::blt_host_to_screen()
|
||||
Bit16u spitch = BLT.h2s_pitch;
|
||||
Bit8u srcfmt = BLT.src_fmt;
|
||||
Bit8u spxsize = 0, r = 0, g = 0, b = 0;
|
||||
Bit8u dstcolor[4], scolor[4];
|
||||
Bit8u *srccolor;
|
||||
Bit8u scolor[4];
|
||||
Bit8u *color;
|
||||
int ncols, nrows, x0, y0, x1, y1, w, h;
|
||||
Bit8u smask;
|
||||
bx_bool set;
|
||||
@ -2005,16 +2009,15 @@ void bx_banshee_c::blt_host_to_screen()
|
||||
ncols = w;
|
||||
do {
|
||||
if (srcfmt == 0) {
|
||||
memcpy(dstcolor, dst_ptr1, dpxsize);
|
||||
set = (*src_ptr1 & smask) > 0;
|
||||
if (set) {
|
||||
srccolor = &BLT.fgcolor[0];
|
||||
} else if (BLT.transp) {
|
||||
srccolor = dstcolor;
|
||||
color = &BLT.fgcolor[0];
|
||||
} else {
|
||||
srccolor = &BLT.bgcolor[0];
|
||||
color = &BLT.bgcolor[0];
|
||||
}
|
||||
if (set || !BLT.transp) {
|
||||
BLT.rop_fn(dst_ptr1, color, dpitch, dpxsize, dpxsize, 1);
|
||||
}
|
||||
BLT.rop_fn(dst_ptr1, srccolor, dpitch, dpxsize, dpxsize, 1);
|
||||
} else {
|
||||
if (BLT.dst_fmt != srcfmt) {
|
||||
if ((srcfmt == 4) || (srcfmt == 5)) {
|
||||
|
@ -317,10 +317,9 @@ void bx_voodoo_base_c::init(void)
|
||||
for (unsigned x = 0; x < s.num_x_tiles; x++)
|
||||
SET_TILE_UPDATED(BX_VOODOO_THIS, x, y, 0);
|
||||
|
||||
bx_create_event(&fifo_wakeup);
|
||||
bx_create_event(&fifo_not_full);
|
||||
bx_set_event(&fifo_not_full);
|
||||
BX_THREAD_CREATE(fifo_thread, this, fifo_thread_var);
|
||||
if (!SIM->get_param_bool(BXPN_RESTORE_FLAG)->get()) {
|
||||
start_fifo_thread();
|
||||
}
|
||||
|
||||
BX_INFO(("3dfx Voodoo Graphics adapter (model=%s) initialized",
|
||||
SIM->get_param_enum("model", base)->get_selected()));
|
||||
@ -503,6 +502,14 @@ void bx_voodoo_base_c::register_state(bx_list_c *parent)
|
||||
register_pci_state(parent);
|
||||
}
|
||||
|
||||
void bx_voodoo_base_c::start_fifo_thread(void)
|
||||
{
|
||||
bx_create_event(&fifo_wakeup);
|
||||
bx_create_event(&fifo_not_full);
|
||||
bx_set_event(&fifo_not_full);
|
||||
BX_THREAD_CREATE(fifo_thread, this, fifo_thread_var);
|
||||
}
|
||||
|
||||
void bx_voodoo_base_c::refresh_display(void *this_ptr, bx_bool redraw)
|
||||
{
|
||||
if (redraw) {
|
||||
@ -556,7 +563,11 @@ void bx_voodoo_base_c::update(void)
|
||||
return;
|
||||
}
|
||||
bpp = 16;
|
||||
start = v->fbi.rgboffs[v->fbi.frontbuf];
|
||||
if (s.model >= VOODOO_BANSHEE) {
|
||||
start = v->fbi.rgboffs[0];
|
||||
} else {
|
||||
start = v->fbi.rgboffs[v->fbi.frontbuf];
|
||||
}
|
||||
pitch = v->fbi.rowpixels * 2;
|
||||
}
|
||||
iWidth = s.vdraw.width;
|
||||
@ -932,6 +943,7 @@ void bx_voodoo_1_2_c::after_restore_state(void)
|
||||
update_timing();
|
||||
DEV_vga_set_override(1, BX_VOODOO_THIS_PTR);
|
||||
}
|
||||
start_fifo_thread();
|
||||
}
|
||||
|
||||
bx_bool bx_voodoo_1_2_c::mem_read_handler(bx_phy_address addr, unsigned len,
|
||||
|
@ -62,6 +62,7 @@ public:
|
||||
virtual void init_model(void) {}
|
||||
virtual void register_state(void) {}
|
||||
|
||||
virtual void start_fifo_thread(void);
|
||||
virtual void refresh_display(void *this_ptr, bx_bool redraw);
|
||||
virtual void redraw_area(unsigned x0, unsigned y0,
|
||||
unsigned width, unsigned height);
|
||||
|
Loading…
x
Reference in New Issue
Block a user