summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/vtech/ioexp/printer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/vtech/ioexp/printer.cpp')
-rw-r--r--src/devices/bus/vtech/ioexp/printer.cpp30
1 files changed, 18 insertions, 12 deletions
diff --git a/src/devices/bus/vtech/ioexp/printer.cpp b/src/devices/bus/vtech/ioexp/printer.cpp
index fa452ce3928..b5eaa4e8a4b 100644
--- a/src/devices/bus/vtech/ioexp/printer.cpp
+++ b/src/devices/bus/vtech/ioexp/printer.cpp
@@ -20,11 +20,25 @@
DEFINE_DEVICE_TYPE(VTECH_PRINTER_INTERFACE, vtech_printer_interface_device, "vtech_printer", "Laser/VZ Printer Interface")
//-------------------------------------------------
+// io_map - memory space address map
+//-------------------------------------------------
+
+void vtech_printer_interface_device::io_map(address_map &map)
+{
+ map.unmap_value_high();
+ map(0x00, 0x00).r(FUNC(vtech_printer_interface_device::busy_r));
+ map(0x0d, 0x0d).w(FUNC(vtech_printer_interface_device::strobe_w));
+ map(0x0e, 0x0e).w(m_latch, FUNC(output_latch_device::write));
+}
+
+//-------------------------------------------------
// device_add_mconfig - add device configuration
//-------------------------------------------------
void vtech_printer_interface_device::device_add_mconfig(machine_config &config)
{
+ vtech_ioexp_device::device_add_mconfig(config);
+
CENTRONICS(config, m_centronics, centronics_devices, "printer");
m_centronics->busy_handler().set(FUNC(vtech_printer_interface_device::busy_w));
@@ -42,8 +56,7 @@ void vtech_printer_interface_device::device_add_mconfig(machine_config &config)
//-------------------------------------------------
vtech_printer_interface_device::vtech_printer_interface_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- device_t(mconfig, VTECH_PRINTER_INTERFACE, tag, owner, clock),
- device_vtech_ioexp_interface(mconfig, *this),
+ vtech_ioexp_device(mconfig, VTECH_PRINTER_INTERFACE, tag, owner, clock),
m_centronics(*this, "centronics"),
m_latch(*this, "latch"),
m_centronics_busy(0)
@@ -56,17 +69,10 @@ vtech_printer_interface_device::vtech_printer_interface_device(const machine_con
void vtech_printer_interface_device::device_start()
{
-}
-
-//-------------------------------------------------
-// device_reset - device-specific reset
-//-------------------------------------------------
+ vtech_ioexp_device::device_start();
-void vtech_printer_interface_device::device_reset()
-{
- io_space().install_read_handler(0x00, 0x00, read8smo_delegate(*this, FUNC(vtech_printer_interface_device::busy_r)));
- io_space().install_write_handler(0x0d, 0x0d, write8smo_delegate(*this, FUNC(vtech_printer_interface_device::strobe_w)));
- io_space().install_write_handler(0x0e, 0x0e, write8smo_delegate(*m_latch, FUNC(output_latch_device::write)));
+ // register for save states
+ save_item(NAME(m_centronics_busy));
}