diff options
| author | 2024-02-18 15:49:57 +0100 | |
|---|---|---|
| committer | 2024-02-18 15:50:41 +0100 | |
| commit | 2785a4df9ec1cfd7cb0130952aef1aa8f71988e0 (patch) | |
| tree | 319a7d46d80237bfb61ae887f086906aa960ffb8 | |
| parent | e7a098b486681faff361ab9f2958979c5fda471a (diff) | |
New machines marked as MACHINE_NOT_WORKING
------------------------------------------
Yamaha MU128 [Matt, O. Galibert]
| -rw-r--r-- | scripts/src/cpu.lua | 2 | ||||
| -rw-r--r-- | src/devices/cpu/h8/h8.h | 2 | ||||
| -rw-r--r-- | src/devices/cpu/sh/sh7042.cpp | 70 | ||||
| -rw-r--r-- | src/devices/cpu/sh/sh7042.h | 48 | ||||
| -rw-r--r-- | src/devices/cpu/sh/sh_adc.cpp | 59 | ||||
| -rw-r--r-- | src/devices/cpu/sh/sh_adc.h | 67 | ||||
| -rw-r--r-- | src/mame/mame.lst | 3 | ||||
| -rw-r--r-- | src/mame/yamaha/ymmu128.cpp | 146 |
8 files changed, 253 insertions, 144 deletions
diff --git a/scripts/src/cpu.lua b/scripts/src/cpu.lua index 21946964984..881e4ca7338 100644 --- a/scripts/src/cpu.lua +++ b/scripts/src/cpu.lua @@ -897,8 +897,6 @@ if CPUS["SH"] then MAME_DIR .. "src/devices/cpu/sh/sh7032.h", MAME_DIR .. "src/devices/cpu/sh/sh7042.cpp", MAME_DIR .. "src/devices/cpu/sh/sh7042.h", - MAME_DIR .. "src/devices/cpu/sh/sh_adc.h", - MAME_DIR .. "src/devices/cpu/sh/sh_adc.cpp", MAME_DIR .. "src/devices/cpu/sh/sh7604_bus.cpp", MAME_DIR .. "src/devices/cpu/sh/sh7604_bus.h", MAME_DIR .. "src/devices/cpu/sh/sh7604_sci.cpp", diff --git a/src/devices/cpu/h8/h8.h b/src/devices/cpu/h8/h8.h index 2aaf18fa2d8..ab59c2c2e7c 100644 --- a/src/devices/cpu/h8/h8.h +++ b/src/devices/cpu/h8/h8.h @@ -42,7 +42,7 @@ public: m_sci[sci].lookup()->do_set_external_clock_period(period); } - template<int Sci> void sci_rx_w(int state) { if(Sci == 2) logerror("sci2 rx %d\n", state); m_sci[Sci]->do_rx_w(state); } + template<int Sci> void sci_rx_w(int state) { m_sci[Sci]->do_rx_w(state); } template<int Sci> void sci_clk_w(int state) { m_sci[Sci]->do_clk_w(state); } void nvram_set_battery(int state) { m_nvram_battery = bool(state); } // default is 1 (nvram_enable_backup needs to be true) diff --git a/src/devices/cpu/sh/sh7042.cpp b/src/devices/cpu/sh/sh7042.cpp index 4c195e787a2..1ae31e7077c 100644 --- a/src/devices/cpu/sh/sh7042.cpp +++ b/src/devices/cpu/sh/sh7042.cpp @@ -6,12 +6,23 @@ #include "emu.h" #include "sh7042.h" -DEFINE_DEVICE_TYPE(SH7042, sh7042_device, "sh7042", "Hitachi SH-2 (SH7042)") +DEFINE_DEVICE_TYPE(SH7042, sh7042_device, "sh7042", "Hitachi SH-2 (SH7042)") +DEFINE_DEVICE_TYPE(SH7043, sh7043_device, "sh7043", "Hitachi SH-2 (SH7043)") sh7042_device::sh7042_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : - sh2_device(mconfig, SH7042, tag, owner, clock, CPU_TYPE_SH2, address_map_constructor(FUNC(sh7042_device::map), this), 32, 0xffffffff), - m_adc(*this, "adc"), - m_read_adc(*this, 0) + sh7042_device(mconfig, SH7042, tag, owner, clock) +{ +} + +sh7043_device::sh7043_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + sh7042_device(mconfig, SH7043, tag, owner, clock) +{ +} + +sh7042_device::sh7042_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : + sh2_device(mconfig, type, tag, owner, clock, CPU_TYPE_SH2, address_map_constructor(FUNC(sh7042_device::map), this), 32, 0xffffffff), + m_read_adc(*this, 0), + m_sci_tx(*this) { for(unsigned int i=0; i != m_read_adc.size(); i++) m_read_adc[i].bind().set([this, i]() { return adc_default(i); }); @@ -26,23 +37,64 @@ u16 sh7042_device::adc_default(int adc) void sh7042_device::device_start() { sh2_device::device_start(); + + save_item(NAME(m_addr)); + save_item(NAME(m_adcsr)); + save_item(NAME(m_adcr)); } void sh7042_device::device_reset() { sh2_device::device_reset(); + + memset(m_addr, 0, sizeof(m_addr)); + m_adcsr = m_adcr = 0; } void sh7042_device::map(address_map &map) { - map(0xffff83e0, 0xffff83e0).rw(m_adc, FUNC(sh_adc_device::adcsr_r), FUNC(sh_adc_device::adcsr_w)); - map(0xffff83e1, 0xffff83e1).rw(m_adc, FUNC(sh_adc_device::adcr_r), FUNC(sh_adc_device::adcr_w)); - map(0xffff83f0, 0xffff83ff).r(m_adc, FUNC(sh_adc_device::addr_r)); + map(0xffff83e0, 0xffff83e0).rw(FUNC(sh7042_device::adcsr_r), FUNC(sh7042_device::adcsr_w)); + map(0xffff83e1, 0xffff83e1).rw(FUNC(sh7042_device::adcr_r), FUNC(sh7042_device::adcr_w)); + map(0xffff83f0, 0xffff83ff).r(FUNC(sh7042_device::addr_r)); map(0xfffff000, 0xffffffff).ram(); } -void sh7042_device::device_add_mconfig(machine_config &config) + +// ADC section + +u16 sh7042_device::addr_r(offs_t offset) +{ + logerror("addr16_r %d %03x\n", offset, m_addr[offset]); + return m_addr[offset]; +} + +u8 sh7042_device::adcsr_r() +{ + logerror("adcsr_r %02x\n", m_adcsr); + return m_adcsr; +} + +u8 sh7042_device::adcr_r() +{ + logerror("adcr_r %02x\n", m_adcr); + return m_adcr; +} + +void sh7042_device::adcsr_w(u8 data) +{ + logerror("adcsr_w %02x\n", data); + // u8 prev = m_adcsr; + m_adcsr = (data & 0x7f) | (m_adcsr & data & CSR_ADF); +} + +void sh7042_device::adcr_w(u8 data) +{ + logerror("adcr_w %02x\n", data); + m_adcr = data; +} + +void sh7042_device::do_sci_w(int sci, int state) { - SH_ADC(config, m_adc, *this); + logerror("sci %d %d\n", sci, state); } diff --git a/src/devices/cpu/sh/sh7042.h b/src/devices/cpu/sh/sh7042.h index 7cf319f3ce4..9c73063d4a6 100644 --- a/src/devices/cpu/sh/sh7042.h +++ b/src/devices/cpu/sh/sh7042.h @@ -9,7 +9,6 @@ #pragma once #include "sh2.h" -#include "sh_adc.h" class sh7042_device : public sh2_device { @@ -17,24 +16,61 @@ public: sh7042_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); template<int Port> auto read_adc() { return m_read_adc[Port].bind(); } + template<int Sci> void sci_rx_w(int state) { do_sci_w(Sci, state); } + template<int Sci> auto write_sci_tx() { return m_sci_tx[Sci].bind(); } - u16 do_read_adc(int port) { return m_read_adc[port](); } protected: + enum { + CSR_ADF = 0x80, + CSR_ADIE = 0x40, + CSR_ADST = 0x20, + CSR_CKS = 0x10, + CSR_GRP = 0x08, + CSR_CHAN = 0x07 + }; + + enum { + CR_PWR = 0x40, + CR_TRGS = 0x30, + CR_SCAN = 0x08, + CR_SIM = 0x04, + CR_BUF = 0x03 + }; + + sh7042_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); + virtual void device_start() override; virtual void device_reset() override; - virtual void device_add_mconfig(machine_config &config) override; private: - required_device<sh_adc_device> m_adc; - devcb_read16::array<8> m_read_adc; + devcb_write_line::array<2> m_sci_tx; + + void map(address_map &map); + + // ADC section + uint16_t m_addr[8]; + uint8_t m_adcsr, m_adcr; u16 adc_default(int adc); + u16 addr_r(offs_t offset); + u8 adcsr_r(); + u8 adcr_r(); + void adcsr_w(u8 data); + void adcr_w(u8 data); + + void do_sci_w(int sci, int state); +}; - void map(address_map &map); +class sh7043_device : public sh7042_device +{ +public: + sh7043_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); }; + DECLARE_DEVICE_TYPE(SH7042, sh7042_device) +DECLARE_DEVICE_TYPE(SH7043, sh7043_device) #endif // MAME_CPU_SH_SH7042_H diff --git a/src/devices/cpu/sh/sh_adc.cpp b/src/devices/cpu/sh/sh_adc.cpp deleted file mode 100644 index 40f9546dc15..00000000000 --- a/src/devices/cpu/sh/sh_adc.cpp +++ /dev/null @@ -1,59 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Olivier Galibert - -#include "emu.h" -#include "sh_adc.h" -#include "sh7042.h" - -DEFINE_DEVICE_TYPE(SH_ADC, sh_adc_device, "sh_adc", "SH7042 ADC") - -sh_adc_device::sh_adc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : - device_t(mconfig, SH_ADC, tag, owner, clock), - m_cpu(*this, finder_base::DUMMY_TAG), - m_adcsr(0), m_adcr(0) -{ -} - -u16 sh_adc_device::addr_r(offs_t offset) -{ - logerror("addr16_r %d %03x\n", offset, m_addr[offset]); - return m_addr[offset]; -} - -u8 sh_adc_device::adcsr_r() -{ - logerror("adcsr_r %02x\n", m_adcsr); - return m_adcsr; -} - -u8 sh_adc_device::adcr_r() -{ - logerror("adcr_r %02x\n", m_adcr); - return m_adcr; -} - -void sh_adc_device::adcsr_w(u8 data) -{ - logerror("adcsr_w %02x\n", data); - // u8 prev = m_adcsr; - m_adcsr = (data & 0x7f) | (m_adcsr & data & CSR_ADF); -} - -void sh_adc_device::adcr_w(u8 data) -{ - logerror("adcr_w %02x\n", data); - m_adcr = data; -} - -void sh_adc_device::device_start() -{ - save_item(NAME(m_addr)); - save_item(NAME(m_adcsr)); - save_item(NAME(m_adcr)); -} - -void sh_adc_device::device_reset() -{ - memset(m_addr, 0, sizeof(m_addr)); - m_adcsr = m_adcr = 0; -} diff --git a/src/devices/cpu/sh/sh_adc.h b/src/devices/cpu/sh/sh_adc.h deleted file mode 100644 index 4b8c371c31d..00000000000 --- a/src/devices/cpu/sh/sh_adc.h +++ /dev/null @@ -1,67 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Olivier Galibert -/*************************************************************************** - - sh_adc.h - - SH Analog to Digital Converter subsystem - -***************************************************************************/ - -#ifndef MAME_CPU_SH_SH_ADC_H -#define MAME_CPU_SH_SH_ADC_H - -#pragma once - -// To generalize eventually -class sh7042_device; - -class sh_adc_device : public device_t { -public: - sh_adc_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0); - - template <typename T> sh_adc_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&cpu) - : sh_adc_device(mconfig, tag, owner) - { - set_info(cpu); - } - - template<typename T> void set_info(T &&cpu) { m_cpu.set_tag(std::forward<T>(cpu)); } - - u16 addr_r(offs_t offset); - u8 adcsr_r(); - u8 adcr_r(); - void adcsr_w(u8 data); - void adcr_w(u8 data); - -protected: - enum { - CSR_ADF = 0x80, - CSR_ADIE = 0x40, - CSR_ADST = 0x20, - CSR_CKS = 0x10, - CSR_GRP = 0x08, - CSR_CHAN = 0x07 - }; - - enum { - CR_PWR = 0x40, - CR_TRGS = 0x30, - CR_SCAN = 0x08, - CR_SIM = 0x04, - CR_BUF = 0x03 - }; - - required_device<sh7042_device> m_cpu; - - uint16_t m_addr[8]; - uint8_t m_adcsr, m_adcr; - - - virtual void device_start() override; - virtual void device_reset() override; -}; - -DECLARE_DEVICE_TYPE(SH_ADC, sh_adc_device) - -#endif diff --git a/src/mame/mame.lst b/src/mame/mame.lst index e4a9e30792e..6f05f33be1a 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -46060,6 +46060,9 @@ mu100 // 1997 MU-100 mu100r // 1997 MU-100 Rackable version mu100b // 1998 MU-100B +@source:yamaha/ymmu128.cpp +mu128 + @source:yamaha/ympcs30.cpp pcs30 // 1984 diff --git a/src/mame/yamaha/ymmu128.cpp b/src/mame/yamaha/ymmu128.cpp new file mode 100644 index 00000000000..6edcf0ceaf2 --- /dev/null +++ b/src/mame/yamaha/ymmu128.cpp @@ -0,0 +1,146 @@ +// license:BSD-3-Clause +// copyright-holders:Olivier Galibert +/************************************************************************************* + + Yamaha MU-128 : 64-part, 128-note polyphonic/multitimbral General MIDI/XG + tone module + Driver by O. Galibert + + Uses a dual SWP30 and a SH7043 as cpu. + +**************************************************************************************/ + +#include "emu.h" + +#include "bus/midi/midiinport.h" +#include "bus/midi/midioutport.h" +#include "cpu/sh/sh7042.h" +#include "machine/i8251.h" +#include "sound/swp30.h" +#include "mulcd.h" +#include "machine/nvram.h" + +#include "debugger.h" +#include "speaker.h" + + +namespace { + +static INPUT_PORTS_START( mu128 ) +INPUT_PORTS_END + +class mu128_state : public driver_device +{ +public: + mu128_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_nvram(*this, "ram") + , m_swp30m(*this, "swp30m") + , m_swp30s(*this, "swp30s") + , m_lcd(*this, "lcd") + , m_sci(*this, "sci") + , m_ram(*this, "ram") + { } + + void mu128(machine_config &config); + +private: + required_device<sh7043_device> m_maincpu; + required_device<nvram_device> m_nvram; + required_device<swp30_device> m_swp30m, m_swp30s; + required_device<mulcd_device> m_lcd; + required_device<i8251_device> m_sci; + required_shared_ptr<u32> m_ram; + + void map(address_map &map); + void swp30_map(address_map &map); + + virtual void machine_start() override; + virtual void machine_reset() override; +}; + +void mu128_state::machine_start() +{ +} + +void mu128_state::machine_reset() +{ +} + +void mu128_state::map(address_map &map) +{ + map(0x000000, 0x1fffff).rom().region("maincpu", 0); + map(0x200000, 0x21ffff).ram().share(m_ram); + map(0x800000, 0x801fff).m(m_swp30m, FUNC(swp30_device::map)); + map(0x802000, 0x803fff).m(m_swp30s, FUNC(swp30_device::map)); + map(0xc00000, 0xc00000).rw(m_sci, FUNC(i8251_device::data_r), FUNC(i8251_device::data_w)).mirror(0x3ffffe); + map(0xc00001, 0xc00001).rw(m_sci, FUNC(i8251_device::status_r), FUNC(i8251_device::control_w)).mirror(0x3ffffe); +} + +void mu128_state::swp30_map(address_map &map) +{ + map(0x000000, 0x5fffff).rom().region("swp30", 0); +} + +void mu128_state::mu128(machine_config &config) +{ + SH7043(config, m_maincpu, 7_MHz_XTAL * 4); + m_maincpu->set_addrmap(AS_PROGRAM, &mu128_state::map); + + NVRAM(config, m_nvram, nvram_device::DEFAULT_NONE); + + MULCD(config, m_lcd); + + SPEAKER(config, "lspeaker").front_left(); + SPEAKER(config, "rspeaker").front_right(); + + SWP30(config, m_swp30m); + m_swp30m->set_addrmap(AS_DATA, &mu128_state::swp30_map); + m_swp30m->add_route(0, "lspeaker", 1.0); + m_swp30m->add_route(1, "rspeaker", 1.0); + + SWP30(config, m_swp30s); + m_swp30s->set_addrmap(AS_DATA, &mu128_state::swp30_map); + m_swp30s->add_route(0, "lspeaker", 1.0); + m_swp30s->add_route(1, "rspeaker", 1.0); + + I8251(config, m_sci, 10_MHz_XTAL); // uPD71051GU-10 + + auto &mdin_a(MIDI_PORT(config, "mdin_a")); + midiin_slot(mdin_a); + mdin_a.rxd_handler().set(m_maincpu, FUNC(sh7043_device::sci_rx_w<0>)); + + auto &mdin_b(MIDI_PORT(config, "mdin_b")); + midiin_slot(mdin_b); + mdin_b.rxd_handler().set(m_maincpu, FUNC(sh7043_device::sci_rx_w<1>)); + + auto &mdout(MIDI_PORT(config, "mdout")); + midiout_slot(mdout); + m_maincpu->write_sci_tx<0>().set(mdout, FUNC(midi_port_device::write_txd)); +} + +#define ROM_LOAD32_WORD_SWAP_BIOS(bios,name,offset,length,hash) \ + ROMX_LOAD(name, offset, length, hash, ROM_GROUPWORD | ROM_REVERSE | ROM_SKIP(2) | ROM_BIOS(bios)) + +ROM_START( mu128 ) + ROM_REGION( 0x200000, "maincpu", 0 ) + ROM_DEFAULT_BIOS("v200") + ROM_SYSTEM_BIOS( 0, "v200", "Upgrade package (Ver2.00 99-MAY-21)" ) + ROM_LOAD32_WORD_SWAP_BIOS( 0, "mu128-v2.00-h.bin", 0x000000, 0x100000, CRC(2891487b) SHA1(8ed4a6929c66fcb5248e16288dfaf56a3286aaf8) ) + ROM_LOAD32_WORD_SWAP_BIOS( 0, "mu128-v2.00-l.bin", 0x000002, 0x100000, CRC(cc236dc4) SHA1(e1ff3387968e89f5bc5df3e15cd0d6039104acd0) ) + ROM_SYSTEM_BIOS( 1, "v106", "c0 (Ver1.06 98-OCT-01)" ) + ROM_LOAD32_WORD_SWAP_BIOS( 1, "xv217c0.ic27", 0x000000, 0x100000, CRC(f4ba61f1) SHA1(381e1d146c4e693a21f6e6e4ea2a8b9f6e3033ef) ) + ROM_LOAD32_WORD_SWAP_BIOS( 1, "xv224c0.ic25", 0x000002, 0x100000, CRC(079bfcf0) SHA1(56d69f3214899fa25ef5e9ea6c2bbf0c3d378123) ) + + ROM_REGION32_LE( 0x1800000, "swp30", ROMREGION_ERASE00 ) + ROM_LOAD32_WORD( "xv364a0.ic53", 0x0000000, 0x800000, CRC(cda1afd6) SHA1(e7098246b33c3cf22ed8cc15ed6383f8a06d17e9) ) + ROM_LOAD32_WORD( "xv365a0.ic54", 0x0000002, 0x800000, CRC(10985ed0) SHA1(d45a2e85859e05046f3ede8317a9bb0b88898116) ) + ROM_LOAD32_WORD( "xv366a0.ic57", 0x1000000, 0x400000, CRC(781dfac6) SHA1(e6b8b7cf95e4e9552001450570fcea87282db1e8) ) + ROM_LOAD32_WORD( "xv376a0.ic58", 0x1000002, 0x400000, CRC(91a7533b) SHA1(c30888603fd5db367d14553763f0a3f392c5427c) ) +ROM_END + +} // anonymous namespace + + +CONS( 1998, mu128, 0, 0, mu128, mu128, mu128_state, empty_init, "Yamaha", "MU128", 0 ) |
