bus/pci: add Vision 864 and 968 cards

This commit is contained in:
angelosa 2024-02-25 01:52:51 +01:00
parent 5899c9b0ea
commit 5c84856b50
7 changed files with 260 additions and 5 deletions

View File

@ -7092,7 +7092,7 @@ Contains software drivers for a ScanExpress 6000SP Flatbed Scanner, SCSI i/f
<publisher>S3</publisher>
<notes><![CDATA[
Provided with an OEM S3 ViRGE/DX, this CD is dated March 1998 and contains the following:
- 3D Demos (Direct3D)
- 3D Demos (and 2D)
- DirectX (versions 3.0, 3.0A, and 5)
- Galileo
- S3 86CM65 Drivers (Windows 3.1, 95, NT4, AutoCAD)

View File

@ -5518,6 +5518,8 @@ if (BUSES["PCI"]~=null) then
MAME_DIR .. "src/devices/bus/pci/sw1000xg.h",
MAME_DIR .. "src/devices/bus/pci/virge_pci.cpp",
MAME_DIR .. "src/devices/bus/pci/virge_pci.h",
MAME_DIR .. "src/devices/bus/pci/vision.cpp",
MAME_DIR .. "src/devices/bus/pci/vision.h",
MAME_DIR .. "src/devices/bus/pci/vt6306.cpp",
MAME_DIR .. "src/devices/bus/pci/vt6306.h",
MAME_DIR .. "src/devices/bus/pci/wd9710_pci.cpp",

View File

@ -22,6 +22,7 @@
#include "sonicvibes.h"
#include "sw1000xg.h"
#include "virge_pci.h"
#include "vision.h"
#include "vt6306.h"
#include "wd9710_pci.h"
#include "zr36057.h"
@ -103,6 +104,11 @@ void pci_card_device::irq_pin_w(offs_t line, int state)
void pci_cards(device_slot_interface &device)
{
// 0x00 - backward compatible pre-class code
// device.option_add("voodoo1", VOODOO_1_PCI);
device.option_add("vision864", VISION864_PCI);
device.option_add("vision968", VISION968_PCI);
// 0x01 - mass storage controllers
device.option_add("aha2940au", AHA2940AU);

View File

@ -0,0 +1,177 @@
// license:BSD-3-Clause
// copyright-holders: Angelo Salese
/**************************************************************************************************
S3 Vision 864 / 868 / 964 / 968
TODO:
- Downgrade S3_VGA (gets detected as Trio card with SDD UVCONFIG.EXE)
**************************************************************************************************/
#include "emu.h"
#include "vision.h"
#define LOG_WARN (1U << 1)
#define VERBOSE (LOG_GENERAL | LOG_WARN)
//#define LOG_OUTPUT_FUNC osd_printf_info
#include "logmacro.h"
#define LOGWARN(...) LOGMASKED(LOG_WARN, __VA_ARGS__)
DEFINE_DEVICE_TYPE(VISION864_PCI, vision864_device, "vision864", "S3 86C864 Vision864")
// Vision868
// Vision964
DEFINE_DEVICE_TYPE(VISION968_PCI, vision968_device, "vision968", "S3 86C968 Vision968")
vision864_device::vision864_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
: pci_card_device(mconfig, type, tag, owner, clock)
, m_vga(*this, "vga")
, m_bios(*this, "bios")
{
}
vision864_device::vision864_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: vision864_device(mconfig, VISION864_PCI, tag, owner, clock)
{
// device IDs:
// 88c0 = 86c864 DRAM v0
// 88c1 = 86c864 DRAM v1
// 88c2 = 86c864-P DRAM v2
// 88c3 = 86c864-P DRAM v3
// NOTE: class code = 0 (backward compatible VGA device)
set_ids(0x533388c1, 0x00, 0x000100, 0x533388c1);
}
ROM_START( vision864 )
ROM_REGION32_LE( 0x8000, "bios", ROMREGION_ERASEFF )
ROM_SYSTEM_BIOS( 0, "vision864", "Phoenix S3 Vision864 1.04-01" )
ROMX_LOAD( "bios.bin", 0x0000, 0x8000, CRC(791c9e0d) SHA1(340a64402958d2ee734d929dfce147d9afcf23f4), ROM_BIOS(0) )
ROM_IGNORE( 0x8000 )
ROM_END
const tiny_rom_entry *vision864_device::device_rom_region() const
{
return ROM_NAME(vision864);
}
void vision864_device::device_add_mconfig(machine_config &config)
{
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
screen.set_raw(XTAL(25'174'800), 900, 0, 640, 526, 0, 480);
screen.set_screen_update("vga", FUNC(s3_vga_device::screen_update));
S3_VGA(config, m_vga, 0);
m_vga->set_screen("screen");
// 1MB, option for 2MB
m_vga->set_vram_size(2*1024*1024);
// m_vga->linear_config_changed().set(FUNC(s3_vga_device::linear_config_changed_w));
}
void vision864_device::device_start()
{
pci_card_device::device_start();
// add_map(64 * 1024 * 1024, M_MEM | M_DISABLED, FUNC(vision864_device::lfb_map));
// set_map_address(0, 0x70000000);
add_rom((u8 *)m_bios->base(), 0x8000);
expansion_rom_base = 0xc0000;
// Shouldn't have an intr pin
}
void vision864_device::device_reset()
{
pci_card_device::device_reset();
command = 0x0020;
command_mask = 0x23;
// Medium DEVSEL
status = 0x0200;
remap_cb();
}
void vision864_device::legacy_io_map(address_map &map)
{
map(0, 0x02f).m(m_vga, FUNC(s3_vga_device::io_map));
}
uint8_t vision864_device::vram_r(offs_t offset)
{
return downcast<s3_vga_device *>(m_vga.target())->mem_r(offset);
}
void vision864_device::vram_w(offs_t offset, uint8_t data)
{
downcast<s3_vga_device *>(m_vga.target())->mem_w(offset, data);
}
void vision864_device::map_extra(uint64_t memory_window_start, uint64_t memory_window_end, uint64_t memory_offset, address_space *memory_space,
uint64_t io_window_start, uint64_t io_window_end, uint64_t io_offset, address_space *io_space)
{
if (BIT(command, 1))
{
memory_space->install_readwrite_handler(0xa0000, 0xbffff, read8sm_delegate(*this, FUNC(vision864_device::vram_r)), write8sm_delegate(*this, FUNC(vision864_device::vram_w)));
}
if (BIT(command, 0))
{
io_space->install_device(0x03b0, 0x03df, *this, &vision864_device::legacy_io_map);
}
}
/******************
*
* Vision968
*
*****************/
vision968_device::vision968_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: vision864_device(mconfig, VISION968_PCI, tag, owner, clock)
{
// device IDs:
// 88f0-88f3 = 86c968 RAM v0-3
// NOTE: class code = 0 (backward compatible VGA device)
set_ids(0x533388f0, 0x00, 0x000100, 0x533388f0);
}
ROM_START( vision968 )
ROM_REGION32_LE( 0x8000, "bios", ROMREGION_ERASEFF )
ROM_DEFAULT_BIOS("no9fx771")
ROM_SYSTEM_BIOS( 0, "no9fx771", "Number Nine 9FX MotionFX 771 v2.45.11" )
ROMX_LOAD( "no9motionfx771.bin", 0x0000, 0x8000, CRC(7732e382) SHA1(9ec2fe056712cef39bd8380d406be3c874ea5ec9), ROM_BIOS(0) )
ROM_IGNORE( 0x8000 )
ROM_SYSTEM_BIOS( 1, "elsaw2k", "Elsa Winner 2000Pro/X-8 v1.21.01-B" )
ROMX_LOAD( "elsaw20008m.bin", 0x0000, 0x8000, CRC(47563211) SHA1(f51a40956c3e6e7c86851d81f81ba5f77509d361), ROM_BIOS(1) )
ROM_IGNORE( 0x8000 )
ROM_SYSTEM_BIOS( 2, "speamp64", "SPEA/Videoseven V7-Mercury P-64 v1.01-08" )
ROMX_LOAD( "spea.bin", 0x0000, 0x8000, CRC(2caeadaf) SHA1(236829f1e6065a2f0ebee91f71891d8402f0ab5a), ROM_BIOS(2) )
ROM_IGNORE( 0x8000 )
ROM_END
const tiny_rom_entry *vision968_device::device_rom_region() const
{
return ROM_NAME(vision968);
}
void vision968_device::device_add_mconfig(machine_config &config)
{
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
screen.set_raw(XTAL(25'174'800), 900, 0, 640, 526, 0, 480);
screen.set_screen_update("vga", FUNC(s3_vga_device::screen_update));
S3_VGA(config, m_vga, 0);
m_vga->set_screen("screen");
// 2MB/4MB/8MB
m_vga->set_vram_size(4*1024*1024);
// m_vga->linear_config_changed().set(FUNC(s3_vga_device::linear_config_changed_w));
}

View File

@ -0,0 +1,55 @@
// license:BSD-3-Clause
// copyright-holders: Angelo Salese
#ifndef MAME_BUS_PCI_S3VISION_PCI_H
#define MAME_BUS_PCI_S3VISION_PCI_H
#pragma once
#include "pci_slot.h"
#include "video/pc_vga_s3.h"
class vision864_device : public pci_card_device
{
public:
vision864_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
static constexpr feature_type imperfect_features() { return feature::GRAPHICS; }
void legacy_io_map(address_map &map);
protected:
vision864_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
virtual void device_start() override;
virtual void device_reset() override;
virtual void device_add_mconfig(machine_config &config) override;
virtual const tiny_rom_entry *device_rom_region() const override;
virtual void map_extra(uint64_t memory_window_start, uint64_t memory_window_end, uint64_t memory_offset, address_space *memory_space,
uint64_t io_window_start, uint64_t io_window_end, uint64_t io_offset, address_space *io_space) override;
required_device<s3_vga_device> m_vga;
required_memory_region m_bios;
private:
u8 vram_r(offs_t offset);
void vram_w(offs_t offset, uint8_t data);
};
class vision968_device : public vision864_device
{
public:
vision968_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
protected:
virtual void device_add_mconfig(machine_config &config) override;
virtual const tiny_rom_entry *device_rom_region() const override;
};
DECLARE_DEVICE_TYPE(VISION864_PCI, vision864_device)
DECLARE_DEVICE_TYPE(VISION968_PCI, vision968_device)
#endif // MAME_BUS_PCI_S3VISION_PCI_H

View File

@ -70,6 +70,7 @@ void s3_vga_device::device_start()
s3.id_low = 0x11; // CR2E
s3.revision = 0x00; // CR2F
s3.id_cr30 = 0xe1; // CR30
// s3.id_cr30 = 0xc1;
}
void s3_vga_device::device_reset()
@ -115,17 +116,32 @@ void s3_vga_device::s3_define_video_mode()
svga.rgb15_en = 0;
svga.rgb16_en = 0;
svga.rgb32_en = 0;
// FIXME: vision has only first 7 modes
switch((s3.ext_misc_ctrl_2) >> 4)
{
// 0001 Mode 8: 2x 8-bit 1 VCLK/2 pixels
case 0x01: svga.rgb8_en = 1; break;
// 0010 Mode 1: 15-bit 2 VCLK/pixel
case 0x02: svga.rgb15_en = 1; break;
// 0011 Mode 9: 15-bit 1 VCLK/pixel
case 0x03: svga.rgb15_en = 1; divisor = 2; break;
// 0100 Mode 2: 24-bit 3 VCLK/pixel
case 0x04: svga.rgb24_en = 1; break;
// 0101 Mode 10: 16-bit 1 VCLK/pixel
case 0x05: svga.rgb16_en = 1; divisor = 2; break;
// 0110 Mode 3: 16-bit 2 VCLK/pixel
case 0x06: svga.rgb16_en = 1; break;
// 0111 Mode 11: 24/32-bit 2 VCLK/pixel
case 0x07: svga.rgb32_en = 1; divisor = 4; break;
case 0x0d: svga.rgb32_en = 1; divisor = 1; break;
default: fatalerror("TODO: S3 colour mode not implemented %02x\n",((s3.ext_misc_ctrl_2) >> 4));
default:
popmessage("pc_vga_s3: PA16B-COLOR-MODE %02x\n",((s3.ext_misc_ctrl_2) >> 4));
break;
}
}
else
{
// 0000: Mode 0 8-bit 1 VCLK/pixel
svga.rgb8_en = (s3.memory_config & 8) >> 3;
svga.rgb15_en = 0;
svga.rgb16_en = 0;

View File

@ -78,7 +78,7 @@
#include "machine/i82371sb.h"
#include "machine/i82439hx.h"
#include "bus/isa/isa_cards.h"
#include "bus/pci/virge_pci.h"
#include "bus/pci/vision.h"
//#include "bus/rs232/hlemouse.h"
//#include "bus/rs232/null_modem.h"
//#include "bus/rs232/rs232.h"
@ -188,8 +188,7 @@ void odyssey_state::odyssey(machine_config &config)
// TODO: 82371FB USB at 07.2
// On-board S3 Vision 968
// FIXME: replace once we have a core for it
VIRGE_PCI(config, "pci:08.0", 0);
VISION968_PCI(config, "pci:08.0", 0);
// pci:0d.0 (J4E1) PCI expansion slot 1
//PCI_SLOT(config, "pci:1", pci_cards, 13, 0, 1, 2, 3, nullptr);