diff --git a/src/emu/sound/t6w28.c b/src/emu/sound/t6w28.c index e42899dbae1..9f5d52cdc21 100644 --- a/src/emu/sound/t6w28.c +++ b/src/emu/sound/t6w28.c @@ -233,11 +233,19 @@ void t6w28_device::sound_stream_update(sound_stream &stream, stream_sample_t **i left -= nextevent; } while (left > 0); - out0 = vol[4] * m_volume[4] + vol[5] * m_volume[5] + - vol[6] * m_volume[6] + vol[3] * m_volume[7]; + if (m_enabled) + { + out0 = vol[4] * m_volume[4] + vol[5] * m_volume[5] + + vol[6] * m_volume[6] + vol[3] * m_volume[7]; - out1 = vol[4] * m_volume[0] + vol[5] * m_volume[1] + - vol[6] * m_volume[2] + vol[3] * m_volume[3]; + out1 = vol[4] * m_volume[0] + vol[5] * m_volume[1] + + vol[6] * m_volume[2] + vol[3] * m_volume[3]; + } + else + { + out0 = 0; + out1 = 0; + } if (out0 > MAX_OUTPUT * STEP) out0 = MAX_OUTPUT * STEP; if (out1 > MAX_OUTPUT * STEP) out1 = MAX_OUTPUT * STEP; @@ -328,6 +336,13 @@ void t6w28_device::device_start() save_item(NAME(m_period)); save_item(NAME(m_count)); save_item(NAME(m_output)); + save_item(NAME(m_enabled)); +} + + +void t6w28_device::set_enable(bool enable) +{ + m_enabled = enable; } const device_type T6W28 = &device_creator; diff --git a/src/emu/sound/t6w28.h b/src/emu/sound/t6w28.h index fad31b48f2a..10d99148bf3 100644 --- a/src/emu/sound/t6w28.h +++ b/src/emu/sound/t6w28.h @@ -10,6 +10,7 @@ public: t6w28_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); DECLARE_WRITE8_MEMBER( write ); + void set_enable( bool enable ); protected: // device-level overrides @@ -35,6 +36,7 @@ private: INT32 m_period[8]; INT32 m_count[8]; INT32 m_output[8]; + bool m_enabled; }; extern const device_type T6W28; diff --git a/src/mess/drivers/ngp.c b/src/mess/drivers/ngp.c index f8d16ec0fd6..915de98be98 100644 --- a/src/mess/drivers/ngp.c +++ b/src/mess/drivers/ngp.c @@ -256,8 +256,10 @@ WRITE8_MEMBER( ngp_state::ngp_io_w ) switch( data ) { case 0x55: /* Enabled sound */ + m_t6w28->set_enable( true ); break; case 0xAA: /* Disable sound */ + m_t6w28->set_enable( false ); break; } break;