From 500eeb169519929acf3e21dca1d815095573ab3c Mon Sep 17 00:00:00 2001 From: angelosa Date: Sun, 14 Jan 2024 03:42:06 +0100 Subject: bus/pci: add ProMotion 3210 PCI card stub [VGA Legacy MKIII] --- scripts/src/bus.lua | 2 + src/devices/bus/pci/pci_slot.cpp | 21 ++++++ src/devices/bus/pci/promotion.cpp | 145 ++++++++++++++++++++++++++++++++++++++ src/devices/bus/pci/promotion.h | 47 ++++++++++++ 4 files changed, 215 insertions(+) create mode 100644 src/devices/bus/pci/promotion.cpp create mode 100644 src/devices/bus/pci/promotion.h diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua index 94a23b3e2f2..8b2be21d695 100644 --- a/scripts/src/bus.lua +++ b/scripts/src/bus.lua @@ -5430,6 +5430,8 @@ if (BUSES["PCI"]~=null) then MAME_DIR .. "src/devices/bus/pci/geforce.h", MAME_DIR .. "src/devices/bus/pci/mga2064w.cpp", MAME_DIR .. "src/devices/bus/pci/mga2064w.h", + MAME_DIR .. "src/devices/bus/pci/promotion.cpp", + MAME_DIR .. "src/devices/bus/pci/promotion.h", MAME_DIR .. "src/devices/bus/pci/sw1000xg.cpp", MAME_DIR .. "src/devices/bus/pci/sw1000xg.h", } diff --git a/src/devices/bus/pci/pci_slot.cpp b/src/devices/bus/pci/pci_slot.cpp index 5496ee35b2e..78251aa6213 100644 --- a/src/devices/bus/pci/pci_slot.cpp +++ b/src/devices/bus/pci/pci_slot.cpp @@ -10,6 +10,7 @@ #include "rivatnt.h" #include "geforce.h" #include "mga2064w.h" +#include "promotion.h" #include "sw1000xg.h" DEFINE_DEVICE_TYPE(PCI_SLOT, pci_slot_device, "pci_slot", "PCI extension motherboard port") @@ -66,6 +67,9 @@ pci_card_device::~pci_card_device() void pci_cards(device_slot_interface &device) { + // 0x01 - mass storage controllers + // 0x02 - network controllers + // 0x03 - display controllers device.option_add("virge", VIRGE_PCI); device.option_add("virgedx", VIRGEDX_PCI); device.option_add("riva128", RIVA128); @@ -79,5 +83,22 @@ void pci_cards(device_slot_interface &device) device.option_add("geforce256_ddr", GEFORCE256_DDR); device.option_add("quadro", QUADRO); device.option_add("mga2064w", MGA2064W); + device.option_add("promotion3210", PROMOTION3210); + // 0x04 - multimedia controllers device.option_add("sw1000xg", SW1000XG); + // 0x05 - memory controllers + // 0x06 - bridge devices + // 0x07 - simple communication controllers + // 0x08 - generic system peripherals + // 0x09 - input devices + // 0x0a - docking stations + // 0x0b - processors + // 0x0c - Serial Bus controllers + // 0x0d - wireless controllers + // 0x0e - Intelligent I/O controllers + // 0x0f - Satellite Communication controllers + // 0x10 - Encryption/Decryption controllers + // 0x11 - Data acquisition and signal processing controllers + // 0x12 - Processing accelerators + // 0x13 - Debug } diff --git a/src/devices/bus/pci/promotion.cpp b/src/devices/bus/pci/promotion.cpp new file mode 100644 index 00000000000..82c31ecfd7a --- /dev/null +++ b/src/devices/bus/pci/promotion.cpp @@ -0,0 +1,145 @@ +// license:BSD-3-Clause +// copyright-holders: +/************************************************************************************************** + +Alliance Semiconductor ProMotion family + +TODO: +- Requires own family of VGA based devices; +- Catch is that said device mirrors the PCI space in memory mapped regs, along with the + (more or less) typical SVGA regs of the mid-90s; +- Black screens when mounted; +- Bare documentation, covering pinout and register names only; + +**************************************************************************************************/ + +#include "emu.h" +#include "promotion.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(PROMOTION3210, promotion3210_device, "promotion3210", "Alliance Semiconductor ProMotion 3210") +//DEFINE_DEVICE_TYPE(PROMOTION6410, promotion6410_device, "promotion6410", "Alliance Semiconductor ProMotion 6410") +//DEFINE_DEVICE_TYPE(PROMOTION6422, promotion6422_device, "promotion6422", "Alliance Semiconductor ProMotion 6422") +//DEFINE_DEVICE_TYPE(PROMOTION6424, promotion6424_device, "promotion6424", "Alliance Semiconductor ProMotion 6424") +// Alias of above? +//DEFINE_DEVICE_TYPE(PROMOTIONAT24, promotionat24_device, "promotionat24", "Alliance Semiconductor ProMotion aT24") +//DEFINE_DEVICE_TYPE(PROMOTIONAT3D, promotionat3d_device, "promotionat3d", "Alliance Semiconductor ProMotion aT3d") +//DEFINE_DEVICE_TYPE(PROMOTIONAT25, promotionat25_device, "promotionat25", "Alliance Semiconductor ProMotion aT25") + + +promotion3210_device::promotion3210_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_vga_rom(*this, "vga_rom") +{ + // vendor ID 0x1142 Alliance Semiconductor Corporation + // subvendor unknown + set_ids(0x11423210, 0x00, 0x030000, 0x11423210); +} + +promotion3210_device::promotion3210_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : promotion3210_device(mconfig, PROMOTION3210, tag, owner, clock) +{ +} + +ROM_START( promotion3210 ) + ROM_REGION32_LE( 0x8000, "vga_rom", ROMREGION_ERASEFF ) + ROM_SYSTEM_BIOS( 0, "miro", "miro Video 12PD" ) + ROMX_LOAD( "mirovideo12pd.vbi", 0x0000, 0x8000, CRC(46041709) SHA1(bd43f05ae7ddb4bbf515132b72b32719b60e6950), ROM_BIOS(0) ) +ROM_END + +const tiny_rom_entry *promotion3210_device::device_rom_region() const +{ + return ROM_NAME(promotion3210); +} + +void promotion3210_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(m_vga, FUNC(vga_device::screen_update)); + + VGA(config, m_vga, 0); + m_vga->set_screen("screen"); + // TODO: configurable between 1 and 4 MB (2x EDO slots on board) + m_vga->set_vram_size(4*1024*1024); + + // AT&T ATT20C408-13 PrecisionDAC + // Reused by ATI Mach64? +} + +void promotion3210_device::device_start() +{ + pci_device::device_start(); + + add_map( 4*1024*1024, M_MEM, FUNC(promotion3210_device::vram_aperture_map)); + + add_rom((u8 *)m_vga_rom->base(), 0x8000); + expansion_rom_base = 0xc0000; + + // INTA# + intr_pin = 1; +} + +void promotion3210_device::device_reset() +{ + pci_device::device_reset(); + + // TODO: to be checked + command = 0x0000; + status = 0x0000; + + remap_cb(); +} + +// bare mapping, except for stuff being mirrored at memory-mapped offsets +void promotion3210_device::config_map(address_map &map) +{ + pci_device::config_map(map); +} + +void promotion3210_device::vram_aperture_map(address_map &map) +{ + +} + +// TODO: this should really be a subclass of VGA +void promotion3210_device::legacy_memory_map(address_map &map) +{ + map(0xa0000, 0xbffff).rw(FUNC(promotion3210_device::vram_r), FUNC(promotion3210_device::vram_w)); +} + +void promotion3210_device::legacy_io_map(address_map &map) +{ + map(0, 0x02f).m(m_vga, FUNC(vga_device::io_map)); +} + +uint8_t promotion3210_device::vram_r(offs_t offset) +{ + return downcast(m_vga.target())->mem_r(offset); +} + +void promotion3210_device::vram_w(offs_t offset, uint8_t data) +{ + downcast(m_vga.target())->mem_w(offset, data); +} + +void promotion3210_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 (1) + { + memory_space->install_readwrite_handler(0xa0000, 0xbffff, read8sm_delegate(*this, FUNC(promotion3210_device::vram_r)), write8sm_delegate(*this, FUNC(promotion3210_device::vram_w))); + + io_space->install_device(0x03b0, 0x03df, *this, &promotion3210_device::legacy_io_map); + //memory_space->install_rom(0xc0000, 0xcffff, (void *)expansion_rom); + } +} diff --git a/src/devices/bus/pci/promotion.h b/src/devices/bus/pci/promotion.h new file mode 100644 index 00000000000..5e66048a557 --- /dev/null +++ b/src/devices/bus/pci/promotion.h @@ -0,0 +1,47 @@ +// license:BSD-3-Clause +// copyright-holders: + +#ifndef MAME_VIDEO_PROMOTION_H +#define MAME_VIDEO_PROMOTION_H + +#pragma once + +#include "pci_slot.h" +#include "video/pc_vga.h" + +class promotion3210_device : public pci_card_device +{ +public: + promotion3210_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + + void legacy_memory_map(address_map &map); + void legacy_io_map(address_map &map); + + static constexpr feature_type unemulated_features() { return feature::GRAPHICS; } + +protected: + promotion3210_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; + + virtual void config_map(address_map &map) override; + + required_device m_vga; + required_memory_region m_vga_rom; +private: + u8 vram_r(offs_t offset); + void vram_w(offs_t offset, uint8_t data); + + void vram_aperture_map(address_map &map); +}; + +DECLARE_DEVICE_TYPE(PROMOTION3210, promotion3210_device) + +#endif // MAME_VIDEO_PROMOTION_H -- cgit v1.2.3