summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2020-09-21 12:47:00 -0700
committer Aaron Giles <aaron@aarongiles.com>2020-09-21 12:47:00 -0700
commit70743c6fb2602a5c2666c679b618706eabfca2ad (patch)
tree380e7aaefe5e3adcf044b69e72e04ad9b34904d4 /src/mame
parentfdfcbf14e874e763b208426488b2e79e67dc735d (diff)
s_dsp/saa1099/scsp/segapcm/sn76477/snkwave/sp0256/spkrdev/spu/st0016/swp*: Update to new stream callbacks
Diffstat (limited to 'src/mame')
-rw-r--r--src/mame/drivers/apogee.cpp2
-rw-r--r--src/mame/drivers/apple2gs.cpp7
-rw-r--r--src/mame/drivers/h01x.cpp2
-rw-r--r--src/mame/drivers/hh_amis2k.cpp8
-rw-r--r--src/mame/drivers/hh_hmcs40.cpp10
-rw-r--r--src/mame/drivers/hh_pic16.cpp6
-rw-r--r--src/mame/drivers/hh_sm510.cpp2
-rw-r--r--src/mame/drivers/hh_tms1k.cpp27
-rw-r--r--src/mame/drivers/hh_ucom4.cpp6
-rw-r--r--src/mame/drivers/meritum.cpp2
-rw-r--r--src/mame/drivers/pokemini.cpp2
-rw-r--r--src/mame/drivers/tasc.cpp2
-rw-r--r--src/mame/drivers/vtech1.cpp2
-rw-r--r--src/mame/machine/trs80.cpp2
14 files changed, 42 insertions, 38 deletions
diff --git a/src/mame/drivers/apogee.cpp b/src/mame/drivers/apogee.cpp
index e89e0ba03b0..f91f058ee6c 100644
--- a/src/mame/drivers/apogee.cpp
+++ b/src/mame/drivers/apogee.cpp
@@ -153,7 +153,7 @@ static INPUT_PORTS_START( apogee )
PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Rus/Lat") PORT_CODE(KEYCODE_LALT) PORT_CODE(KEYCODE_RALT)
INPUT_PORTS_END
-static const int16_t speaker_levels[] = {-32767, -10922, 10922, 32767};
+static const double speaker_levels[] = {-1.0, -0.33333, 0.33333, 1.0};
WRITE_LINE_MEMBER(apogee_state::pit8253_out0_changed)
{
diff --git a/src/mame/drivers/apple2gs.cpp b/src/mame/drivers/apple2gs.cpp
index ba7dbbb67b5..464133ef4b4 100644
--- a/src/mame/drivers/apple2gs.cpp
+++ b/src/mame/drivers/apple2gs.cpp
@@ -1233,10 +1233,11 @@ void apple2gs_state::machine_start()
// setup speaker toggle volumes. this should be done mathematically probably,
// but these ad-hoc values aren't too bad.
- static const int16_t lvlTable[16] =
+#define LVL(x) (double(x) / 32768.0)
+ static const double lvlTable[16] =
{
- 0x0000, 0x03ff, 0x04ff, 0x05ff, 0x06ff, 0x07ff, 0x08ff, 0x09ff,
- 0x0aff, 0x0bff, 0x0cff, 0x0fff, 0x1fff, 0x3fff, 0x5fff, 0x7fff
+ LVL(0x0000), LVL(0x03ff), LVL(0x04ff), LVL(0x05ff), LVL(0x06ff), LVL(0x07ff), LVL(0x08ff), LVL(0x09ff),
+ LVL(0x0aff), LVL(0x0bff), LVL(0x0cff), LVL(0x0fff), LVL(0x1fff), LVL(0x3fff), LVL(0x5fff), LVL(0x7fff)
};
m_speaker->set_levels(16, lvlTable);
diff --git a/src/mame/drivers/h01x.cpp b/src/mame/drivers/h01x.cpp
index 15a676a477b..6680a803a77 100644
--- a/src/mame/drivers/h01x.cpp
+++ b/src/mame/drivers/h01x.cpp
@@ -11,7 +11,7 @@
#include "emu.h"
#include "includes/h01x.h"
-static const int16_t speaker_levels[] = {-32768, 0, 32767, 0};
+static const double speaker_levels[] = {-1.0, 0.0, 1.0, 0.0};
void h01x_state::h01x(machine_config &config)
{
diff --git a/src/mame/drivers/hh_amis2k.cpp b/src/mame/drivers/hh_amis2k.cpp
index 67778048e8a..051503c30f6 100644
--- a/src/mame/drivers/hh_amis2k.cpp
+++ b/src/mame/drivers/hh_amis2k.cpp
@@ -157,6 +157,8 @@ public:
protected:
virtual void machine_start() override;
+
+ std::vector<double> m_speaker_levels;
};
void wildfire_state::machine_start()
@@ -255,10 +257,10 @@ void wildfire_state::wildfire(machine_config &config)
TIMER(config, "speaker_decay").configure_periodic(FUNC(wildfire_state::speaker_decay_sim), attotime::from_usec(100));
// set volume levels (set_output_gain is too slow for sub-frame intervals)
- static s16 speaker_levels[0x8000];
+ m_speaker_levels.resize(0x8000);
for (int i = 0; i < 0x8000; i++)
- speaker_levels[i] = i;
- m_speaker->set_levels(0x8000, speaker_levels);
+ m_speaker_levels[i] = double(i) / 32768.0;
+ m_speaker->set_levels(0x8000, &m_speaker_levels[0]);
}
// roms
diff --git a/src/mame/drivers/hh_hmcs40.cpp b/src/mame/drivers/hh_hmcs40.cpp
index d9f8bf63ce3..249a3c859c4 100644
--- a/src/mame/drivers/hh_hmcs40.cpp
+++ b/src/mame/drivers/hh_hmcs40.cpp
@@ -1926,6 +1926,8 @@ public:
protected:
virtual void machine_start() override;
+
+ std::vector<double> m_speaker_levels;
};
void cdkong_state::machine_start()
@@ -2027,10 +2029,10 @@ void cdkong_state::cdkong(machine_config &config)
TIMER(config, "speaker_decay").configure_periodic(FUNC(cdkong_state::speaker_decay_sim), attotime::from_msec(1));
// set volume levels (set_output_gain is too slow for sub-frame intervals)
- static s16 speaker_levels[0x8000];
+ m_speaker_levels.resize(0x8000);
for (int i = 0; i < 0x8000; i++)
- speaker_levels[i] = i;
- m_speaker->set_levels(0x8000, speaker_levels);
+ m_speaker_levels[i] = double(i) / 32768.0;
+ m_speaker->set_levels(0x8000, &m_speaker_levels[0]);
}
// roms
@@ -3668,7 +3670,7 @@ void mwcbaseb_state::mwcbaseb(machine_config &config)
/* sound hardware */
SPEAKER(config, "mono").front_center();
SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25);
- static const s16 speaker_levels[] = { 0, 0x3fff, -0x4000, 0, -0x4000, 0, -0x8000, -0x4000 };
+ static const double speaker_levels[] = { 0.0, 0.5, -0.5, 0.0, -0.5, 0.0, -1.0, -0.5 };
m_speaker->set_levels(8, speaker_levels);
}
diff --git a/src/mame/drivers/hh_pic16.cpp b/src/mame/drivers/hh_pic16.cpp
index 8fb36a746c4..102111824bc 100644
--- a/src/mame/drivers/hh_pic16.cpp
+++ b/src/mame/drivers/hh_pic16.cpp
@@ -295,7 +295,7 @@ void touchme_state::touchme(machine_config &config)
/* sound hardware */
SPEAKER(config, "mono").front_center();
SPEAKER_SOUND(config, m_speaker);
- static const s16 speaker_levels[] = { 0, 0x7fff, -0x8000, 0 };
+ static const double speaker_levels[] = { 0.0, 1.0, -1.0, 0.0 };
m_speaker->set_levels(4, speaker_levels);
m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25);
}
@@ -626,7 +626,7 @@ void maniac_state::maniac(machine_config &config)
/* sound hardware */
SPEAKER(config, "mono").front_center();
SPEAKER_SOUND(config, m_speaker);
- static const s16 speaker_levels[] = { 0, 0x7fff, -0x8000, 0 };
+ static const double speaker_levels[] = { 0.0, 1.0, -1.0, 0.0 };
m_speaker->set_levels(4, speaker_levels);
m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25);
}
@@ -1336,7 +1336,7 @@ void rockpin_state::rockpin(machine_config &config)
/* sound hardware */
SPEAKER(config, "mono").front_center();
SPEAKER_SOUND(config, m_speaker);
- static const s16 speaker_levels[] = { 0, 0x7fff, -0x8000, 0 };
+ static const double speaker_levels[] = { 0.0, 1.0, -1.0, 0.0 };
m_speaker->set_levels(4, speaker_levels);
m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25);
}
diff --git a/src/mame/drivers/hh_sm510.cpp b/src/mame/drivers/hh_sm510.cpp
index 7fc98eb6a76..01951558fa1 100644
--- a/src/mame/drivers/hh_sm510.cpp
+++ b/src/mame/drivers/hh_sm510.cpp
@@ -520,7 +520,7 @@ void hh_sm510_state::sm511_tiger2bit(machine_config &config, u16 width, u16 heig
m_maincpu->write_r().set(FUNC(hh_sm510_state::piezo2bit_r1_w));
// R via 120K resistor, S1 via 39K resistor (eg. tsonic, tsonic2, tbatmana)
- static const s16 speaker_levels[] = { 0, 0x7fff/3*1, 0x7fff/3*2, 0x7fff };
+ static const double speaker_levels[] = { 0.0, 1.0/3.0, 2.0/3.0, 1.0 };
m_speaker->set_levels(4, speaker_levels);
}
diff --git a/src/mame/drivers/hh_tms1k.cpp b/src/mame/drivers/hh_tms1k.cpp
index 872d4e19568..3219fa5234b 100644
--- a/src/mame/drivers/hh_tms1k.cpp
+++ b/src/mame/drivers/hh_tms1k.cpp
@@ -494,7 +494,7 @@ void matchnum_state::matchnum(machine_config &config)
/* sound hardware */
SPEAKER(config, "mono").front_center();
SPEAKER_SOUND(config, m_speaker);
- static const s16 speaker_levels[4] = { 0, 0x7fff, -0x8000, 0 };
+ static const double speaker_levels[4] = { 0.0, 1.0, -1.0, 0.0 };
m_speaker->set_levels(4, speaker_levels);
m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25);
}
@@ -606,7 +606,7 @@ void arrball_state::arrball(machine_config &config)
/* sound hardware */
SPEAKER(config, "mono").front_center();
SPEAKER_SOUND(config, m_speaker);
- static const s16 speaker_levels[4] = { 0, 0x7fff, -0x8000, 0 };
+ static const double speaker_levels[4] = { 0.0, 1.0, -1.0, 0.0 };
m_speaker->set_levels(4, speaker_levels);
m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25);
}
@@ -2852,7 +2852,7 @@ void cnfball_state::cnfball(machine_config &config)
/* sound hardware */
SPEAKER(config, "mono").front_center();
SPEAKER_SOUND(config, m_speaker);
- static const s16 speaker_levels[4] = { 0, 0x7fff, -0x8000, 0 };
+ static const double speaker_levels[4] = { 0.0, 1.0, -1.0, 0.0 };
m_speaker->set_levels(4, speaker_levels);
m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25);
}
@@ -5755,7 +5755,7 @@ void elecdet_state::elecdet(machine_config &config)
/* sound hardware */
SPEAKER(config, "mono").front_center();
SPEAKER_SOUND(config, m_speaker);
- static const s16 speaker_levels[4] = { 0, 0x3fff, 0x3fff, 0x7fff };
+ static const double speaker_levels[4] = { 0.0, 0.5, 0.5, 1.0};
m_speaker->set_levels(4, speaker_levels);
m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25);
}
@@ -7469,7 +7469,7 @@ void bigtrak_state::bigtrak(machine_config &config)
/* sound hardware */
SPEAKER(config, "mono").front_center();
SPEAKER_SOUND(config, m_speaker);
- static const s16 speaker_levels[8] = { 0, 0x7fff/3, 0x7fff/3, 0x7fff/3*2, 0x7fff/3, 0x7fff/3*2, 0x7fff/3*2, 0x7fff };
+ static const double speaker_levels[8] = { 0.0, 1.0/3.0, 1.0/3.0, 2.0/3.0, 1.0/3.0, 2.0/3.0, 2.0/3.0, 1.0 };
m_speaker->set_levels(8, speaker_levels);
m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25);
}
@@ -7834,7 +7834,7 @@ void arcmania_state::arcmania(machine_config &config)
/* sound hardware */
SPEAKER(config, "mono").front_center();
SPEAKER_SOUND(config, m_speaker);
- static const s16 speaker_levels[8] = { 0, 0x7fff/3, 0x7fff/3, 0x7fff/3*2, 0x7fff/3, 0x7fff/3*2, 0x7fff/3*2, 0x7fff };
+ static const double speaker_levels[8] = { 0.0, 1.0/3.0, 1.0/3.0, 2.0/3.0, 1.0/3.0, 2.0/3.0, 2.0/3.0, 1.0 };
m_speaker->set_levels(8, speaker_levels);
m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25);
}
@@ -8096,7 +8096,7 @@ void merlin_state::merlin(machine_config &config)
/* sound hardware */
SPEAKER(config, "mono").front_center();
SPEAKER_SOUND(config, m_speaker);
- static const s16 speaker_levels[8] = { 0, 0x7fff/3, 0x7fff/3, 0x7fff/3*2, 0x7fff/3, 0x7fff/3*2, 0x7fff/3*2, 0x7fff };
+ static const double speaker_levels[8] = { 0.0, 1.0/3.0, 1.0/3.0, 2.0/3.0, 1.0/3.0, 2.0/3.0, 2.0/3.0, 1.0 };
m_speaker->set_levels(8, speaker_levels);
m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25);
}
@@ -8413,7 +8413,7 @@ void stopthief_state::stopthief(machine_config &config)
/* sound hardware */
SPEAKER(config, "mono").front_center();
SPEAKER_SOUND(config, m_speaker);
- static const s16 speaker_levels[7] = { 0x7fff/7, 0x7fff/6, 0x7fff/5, 0x7fff/4, 0x7fff/3, 0x7fff/2, 0x7fff/1 };
+ static const double speaker_levels[7] = { 1.0/7.0, 1.0/6.0, 1.0/5.0, 1.0/4.0, 1.0/3.0, 1.0/2.0, 1.0 };
m_speaker->set_levels(7, speaker_levels);
m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25);
}
@@ -8820,9 +8820,8 @@ void lostreas_state::lostreas(machine_config &config)
m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25);
// set volume levels
- static s16 speaker_levels[0x10];
- for (int i = 0; i < 0x10; i++)
- speaker_levels[i] = 0x7fff / (0x10 - i);
+ static const double speaker_levels[0x10] =
+ { 1.0/16.0, 1.0/15.0, 1.0/14.0, 1.0/13.0, 1.0/12.0, 1.0/11.0, 1.0/10.0, 1.0/9.0, 1.0/8.0, 1.0/7.0, 1.0/6.0, 1.0/5.0, 1.0/4.0, 1.0/3.0, 1.0/2.0, 1.0 };
m_speaker->set_levels(16, speaker_levels);
}
@@ -11519,7 +11518,7 @@ void copycat_state::copycat(machine_config &config)
/* sound hardware */
SPEAKER(config, "mono").front_center();
SPEAKER_SOUND(config, m_speaker);
- static const s16 speaker_levels[4] = { 0, 0x7fff, -0x8000, 0 };
+ static const double speaker_levels[4] = { 0.0, 1.0, -1.0, 0.0 };
m_speaker->set_levels(4, speaker_levels);
m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25);
}
@@ -11609,7 +11608,7 @@ void copycatm2_state::copycatm2(machine_config &config)
/* sound hardware */
SPEAKER(config, "mono").front_center();
SPEAKER_SOUND(config, m_speaker);
- static const s16 speaker_levels[4] = { 0, 0x7fff, -0x8000, 0 };
+ static const double speaker_levels[4] = { 0.0, 1.0, -1.0, 0 };
m_speaker->set_levels(4, speaker_levels);
m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25);
}
@@ -11694,7 +11693,7 @@ void ditto_state::ditto(machine_config &config)
/* sound hardware */
SPEAKER(config, "mono").front_center();
SPEAKER_SOUND(config, m_speaker);
- static const s16 speaker_levels[4] = { 0, 0x7fff, -0x8000, 0 };
+ static const double speaker_levels[4] = { 0.0, 1.0, -1.0, 0 };
m_speaker->set_levels(4, speaker_levels);
m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25);
}
diff --git a/src/mame/drivers/hh_ucom4.cpp b/src/mame/drivers/hh_ucom4.cpp
index 33c68e23a51..c6c778bb9b3 100644
--- a/src/mame/drivers/hh_ucom4.cpp
+++ b/src/mame/drivers/hh_ucom4.cpp
@@ -323,7 +323,7 @@ void ufombs_state::ufombs(machine_config &config)
/* sound hardware */
SPEAKER(config, "mono").front_center();
SPEAKER_SOUND(config, m_speaker);
- static const s16 speaker_levels[] = { 0, 0x7fff, -0x8000, 0 };
+ static const double speaker_levels[] = { 0.0, 1.0, -1.0, 0.0 };
m_speaker->set_levels(4, speaker_levels);
m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25);
}
@@ -479,7 +479,7 @@ void ssfball_state::ssfball(machine_config &config)
/* sound hardware */
SPEAKER(config, "mono").front_center();
SPEAKER_SOUND(config, m_speaker);
- static const s16 speaker_levels[] = { 0, 0x7fff, -0x8000, 0 };
+ static const double speaker_levels[] = { 0.0, 1.0, -1.0, 0.0 };
m_speaker->set_levels(4, speaker_levels);
m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25);
}
@@ -902,7 +902,7 @@ void splasfgt_state::splasfgt(machine_config &config)
/* sound hardware */
SPEAKER(config, "mono").front_center();
SPEAKER_SOUND(config, m_speaker);
- static const s16 speaker_levels[] = { 0, 0x7fff, -0x8000, 0 };
+ static const double speaker_levels[] = { 0.0, 1.0, -1.0, 0.0 };
m_speaker->set_levels(4, speaker_levels);
m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25);
}
diff --git a/src/mame/drivers/meritum.cpp b/src/mame/drivers/meritum.cpp
index a91fc301bf8..6be63729eea 100644
--- a/src/mame/drivers/meritum.cpp
+++ b/src/mame/drivers/meritum.cpp
@@ -354,7 +354,7 @@ void meritum_state::port_ff_w(u8 data)
if (!init)
{
init = 1;
- static int16_t speaker_levels[4] = { 0, -32767, 0, 32767 };
+ static double const speaker_levels[4] = { 0.0, -1.0, 0.0, 1.0 };
m_speaker->set_levels(4, speaker_levels);
}
}
diff --git a/src/mame/drivers/pokemini.cpp b/src/mame/drivers/pokemini.cpp
index 34a62148174..70205b76e24 100644
--- a/src/mame/drivers/pokemini.cpp
+++ b/src/mame/drivers/pokemini.cpp
@@ -1747,7 +1747,7 @@ void pokemini_state::device_timer(emu_timer &timer, device_timer_id id, int para
}
-static const int16_t speaker_levels[] = {-32768, 0, 32767};
+static const double speaker_levels[] = {-1.0, 0.0, 1.0};
void pokemini_state::video_start()
{
diff --git a/src/mame/drivers/tasc.cpp b/src/mame/drivers/tasc.cpp
index 7a6d2efa96f..097be9d0600 100644
--- a/src/mame/drivers/tasc.cpp
+++ b/src/mame/drivers/tasc.cpp
@@ -239,7 +239,7 @@ void tasc_state::tasc(machine_config &config)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- static const int16_t speaker_levels[4] = { 0, 32767, -32768, 0 };
+ static const double speaker_levels[4] = { 0.0, 1.0, -1.0, 0.0 };
SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.75);
m_speaker->set_levels(4, speaker_levels);
}
diff --git a/src/mame/drivers/vtech1.cpp b/src/mame/drivers/vtech1.cpp
index bb69f550b54..934c86000ce 100644
--- a/src/mame/drivers/vtech1.cpp
+++ b/src/mame/drivers/vtech1.cpp
@@ -395,7 +395,7 @@ INPUT_PORTS_END
MACHINE DRIVERS
***************************************************************************/
-static const int16_t speaker_levels[] = {-32768, 0, 32767, 0};
+static const double speaker_levels[] = {-1.0, 0.0, 1.0, 0.0};
void vtech1_state::laser110(machine_config &config)
{
diff --git a/src/mame/machine/trs80.cpp b/src/mame/machine/trs80.cpp
index 99deddaafb4..898ff364550 100644
--- a/src/mame/machine/trs80.cpp
+++ b/src/mame/machine/trs80.cpp
@@ -199,7 +199,7 @@ void trs80_state::port_ff_w(uint8_t data)
if (!init)
{
init = 1;
- static int16_t speaker_levels[4] = { 0, -32767, 0, 32767 };
+ static double speaker_levels[4] = { 0.0, -1.0, 0.0, 1.0 };
m_speaker->set_levels(4, speaker_levels);
}