Previous 199869 Revisions Next

r31748 Saturday 23rd August, 2014 at 03:11:34 UTC by Barry Rodewald
amstrad: added Digiblaster printer-port device [Barry Rodewald]
[src/emu/bus]bus.mak
[src/emu/bus/centronics]digiblst.c* digiblst.h*
[src/mess/drivers]amstrad.c
[src/mess/includes]amstrad.h

trunk/src/emu/bus/centronics/digiblst.c
r0r31748
1/*
2 * digiblst.c
3 *
4 *  Created on: 23/08/2014
5 */
6
7#include "emu.h"
8#include "sound/dac.h"
9#include "digiblst.h"
10
11//**************************************************************************
12//  COVOX DEVICE
13//**************************************************************************
14
15// device type definition
16const device_type CENTRONICS_DIGIBLASTER = &device_creator<centronics_digiblaster_device>;
17
18static MACHINE_CONFIG_FRAGMENT( digiblst )
19   /* sound hardware */
20   MCFG_SPEAKER_STANDARD_MONO("mono")
21
22   MCFG_SOUND_ADD("dac", DAC, 0)
23   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
24MACHINE_CONFIG_END
25
26
27/***************************************************************************
28    IMPLEMENTATION
29***************************************************************************/
30//-------------------------------------------------
31//  centronics_covox_device - constructor
32//-------------------------------------------------
33
34centronics_digiblaster_device::centronics_digiblaster_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
35   : device_t(mconfig, CENTRONICS_DIGIBLASTER, "Digiblaster (DIY)", tag, owner, clock, "digiblst", __FILE__),
36   device_centronics_peripheral_interface( mconfig, *this ),
37   m_dac(*this, "dac"),
38   m_data(0)
39{
40}
41
42//-------------------------------------------------
43//  machine_config_additions - device-specific
44//  machine configurations
45//-------------------------------------------------
46
47machine_config_constructor centronics_digiblaster_device::device_mconfig_additions() const
48{
49   return MACHINE_CONFIG_NAME( digiblst );
50}
51
52void centronics_digiblaster_device::device_start()
53{
54   save_item(NAME(m_data));
55}
56
57void centronics_digiblaster_device::update_dac()
58{
59   if (started())
60      m_dac->write_unsigned8(m_data);
61}
Property changes on: trunk/src/emu/bus/centronics/digiblst.c
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/emu/bus/centronics/digiblst.h
r0r31748
1/*
2 * digiblst.h
3 *
4 *   Digiblaster - a DIY printer port DAC for the Amstrad CPC
5 *   Printed in the German magazine CPC Amstrad International issue 8-9/1991
6 *   Uses Strobe (inverted on the CPC) for the 8th bit (CPCs only have 7-bit printer ports)
7 *
8 *   Code borrows from the Covox Speech Thing device.
9 *
10 *  Created on: 23/08/2014
11 */
12
13#ifndef DIGIBLST_H_
14#define DIGIBLST_H_
15
16#pragma once
17
18#include "ctronics.h"
19#include "sound/dac.h"
20
21// ======================> centronics_covox_device
22
23class centronics_digiblaster_device : public device_t,
24   public device_centronics_peripheral_interface
25{
26public:
27   // construction/destruction
28   centronics_digiblaster_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
29
30   // optional information overrides
31   virtual machine_config_constructor device_mconfig_additions() const;
32
33protected:
34   // device-level overrides
35   virtual void device_start();
36
37   virtual DECLARE_WRITE_LINE_MEMBER( input_data0 ) { if (state) m_data |= 0x01; else m_data &= ~0x01; update_dac(); }
38   virtual DECLARE_WRITE_LINE_MEMBER( input_data1 ) { if (state) m_data |= 0x02; else m_data &= ~0x02; update_dac(); }
39   virtual DECLARE_WRITE_LINE_MEMBER( input_data2 ) { if (state) m_data |= 0x04; else m_data &= ~0x04; update_dac(); }
40   virtual DECLARE_WRITE_LINE_MEMBER( input_data3 ) { if (state) m_data |= 0x08; else m_data &= ~0x08; update_dac(); }
41   virtual DECLARE_WRITE_LINE_MEMBER( input_data4 ) { if (state) m_data |= 0x10; else m_data &= ~0x10; update_dac(); }
42   virtual DECLARE_WRITE_LINE_MEMBER( input_data5 ) { if (state) m_data |= 0x20; else m_data &= ~0x20; update_dac(); }
43   virtual DECLARE_WRITE_LINE_MEMBER( input_data6 ) { if (state) m_data |= 0x40; else m_data &= ~0x40; update_dac(); }
44   virtual DECLARE_WRITE_LINE_MEMBER( input_strobe ) { if (state) m_data &= ~0x80; else m_data |= 0x80; update_dac(); }
45
46private:
47   required_device<dac_device> m_dac;
48
49   void update_dac();
50
51   UINT8 m_data;
52};
53
54// device type definition
55extern const device_type CENTRONICS_DIGIBLASTER;
56
57
58#endif /* DIGIBLST_H_ */
Property changes on: trunk/src/emu/bus/centronics/digiblst.h
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/emu/bus/bus.mak
r31747r31748
761761BUSOBJS += $(BUSOBJ)/centronics/epson_ex800.o
762762BUSOBJS += $(BUSOBJ)/centronics/epson_lx800.o
763763BUSOBJS += $(BUSOBJ)/centronics/printer.o
764BUSOBJS += $(BUSOBJ)/centronics/digiblst.o
764765$(BUSOBJ)/centronics/epson_ex800.o:    $(EMUOBJ)/layout/ex800.lh
765766$(BUSOBJ)/centronics/epson_lx800.o:    $(EMUOBJ)/layout/lx800.lh
766767endif
trunk/src/mess/includes/amstrad.h
r31747r31748
2525#include "machine/ram.h"
2626#include "imagedev/cassette.h"
2727#include "bus/centronics/ctronics.h"
28#include "bus/centronics/comxpl80.h"
29#include "bus/centronics/epson_ex800.h"
30#include "bus/centronics/epson_lx800.h"
31#include "bus/centronics/printer.h"
32#include "bus/centronics/digiblst.h"
2833
34
2935/****************************
3036 * Gate Array data (CPC) -
3137 ****************************/
trunk/src/mess/drivers/amstrad.c
r31747r31748
830830   SLOT_INTERFACE("amdrum", CPC_AMDRUM)
831831SLOT_INTERFACE_END
832832
833SLOT_INTERFACE_START(amstrad_printers)
834   SLOT_INTERFACE("pl80", COMX_PL80)
835   SLOT_INTERFACE("ex800", EPSON_EX800)
836   SLOT_INTERFACE("lx800", EPSON_LX800)
837   SLOT_INTERFACE("lx810l", EPSON_LX810L)
838   SLOT_INTERFACE("ap2000", EPSON_AP2000)
839   SLOT_INTERFACE("printer", CENTRONICS_PRINTER)
840   SLOT_INTERFACE("digiblst", CENTRONICS_DIGIBLASTER)
841SLOT_INTERFACE_END
842
833843static MACHINE_CONFIG_START( amstrad_nofdc, amstrad_state )
834844   /* Machine hardware */
835845   MCFG_CPU_ADD("maincpu", Z80, XTAL_16MHz / 4)
r31747r31748
877887   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
878888
879889   /* printer */
880   MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer")
890   MCFG_CENTRONICS_ADD("centronics", amstrad_printers, "printer")
881891   MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(amstrad_state, write_centronics_busy))
882892
883893   /* snapshot */

Previous 199869 Revisions Next


© 1997-2024 The MAME Team