diff --git a/bochs/iodev/display/banshee.cc b/bochs/iodev/display/banshee.cc index 1340a16ca..de52ba534 100644 --- a/bochs/iodev/display/banshee.cc +++ b/bochs/iodev/display/banshee.cc @@ -136,9 +136,17 @@ void bx_banshee_c::init_model(void) if (theVoodooVga == NULL) { BX_PANIC(("Voodoo Banshee with VGA disabled not supported yet")); } - DEV_register_pci_handlers(this, &s.devfunc, BX_PLUGIN_VOODOO, - "Experimental 3dfx Voodoo Banshee"); - init_pci_conf(0x121a, 0x0003, 0x01, 0x030000, 0x00, BX_PCI_INTA); + if (s.model == VOODOO_BANSHEE) { + DEV_register_pci_handlers(this, &s.devfunc, BX_PLUGIN_VOODOO, + "Experimental 3dfx Voodoo Banshee"); + init_pci_conf(0x121a, 0x0003, 0x01, 0x030000, 0x00, BX_PCI_INTA); + } else if (s.model == VOODOO_3) { + DEV_register_pci_handlers(this, &s.devfunc, BX_PLUGIN_VOODOO, + "Experimental 3dfx Voodoo 3"); + init_pci_conf(0x121a, 0x0005, 0x01, 0x030000, 0x00, BX_PCI_INTA); + } else { + BX_PANIC(("Unknown Voodoo Banshee compatible model")); + } pci_conf[0x14] = 0x08; init_bar_mem(0, 0x2000000, mem_read_handler, mem_write_handler); init_bar_mem(1, 0x2000000, mem_read_handler, mem_write_handler); @@ -176,6 +184,10 @@ void bx_banshee_c::reset(unsigned type) for (i = 0; i < sizeof(reset_vals2) / sizeof(*reset_vals2); ++i) { pci_conf[reset_vals2[i].addr] = reset_vals2[i].val; } + if (s.model == VOODOO_3) { + pci_conf[0x2e] = 0x52; // FIXME: this is an AGP subsystem ID - find a + // VGABIOS ROM image with the correct value for PCI + } // TODO // Deassert IRQ @@ -781,6 +793,8 @@ void bx_banshee_c::mem_write(bx_phy_address addr, unsigned len, void *data) register_w_common((offset - 0x200000) >> 2, value); } else if (offset < 0x800000) { texture_w((offset & 0x1fffff) >> 2, value); + } else if ((offset < 0xa00000) && (s.model == VOODOO_3)) { + texture_w((1 << 19) | ((offset & 0x1fffff) >> 2), value); } else if (offset < 0xc00000) { BX_ERROR(("reserved write to offset 0x%08x", offset)); } else if (offset < 0x1000000) { @@ -1132,9 +1146,6 @@ void bx_banshee_c::blt_launch_area_setup() BLT.h2s_alt_align = 0; pxpack = (BLT.reg[blt_srcFormat] >> 22) & 3; BLT.src_wizzle = (BLT.reg[blt_srcFormat] >> 20) & 0x03; - if ((BLT.reg[blt_srcXY] & 0xffe0) != 0) { - BX_ERROR(("host to screen blt: srcXY: undocumented bit(s) set")); - } if ((BLT.reg[blt_srcXY] & 0x1f) != 0) { if (BLT.src_fmt == 0) { BLT.h2s_pxstart = BLT.reg[blt_srcXY] & 0x1f; diff --git a/bochs/iodev/display/voodoo.cc b/bochs/iodev/display/voodoo.cc index d61deae64..703bd8cd0 100644 --- a/bochs/iodev/display/voodoo.cc +++ b/bochs/iodev/display/voodoo.cc @@ -94,6 +94,7 @@ void voodoo_init_options(void) "voodoo1", "voodoo2", "banshee", + "voodoo3", NULL }; diff --git a/bochs/iodev/display/voodoo_func.h b/bochs/iodev/display/voodoo_func.h index d2c6ea39c..3d22d2c05 100644 --- a/bochs/iodev/display/voodoo_func.h +++ b/bochs/iodev/display/voodoo_func.h @@ -3476,6 +3476,14 @@ void voodoo_init(Bit8u _type) v->fbi.lfb_stride = 11; v->chipmask = 0x01 | 0x02; break; + + case VOODOO_3: + v->regaccess = banshee_register_access; + v->regnames = banshee_reg_name; + v->alt_regmap = 1; + v->fbi.lfb_stride = 11; + v->chipmask = 0x01 | 0x02 | 0x04; + break; } memset(v->dac.reg, 0, sizeof(v->dac.reg)); v->dac.read_result = 0; @@ -3483,7 +3491,7 @@ void voodoo_init(Bit8u _type) v->dac.clk0_n = 0x02; v->dac.clk0_p = 0x03; - if (v->type == VOODOO_BANSHEE) { + if (v->type >= VOODOO_BANSHEE) { /* initialize banshee registers */ memset(v->banshee.io, 0, sizeof(v->banshee.io)); v->banshee.io[io_pciInit0] = 0x01800040;