From 84a9012313cd77c2863675255c8db55065f20e9e Mon Sep 17 00:00:00 2001 From: angelosa Date: Sat, 27 Jul 2024 14:32:40 +0200 Subject: bus/pci: ncr53c825 stub [Roberto Fresca, Gaby, recreativas.org] --- scripts/src/bus.lua | 6 ++- src/devices/bus/pci/ncr53c825.cpp | 95 +++++++++++++++++++++++++++++++++++++++ src/devices/bus/pci/ncr53c825.h | 39 ++++++++++++++++ src/devices/bus/pci/pci_slot.cpp | 2 + src/mame/misc/odyssey.cpp | 6 +-- 5 files changed, 142 insertions(+), 6 deletions(-) create mode 100644 src/devices/bus/pci/ncr53c825.cpp create mode 100644 src/devices/bus/pci/ncr53c825.h diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua index c8fb32906f5..37db2a904a8 100644 --- a/scripts/src/bus.lua +++ b/scripts/src/bus.lua @@ -5504,8 +5504,8 @@ end if (BUSES["PC8801"]~=null) then files { - MAME_DIR .. "src/devices/bus/pc8801/gsx8800.cpp", - MAME_DIR .. "src/devices/bus/pc8801/gsx8800.h", + MAME_DIR .. "src/devices/bus/pc8801/gsx8800.cpp", + MAME_DIR .. "src/devices/bus/pc8801/gsx8800.h", MAME_DIR .. "src/devices/bus/pc8801/pc8801_23.cpp", MAME_DIR .. "src/devices/bus/pc8801/pc8801_23.h", MAME_DIR .. "src/devices/bus/pc8801/pc8801_31.cpp", @@ -5617,6 +5617,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/ncr53c825.cpp", + MAME_DIR .. "src/devices/bus/pci/ncr53c825.h", MAME_DIR .. "src/devices/bus/pci/oti_spitfire.cpp", MAME_DIR .. "src/devices/bus/pci/oti_spitfire.h", MAME_DIR .. "src/devices/bus/pci/opti82c861.cpp", diff --git a/src/devices/bus/pci/ncr53c825.cpp b/src/devices/bus/pci/ncr53c825.cpp new file mode 100644 index 00000000000..b30263cd604 --- /dev/null +++ b/src/devices/bus/pci/ncr53c825.cpp @@ -0,0 +1,95 @@ +// license:BSD-3-Clause +// copyright-holders: +/************************************************************************************************** + +NCR / Symbios Logic / LSI Logic 53C825A + +**************************************************************************************************/ + +#include "emu.h" +#include "ncr53c825.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(NCR53C825_PCI, ncr53c825_pci_device, "ncr53c825_pci", "NCR/Symbios Logic/LSI Logic 53C825A PCI") + +ncr53c825_pci_device::ncr53c825_pci_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_scsi_rom(*this, "scsi_rom") +{ + // '825AE straps subvendor with 0x1000'1000, revision 0x26 + set_ids(0x10000003, 0x14, 0x010000, 0x00000000); +} + +ncr53c825_pci_device::ncr53c825_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : ncr53c825_pci_device(mconfig, NCR53C825_PCI, tag, owner, clock) +{ +} + +void ncr53c825_pci_device::device_add_mconfig(machine_config &config) +{ + // TODO: SCSI controller, derives from 53C710 according to ROM +} + +ROM_START( ncr53c825 ) + ROM_REGION32_LE( 0x10000, "scsi_rom", ROMREGION_ERASEFF ) + // misc/odyssey.cpp SCSI board + ROM_SYSTEM_BIOS( 0, "odyssey", "NCR SDMS PCI-3.07.00 Lomas Optimum III" ) + ROMX_LOAD( "tms28f512a.u4", 0x0000, 0x10000, CRC(0d5a8054) SHA1(ed22a726976fdc34db6176a1384609f93d50f27a), ROM_BIOS(0) ) +ROM_END + +const tiny_rom_entry *ncr53c825_pci_device::device_rom_region() const +{ + return ROM_NAME(ncr53c825); +} + + +void ncr53c825_pci_device::device_start() +{ + pci_card_device::device_start(); + + add_map( 128, M_IO, FUNC(ncr53c825_pci_device::io_map)); + add_map( 128, M_MEM, FUNC(ncr53c825_pci_device::io_map)); + add_map( 4*1024, M_MEM, FUNC(ncr53c825_pci_device::scripts_map)); + add_rom((u8 *)m_scsi_rom->base(), 0x8000); + expansion_rom_base = 0xc8000; + + // INTA# + intr_pin = 1; + + // TODO: min_gnt = 0x11, max_lat = 0x40 +} + +void ncr53c825_pci_device::device_reset() +{ + pci_card_device::device_reset(); + + command = 0x0000; + command_mask = 0x157; + // status = 0x0010; for 'AE only + status = 0x0000; + + remap_cb(); +} + +void ncr53c825_pci_device::config_map(address_map &map) +{ + pci_card_device::config_map(map); +// map(0x40, 0x40) power management capability for 'AE +// map(0x46, 0x46) bridge support extension for 'A +} + +void ncr53c825_pci_device::io_map(address_map &map) +{ +} + +void ncr53c825_pci_device::scripts_map(address_map &map) +{ +} diff --git a/src/devices/bus/pci/ncr53c825.h b/src/devices/bus/pci/ncr53c825.h new file mode 100644 index 00000000000..1297f340dbc --- /dev/null +++ b/src/devices/bus/pci/ncr53c825.h @@ -0,0 +1,39 @@ +// license:BSD-3-Clause +// copyright-holders: + +#ifndef MAME_BUS_PCI_NCR53C825_PCI_H +#define MAME_BUS_PCI_NCR53C825_PCI_H + +#pragma once + +#include "pci_slot.h" + +class ncr53c825_pci_device : public pci_card_device +{ +public: + ncr53c825_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + + static constexpr feature_type unemulated_features() { return feature::MEDIA; } + +protected: + ncr53c825_pci_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 config_map(address_map &map) override; + + void io_map(address_map &map); + void scripts_map(address_map &map); + + required_memory_region m_scsi_rom; +private: + // ... +}; + +DECLARE_DEVICE_TYPE(NCR53C825_PCI, ncr53c825_pci_device) + +#endif // MAME_BUS_PCI_NCR53C825_PCI_H diff --git a/src/devices/bus/pci/pci_slot.cpp b/src/devices/bus/pci/pci_slot.cpp index 1a7ef5b760f..ed297fbda38 100644 --- a/src/devices/bus/pci/pci_slot.cpp +++ b/src/devices/bus/pci/pci_slot.cpp @@ -14,6 +14,7 @@ #include "ess_maestro.h" #include "geforce.h" #include "mga2064w.h" +#include "ncr53c825.h" #include "opti82c861.h" #include "oti_spitfire.h" #include "pdc20262.h" @@ -115,6 +116,7 @@ void pci_cards(device_slot_interface &device) // 0x01 - mass storage controllers device.option_add("aha2940au", AHA2940AU); + device.option_add("ncr53c825", NCR53C825_PCI); device.option_add("pdc20262", PDC20262); // 0x02 - network controllers diff --git a/src/mame/misc/odyssey.cpp b/src/mame/misc/odyssey.cpp index 9a924c2d70f..ceef1467c5e 100644 --- a/src/mame/misc/odyssey.cpp +++ b/src/mame/misc/odyssey.cpp @@ -10,6 +10,7 @@ TODO: - bp f7ae6,1,{eip+=0xf;g} fails ISA state $0f; + - Hangs after playing with SCSI regs, needs dump to proceed; - Accesses S3 video in New MMIO mode, core fumbles on video mode setup (prepares linear for 32bpp, core sets SVGA 8bpp instead) - Hangs after playing with LPT1 & IDE checks; @@ -197,7 +198,7 @@ void odyssey_state::odyssey(machine_config &config) //PCI_SLOT(config, "pci:3", pci_cards, 15, 0, 1, 2, 3, nullptr); // pci:10.0 (J4C1) PCI expansion slot 4 - PCI_SLOT(config, "pci:4", pci_cards, 16, 0, 1, 2, 3, nullptr); + PCI_SLOT(config, "pci:4", pci_cards, 16, 0, 1, 2, 3, "ncr53c825"); ISA16_SLOT(config, "board4", 0, "pci:07.0:isabus", isa_internal_devices, "pc87306", true).set_option_machine_config("pc87306", national_superio_config); ISA16_SLOT(config, "isa1", 0, "pci:07.0:isabus", pc_isa16_cards, nullptr, false); @@ -269,9 +270,6 @@ ROM_START( odyssey ) ROM_REGION( 0x10000, "vbios", 0 ) // video card BIOS ROM_LOAD( "videobios", 0x000000, 0x00d000, NO_DUMP ) - ROM_REGION( 0x10000, "scsibios", 0 ) // SCSI card BIOS - ROM_LOAD( "scsibios", 0x000000, 0x00d000, NO_DUMP ) - DISK_REGION( "scsi_hdd_image" ) // SCSI HDD DISK_IMAGE( "odyssey", 0, NO_DUMP ) -- cgit v1.2.3