Skip to content

Commit

Permalink
Added basic support for the Voodoo3 model (Banshee plus secondary TMU).
Browse files Browse the repository at this point in the history
Using a temporary subsystem ID, since I haven't found a VGABIOS ROM image for
the PCI version and Bochs doesn't support AGP yet. After modifying Voodoo3.inf
the driver could be installed successfully in Win95/98 and the Voodoo3 works as
expected (same issues as the Banshee model).
Removed BX_ERROR message about setting undocumented srcXY register bits. They
seem to have no effect on the emulation and could be ignored.


git-svn-id: https://svn.code.sf.net/p/bochs/code/trunk/bochs@13465 6c8e4198-a580-4521-a02f-c9ae86df1db9
  • Loading branch information
vruppert committed Feb 13, 2018
1 parent 3c3061c commit 84c3c82
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 7 deletions.
23 changes: 17 additions & 6 deletions iodev/display/banshee.cc
Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions iodev/display/voodoo.cc
Expand Up @@ -94,6 +94,7 @@ void voodoo_init_options(void)
"voodoo1",
"voodoo2",
"banshee",
"voodoo3",
NULL
};

Expand Down
10 changes: 9 additions & 1 deletion iodev/display/voodoo_func.h
Expand Up @@ -3476,14 +3476,22 @@ 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;
v->dac.clk0_m = 0x37;
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;
Expand Down

0 comments on commit 84c3c82

Please sign in to comment.