summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/sound
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2018-05-01 16:56:13 -0400
committer AJR <ajrhacker@users.noreply.github.com>2018-05-01 16:57:54 -0400
commitc5db561a10f78604c6bb57a324c67bcaa3670852 (patch)
treedce99e74f6b5eb25621a43f78e31cba89ce4710c /src/devices/sound
parentc8f7418d2a2e75d2a9c387033e06b591c36bfd29 (diff)
namco, polepos: Clean up some line write handlers (nw)
Diffstat (limited to 'src/devices/sound')
-rw-r--r--src/devices/sound/namco.cpp32
-rw-r--r--src/devices/sound/namco.h5
2 files changed, 14 insertions, 23 deletions
diff --git a/src/devices/sound/namco.cpp b/src/devices/sound/namco.cpp
index 04e73d03b81..99c016996ed 100644
--- a/src/devices/sound/namco.cpp
+++ b/src/devices/sound/namco.cpp
@@ -55,7 +55,7 @@ namco_audio_device::namco_audio_device(const machine_config &mconfig, device_typ
, m_soundregs(nullptr)
, m_wavedata(nullptr)
, m_wave_size(0)
- , m_sound_enable(0)
+ , m_sound_enable(false)
, m_stream(nullptr)
, m_namco_clock(0)
, m_sample_rate(0)
@@ -104,7 +104,7 @@ void namco_audio_device::device_start()
m_stream = machine().sound().stream_alloc(*this, 0, 1, 192000);
/* start with sound enabled, many games don't have a sound enable register */
- m_sound_enable = 1;
+ m_sound_enable = true;
/* register with the save state system */
save_pointer(NAME(m_soundregs), 0x400);
@@ -245,6 +245,12 @@ uint32_t namco_audio_device::namco_update_one(stream_sample_t *buffer, int lengt
}
+WRITE_LINE_MEMBER(namco_audio_device::sound_enable_w)
+{
+ m_sound_enable = state;
+}
+
+
/********************************************************************************/
/* pacman register map
@@ -263,11 +269,6 @@ uint32_t namco_audio_device::namco_update_one(stream_sample_t *buffer, int lengt
0x1f: ch 2 volume
*/
-WRITE_LINE_MEMBER(namco_device::pacman_sound_enable_w)
-{
- m_sound_enable = state;
-}
-
WRITE8_MEMBER( namco_device::pacman_sound_w )
{
sound_channel *voice;
@@ -410,11 +411,6 @@ it select the 54XX/52XX outputs on those channels
0x3f ch 7
*/
-void namco_device::polepos_sound_enable(int enable)
-{
- m_sound_enable = enable;
-}
-
READ8_MEMBER( namco_device::polepos_sound_r )
{
return m_soundregs[offset];
@@ -491,11 +487,6 @@ WRITE8_MEMBER( namco_device::polepos_sound_w )
0x3e ch 7 waveform select & frequency
*/
-WRITE_LINE_MEMBER(namco_15xx_device::mappy_sound_enable)
-{
- m_sound_enable = state;
-}
-
WRITE8_MEMBER(namco_15xx_device::namco_15xx_w)
{
sound_channel *voice;
@@ -675,7 +666,7 @@ void namco_audio_device::sound_stream_update(sound_stream &stream, stream_sample
memset(outputs[1], 0, samples * sizeof(*outputs[1]));
/* if no sound, we're done */
- if (m_sound_enable == 0)
+ if (!m_sound_enable)
return;
/* loop over each voice and add its contribution */
@@ -782,9 +773,8 @@ void namco_audio_device::sound_stream_update(sound_stream &stream, stream_sample
memset(buffer, 0, samples * sizeof(*buffer));
/* if no sound, we're done */
-
- if (m_sound_enable == 0)
- return;
+ if (!m_sound_enable)
+ return;
/* loop over each voice and add its contribution */
for (voice = m_channel_list; voice < m_last_channel; voice++)
diff --git a/src/devices/sound/namco.h b/src/devices/sound/namco.h
index f9d7b68a17e..560090cb71d 100644
--- a/src/devices/sound/namco.h
+++ b/src/devices/sound/namco.h
@@ -21,6 +21,8 @@ public:
void set_voices(int voices) { m_voices = voices; }
void set_stereo(int stereo) { m_stereo = stereo; }
+ DECLARE_WRITE_LINE_MEMBER(sound_enable_w);
+
protected:
static constexpr unsigned MAX_VOICES = 8;
static constexpr unsigned MAX_VOLUME = 16;
@@ -62,7 +64,7 @@ protected:
/* global sound parameters */
int m_wave_size;
- int32_t m_sound_enable;
+ bool m_sound_enable;
sound_stream *m_stream;
int m_namco_clock;
int m_sample_rate;
@@ -82,7 +84,6 @@ class namco_device : public namco_audio_device
public:
namco_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- DECLARE_WRITE_LINE_MEMBER(pacman_sound_enable_w);
DECLARE_WRITE8_MEMBER(pacman_sound_w);
void polepos_sound_enable(int enable);