Previous 199869 Revisions Next

r18579 Wednesday 17th October, 2012 at 17:48:40 UTC by Wilbert Pol
(MESS) ngp.c: Implemented disabling the t6w28 output. (nw)
[src/emu/sound]t6w28.c t6w28.h
[src/mess/drivers]ngp.c

trunk/src/emu/sound/t6w28.c
r18578r18579
233233         left -= nextevent;
234234      } while (left > 0);
235235
236      out0 = vol[4] * m_volume[4] + vol[5] * m_volume[5] +
237            vol[6] * m_volume[6] + vol[3] * m_volume[7];
236      if (m_enabled)
237      {
238         out0 = vol[4] * m_volume[4] + vol[5] * m_volume[5] +
239               vol[6] * m_volume[6] + vol[3] * m_volume[7];
238240
239      out1 = vol[4] * m_volume[0] + vol[5] * m_volume[1] +
240            vol[6] * m_volume[2] + vol[3] * m_volume[3];
241         out1 = vol[4] * m_volume[0] + vol[5] * m_volume[1] +
242               vol[6] * m_volume[2] + vol[3] * m_volume[3];
243      }
244      else
245      {
246         out0 = 0;
247         out1 = 0;
248      }
241249
242250      if (out0 > MAX_OUTPUT * STEP) out0 = MAX_OUTPUT * STEP;
243251      if (out1 > MAX_OUTPUT * STEP) out1 = MAX_OUTPUT * STEP;
r18578r18579
328336   save_item(NAME(m_period));
329337   save_item(NAME(m_count));
330338   save_item(NAME(m_output));
339   save_item(NAME(m_enabled));
331340}
332341
342
343void t6w28_device::set_enable(bool enable)
344{
345   m_enabled = enable;
346}
347
333348const device_type T6W28 = &device_creator<t6w28_device>;
334349
335350t6w28_device::t6w28_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
trunk/src/emu/sound/t6w28.h
r18578r18579
1010   t6w28_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
1111
1212   DECLARE_WRITE8_MEMBER( write );
13   void set_enable( bool enable );
1314
1415protected:
1516   // device-level overrides
r18578r18579
3536   INT32 m_period[8];
3637   INT32 m_count[8];
3738   INT32 m_output[8];
39   bool m_enabled;
3840};
3941
4042extern const device_type T6W28;
trunk/src/mess/drivers/ngp.c
r18578r18579
256256      switch( data )
257257      {
258258      case 0x55:      /* Enabled sound */
259         m_t6w28->set_enable( true );
259260         break;
260261      case 0xAA:      /* Disable sound */
262         m_t6w28->set_enable( false );
261263         break;
262264      }
263265      break;

Previous 199869 Revisions Next


© 1997-2024 The MAME Team