mirror of
https://github.com/holub/mame
synced 2025-04-21 16:01:56 +03:00
amstrad: added Digiblaster printer-port device [Barry Rodewald]
This commit is contained in:
parent
fdedeade69
commit
4836359c17
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -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
|
||||
|
@ -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
|
||||
|
61
src/emu/bus/centronics/digiblst.c
Normal file
61
src/emu/bus/centronics/digiblst.c
Normal file
@ -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);
|
||||
}
|
58
src/emu/bus/centronics/digiblst.h
Normal file
58
src/emu/bus/centronics/digiblst.h
Normal file
@ -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_ */
|
@ -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 */
|
||||
|
@ -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) -
|
||||
|
Loading…
Reference in New Issue
Block a user