summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices
diff options
context:
space:
mode:
author hap <happppp@users.noreply.github.com>2026-04-26 12:16:53 +0200
committer hap <happppp@users.noreply.github.com>2026-04-26 14:23:25 +0200
commitd563fcaec4aab45c73f414d1f4b8306efae1d593 (patch)
tree02298c36133b05fa6dcf442a778a95b9dec11edb /src/devices
parent28aca8532da49317fce3c76434b0a4a2f8f44ea3 (diff)
mb87077: change gain to float
Diffstat (limited to 'src/devices')
-rw-r--r--src/devices/sound/mb87077.cpp10
-rw-r--r--src/devices/sound/mb87077.h6
2 files changed, 8 insertions, 8 deletions
diff --git a/src/devices/sound/mb87077.cpp b/src/devices/sound/mb87077.cpp
index f2463868a8b..b42d1b1c523 100644
--- a/src/devices/sound/mb87077.cpp
+++ b/src/devices/sound/mb87077.cpp
@@ -79,8 +79,8 @@
DEVICE INTERFACE
*****************************************************************************/
-DEFINE_DEVICE_TYPE(MB87077, mb87077_device, "mb87077", "MB87077 Volume Controller")
-DEFINE_DEVICE_TYPE(MB87078, mb87078_device, "mb87078", "MB87078 Volume Controller")
+DEFINE_DEVICE_TYPE(MB87077, mb87077_device, "mb87077", "Fujitsu MB87077 Volume Controller")
+DEFINE_DEVICE_TYPE(MB87078, mb87078_device, "mb87078", "Fujitsu MB87078 Volume Controller")
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),
@@ -108,8 +108,8 @@ void mb87077_device::device_start()
// output volume table, 0dB to -32dB in steps of -0.5dB
for (int i = 0; i < (64+1); i++)
- m_gains[i] = pow(10.0, (-0.5 * i) / 20.0);
- m_gains[65] = 0.0; // -infinity
+ m_gains[i] = powf(10.0f, (-0.5f * i) / 20.0f);
+ m_gains[65] = 0.0f; // -infinity
m_gains[66] = m_gains[0];
m_data = 0;
@@ -166,7 +166,7 @@ void mb87077_device::gain_recalc()
if (gain_index != m_gain_index[i])
{
m_gain_index[i] = gain_index;
- m_gain_changed_cb((offs_t)i, gain_percent_r(i));
+ m_gain_changed_cb(i, gain_percent_r(i));
}
}
}
diff --git a/src/devices/sound/mb87077.h b/src/devices/sound/mb87077.h
index 0e4a40d009d..9a850d5e731 100644
--- a/src/devices/sound/mb87077.h
+++ b/src/devices/sound/mb87077.h
@@ -25,8 +25,8 @@ public:
Returned value represents channel gain expressed in percents of maximum volume.
Range from 100 to 0. (100 = 0dB; 50 = -6dB; 0 = -infinity)
This function is designed for use with MAME mixer_xxx() functions. */
- u8 gain_percent_r(offs_t offset) { return gain_factor_r(offset) * 100.0 + 0.5; } // range 100 .. 0
- double gain_factor_r(offs_t offset) { return m_gains[m_gain_index[offset & 3]]; } // range 1.0 .. 0.0
+ u8 gain_percent_r(offs_t offset) { return gain_factor_r(offset) * 100.0 + 0.5f; } // range 100 .. 0
+ float gain_factor_r(offs_t offset) { return m_gains[m_gain_index[offset & 3]]; } // range 1.0 .. 0.0
protected:
mb87077_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock);
@@ -37,7 +37,7 @@ protected:
private:
void gain_recalc();
- double m_gains[64+3];
+ float m_gains[64+3];
// internal state
u8 m_gain_index[4]; // per-channel current index to m_gains