summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2020-03-30 23:17:39 -0400
committer AJR <ajrhacker@users.noreply.github.com>2020-03-30 23:17:39 -0400
commit9d16d76f999e8430d4bd1ec32fd8d12ef9419461 (patch)
tree525f2dfad439c5bb0d2c1e8a7441b966fa961c91
parent47dfbd5ba1342749bc1983f1ef5d2d90b937d40e (diff)
mb62h195: New skeleton device (nw)
-rw-r--r--scripts/target/mame/mess.lua2
-rw-r--r--src/mame/drivers/alphajuno.cpp11
-rw-r--r--src/mame/drivers/roland_s10.cpp20
-rw-r--r--src/mame/machine/mb62h195.cpp75
-rw-r--r--src/mame/machine/mb62h195.h60
5 files changed, 168 insertions, 0 deletions
diff --git a/scripts/target/mame/mess.lua b/scripts/target/mame/mess.lua
index 27f29d3f9b3..94cccb82f30 100644
--- a/scripts/target/mame/mess.lua
+++ b/scripts/target/mame/mess.lua
@@ -3285,6 +3285,8 @@ files {
MAME_DIR .. "src/mame/drivers/roland_tr707.cpp",
MAME_DIR .. "src/mame/audio/jx8p_synth.cpp",
MAME_DIR .. "src/mame/audio/jx8p_synth.h",
+ MAME_DIR .. "src/mame/machine/mb62h195.cpp",
+ MAME_DIR .. "src/mame/machine/mb62h195.h",
MAME_DIR .. "src/mame/machine/mb63h149.cpp",
MAME_DIR .. "src/mame/machine/mb63h149.h",
MAME_DIR .. "src/mame/machine/pg200.cpp",
diff --git a/src/mame/drivers/alphajuno.cpp b/src/mame/drivers/alphajuno.cpp
index a03efd0e6a4..017947da5d5 100644
--- a/src/mame/drivers/alphajuno.cpp
+++ b/src/mame/drivers/alphajuno.cpp
@@ -9,6 +9,7 @@
#include "emu.h"
//#include "bus/midi/midi.h"
#include "cpu/mcs51/mcs51.h"
+#include "machine/mb62h195.h"
#include "machine/mb63h149.h"
#include "machine/nvram.h"
#include "machine/rescap.h"
@@ -116,6 +117,13 @@ void alphajuno_state::ajuno1(machine_config &config)
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); // TC5517APL + battery
+ mb62h195_device &io(MB62H195(config, "io"));
+ io.lc_callback().set(m_lcdc, FUNC(hd44780_device::write));
+ io.sout_callback().set("adc", FUNC(upd7001_device::si_w));
+ io.sck_callback().set("adc", FUNC(upd7001_device::sck_w));
+ io.sin_callback().set("adc", FUNC(upd7001_device::so_r));
+ io.adc_callback().set("adc", FUNC(upd7001_device::cs_w));
+
//MB87123(config, "dco", 12_MHz_XTAL);
UPD7001(config, "adc", RES_K(27), CAP_P(47));
@@ -154,6 +162,9 @@ void alphajuno_state::mks50(machine_config &config)
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); // TC5564PL-20 + battery
+ mb62h195_device &io(MB62H195(config, "io"));
+ io.lc_callback().set(m_lcdc, FUNC(hd44780_device::write));
+
//MB87123(config, "dco", 12_MHz_XTAL);
// LCD Unit: DM011Z-1DL3
diff --git a/src/mame/drivers/roland_s10.cpp b/src/mame/drivers/roland_s10.cpp
index 9170ed91b41..41deab96b34 100644
--- a/src/mame/drivers/roland_s10.cpp
+++ b/src/mame/drivers/roland_s10.cpp
@@ -14,6 +14,7 @@
//#include "bus/midi/midi.h"
#include "cpu/mcs51/mcs51.h"
#include "machine/i8251.h"
+#include "machine/mb62h195.h"
#include "machine/mb63h149.h"
#include "machine/nvram.h"
#include "machine/rescap.h"
@@ -28,6 +29,7 @@ public:
roland_s10_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag)
, m_maincpu(*this, "maincpu")
+ , m_io(*this, "io")
, m_usart(*this, "usart")
, m_lcdc(*this, "lcdc")
{
@@ -54,6 +56,7 @@ protected:
void palette_init(palette_device &palette);
required_device<mcs51_cpu_device> m_maincpu;
+ required_device<mb62h195_device> m_io;
required_device<i8251_device> m_usart;
required_device<hd44780_device> m_lcdc;
};
@@ -205,6 +208,13 @@ void roland_s10_state::s10(machine_config &config)
m_maincpu->set_addrmap(AS_PROGRAM, &roland_s10_state::prog_map);
m_maincpu->set_addrmap(AS_IO, &roland_s10_state::s10_ext_map);
+ MB62H195(config, m_io);
+ m_io->lc_callback().set(m_lcdc, FUNC(hd44780_device::write));
+ m_io->sout_callback().set("adc", FUNC(upd7001_device::si_w));
+ m_io->sck_callback().set("adc", FUNC(upd7001_device::sck_w));
+ m_io->sin_callback().set("adc", FUNC(upd7001_device::so_r));
+ m_io->adc_callback().set("adc", FUNC(upd7001_device::cs_w));
+
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); // TC5564PL-20 + battery
I8251(config, m_usart, 6.5_MHz_XTAL / 2); // MB89251A
@@ -240,6 +250,11 @@ void roland_s10_state::mks100(machine_config &config)
s10(config);
m_maincpu->set_addrmap(AS_IO, &roland_s10_state::mks100_ext_map);
+ m_io->sout_callback().set_nop();
+ m_io->sck_callback().set_nop();
+ m_io->sin_callback().set_constant(1);
+ m_io->adc_callback().set_nop();
+
config.device_remove("keyscan");
config.device_remove("adc");
}
@@ -249,6 +264,11 @@ void roland_s220_state::s220(machine_config &config)
s10(config);
m_maincpu->set_addrmap(AS_IO, &roland_s220_state::s220_ext_map);
+ m_io->sout_callback().set_nop();
+ m_io->sck_callback().set_nop();
+ m_io->sin_callback().set_constant(1);
+ m_io->adc_callback().set_nop();
+
config.device_remove("keyscan");
config.device_remove("adc");
diff --git a/src/mame/machine/mb62h195.cpp b/src/mame/machine/mb62h195.cpp
new file mode 100644
index 00000000000..7e8a0671c34
--- /dev/null
+++ b/src/mame/machine/mb62h195.cpp
@@ -0,0 +1,75 @@
+// license:BSD-3-Clause
+// copyright-holders:AJR
+/***************************************************************************
+
+ Roland MB62H195 gate array
+
+ This is one of Roland's several multifunction I/O gate arrays including
+ built-in address latches and chip select decoders. This one's
+ particular features include both an LCD data FIFO (write-only) and a
+ parallel/serial converter for a µPD7001 ADC (the clock for which is
+ based on an internal oscillator).
+
+***************************************************************************/
+
+#include "emu.h"
+#include "mb62h195.h"
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+// device type definition
+DEFINE_DEVICE_TYPE(MB62H195, mb62h195_device, "mb62h195", "Roland MB62H195 I/O")
+
+
+//**************************************************************************
+// DEVICE IMPLEMENTATION
+//**************************************************************************
+
+//-------------------------------------------------
+// mb62h195_device - constructor
+//-------------------------------------------------
+
+mb62h195_device::mb62h195_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
+ : device_t(mconfig, MB62H195, tag, owner, clock)
+ , m_lc_callback(*this)
+ , m_r_callback(*this)
+ , m_t_callback(*this)
+ , m_da_callback(*this)
+ , m_dc_callback(*this)
+ , m_sout_callback(*this)
+ , m_sck_callback(*this)
+ , m_sin_callback(*this)
+ , m_adc_callback(*this)
+{
+}
+
+
+//-------------------------------------------------
+// device_resolve_objects - resolve objects that
+// may be needed for other devices to set
+// initial conditions at start time
+//-------------------------------------------------
+
+void mb62h195_device::device_resolve_objects()
+{
+ m_lc_callback.resolve_safe();
+ m_r_callback.resolve_safe(0xff);
+ m_t_callback.resolve_safe();
+ m_da_callback.resolve_safe();
+ m_dc_callback.resolve_safe();
+ m_sout_callback.resolve_safe();
+ m_sck_callback.resolve_safe();
+ m_sin_callback.resolve_safe(1);
+ m_adc_callback.resolve_safe();
+}
+
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void mb62h195_device::device_start()
+{
+}
diff --git a/src/mame/machine/mb62h195.h b/src/mame/machine/mb62h195.h
new file mode 100644
index 00000000000..4ceb81f4533
--- /dev/null
+++ b/src/mame/machine/mb62h195.h
@@ -0,0 +1,60 @@
+// license:BSD-3-Clause
+// copyright-holders:AJR
+/***************************************************************************
+
+ Roland MB62H195 gate array
+
+***************************************************************************/
+
+#ifndef MAME_MACHINE_MB62H195_H
+#define MAME_MACHINE_MB62H195_H
+
+#pragma once
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> mb62h195_device
+
+class mb62h195_device : public device_t
+{
+public:
+ // device type constructor
+ mb62h195_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0);
+
+ // configuration
+ auto lc_callback() { return m_lc_callback.bind(); }
+ auto r_callback() { return m_r_callback.bind(); }
+ auto t_callback() { return m_t_callback.bind(); }
+ auto da_callback() { return m_da_callback.bind(); }
+ auto dc_callback() { return m_dc_callback.bind(); }
+ auto sout_callback() { return m_sout_callback.bind(); }
+ auto sck_callback() { return m_sck_callback.bind(); }
+ auto sin_callback() { return m_sin_callback.bind(); }
+ auto adc_callback() { return m_adc_callback.bind(); }
+
+ // CPU read/write handlers (TODO)
+
+ // device-specific overrides
+ virtual void device_resolve_objects() override;
+ virtual void device_start() override;
+
+private:
+ // callback objects
+ devcb_write8 m_lc_callback;
+ devcb_read8 m_r_callback;
+ devcb_write8 m_t_callback;
+ devcb_write16 m_da_callback;
+ devcb_write8 m_dc_callback;
+ devcb_write_line m_sout_callback;
+ devcb_write_line m_sck_callback;
+ devcb_read_line m_sin_callback;
+ devcb_write_line m_adc_callback;
+};
+
+
+// device type declaration
+DECLARE_DEVICE_TYPE(MB62H195, mb62h195_device)
+
+#endif // MAME_MACHINE_MB62H195_H