summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/machine/8237dma.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu/machine/8237dma.c')
-rw-r--r--src/emu/machine/8237dma.c79
1 files changed, 36 insertions, 43 deletions
diff --git a/src/emu/machine/8237dma.c b/src/emu/machine/8237dma.c
index 0648e2925ff..3537fd832ec 100644
--- a/src/emu/machine/8237dma.c
+++ b/src/emu/machine/8237dma.c
@@ -45,10 +45,20 @@
//**************************************************************************
-// DEVICE CONFIGURATION
+// LIVE DEVICE
//**************************************************************************
-GENERIC_DEVICE_CONFIG_SETUP(i8237, "Intel 8237")
+// device type definition
+const device_type I8237 = &device_creator<i8237_device>;
+
+//-------------------------------------------------
+// i8237_device - constructor
+//-------------------------------------------------
+
+i8237_device::i8237_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, I8237, "Intel 8237", tag, owner, clock)
+{
+}
//-------------------------------------------------
// device_config_complete - perform any
@@ -56,7 +66,7 @@ GENERIC_DEVICE_CONFIG_SETUP(i8237, "Intel 8237")
// complete
//-------------------------------------------------
-void i8237_device_config::device_config_complete()
+void i8237_device::device_config_complete()
{
// inherit a copy of the static data
const i8237_interface *intf = reinterpret_cast<const i8237_interface *>(static_config());
@@ -68,43 +78,26 @@ void i8237_device_config::device_config_complete()
// or initialize to defaults if none provided
else
{
- memset(&m_out_hrq_func, 0, sizeof(m_out_hrq_func));
- memset(&m_out_eop_func, 0, sizeof(m_out_eop_func));
- memset(&m_in_memr_func, 0, sizeof(m_in_memr_func));
- memset(&m_out_memw_func, 0, sizeof(m_out_memw_func));
- memset(&m_in_ior_func[0], 0, sizeof(m_in_ior_func[0]));
- memset(&m_in_ior_func[1], 0, sizeof(m_in_ior_func[1]));
- memset(&m_in_ior_func[2], 0, sizeof(m_in_ior_func[2]));
- memset(&m_in_ior_func[3], 0, sizeof(m_in_ior_func[3]));
- memset(&m_out_iow_func[0], 0, sizeof(m_out_iow_func[0]));
- memset(&m_out_iow_func[1], 0, sizeof(m_out_iow_func[1]));
- memset(&m_out_iow_func[2], 0, sizeof(m_out_iow_func[2]));
- memset(&m_out_iow_func[3], 0, sizeof(m_out_iow_func[3]));
- memset(&m_out_dack_func[0], 0, sizeof(m_out_dack_func[0]));
- memset(&m_out_dack_func[1], 0, sizeof(m_out_dack_func[1]));
- memset(&m_out_dack_func[2], 0, sizeof(m_out_dack_func[2]));
- memset(&m_out_dack_func[3], 0, sizeof(m_out_dack_func[3]));
+ memset(&m_out_hrq_cb, 0, sizeof(m_out_hrq_cb));
+ memset(&m_out_eop_cb, 0, sizeof(m_out_eop_cb));
+ memset(&m_in_memr_cb, 0, sizeof(m_in_memr_cb));
+ memset(&m_out_memw_cb, 0, sizeof(m_out_memw_cb));
+ memset(&m_in_ior_cb[0], 0, sizeof(m_in_ior_cb[0]));
+ memset(&m_in_ior_cb[1], 0, sizeof(m_in_ior_cb[1]));
+ memset(&m_in_ior_cb[2], 0, sizeof(m_in_ior_cb[2]));
+ memset(&m_in_ior_cb[3], 0, sizeof(m_in_ior_cb[3]));
+ memset(&m_out_iow_cb[0], 0, sizeof(m_out_iow_cb[0]));
+ memset(&m_out_iow_cb[1], 0, sizeof(m_out_iow_cb[1]));
+ memset(&m_out_iow_cb[2], 0, sizeof(m_out_iow_cb[2]));
+ memset(&m_out_iow_cb[3], 0, sizeof(m_out_iow_cb[3]));
+ memset(&m_out_dack_cb[0], 0, sizeof(m_out_dack_cb[0]));
+ memset(&m_out_dack_cb[1], 0, sizeof(m_out_dack_cb[1]));
+ memset(&m_out_dack_cb[2], 0, sizeof(m_out_dack_cb[2]));
+ memset(&m_out_dack_cb[3], 0, sizeof(m_out_dack_cb[3]));
}
}
-
-//**************************************************************************
-// LIVE DEVICE
-//**************************************************************************
-
-const device_type I8237 = i8237_device_config::static_alloc_device_config;
-
-//-------------------------------------------------
-// i8237_device - constructor
-//-------------------------------------------------
-
-i8237_device::i8237_device(running_machine &_machine, const i8237_device_config &config)
- : device_t(_machine, config),
- m_config(config)
-{
-}
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -112,16 +105,16 @@ i8237_device::i8237_device(running_machine &_machine, const i8237_device_config
void i8237_device::device_start()
{
/* resolve callbacks */
- devcb_resolve_write_line(&m_out_hrq_func, &m_config.m_out_hrq_func, this);
- devcb_resolve_write_line(&m_out_eop_func, &m_config.m_out_eop_func, this);
- devcb_resolve_read8(&m_in_memr_func, &m_config.m_in_memr_func, this);
- devcb_resolve_write8(&m_out_memw_func, &m_config.m_out_memw_func, this);
+ devcb_resolve_write_line(&m_out_hrq_func, &m_out_hrq_cb, this);
+ devcb_resolve_write_line(&m_out_eop_func, &m_out_eop_cb, this);
+ devcb_resolve_read8(&m_in_memr_func, &m_in_memr_cb, this);
+ devcb_resolve_write8(&m_out_memw_func, &m_out_memw_cb, this);
for (int i = 0; i < 4; i++)
{
- devcb_resolve_read8(&m_chan[i].m_in_ior_func, &m_config.m_in_ior_func[i], this);
- devcb_resolve_write8(&m_chan[i].m_out_iow_func, &m_config.m_out_iow_func[i], this);
- devcb_resolve_write_line(&m_chan[i].m_out_dack_func, &m_config.m_out_dack_func[i], this);
+ devcb_resolve_read8(&m_chan[i].m_in_ior_func, &m_in_ior_cb[i], this);
+ devcb_resolve_write8(&m_chan[i].m_out_iow_func, &m_out_iow_cb[i], this);
+ devcb_resolve_write_line(&m_chan[i].m_out_dack_func, &m_out_dack_cb[i], this);
}
m_timer = machine().scheduler().timer_alloc(FUNC(i8237_timerproc_callback), (void *)this);