Previous 15994 Revisions Next

r14318 Thursday 2nd February, 2012 at 14:06:47 UTC by Miodrag Milanović
Added Covox Stereo-On-1 (no whatsnew)
[src/mess/machine]cntr_covox.c cntr_covox.h pc_lpt.c

src/mess/machine/pc_lpt.c
r14317r14318
5555static SLOT_INTERFACE_START(pc_centronics)
5656   SLOT_INTERFACE("printer", CENTRONICS_PRINTER)
5757   SLOT_INTERFACE("covox", CENTRONICS_COVOX)
58   SLOT_INTERFACE("covox_stereo", CENTRONICS_COVOX_STEREO)
5859SLOT_INTERFACE_END
5960
6061static MACHINE_CONFIG_FRAGMENT( pc_lpt )
r14317r14318
210211{
211212   pc_lpt_state *lpt = get_safe_token(device);
212213
213   logerror("pc_lpt_control_w: 0x%02x\n", data);
214//   logerror("pc_lpt_control_w: 0x%02x\n", data);
214215
215216   /* save to latch */
216217   lpt->strobe = BIT(data, 0);
src/mess/machine/cntr_covox.c
r14317r14318
5555void centronics_covox_device::write(UINT8 data)
5656{
5757   dac_w(m_dac, 0, data);
58}
59
60//**************************************************************************
61//  COVOX STEREO DEVICE
62//**************************************************************************
63
64// device type definition
65const device_type CENTRONICS_COVOX_STEREO = &device_creator<centronics_covox_stereo_device>;
66
67static MACHINE_CONFIG_FRAGMENT( covox_stereo )
68   /* sound hardware */
69   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
70
71   MCFG_SOUND_ADD("dac_left", DAC, 0)
72   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
73
74   MCFG_SOUND_ADD("dac_right", DAC, 0)
75   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
76MACHINE_CONFIG_END
77
78
79/***************************************************************************
80    IMPLEMENTATION
81***************************************************************************/
82//-------------------------------------------------
83//  centronics_covox_stereo_device - constructor
84//-------------------------------------------------
85
86centronics_covox_stereo_device::centronics_covox_stereo_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
87    : device_t(mconfig, CENTRONICS_COVOX_STEREO, "Covox (Stereo-in-1)", tag, owner, clock),
88     device_centronics_peripheral_interface( mconfig, *this )
89{
90}
91//-------------------------------------------------
92//  machine_config_additions - device-specific
93//  machine configurations
94//-------------------------------------------------
95
96machine_config_constructor centronics_covox_stereo_device::device_mconfig_additions() const
97{
98   return MACHINE_CONFIG_NAME( covox_stereo );
99}
100
101
102void centronics_covox_stereo_device::device_start()
103{
104   m_dac_left  = subdevice("dac_left");
105   m_dac_right = subdevice("dac_right");
106}
107
108void centronics_covox_stereo_device::write(UINT8 data)
109{
110   if (m_strobe)  dac_w(m_dac_left, 0, data);
111   if (m_auto_fd) dac_w(m_dac_right, 0, data);
58112}
No newline at end of file
src/mess/machine/cntr_covox.h
r14317r14318
3232// device type definition
3333extern const device_type CENTRONICS_COVOX;
3434
35// ======================> centronics_covox_stereo_device
36
37class centronics_covox_stereo_device :
38      public device_t,
39      public device_centronics_peripheral_interface
40{
41public:
42    // construction/destruction
43    centronics_covox_stereo_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
44
45   // optional information overrides
46   virtual machine_config_constructor device_mconfig_additions() const;
47   
48   virtual void write(UINT8 data);
49protected:
50    // device-level overrides
51    virtual void device_start();
52private:
53   device_t *m_dac_left;
54   device_t *m_dac_right;
55};
56// device type definition
57extern const device_type CENTRONICS_COVOX_STEREO;
58
3559#endif /* __CENTRONICS_COVOX_H__ */

Previous 15994 Revisions Next


© 1998-2018 The MESS Team