summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/audio/gridlee.cpp
diff options
context:
space:
mode:
author Aaron Giles <aaronsgiles@users.noreply.github.com>2020-09-27 20:46:58 -0700
committer GitHub <noreply@github.com>2020-09-28 13:46:58 +1000
commit7b8913fefa46d67e4be7c662f20a4e26e21000eb (patch)
tree5e8e471549b9c640aca9ba995de7e0c470154581 /src/mame/audio/gridlee.cpp
parent52514f1acd4c825aee93acb93b286af1c8712807 (diff)
Complete sound modernization of remaining devices. Legacy callbacks and stream_sample_t removed. (#7297)
* a2mcms/coco_ssc/gus/cassette/floppy/8364_paula/laserdsc/s2636/spg2xx_audio/arcadia/channelf/cmi01a/cps3/dai_snd: Update to new stream callbacks * dsbz80/elan_eu3a05/exidy/exidy440/flower/geebee/gomoku/gridlee: Update to new stream callbacks * hyprolyb/lynx/micro3d/phoenix/pleiads/polepos: Update to new sound stream callback * redbaron/segag80r/segausb/seibu/snk6502/socrates/special/svis_snd: Update to new stream callbacks. * tiamc1/turrett/tvc/tx1/vboy/vc4000: Update to new stream callbacks * warpwarp/wiping/wswan/xavix/esq1/istrebiteli/milton6805/pv1000/mega32x/gic: Update to new stream callback * sound: Remove legacy stream support and stream_sample_t * * gomoku/wiping: Remove silly mixer tables in favor of math * micro3d: Remove tiny vectors in favor of fixed arrays * phoenix: Went back to std::unique_ptr array for LFSR * wiping: Fixed the scale factor.
Diffstat (limited to 'src/mame/audio/gridlee.cpp')
-rw-r--r--src/mame/audio/gridlee.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mame/audio/gridlee.cpp b/src/mame/audio/gridlee.cpp
index 429518b39d0..2f6904c4efc 100644
--- a/src/mame/audio/gridlee.cpp
+++ b/src/mame/audio/gridlee.cpp
@@ -43,26 +43,26 @@ gridlee_sound_device::gridlee_sound_device(const machine_config &mconfig, const
void gridlee_sound_device::device_start()
{
/* allocate the stream */
- m_stream = stream_alloc_legacy(0, 1, machine().sample_rate());
+ m_stream = stream_alloc(0, 1, machine().sample_rate());
m_freq_to_step = (double)(1 << 24) / (double)machine().sample_rate();
}
//-------------------------------------------------
-// sound_stream_update_legacy - handle a stream update
+// sound_stream_update - handle a stream update
//-------------------------------------------------
-void gridlee_sound_device::sound_stream_update_legacy(sound_stream &stream, stream_sample_t const * const *inputs, stream_sample_t * const *outputs, int samples)
+void gridlee_sound_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs)
{
- stream_sample_t *buffer = outputs[0];
+ auto &buffer = outputs[0];
/* loop over samples */
- while (samples--)
+ for (int sampindex = 0; sampindex < buffer.samples(); sampindex++)
{
/* tone channel */
m_tone_fraction += m_tone_step;
- *buffer++ = (m_tone_fraction & 0x0800000) ? (m_tone_volume << 6) : 0;
+ buffer.put_int(sampindex, (m_tone_fraction & 0x0800000) ? m_tone_volume : 0, 32768 >> 6);
}
}