Previous 199869 Revisions Next

r28711 Wednesday 19th March, 2014 at 12:26:41 UTC by Osso
votrax_sc01_device: converted to devcb2 (nw)
[src/emu/sound]votrax.c votrax.h
[src/mame/audio]gottlieb.c
[src/mess/drivers]votrpss.c votrtnt.c

trunk/src/emu/sound/votrax.c
r28710r28711
9898   : device_t(mconfig, VOTRAX_SC01, "Votrax SC-01", tag, owner, clock, "votrax", __FILE__),
9999      device_sound_interface(mconfig, *this),
100100      m_stream(NULL),
101      m_phoneme_timer(NULL)
101      m_phoneme_timer(NULL),
102      m_request_cb(*this)
102103{
103104}
104105
105
106//-------------------------------------------------
107//  static_set_interface - configuration helper
108//  to set the interface
109//-------------------------------------------------
110
111void votrax_sc01_device::static_set_interface(device_t &device, const votrax_sc01_interface &interface)
112{
113   votrax_sc01_device &votrax = downcast<votrax_sc01_device &>(device);
114   static_cast<votrax_sc01_interface &>(votrax) = interface;
115}
116
117
118
119106//**************************************************************************
120107//  READ/WRITE HANDLERS
121108//**************************************************************************
r28710r28711
144131   m_latch_92 = 0;
145132
146133   // clear the request signal
147   m_request_func(m_request_state = m_internal_request = CLEAR_LINE);
134   m_request_cb(m_request_state = m_internal_request = CLEAR_LINE);
148135   m_phoneme_timer->adjust(attotime::zero);
149136}
150137
r28710r28711
11451132   m_phoneme = 0x3f;
11461133
11471134   // reset outputs
1148   m_request_func.resolve(m_request_cb, *this);
1135   m_request_cb.resolve_safe();
11491136   m_request_state = ASSERT_LINE;
11501137   m_internal_request = ASSERT_LINE;
11511138
r28710r28711
12371224
12381225   // reset inputs
12391226   m_phoneme = 0x3f;
1240   m_request_func(m_internal_request = m_request_state = ASSERT_LINE);
1227   m_request_cb(m_internal_request = m_request_state = ASSERT_LINE);
12411228
12421229   // reset timing circuit
12431230   m_master_clock = 0;
r28710r28711
13561343   if (m_internal_request == ASSERT_LINE)
13571344   {
13581345mame_printf_debug("%s: REQUEST\n", timer.machine().time().as_string(3));
1359      m_request_func(m_request_state = ASSERT_LINE);
1346      m_request_cb(m_request_state = ASSERT_LINE);
13601347      return;
13611348   }
13621349
trunk/src/emu/sound/votrax.h
r28710r28711
2020//  INTERFACE CONFIGURATION MACROS
2121//**************************************************************************
2222
23#define MCFG_VOTRAX_SC01_ADD(_tag, _clock, _interface) \
24   MCFG_DEVICE_ADD(_tag, VOTRAX_SC01, _clock) \
25   votrax_sc01_device::static_set_interface(*device, _interface);
23#define MCFG_VOTRAX_SC01_REQUEST_CB(_devcb) \
24   devcb = &votrax_sc01_device::set_request_callback(*device, DEVCB2_##_devcb);
2625
2726
2827//**************************************************************************
2928//  TYPE DEFINITIONS
3029//**************************************************************************
3130
32// ======================> votrax_sc01_interface
33
34struct votrax_sc01_interface
35{
36   devcb_write_line m_request_cb;      // callback for request
37};
38
39
4031// ======================> votrax_sc01_device
4132
4233class votrax_sc01_device :  public device_t,
43                     public device_sound_interface,
44                     public votrax_sc01_interface
34                     public device_sound_interface
4535{
4636public:
4737   // construction/destruction
4838   votrax_sc01_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
4939
50   // static configuration helpers
51   static void static_set_interface(device_t &device, const votrax_sc01_interface &interface);
52
40   template<class _Object> static devcb2_base &set_request_callback(device_t &device, _Object object) { return downcast<votrax_sc01_device &>(device).m_request_cb.set_callback(object); }
41   
5342   // writers
5443   DECLARE_WRITE8_MEMBER( write );
5544   DECLARE_WRITE8_MEMBER( inflection_w );
r28710r28711
8473   UINT8                       m_phoneme;              // 6-bit phoneme value
8574
8675   // outputs
87   devcb_resolved_write_line   m_request_func;         // request callback
76   devcb2_write_line         m_request_cb;          // callback for request
8877   UINT8                       m_request_state;        // request as seen to the outside world
8978   UINT8                       m_internal_request;     // request managed by stream timing
9079
trunk/src/mess/drivers/votrpss.c
r28710r28711
256256   DEVCB_NULL      // port B write
257257};
258258
259static struct votrax_sc01_interface votrax_interface =
260{
261};
262
263259WRITE8_MEMBER( votrpss_state::kbd_put )
264260{
265261   m_term_data = data;
r28710r28711
294290   MCFG_SOUND_ADD("ay", AY8910, XTAL_8MHz/4) /* 2.000 MHz, verified */
295291   MCFG_SOUND_CONFIG(ay8910_intf)
296292   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
297   MCFG_VOTRAX_SC01_ADD("votrax", 720000, votrax_interface ) /* 720 kHz? needs verify */
293   MCFG_DEVICE_ADD("votrax", VOTRAX_SC01, 720000) /* 720 kHz? needs verify */
298294   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
299295
300296   /* Devices */
trunk/src/mess/drivers/votrtnt.c
r28710r28711
9797   m_acia->write_rxc(state);
9898}
9999
100static struct votrax_sc01_interface votrtnt_votrax_interface =
101{
102   DEVCB_CPU_INPUT_LINE("maincpu", INPUT_LINE_IRQ0)
103};
104100
105101/******************************************************************************
106102 Machine Drivers
r28710r28711
128124
129125   /* sound hardware */
130126   MCFG_SPEAKER_STANDARD_MONO("mono")
131   MCFG_VOTRAX_SC01_ADD("votrax", 720000, votrtnt_votrax_interface ) /* 720kHz? needs verify */
127   MCFG_DEVICE_ADD("votrax", VOTRAX_SC01, 720000) /* 720kHz? needs verify */
128   MCFG_VOTRAX_SC01_REQUEST_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
132129   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
133130MACHINE_CONFIG_END
134131
trunk/src/mame/audio/gottlieb.c
r28710r28711
452452
453453
454454//-------------------------------------------------
455//  VOTRAX interface
456//-------------------------------------------------
457
458static const votrax_sc01_interface gottlieb_votrax_interface =
459{
460   DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, gottlieb_sound_r1_device, votrax_request)
461};
462
463
464//-------------------------------------------------
465455//  audio CPU map
466456//-------------------------------------------------
467457
r28710r28711
498488   MCFG_FRAGMENT_ADD(gottlieb_sound_r1)
499489
500490   // add the VOTRAX
501   MCFG_VOTRAX_SC01_ADD("votrax", 720000, gottlieb_votrax_interface)
491   MCFG_DEVICE_ADD("votrax", VOTRAX_SC01, 720000)
492   MCFG_VOTRAX_SC01_REQUEST_CB(DEVWRITELINE(DEVICE_SELF_OWNER, gottlieb_sound_r1_device, votrax_request))
502493   MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.50)
503494MACHINE_CONFIG_END
504495

Previous 199869 Revisions Next


© 1997-2024 The MAME Team