diff options
| -rw-r--r-- | scripts/src/bus.lua | 6 | ||||
| -rw-r--r-- | src/devices/bus/pci/cmi8738.cpp | 88 | ||||
| -rw-r--r-- | src/devices/bus/pci/cmi8738.h | 35 | ||||
| -rw-r--r-- | src/devices/bus/pci/cs4281.cpp | 88 | ||||
| -rw-r--r-- | src/devices/bus/pci/cs4281.h | 34 | ||||
| -rw-r--r-- | src/devices/bus/pci/pci_slot.cpp | 8 | ||||
| -rw-r--r-- | src/devices/bus/pci/ymf740c.cpp | 81 | ||||
| -rw-r--r-- | src/devices/bus/pci/ymf740c.h | 33 |
8 files changed, 373 insertions, 0 deletions
diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua index ff5cfe431b7..5bc9cbd54ee 100644 --- a/scripts/src/bus.lua +++ b/scripts/src/bus.lua @@ -4452,6 +4452,10 @@ if BUSES["PCI"] then MAME_DIR .. "src/devices/bus/pci/clgd5446.h", MAME_DIR .. "src/devices/bus/pci/clgd546x_laguna.cpp", MAME_DIR .. "src/devices/bus/pci/clgd546x_laguna.h", + MAME_DIR .. "src/devices/bus/pci/cmi8738.cpp", + MAME_DIR .. "src/devices/bus/pci/cmi8738.h", + MAME_DIR .. "src/devices/bus/pci/cs4281.cpp", + MAME_DIR .. "src/devices/bus/pci/cs4281.h", MAME_DIR .. "src/devices/bus/pci/ds2416.cpp", MAME_DIR .. "src/devices/bus/pci/ds2416.h", MAME_DIR .. "src/devices/bus/pci/ess_maestro.cpp", @@ -4500,6 +4504,8 @@ if BUSES["PCI"] then MAME_DIR .. "src/devices/bus/pci/vt6306.h", MAME_DIR .. "src/devices/bus/pci/wd9710_pci.cpp", MAME_DIR .. "src/devices/bus/pci/wd9710_pci.h", + MAME_DIR .. "src/devices/bus/pci/ymf740c.cpp", + MAME_DIR .. "src/devices/bus/pci/ymf740c.h", MAME_DIR .. "src/devices/bus/pci/ymp21.cpp", MAME_DIR .. "src/devices/bus/pci/ymp21.h", MAME_DIR .. "src/devices/bus/pci/zr36057.cpp", diff --git a/src/devices/bus/pci/cmi8738.cpp b/src/devices/bus/pci/cmi8738.cpp new file mode 100644 index 00000000000..789e2566461 --- /dev/null +++ b/src/devices/bus/pci/cmi8738.cpp @@ -0,0 +1,88 @@ +// license:BSD-3-Clause +// copyright-holders: +/************************************************************************************************** + +TODO: +- stub +- Incredibly common on motherboards (The Retro Web counts 451 MBs!) + +**************************************************************************************************/ + +#include "emu.h" +#include "cmi8738.h" + +#define VERBOSE (LOG_GENERAL) +//#define LOG_OUTPUT_FUNC osd_printf_info + +#include "logmacro.h" + + +DEFINE_DEVICE_TYPE(CMI8738, cmi8738_device, "cmi8738", "C-Media CMI8738/C3DX sound card") + + +cmi8738_device::cmi8738_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) +{ +} + +cmi8738_device::cmi8738_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : cmi8738_device(mconfig, CMI8738, tag, owner, clock) +{ + // https://admin.pci-ids.ucw.cz/read/PC/13f6/0111 + set_ids(0x13f60111, 0x10, 0x040100, 0x13f60111); +} + +void cmi8738_device::device_add_mconfig(machine_config &config) +{ + +} + +void cmi8738_device::device_start() +{ + pci_card_device::device_start(); + + // TODO: verify length + add_map( 256, M_IO, FUNC(cmi8738_device::map)); + + // INTA# + intr_pin = 1; + intr_line = 5; + + minimum_grant = 0x02; + maximum_latency = 0x18; +} + +void cmi8738_device::device_reset() +{ + pci_card_device::device_reset(); + + command = 0x0000; + command_mask = 0x105; + // Fast Back-to-Back, medium DEVSEL#, has Capability List + status = 0x0290; + + remap_cb(); +} + +u8 cmi8738_device::latency_timer_r() +{ + return 0x20; +} + +// NOTE: documentation claims "0x0c" which is clearly a mistake +u8 cmi8738_device::capptr_r() +{ + return 0x40; +} + +void cmi8738_device::config_map(address_map &map) +{ + pci_card_device::config_map(map); + // TODO: values not provided by 2.2 documentation + // 1.2 doc really claims DDMA being there (???) + map(0x40, 0x43).lr32(NAME([] () { return 0x0601'0001; })); +} + +void cmi8738_device::map(address_map &map) +{ +} diff --git a/src/devices/bus/pci/cmi8738.h b/src/devices/bus/pci/cmi8738.h new file mode 100644 index 00000000000..61d892f13b1 --- /dev/null +++ b/src/devices/bus/pci/cmi8738.h @@ -0,0 +1,35 @@ +// license:BSD-3-Clause +// copyright-holders: + +#ifndef MAME_BUS_PCI_CMI8738_H +#define MAME_BUS_PCI_CMI8738_H + +#pragma once + +#include "pci_slot.h" + +class cmi8738_device : public pci_card_device +{ +public: + cmi8738_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + + static constexpr feature_type unemulated_features() { return feature::SOUND; } + +protected: + cmi8738_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 void config_map(address_map &map) override; + virtual u8 capptr_r() override; + + virtual uint8_t latency_timer_r() override; +private: + void map(address_map &map); +}; + +DECLARE_DEVICE_TYPE(CMI8738, cmi8738_device) + +#endif // MAME_BUS_PCI_CMI8738_H diff --git a/src/devices/bus/pci/cs4281.cpp b/src/devices/bus/pci/cs4281.cpp new file mode 100644 index 00000000000..fb98122a417 --- /dev/null +++ b/src/devices/bus/pci/cs4281.cpp @@ -0,0 +1,88 @@ +// license:BSD-3-Clause +// copyright-holders: + +#include "emu.h" +#include "cs4281.h" + +#define VERBOSE (LOG_GENERAL) +//#define LOG_OUTPUT_FUNC osd_printf_info + +#include "logmacro.h" + + +DEFINE_DEVICE_TYPE(CS4281, cs4281_device, "cs4281", "Cirrus Logic Crystal CS4281 \"SoundFusion\" sound card") + + +cs4281_device::cs4281_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) +{ +} + +cs4281_device::cs4281_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : cs4281_device(mconfig, CS4281, tag, owner, clock) +{ + // Subsystem ID actually r/w from optional EEPROM (and PCI register $fc) + set_ids(0x10136005, 0x01, 0x040100, 0x10134281); +} + +void cs4281_device::device_add_mconfig(machine_config &config) +{ + +} + +void cs4281_device::device_start() +{ + pci_card_device::device_start(); + + add_map( 4*1024, M_MEM, FUNC(cs4281_device::io_map)); + add_map( 64*1024, M_MEM, FUNC(cs4281_device::mmio_map)); + + // INTA# + intr_pin = 1; + + minimum_grant = 0x04; + maximum_latency = 0x18; +} + +void cs4281_device::device_reset() +{ + pci_card_device::device_reset(); + + command = 0x0000; + command_mask = 0x46; + status = 0x0210; + + remap_cb(); +} + + +u8 cs4281_device::capptr_r() +{ + return 0x40; +} + + +void cs4281_device::config_map(address_map &map) +{ + pci_card_device::config_map(map); + // Power Management v1.0, PME# (D0 up to D3hot), D2 and D1 support, Device Specific Init (bit 5) + map(0x40, 0x43).lr32(NAME([] () { return 0x7f21'0001; })); +// map(0x44, 0x47) PMCSR + +// map(0xe0, 0xe3) Configuration Write Protect (CWPR) +// map(0xe4, 0xe7) <reserved> +// map(0xe8, 0xeb) GPIO Pin Interface (GPIOR) +// map(0xec, 0xef) Serial Port Power Management & Control (SMPC) +// map(0xf0, 0xf3) Configuration Load (CFLR) +// map(0xf4, 0xf7) BIOS and ISA IRQ +// map(0xf8, 0xfb) <reserved> +// map(0xfc, 0xff) Subsystem ID write once +} + +void cs4281_device::io_map(address_map &map) +{ +} + +void cs4281_device::mmio_map(address_map &map) +{ +} diff --git a/src/devices/bus/pci/cs4281.h b/src/devices/bus/pci/cs4281.h new file mode 100644 index 00000000000..0ee2d02f988 --- /dev/null +++ b/src/devices/bus/pci/cs4281.h @@ -0,0 +1,34 @@ +// license:BSD-3-Clause +// copyright-holders: + +#ifndef MAME_BUS_PCI_CS4281_H +#define MAME_BUS_PCI_CS4281_H + +#pragma once + +#include "pci_slot.h" + +class cs4281_device : public pci_card_device +{ +public: + cs4281_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + + static constexpr feature_type unemulated_features() { return feature::SOUND; } + +protected: + cs4281_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 void config_map(address_map &map) override; + virtual u8 capptr_r() override; +private: + void io_map(address_map &map); + void mmio_map(address_map &map); +}; + +DECLARE_DEVICE_TYPE(CS4281, cs4281_device) + +#endif // MAME_BUS_PCI_CS4281_H diff --git a/src/devices/bus/pci/pci_slot.cpp b/src/devices/bus/pci/pci_slot.cpp index 884c9f712eb..871f3a3cfb0 100644 --- a/src/devices/bus/pci/pci_slot.cpp +++ b/src/devices/bus/pci/pci_slot.cpp @@ -11,6 +11,8 @@ #include "clgd543x_alpine.h" #include "clgd5446.h" #include "clgd546x_laguna.h" +#include "cmi8738.h" +#include "cs4281.h" #include "ds2416.h" #include "ess_maestro.h" #include "geforce.h" @@ -35,6 +37,7 @@ #include "vision.h" #include "vt6306.h" #include "wd9710_pci.h" +#include "ymf740c.h" #include "zr36057.h" @@ -145,11 +148,16 @@ void pci_cards(device_slot_interface &device) device.option_add("wd9710", WD9710_PCI); // 0x04 - multimedia controllers + // sound cards device.option_add("sw1000xg", SW1000XG); device.option_add("ds2416", DS2416); + device.option_add("ymf740c", YMF740C); device.option_add("sonicvibes", SONICVIBES); device.option_add("ess_solo1", ES1946_SOLO1E); device.option_add("4dwavedx", TRIDENT_4DWAVEDX); + device.option_add("cmi8738", CMI8738); + device.option_add("cs4281", CS4281); + // non-sound device.option_add("zr36057", ZR36057_PCI); device.option_add("audiowerk2", AUDIOWERK2); diff --git a/src/devices/bus/pci/ymf740c.cpp b/src/devices/bus/pci/ymf740c.cpp new file mode 100644 index 00000000000..60867897d1d --- /dev/null +++ b/src/devices/bus/pci/ymf740c.cpp @@ -0,0 +1,81 @@ +// license:BSD-3-Clause +// copyright-holders: + +#include "emu.h" +#include "ymf740c.h" + +#define VERBOSE (LOG_GENERAL) +//#define LOG_OUTPUT_FUNC osd_printf_info + +#include "logmacro.h" + + +DEFINE_DEVICE_TYPE(YMF740C, ymf740c_device, "ymf740c", "Yamaha YMF740C DS-1L") + + +ymf740c_device::ymf740c_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) +{ +} + +ymf740c_device::ymf740c_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : ymf740c_device(mconfig, YMF740C, tag, owner, clock) +{ + // Subsystem has write once at $44~$47 + // NOTE: by default it really wants 0x107a000c ("Networth" DS-XG PCI Audio CODEC) + set_ids(0x1073000c, 0x03, 0x040100, 0x107a000c); +} + +void ymf740c_device::device_add_mconfig(machine_config &config) +{ + +} + +void ymf740c_device::device_start() +{ + pci_card_device::device_start(); + + add_map(32*1024, M_MEM, FUNC(ymf740c_device::map)); + + // INTA# + intr_pin = 1; + + minimum_grant = 0x05; + maximum_latency = 0x19; +} + +void ymf740c_device::device_reset() +{ + pci_card_device::device_reset(); + + command = 0x0000; + command_mask = 0x146; + status = 0x0210; + + remap_cb(); +} + + +u8 ymf740c_device::capptr_r() +{ + return 0x50; +} + + +void ymf740c_device::config_map(address_map &map) +{ + pci_card_device::config_map(map); +// map(0x40, 0x41) Legacy Audio Control +// map(0x42, 0x43) Extended Legacy Audio Control +// map(0x44, 0x47) Subsystem Vendor/Device ID write once +// map(0x48, 0x49) DS-1L Control +// map(0x4a, 0x4b) DS-1L Power Control + // Power Management v1.0, D2 support + map(0x50, 0x53).lr32(NAME([] () { return 0x0401'0001; })); +// map(0x54, 0x55) Power Management Control / Status +// map(0x58, 0x59) ACPI mode +} + +void ymf740c_device::map(address_map &map) +{ +} diff --git a/src/devices/bus/pci/ymf740c.h b/src/devices/bus/pci/ymf740c.h new file mode 100644 index 00000000000..3fb8f1dc92c --- /dev/null +++ b/src/devices/bus/pci/ymf740c.h @@ -0,0 +1,33 @@ +// license:BSD-3-Clause +// copyright-holders: + +#ifndef MAME_BUS_PCI_YMF740C_H +#define MAME_BUS_PCI_YMF740C_H + +#pragma once + +#include "pci_slot.h" + +class ymf740c_device : public pci_card_device +{ +public: + ymf740c_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + + static constexpr feature_type unemulated_features() { return feature::SOUND; } + +protected: + ymf740c_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 void config_map(address_map &map) override; + virtual u8 capptr_r() override; +private: + void map(address_map &map); +}; + +DECLARE_DEVICE_TYPE(YMF740C, ymf740c_device) + +#endif // MAME_BUS_PCI_YMF740C_H |
