diff options
author | Dirk Best <mail@dirk-best.de> | 2016-03-19 19:03:20 +0100 |
---|---|---|
committer | Dirk Best <mail@dirk-best.de> | 2016-03-20 14:23:27 +0100 |
commit | 55ebe70ca956d83e401bd4e0a60c60f38e8c91ad (patch) | |
tree | 88362344065a823caa959c1a06a57660fa808e8a /src/devices/bus | |
parent | d18e9f343c25d76e0618c98de6a7a4672e4e5fff (diff) |
svi318: add centronics interface card (sv802)
Diffstat (limited to 'src/devices/bus')
-rw-r--r-- | src/devices/bus/svi3x8/slot/cards.cpp | 1 | ||||
-rw-r--r-- | src/devices/bus/svi3x8/slot/cards.h | 1 | ||||
-rw-r--r-- | src/devices/bus/svi3x8/slot/sv802.cpp | 88 | ||||
-rw-r--r-- | src/devices/bus/svi3x8/slot/sv802.h | 51 | ||||
-rw-r--r-- | src/devices/bus/svi3x8/slot/sv805.cpp | 2 |
5 files changed, 142 insertions, 1 deletions
diff --git a/src/devices/bus/svi3x8/slot/cards.cpp b/src/devices/bus/svi3x8/slot/cards.cpp index aedcb736d03..1547443b136 100644 --- a/src/devices/bus/svi3x8/slot/cards.cpp +++ b/src/devices/bus/svi3x8/slot/cards.cpp @@ -10,6 +10,7 @@ SLOT_INTERFACE_START( svi_slot_cards ) SLOT_INTERFACE("sv801", SV801) + SLOT_INTERFACE("sv802", SV802) SLOT_INTERFACE("sv803", SV803) SLOT_INTERFACE("sv805", SV805) SLOT_INTERFACE("sv806", SV806) diff --git a/src/devices/bus/svi3x8/slot/cards.h b/src/devices/bus/svi3x8/slot/cards.h index 8bc3e31f1bc..d54b3f11b0b 100644 --- a/src/devices/bus/svi3x8/slot/cards.h +++ b/src/devices/bus/svi3x8/slot/cards.h @@ -13,6 +13,7 @@ #include "emu.h" #include "sv801.h" +#include "sv802.h" #include "sv803.h" #include "sv805.h" #include "sv806.h" diff --git a/src/devices/bus/svi3x8/slot/sv802.cpp b/src/devices/bus/svi3x8/slot/sv802.cpp new file mode 100644 index 00000000000..adeed63588b --- /dev/null +++ b/src/devices/bus/svi3x8/slot/sv802.cpp @@ -0,0 +1,88 @@ +// license:GPL-2.0+ +// copyright-holders:Dirk Best +/*************************************************************************** + + SV-802 Centronics Printer Interface for SVI-318/328 + +***************************************************************************/ + +#include "sv802.h" + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +const device_type SV802 = &device_creator<sv802_device>; + +//------------------------------------------------- +// machine_config_additions - device-specific +// machine configurations +//------------------------------------------------- + +static MACHINE_CONFIG_FRAGMENT( sv802 ) + MCFG_CENTRONICS_ADD("centronics", centronics_devices, "printer") + MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(sv802_device, busy_w)) + + MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics") +MACHINE_CONFIG_END + +machine_config_constructor sv802_device::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME( sv802 ); +} + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// sv802_device - constructor +//------------------------------------------------- + +sv802_device::sv802_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, SV805, "SV-802 Centronics Printer Interface", tag, owner, clock, "sv802", __FILE__), + device_svi_slot_interface(mconfig, *this), + m_centronics(*this, "centronics"), + m_cent_data_out(*this, "cent_data_out"), + m_busy(0) +{ +} + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void sv802_device::device_start() +{ + // register for savestates + save_item(NAME(m_busy)); +} + + +//************************************************************************** +// IMPLEMENTATION +//************************************************************************** + +READ8_MEMBER( sv802_device::iorq_r ) +{ + if (offset == 0x12) + return 0xfe | m_busy; + + return 0xff; +} + +WRITE8_MEMBER( sv802_device::iorq_w ) +{ + switch (offset) + { + case 0x10: m_cent_data_out->write(space, 0, data); break; + case 0x11: m_centronics->write_strobe(BIT(data, 0)); break; + } +} + +WRITE_LINE_MEMBER( sv802_device::busy_w ) +{ + m_busy = state; +} diff --git a/src/devices/bus/svi3x8/slot/sv802.h b/src/devices/bus/svi3x8/slot/sv802.h new file mode 100644 index 00000000000..0b363c035ed --- /dev/null +++ b/src/devices/bus/svi3x8/slot/sv802.h @@ -0,0 +1,51 @@ +// license:GPL-2.0+ +// copyright-holders:Dirk Best +/*************************************************************************** + + SV-802 Centronics Printer Interface for SVI-318/328 + +***************************************************************************/ + +#pragma once + +#ifndef __SVI3X8_SLOT_SV802_H__ +#define __SVI3X8_SLOT_SV802_H__ + +#include "emu.h" +#include "slot.h" +#include "machine/buffer.h" +#include "bus/centronics/ctronics.h" + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> sv802_device + +class sv802_device : public device_t, public device_svi_slot_interface +{ +public: + // construction/destruction + sv802_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + virtual DECLARE_READ8_MEMBER( iorq_r ) override; + virtual DECLARE_WRITE8_MEMBER( iorq_w ) override; + + DECLARE_WRITE_LINE_MEMBER( busy_w ); + +protected: + virtual machine_config_constructor device_mconfig_additions() const override; + virtual void device_start() override; + +private: + required_device<centronics_device> m_centronics; + required_device<output_latch_device> m_cent_data_out; + + int m_busy; +}; + +// device type definition +extern const device_type SV802; + +#endif // __SVI3X8_SLOT_SV802_H__ diff --git a/src/devices/bus/svi3x8/slot/sv805.cpp b/src/devices/bus/svi3x8/slot/sv805.cpp index d240e95f2e1..71ba5b69820 100644 --- a/src/devices/bus/svi3x8/slot/sv805.cpp +++ b/src/devices/bus/svi3x8/slot/sv805.cpp @@ -45,7 +45,7 @@ machine_config_constructor sv805_device::device_mconfig_additions() const //************************************************************************** //------------------------------------------------- -// sv806_device - constructor +// sv805_device - constructor //------------------------------------------------- sv805_device::sv805_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |