diff options
-rw-r--r-- | .gitattributes | 2 | ||||
-rw-r--r-- | src/emu/bus/bus.mak | 1 | ||||
-rw-r--r-- | src/emu/bus/centronics/digiblst.c | 61 | ||||
-rw-r--r-- | src/emu/bus/centronics/digiblst.h | 58 | ||||
-rw-r--r-- | src/mess/drivers/amstrad.c | 12 | ||||
-rw-r--r-- | src/mess/includes/amstrad.h | 6 |
6 files changed, 139 insertions, 1 deletions
diff --git a/.gitattributes b/.gitattributes index 4c607b7bf50..717a07c3aa2 100644 --- a/.gitattributes +++ b/.gitattributes @@ -735,6 +735,8 @@ src/emu/bus/centronics/covox.c svneol=native#text/plain src/emu/bus/centronics/covox.h svneol=native#text/plain src/emu/bus/centronics/ctronics.c svneol=native#text/plain src/emu/bus/centronics/ctronics.h svneol=native#text/plain +src/emu/bus/centronics/digiblst.c svneol=native#text/plain +src/emu/bus/centronics/digiblst.h svneol=native#text/plain src/emu/bus/centronics/dsjoy.c svneol=native#text/plain src/emu/bus/centronics/dsjoy.h svneol=native#text/plain src/emu/bus/centronics/epson_ex800.c svneol=native#text/plain diff --git a/src/emu/bus/bus.mak b/src/emu/bus/bus.mak index 1b356c19fbb..99475416480 100644 --- a/src/emu/bus/bus.mak +++ b/src/emu/bus/bus.mak @@ -761,6 +761,7 @@ BUSOBJS += $(BUSOBJ)/centronics/dsjoy.o BUSOBJS += $(BUSOBJ)/centronics/epson_ex800.o BUSOBJS += $(BUSOBJ)/centronics/epson_lx800.o BUSOBJS += $(BUSOBJ)/centronics/printer.o +BUSOBJS += $(BUSOBJ)/centronics/digiblst.o $(BUSOBJ)/centronics/epson_ex800.o: $(EMUOBJ)/layout/ex800.lh $(BUSOBJ)/centronics/epson_lx800.o: $(EMUOBJ)/layout/lx800.lh endif diff --git a/src/emu/bus/centronics/digiblst.c b/src/emu/bus/centronics/digiblst.c new file mode 100644 index 00000000000..b03189d0206 --- /dev/null +++ b/src/emu/bus/centronics/digiblst.c @@ -0,0 +1,61 @@ +/* + * digiblst.c + * + * Created on: 23/08/2014 + */ + +#include "emu.h" +#include "sound/dac.h" +#include "digiblst.h" + +//************************************************************************** +// COVOX DEVICE +//************************************************************************** + +// device type definition +const device_type CENTRONICS_DIGIBLASTER = &device_creator<centronics_digiblaster_device>; + +static MACHINE_CONFIG_FRAGMENT( digiblst ) + /* sound hardware */ + MCFG_SPEAKER_STANDARD_MONO("mono") + + MCFG_SOUND_ADD("dac", DAC, 0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) +MACHINE_CONFIG_END + + +/*************************************************************************** + IMPLEMENTATION +***************************************************************************/ +//------------------------------------------------- +// centronics_covox_device - constructor +//------------------------------------------------- + +centronics_digiblaster_device::centronics_digiblaster_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : device_t(mconfig, CENTRONICS_DIGIBLASTER, "Digiblaster (DIY)", tag, owner, clock, "digiblst", __FILE__), + device_centronics_peripheral_interface( mconfig, *this ), + m_dac(*this, "dac"), + m_data(0) +{ +} + +//------------------------------------------------- +// machine_config_additions - device-specific +// machine configurations +//------------------------------------------------- + +machine_config_constructor centronics_digiblaster_device::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME( digiblst ); +} + +void centronics_digiblaster_device::device_start() +{ + save_item(NAME(m_data)); +} + +void centronics_digiblaster_device::update_dac() +{ + if (started()) + m_dac->write_unsigned8(m_data); +} diff --git a/src/emu/bus/centronics/digiblst.h b/src/emu/bus/centronics/digiblst.h new file mode 100644 index 00000000000..8ff24c8c434 --- /dev/null +++ b/src/emu/bus/centronics/digiblst.h @@ -0,0 +1,58 @@ +/* + * digiblst.h + * + * Digiblaster - a DIY printer port DAC for the Amstrad CPC + * Printed in the German magazine CPC Amstrad International issue 8-9/1991 + * Uses Strobe (inverted on the CPC) for the 8th bit (CPCs only have 7-bit printer ports) + * + * Code borrows from the Covox Speech Thing device. + * + * Created on: 23/08/2014 + */ + +#ifndef DIGIBLST_H_ +#define DIGIBLST_H_ + +#pragma once + +#include "ctronics.h" +#include "sound/dac.h" + +// ======================> centronics_covox_device + +class centronics_digiblaster_device : public device_t, + public device_centronics_peripheral_interface +{ +public: + // construction/destruction + centronics_digiblaster_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + // optional information overrides + virtual machine_config_constructor device_mconfig_additions() const; + +protected: + // device-level overrides + virtual void device_start(); + + virtual DECLARE_WRITE_LINE_MEMBER( input_data0 ) { if (state) m_data |= 0x01; else m_data &= ~0x01; update_dac(); } + virtual DECLARE_WRITE_LINE_MEMBER( input_data1 ) { if (state) m_data |= 0x02; else m_data &= ~0x02; update_dac(); } + virtual DECLARE_WRITE_LINE_MEMBER( input_data2 ) { if (state) m_data |= 0x04; else m_data &= ~0x04; update_dac(); } + virtual DECLARE_WRITE_LINE_MEMBER( input_data3 ) { if (state) m_data |= 0x08; else m_data &= ~0x08; update_dac(); } + virtual DECLARE_WRITE_LINE_MEMBER( input_data4 ) { if (state) m_data |= 0x10; else m_data &= ~0x10; update_dac(); } + virtual DECLARE_WRITE_LINE_MEMBER( input_data5 ) { if (state) m_data |= 0x20; else m_data &= ~0x20; update_dac(); } + virtual DECLARE_WRITE_LINE_MEMBER( input_data6 ) { if (state) m_data |= 0x40; else m_data &= ~0x40; update_dac(); } + virtual DECLARE_WRITE_LINE_MEMBER( input_strobe ) { if (state) m_data &= ~0x80; else m_data |= 0x80; update_dac(); } + +private: + required_device<dac_device> m_dac; + + void update_dac(); + + UINT8 m_data; +}; + +// device type definition +extern const device_type CENTRONICS_DIGIBLASTER; + + +#endif /* DIGIBLST_H_ */ diff --git a/src/mess/drivers/amstrad.c b/src/mess/drivers/amstrad.c index e09868b3578..0350a47d8c1 100644 --- a/src/mess/drivers/amstrad.c +++ b/src/mess/drivers/amstrad.c @@ -830,6 +830,16 @@ SLOT_INTERFACE_START(cpcplus_exp_cards) SLOT_INTERFACE("amdrum", CPC_AMDRUM) SLOT_INTERFACE_END +SLOT_INTERFACE_START(amstrad_printers) + SLOT_INTERFACE("pl80", COMX_PL80) + SLOT_INTERFACE("ex800", EPSON_EX800) + SLOT_INTERFACE("lx800", EPSON_LX800) + SLOT_INTERFACE("lx810l", EPSON_LX810L) + SLOT_INTERFACE("ap2000", EPSON_AP2000) + SLOT_INTERFACE("printer", CENTRONICS_PRINTER) + SLOT_INTERFACE("digiblst", CENTRONICS_DIGIBLASTER) +SLOT_INTERFACE_END + static MACHINE_CONFIG_START( amstrad_nofdc, amstrad_state ) /* Machine hardware */ MCFG_CPU_ADD("maincpu", Z80, XTAL_16MHz / 4) @@ -877,7 +887,7 @@ static MACHINE_CONFIG_START( amstrad_nofdc, amstrad_state ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) /* printer */ - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") + MCFG_CENTRONICS_ADD("centronics", amstrad_printers, "printer") MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(amstrad_state, write_centronics_busy)) /* snapshot */ diff --git a/src/mess/includes/amstrad.h b/src/mess/includes/amstrad.h index 8bc88fb9203..00e0e873bf4 100644 --- a/src/mess/includes/amstrad.h +++ b/src/mess/includes/amstrad.h @@ -25,6 +25,12 @@ #include "machine/ram.h" #include "imagedev/cassette.h" #include "bus/centronics/ctronics.h" +#include "bus/centronics/comxpl80.h" +#include "bus/centronics/epson_ex800.h" +#include "bus/centronics/epson_lx800.h" +#include "bus/centronics/printer.h" +#include "bus/centronics/digiblst.h" + /**************************** * Gate Array data (CPC) - |