diff options
| -rw-r--r-- | scripts/src/sound.lua | 4 | ||||
| -rw-r--r-- | src/devices/sound/mb87077.cpp | 58 | ||||
| -rw-r--r-- | src/devices/sound/mb87077.h | 17 |
3 files changed, 49 insertions, 30 deletions
diff --git a/scripts/src/sound.lua b/scripts/src/sound.lua index 936938ed563..b62f0e2867d 100644 --- a/scripts/src/sound.lua +++ b/scripts/src/sound.lua @@ -555,7 +555,7 @@ if SOUNDS["K053260"] then } end -if MACHINES["K054321"] then +if SOUNDS["K054321"] then files { MAME_DIR .. "src/devices/sound/k054321.cpp", MAME_DIR .. "src/devices/sound/k054321.h", @@ -634,7 +634,7 @@ end --@src/devices/sound/mb87077.h,SOUNDS["MB87077"] = true --------------------------------------------------- -if MACHINES["MB87077"] then +if SOUNDS["MB87077"] then files { MAME_DIR .. "src/devices/sound/mb87077.cpp", MAME_DIR .. "src/devices/sound/mb87077.h", diff --git a/src/devices/sound/mb87077.cpp b/src/devices/sound/mb87077.cpp index 495e0072e90..1dc21a40d88 100644 --- a/src/devices/sound/mb87077.cpp +++ b/src/devices/sound/mb87077.cpp @@ -2,7 +2,7 @@ // copyright-holders:Fabio Priuli, Philip Bennett, hap /***************************************************************************** - Fujitsu MB87078 6-bit, 4-channel electronic volume controller emulator + Fujitsu MB87077 6-bit, 4-channel electronic volume controller emulator An excerpt from the datasheet about the chip functionality: "A digital signal input controls gain every 0.5 dB step from 0dB to -32dB. @@ -52,22 +52,22 @@ * When reset, DATA is set to 0 dB (code 111111 100) - MB87078 pins and assigned interface variables/functions: + MB87077 pins and assigned interface variables/functions: - /[ 1] D0 /TC [24] - | [ 2] D1 /WR [23] - data_w()| [ 3] D2 /CE [22] - data_r()| [ 4] D3 DSEL [21]-data_w()/data_r() (offset) - (data) | [ 5] D4 /RESET [20] - \[ 6] D5 /PD [19] - [ 7] DGND VDD [18] - [ 8] AGND 1/2 VDD [17] - [ 9] AIN0 AOUT3 [16] - [10] AOUT0 AIN3 [15] - [11] AIN1 AOUT2 [14] - [12] AOUT1 AIN2 [13] + /[ 1] D0 /TC [24] + | [ 2] D1 /WR [23] + data_w()| [ 3] D2 /CE [22] + data_r()| [ 4] D3 DSEL [21]-data_w()/data_r() (offset) + (data) | [ 5] D4 /RESET [20] + \[ 6] D5 /PD [19] + [ 7] DGND VDD [18] + [ 8] VSS AGND [17] + [ 9] AIN0 AOUT3 [16] + [10] AOUT0 AIN3 [15] + [11] AIN1 AOUT2 [14] + [12] AOUT1 AIN2 [13] - MB87077 pin 8 is VSS, pin 17 is AGND, the rest is same as MB87078. + MB87078 pin 8 is AGND, pin 17 is 1/2 VDD, the rest is same as MB87077. *****************************************************************************/ @@ -79,19 +79,28 @@ DEVICE INTERFACE *****************************************************************************/ +DEFINE_DEVICE_TYPE(MB87077, mb87077_device, "mb87077", "MB87077 Volume Controller") DEFINE_DEVICE_TYPE(MB87078, mb87078_device, "mb87078", "MB87078 Volume Controller") -mb87078_device::mb87078_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : - device_t(mconfig, MB87078, tag, owner, clock), +mb87077_device::mb87077_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) : + device_t(mconfig, type, tag, owner, clock), m_gain_changed_cb(*this) -{ -} +{ } + +mb87077_device::mb87077_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + mb87077_device(mconfig, MB87077, tag, owner, clock) +{ } + +mb87078_device::mb87078_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + mb87077_device(mconfig, MB87078, tag, owner, clock) +{ } + //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- -void mb87078_device::device_start() +void mb87077_device::device_start() { m_data = 0; m_control = 0; @@ -113,11 +122,12 @@ void mb87078_device::device_start() save_item(NAME(m_control)); } + //------------------------------------------------- // device_reset - device-specific reset //------------------------------------------------- -void mb87078_device::device_reset() +void mb87077_device::device_reset() { // all channels enabled, and set at 0dB for (int i = 0; i < 4; i++) @@ -131,7 +141,7 @@ void mb87078_device::device_reset() IMPLEMENTATION *****************************************************************************/ -void mb87078_device::gain_recalc() +void mb87077_device::gain_recalc() { for (int i = 0; i < 4; i++) { @@ -161,7 +171,7 @@ void mb87078_device::gain_recalc() } } -void mb87078_device::data_w(offs_t offset, u8 data) +void mb87077_device::data_w(offs_t offset, u8 data) { if (offset & 1) m_control = data & 0x1f; @@ -175,7 +185,7 @@ void mb87078_device::data_w(offs_t offset, u8 data) } } -u8 mb87078_device::data_r(offs_t offset) +u8 mb87077_device::data_r(offs_t offset) { return (offset & 1) ? m_control : m_data; } diff --git a/src/devices/sound/mb87077.h b/src/devices/sound/mb87077.h index 555aaadc85c..a94b28c730c 100644 --- a/src/devices/sound/mb87077.h +++ b/src/devices/sound/mb87077.h @@ -2,7 +2,7 @@ // copyright-holders:Fabio Priuli, Philip Bennett, hap /***************************************************************************** - MB87078 6-bit,4-channel electronic volume controller emulator + MB87077 6-bit, 4-channel electronic volume controller emulator *****************************************************************************/ @@ -11,10 +11,10 @@ #pragma once -class mb87078_device : public device_t +class mb87077_device : public device_t { public: - mb87078_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); + mb87077_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0); auto gain_changed() { return m_gain_changed_cb.bind(); } @@ -29,7 +29,9 @@ public: double gain_factor_r(offs_t offset) { return m_lut_gains[m_gain_index[offset & 3]]; } // range 1.0 .. 0.0 protected: - // device-level overrides + mb87077_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); + + // device-level implementation virtual void device_start() override ATTR_COLD; virtual void device_reset() override ATTR_COLD; @@ -46,6 +48,13 @@ private: devcb_write8 m_gain_changed_cb; }; +class mb87078_device : public mb87077_device +{ +public: + mb87078_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0); +}; + +DECLARE_DEVICE_TYPE(MB87077, mb87077_device) DECLARE_DEVICE_TYPE(MB87078, mb87078_device) #endif // MAME_SOUND_MB87077_H |
