summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Dirk Best <mail@dirk-best.de>2018-04-08 23:31:39 +0200
committer Dirk Best <mail@dirk-best.de>2018-04-08 23:31:39 +0200
commitd4d7f94c5fa0e02e5e9ccef9eaf5bf63722bba9a (patch)
treeeb87c3a54c225a5a74edb54dcc31a7a49195aa77
parent2bfe0b338151569a176b70d9b511721c385eeaf1 (diff)
Rename 315-5338a to m1io since it doesn't actually represent that device
-rw-r--r--scripts/target/mame/arcade.lua4
-rw-r--r--src/mame/drivers/model1.cpp60
-rw-r--r--src/mame/drivers/model2.cpp30
-rw-r--r--src/mame/machine/315-5338a.h103
-rw-r--r--src/mame/machine/m1io.cpp (renamed from src/mame/machine/315-5338a.cpp)20
-rw-r--r--src/mame/machine/m1io.h98
6 files changed, 154 insertions, 161 deletions
diff --git a/scripts/target/mame/arcade.lua b/scripts/target/mame/arcade.lua
index f0b520fb6ef..914c8f6b27b 100644
--- a/scripts/target/mame/arcade.lua
+++ b/scripts/target/mame/arcade.lua
@@ -3368,8 +3368,8 @@ files {
MAME_DIR .. "src/mame/video/zaxxon.cpp",
MAME_DIR .. "src/mame/machine/315_5296.cpp",
MAME_DIR .. "src/mame/machine/315_5296.h",
- MAME_DIR .. "src/mame/machine/315-5338a.cpp",
- MAME_DIR .. "src/mame/machine/315-5338a.h",
+ MAME_DIR .. "src/mame/machine/m1io.cpp",
+ MAME_DIR .. "src/mame/machine/m1io.h",
MAME_DIR .. "src/mame/machine/fd1089.cpp",
MAME_DIR .. "src/mame/machine/fd1089.h",
MAME_DIR .. "src/mame/machine/fd1094.cpp",
diff --git a/src/mame/drivers/model1.cpp b/src/mame/drivers/model1.cpp
index d60a333a822..e87d8529f58 100644
--- a/src/mame/drivers/model1.cpp
+++ b/src/mame/drivers/model1.cpp
@@ -636,7 +636,7 @@ Notes:
#include "cpu/i386/i386.h"
#include "machine/clock.h"
#include "machine/nvram.h"
-#include "machine/315-5338a.h"
+#include "machine/m1io.h"
#include "speaker.h"
#include "vr.lh"
@@ -930,7 +930,7 @@ void model1_state::model1_mem(address_map &map)
map(0x900000, 0x903fff).ram().w(this, FUNC(model1_state::p_w)).share("palette");
map(0x910000, 0x91bfff).ram().share("color_xlat");
- map(0xc00000, 0xc0001f).rw("io", FUNC(sega_315_5338a_device::read), FUNC(sega_315_5338a_device::write)).umask16(0x00ff);
+ map(0xc00000, 0xc0001f).rw("io", FUNC(m1io_device::read), FUNC(m1io_device::write)).umask16(0x00ff);
map(0xc00020, 0xc0003f).w(this, FUNC(model1_state::drive_board_w));
map(0xc00040, 0xc00043).rw(this, FUNC(model1_state::network_ctl_r), FUNC(model1_state::network_ctl_w));
@@ -1659,10 +1659,10 @@ MACHINE_CONFIG_START(model1_state::model1)
MCFG_MACHINE_RESET_OVERRIDE(model1_state,model1)
MCFG_NVRAM_ADD_0FILL("nvram")
- MCFG_DEVICE_ADD("io", SEGA_315_5338A, 0)
- MCFG_315_5338A_DI0_CB(IOPORT("IN.0"))
- MCFG_315_5338A_DI1_CB(IOPORT("IN.1"))
- MCFG_315_5338A_DI2_CB(IOPORT("IN.2"))
+ MCFG_DEVICE_ADD("io", SEGA_M1IO, 0)
+ MCFG_M1IO_DI0_CB(IOPORT("IN.0"))
+ MCFG_M1IO_DI1_CB(IOPORT("IN.1"))
+ MCFG_M1IO_DI2_CB(IOPORT("IN.2"))
MCFG_S24TILE_DEVICE_ADD("tile", 0x3fff)
MCFG_S24TILE_DEVICE_PALETTE("palette")
@@ -1699,17 +1699,17 @@ MACHINE_CONFIG_START(model1_state::vf)
model1_hle(config);
MCFG_DEVICE_MODIFY("io")
- MCFG_315_5338A_DO_CB(WRITE8(model1_state, vf_outputs_w))
+ MCFG_M1IO_DO_CB(WRITE8(model1_state, vf_outputs_w))
MACHINE_CONFIG_END
MACHINE_CONFIG_START(model1_state::vr)
model1(config);
MCFG_DEVICE_MODIFY("io")
- MCFG_315_5338A_AN0_CB(IOPORT("WHEEL"))
- MCFG_315_5338A_AN1_CB(IOPORT("ACCEL"))
- MCFG_315_5338A_AN2_CB(IOPORT("BRAKE"))
- MCFG_315_5338A_DO_CB(WRITE8(model1_state, vr_outputs_w))
+ MCFG_M1IO_AN0_CB(IOPORT("WHEEL"))
+ MCFG_M1IO_AN1_CB(IOPORT("ACCEL"))
+ MCFG_M1IO_AN2_CB(IOPORT("BRAKE"))
+ MCFG_M1IO_DO_CB(WRITE8(model1_state, vr_outputs_w))
MCFG_M1COMM_ADD(M1COMM_TAG)
MCFG_DEVICE_BIOS("epr15112");
@@ -1719,10 +1719,10 @@ MACHINE_CONFIG_START(model1_state::vformula)
model1(config);
MCFG_DEVICE_MODIFY("io")
- MCFG_315_5338A_AN0_CB(IOPORT("WHEEL"))
- MCFG_315_5338A_AN1_CB(IOPORT("ACCEL"))
- MCFG_315_5338A_AN2_CB(IOPORT("BRAKE"))
- MCFG_315_5338A_DO_CB(WRITE8(model1_state, vr_outputs_w))
+ MCFG_M1IO_AN0_CB(IOPORT("WHEEL"))
+ MCFG_M1IO_AN1_CB(IOPORT("ACCEL"))
+ MCFG_M1IO_AN2_CB(IOPORT("BRAKE"))
+ MCFG_M1IO_DO_CB(WRITE8(model1_state, vr_outputs_w))
MCFG_M1COMM_ADD(M1COMM_TAG)
MCFG_DEVICE_BIOS("epr15624");
@@ -1732,13 +1732,13 @@ MACHINE_CONFIG_START(model1_state::swa)
model1_hle(config);
MCFG_DEVICE_MODIFY("io")
- MCFG_315_5338A_AN0_CB(IOPORT("STICK1X"))
- MCFG_315_5338A_AN1_CB(IOPORT("STICK1Y"))
- MCFG_315_5338A_AN2_CB(IOPORT("THROTTLE"))
- MCFG_315_5338A_AN3_CB(NOOP)
- MCFG_315_5338A_AN4_CB(IOPORT("STICK2X"))
- MCFG_315_5338A_AN5_CB(IOPORT("STICK2Y"))
- MCFG_315_5338A_DO_CB(WRITE8(model1_state, swa_outputs_w))
+ MCFG_M1IO_AN0_CB(IOPORT("STICK1X"))
+ MCFG_M1IO_AN1_CB(IOPORT("STICK1Y"))
+ MCFG_M1IO_AN2_CB(IOPORT("THROTTLE"))
+ MCFG_M1IO_AN3_CB(NOOP)
+ MCFG_M1IO_AN4_CB(IOPORT("STICK2X"))
+ MCFG_M1IO_AN5_CB(IOPORT("STICK2Y"))
+ MCFG_M1IO_DO_CB(WRITE8(model1_state, swa_outputs_w))
MCFG_SPEAKER_STANDARD_STEREO("dleft", "dright")
MCFG_DSBZ80_ADD(DSBZ80_TAG)
@@ -1758,10 +1758,10 @@ MACHINE_CONFIG_START(model1_state::wingwar)
MCFG_CPU_PROGRAM_MAP(model1_comm_mem)
MCFG_DEVICE_MODIFY("io")
- MCFG_315_5338A_AN0_CB(IOPORT("STICKX"))
- MCFG_315_5338A_AN1_CB(IOPORT("STICKY"))
- MCFG_315_5338A_AN2_CB(IOPORT("THROTTLE"))
- MCFG_315_5338A_DO_CB(WRITE8(model1_state, wingwar_outputs_w))
+ MCFG_M1IO_AN0_CB(IOPORT("STICKX"))
+ MCFG_M1IO_AN1_CB(IOPORT("STICKY"))
+ MCFG_M1IO_AN2_CB(IOPORT("THROTTLE"))
+ MCFG_M1IO_DO_CB(WRITE8(model1_state, wingwar_outputs_w))
MCFG_M1COMM_ADD(M1COMM_TAG)
MCFG_DEVICE_BIOS("epr15112");
@@ -1771,7 +1771,7 @@ MACHINE_CONFIG_START(model1_state::wingwar360)
wingwar(config);
MCFG_DEVICE_MODIFY("io")
- MCFG_315_5338A_DO_CB(WRITE8(model1_state, wingwar360_outputs_w))
+ MCFG_M1IO_DO_CB(WRITE8(model1_state, wingwar360_outputs_w))
MACHINE_CONFIG_END
void model1_state::polhemus_map(address_map &map)
@@ -1787,9 +1787,9 @@ MACHINE_CONFIG_START(model1_state::netmerc)
MCFG_CPU_PROGRAM_MAP(polhemus_map)
MCFG_DEVICE_MODIFY("io")
- MCFG_315_5338A_AN0_CB(IOPORT("STICKX"))
- MCFG_315_5338A_AN2_CB(IOPORT("STICKY"))
- MCFG_315_5338A_DO_CB(WRITE8(model1_state, netmerc_outputs_w))
+ MCFG_M1IO_AN0_CB(IOPORT("STICKX"))
+ MCFG_M1IO_AN2_CB(IOPORT("STICKY"))
+ MCFG_M1IO_DO_CB(WRITE8(model1_state, netmerc_outputs_w))
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/model2.cpp b/src/mame/drivers/model2.cpp
index 241ba871c35..4ebacf07072 100644
--- a/src/mame/drivers/model2.cpp
+++ b/src/mame/drivers/model2.cpp
@@ -98,7 +98,7 @@
#include "machine/msm6253.h"
#include "machine/nvram.h"
#include "machine/315_5296.h"
-#include "machine/315-5338a.h"
+#include "machine/m1io.h"
#include "sound/2612intf.h"
#include "video/segaic24.h"
#include "speaker.h"
@@ -1575,7 +1575,7 @@ void model2o_state::model2o_mem(address_map &map)
map(0x00220000, 0x0023ffff).rom().region("maincpu", 0x20000);
map(0x00980004, 0x00980007).r(this, FUNC(model2o_state::fifo_control_2o_r));
- map(0x01c00000, 0x01c0001f).rw("io", FUNC(sega_315_5338a_device::read), FUNC(sega_315_5338a_device::write)).umask32(0x00ff00ff);
+ map(0x01c00000, 0x01c0001f).rw("io", FUNC(m1io_device::read), FUNC(m1io_device::write)).umask32(0x00ff00ff);
map(0x01c00040, 0x01c00043).r(this, FUNC(model2o_state::daytona_unk_r));
map(0x01c00100, 0x01c0010f).r(this, FUNC(model2o_state::virtuacop_lightgun_r)).umask32(0x00ff00ff);
map(0x01c00110, 0x01c00113).r(this, FUNC(model2o_state::virtuacop_lightgun_offscreen_r)).umask32(0x00ff00ff);
@@ -2510,9 +2510,9 @@ MACHINE_CONFIG_START(model2o_state::model2o)
MCFG_NVRAM_ADD_1FILL("backup1")
MCFG_NVRAM_ADD_1FILL("backup2")
- MCFG_DEVICE_ADD("io", SEGA_315_5338A, 0)
- MCFG_315_5338A_DI0_CB(IOPORT("IN0"))
- MCFG_315_5338A_DI1_CB(IOPORT("IN1"))
+ MCFG_DEVICE_ADD("io", SEGA_M1IO, 0)
+ MCFG_M1IO_DI0_CB(IOPORT("IN0"))
+ MCFG_M1IO_DI1_CB(IOPORT("IN1"))
model2_timers(config);
model2_screen(config);
@@ -2582,10 +2582,10 @@ MACHINE_CONFIG_START(model2o_state::daytona)
sj25_0207_01(config);
MCFG_DEVICE_MODIFY("io")
- MCFG_315_5338A_AN0_CB(IOPORT("STEER"))
- MCFG_315_5338A_AN1_CB(IOPORT("ACCEL"))
- MCFG_315_5338A_AN2_CB(IOPORT("BRAKE"))
- MCFG_315_5338A_DO_CB(WRITE8(model2o_state, daytona_output_w))
+ MCFG_M1IO_AN0_CB(IOPORT("STEER"))
+ MCFG_M1IO_AN1_CB(IOPORT("ACCEL"))
+ MCFG_M1IO_AN2_CB(IOPORT("BRAKE"))
+ MCFG_M1IO_DO_CB(WRITE8(model2o_state, daytona_output_w))
MACHINE_CONFIG_END
MACHINE_CONFIG_START(model2o_maxx_state::daytona_maxx)
@@ -2606,18 +2606,18 @@ MACHINE_CONFIG_START(model2o_state::desert)
model2o(config);
MCFG_DEVICE_MODIFY("io")
- MCFG_315_5338A_AN0_CB(IOPORT("STEER"))
- MCFG_315_5338A_AN1_CB(IOPORT("ACCEL"))
- MCFG_315_5338A_AN2_CB(IOPORT("BRAKE"))
- MCFG_315_5338A_DO_CB(WRITE8(model2o_state, desert_output_w))
+ MCFG_M1IO_AN0_CB(IOPORT("STEER"))
+ MCFG_M1IO_AN1_CB(IOPORT("ACCEL"))
+ MCFG_M1IO_AN2_CB(IOPORT("BRAKE"))
+ MCFG_M1IO_DO_CB(WRITE8(model2o_state, desert_output_w))
MACHINE_CONFIG_END
MACHINE_CONFIG_START(model2o_state::vcop)
model2o(config);
MCFG_DEVICE_MODIFY("io")
- MCFG_315_5338A_DI2_CB(IOPORT("DEBUG"))
- MCFG_315_5338A_DO_CB(WRITE8(model2o_state, vcop_output_w))
+ MCFG_M1IO_DI2_CB(IOPORT("DEBUG"))
+ MCFG_M1IO_DO_CB(WRITE8(model2o_state, vcop_output_w))
MACHINE_CONFIG_END
/* 2A-CRX */
diff --git a/src/mame/machine/315-5338a.h b/src/mame/machine/315-5338a.h
deleted file mode 100644
index da620f29c4e..00000000000
--- a/src/mame/machine/315-5338a.h
+++ /dev/null
@@ -1,103 +0,0 @@
-// license: BSD-3-Clause
-// copyright-holders: Dirk Best
-/***************************************************************************
-
- Sega 315-5338A
-
- I/O Controller
-
- Custom 100-pin QFP LSI. Supports 8 analog channels, 3 digital 8-bit
- input ports, 1 digital 8-bit output port and a serial mode (and
- probably more).
-
- TODO:
- - Serial/remote mode
-
-***************************************************************************/
-
-#ifndef MAME_MACHINE_315_5338A_H
-#define MAME_MACHINE_315_5338A_H
-
-#pragma once
-
-//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_315_5338A_AN0_CB(_devcb) \
- devcb = &downcast<sega_315_5338a_device &>(*device).set_an_callback(DEVCB_##_devcb, 0);
-
-#define MCFG_315_5338A_AN1_CB(_devcb) \
- devcb = &downcast<sega_315_5338a_device &>(*device).set_an_callback(DEVCB_##_devcb, 1);
-
-#define MCFG_315_5338A_AN2_CB(_devcb) \
- devcb = &downcast<sega_315_5338a_device &>(*device).set_an_callback(DEVCB_##_devcb, 2);
-
-#define MCFG_315_5338A_AN3_CB(_devcb) \
- devcb = &downcast<sega_315_5338a_device &>(*device).set_an_callback(DEVCB_##_devcb, 3);
-
-#define MCFG_315_5338A_AN4_CB(_devcb) \
- devcb = &downcast<sega_315_5338a_device &>(*device).set_an_callback(DEVCB_##_devcb, 4);
-
-#define MCFG_315_5338A_AN5_CB(_devcb) \
- devcb = &downcast<sega_315_5338a_device &>(*device).set_an_callback(DEVCB_##_devcb, 5);
-
-#define MCFG_315_5338A_AN6_CB(_devcb) \
- devcb = &downcast<sega_315_5338a_device &>(*device).set_an_callback(DEVCB_##_devcb, 6);
-
-#define MCFG_315_5338A_AN7_CB(_devcb) \
- devcb = &downcast<sega_315_5338a_device &>(*device).set_an_callback(DEVCB_##_devcb, 7);
-
-#define MCFG_315_5338A_DI0_CB(_devcb) \
- devcb = &downcast<sega_315_5338a_device &>(*device).set_di_callback(DEVCB_##_devcb, 0);
-
-#define MCFG_315_5338A_DI1_CB(_devcb) \
- devcb = &downcast<sega_315_5338a_device &>(*device).set_di_callback(DEVCB_##_devcb, 1);
-
-#define MCFG_315_5338A_DI2_CB(_devcb) \
- devcb = &downcast<sega_315_5338a_device &>(*device).set_di_callback(DEVCB_##_devcb, 2);
-
-#define MCFG_315_5338A_DO_CB(_devcb) \
- devcb = &downcast<sega_315_5338a_device &>(*device).set_do_callback(DEVCB_##_devcb);
-
-
-//**************************************************************************
-// TYPE DEFINITIONS
-//**************************************************************************
-
-class sega_315_5338a_device : public device_t
-{
-public:
- // construction/destruction
- sega_315_5338a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
-
- // configuration
- template <class Object> devcb_base &set_an_callback(Object &&cb, int index)
- { return m_an_cb[index].set_callback(std::forward<Object>(cb)); }
-
- template <class Object> devcb_base &set_di_callback(Object &&cb, int index)
- { return m_di_cb[index].set_callback(std::forward<Object>(cb)); }
-
- template <class Object> devcb_base &set_do_callback(Object &&cb)
- { return m_do_cb.set_callback(std::forward<Object>(cb)); }
-
- DECLARE_READ8_MEMBER(read);
- DECLARE_WRITE8_MEMBER(write);
-
-protected:
- // device-level overrides
- virtual void device_start() override;
-
-private:
- // callbacks
- devcb_read8 m_an_cb[8];
- devcb_read8 m_di_cb[3];
- devcb_write8 m_do_cb;
-
- uint8_t m_out;
-};
-
-// device type definition
-DECLARE_DEVICE_TYPE(SEGA_315_5338A, sega_315_5338a_device)
-
-#endif // MAME_MACHINE_315_5338A_H
diff --git a/src/mame/machine/315-5338a.cpp b/src/mame/machine/m1io.cpp
index 356acaa0ebb..b1ac5b996fe 100644
--- a/src/mame/machine/315-5338a.cpp
+++ b/src/mame/machine/m1io.cpp
@@ -2,14 +2,12 @@
// copyright-holders: Dirk Best
/***************************************************************************
- Sega 315-5338A
-
- I/O Controller
+ Sega Model 1/2 I/O RAM Abstraction
***************************************************************************/
#include "emu.h"
-#include "315-5338a.h"
+#include "m1io.h"
//#define VERBOSE 1
#include "logmacro.h"
@@ -19,7 +17,7 @@
// DEVICE DEFINITIONS
//**************************************************************************
-DEFINE_DEVICE_TYPE(SEGA_315_5338A, sega_315_5338a_device, "315_5338a", "315-5338A I/O Controller")
+DEFINE_DEVICE_TYPE(SEGA_M1IO, m1io_device, "m1io", "Sega Model 1/2 I/O RAM")
//**************************************************************************
@@ -27,11 +25,11 @@ DEFINE_DEVICE_TYPE(SEGA_315_5338A, sega_315_5338a_device, "315_5338a", "315-5338
//**************************************************************************
//-------------------------------------------------
-// sega_315_5338a_device - constructor
+// m1io_device - constructor
//-------------------------------------------------
-sega_315_5338a_device::sega_315_5338a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- device_t(mconfig, SEGA_315_5338A, tag, owner, clock),
+m1io_device::m1io_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
+ device_t(mconfig, SEGA_M1IO, tag, owner, clock),
m_an_cb{ {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this} },
m_di_cb{ {*this}, {*this}, {*this} },
m_do_cb(*this),
@@ -43,7 +41,7 @@ sega_315_5338a_device::sega_315_5338a_device(const machine_config &mconfig, cons
// device_start - device-specific startup
//-------------------------------------------------
-void sega_315_5338a_device::device_start()
+void m1io_device::device_start()
{
// resolve callbacks
for (int i = 0; i < 8; i++)
@@ -60,7 +58,7 @@ void sega_315_5338a_device::device_start()
// INTERFACE
//**************************************************************************
-READ8_MEMBER( sega_315_5338a_device::read )
+READ8_MEMBER( m1io_device::read )
{
uint8_t data = 0xff;
@@ -96,7 +94,7 @@ READ8_MEMBER( sega_315_5338a_device::read )
return data;
}
-WRITE8_MEMBER( sega_315_5338a_device::write )
+WRITE8_MEMBER( m1io_device::write )
{
LOG("WR %02x = %02x\n", offset, data);
diff --git a/src/mame/machine/m1io.h b/src/mame/machine/m1io.h
new file mode 100644
index 00000000000..4700d053b5a
--- /dev/null
+++ b/src/mame/machine/m1io.h
@@ -0,0 +1,98 @@
+// license: BSD-3-Clause
+// copyright-holders: Dirk Best
+/***************************************************************************
+
+ Sega Model 1/2 I/O RAM Abstraction
+
+ This device handles the 16 bytes of dual-port RAM that are used to
+ communicate with the I/O board. It should go away once we properly
+ emulate the I/O boards.
+
+***************************************************************************/
+
+#ifndef MAME_MACHINE_M1IO_H
+#define MAME_MACHINE_M1IO_H
+
+#pragma once
+
+//**************************************************************************
+// INTERFACE CONFIGURATION MACROS
+//**************************************************************************
+
+#define MCFG_M1IO_AN0_CB(_devcb) \
+ devcb = &downcast<m1io_device &>(*device).set_an_callback(DEVCB_##_devcb, 0);
+
+#define MCFG_M1IO_AN1_CB(_devcb) \
+ devcb = &downcast<m1io_device &>(*device).set_an_callback(DEVCB_##_devcb, 1);
+
+#define MCFG_M1IO_AN2_CB(_devcb) \
+ devcb = &downcast<m1io_device &>(*device).set_an_callback(DEVCB_##_devcb, 2);
+
+#define MCFG_M1IO_AN3_CB(_devcb) \
+ devcb = &downcast<m1io_device &>(*device).set_an_callback(DEVCB_##_devcb, 3);
+
+#define MCFG_M1IO_AN4_CB(_devcb) \
+ devcb = &downcast<m1io_device &>(*device).set_an_callback(DEVCB_##_devcb, 4);
+
+#define MCFG_M1IO_AN5_CB(_devcb) \
+ devcb = &downcast<m1io_device &>(*device).set_an_callback(DEVCB_##_devcb, 5);
+
+#define MCFG_M1IO_AN6_CB(_devcb) \
+ devcb = &downcast<m1io_device &>(*device).set_an_callback(DEVCB_##_devcb, 6);
+
+#define MCFG_M1IO_AN7_CB(_devcb) \
+ devcb = &downcast<m1io_device &>(*device).set_an_callback(DEVCB_##_devcb, 7);
+
+#define MCFG_M1IO_DI0_CB(_devcb) \
+ devcb = &downcast<m1io_device &>(*device).set_di_callback(DEVCB_##_devcb, 0);
+
+#define MCFG_M1IO_DI1_CB(_devcb) \
+ devcb = &downcast<m1io_device &>(*device).set_di_callback(DEVCB_##_devcb, 1);
+
+#define MCFG_M1IO_DI2_CB(_devcb) \
+ devcb = &downcast<m1io_device &>(*device).set_di_callback(DEVCB_##_devcb, 2);
+
+#define MCFG_M1IO_DO_CB(_devcb) \
+ devcb = &downcast<m1io_device &>(*device).set_do_callback(DEVCB_##_devcb);
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class m1io_device : public device_t
+{
+public:
+ // construction/destruction
+ m1io_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+ // configuration
+ template <class Object> devcb_base &set_an_callback(Object &&cb, int index)
+ { return m_an_cb[index].set_callback(std::forward<Object>(cb)); }
+
+ template <class Object> devcb_base &set_di_callback(Object &&cb, int index)
+ { return m_di_cb[index].set_callback(std::forward<Object>(cb)); }
+
+ template <class Object> devcb_base &set_do_callback(Object &&cb)
+ { return m_do_cb.set_callback(std::forward<Object>(cb)); }
+
+ DECLARE_READ8_MEMBER(read);
+ DECLARE_WRITE8_MEMBER(write);
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
+private:
+ // callbacks
+ devcb_read8 m_an_cb[8];
+ devcb_read8 m_di_cb[3];
+ devcb_write8 m_do_cb;
+
+ uint8_t m_out;
+};
+
+// device type definition
+DECLARE_DEVICE_TYPE(SEGA_M1IO, m1io_device)
+
+#endif // MAME_MACHINE_M1IO_H