mirror of
https://github.com/holub/mame
synced 2025-04-25 01:40:16 +03:00
s_dsp/saa1099/scsp/segapcm/sn76477/snkwave/sp0256/spkrdev/spu/st0016/swp*: Update to new stream callbacks
This commit is contained in:
parent
fdfcbf14e8
commit
70743c6fb2
@ -217,7 +217,7 @@ MC6845_ON_UPDATE_ADDR_CHANGED( ecb_grip21_device::grip5_addr_changed )
|
||||
}
|
||||
*/
|
||||
|
||||
static const int16_t speaker_levels[] = { -32768, 0, 32767, 0 };
|
||||
static const double speaker_levels[] = { -1.0, 0.0, 1.0, 0.0 };
|
||||
|
||||
//-------------------------------------------------
|
||||
// I8255A interface
|
||||
|
@ -126,7 +126,7 @@ void astrocade_io_device::device_start()
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// sound_stream_update_legacy - handle a stream update
|
||||
// sound_stream_update - handle a stream update
|
||||
//-------------------------------------------------
|
||||
|
||||
void astrocade_io_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs)
|
||||
|
@ -1060,7 +1060,7 @@ void discrete_device::process(int samples)
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// sound_stream_update_legacy - handle update requests for
|
||||
// sound_stream_update - handle update requests for
|
||||
// our sound stream
|
||||
//-------------------------------------------------
|
||||
|
||||
|
@ -232,7 +232,7 @@ dmadac_sound_device::dmadac_sound_device(const machine_config &mconfig, const ch
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// sound_stream_update_legacy - handle a stream update
|
||||
// sound_stream_update - handle a stream update
|
||||
//-------------------------------------------------
|
||||
|
||||
void dmadac_sound_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs)
|
||||
|
@ -230,13 +230,13 @@ void es1373_device::device_timer(emu_timer &timer, device_timer_id tid, int para
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// sound_stream_update_legacy - handle update requests for
|
||||
// sound_stream_update - handle update requests for
|
||||
// our sound stream
|
||||
//-------------------------------------------------
|
||||
void es1373_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs)
|
||||
{
|
||||
if (m_dac1.enable) {
|
||||
logerror("%s: sound_stream_update_legacy DAC1 not implemented yet\n", tag());
|
||||
logerror("%s: sound_stream_update DAC1 not implemented yet\n", tag());
|
||||
}
|
||||
|
||||
if (m_dac2.enable) {
|
||||
@ -248,7 +248,7 @@ void es1373_device::sound_stream_update(sound_stream &stream, std::vector<read_s
|
||||
|
||||
if (m_adc.enable) {
|
||||
if (m_adc.format!=SCTRL_16BIT_MONO) {
|
||||
logerror("%s: sound_stream_update_legacy Only SCTRL_16BIT_MONO recorded supported\n", tag());
|
||||
logerror("%s: sound_stream_update Only SCTRL_16BIT_MONO recorded supported\n", tag());
|
||||
} else {
|
||||
for (int i=0; i<outputs[0].samples(); i++) {
|
||||
if (m_adc.buf_count<=m_adc.buf_size) {
|
||||
@ -349,7 +349,7 @@ void es1373_device::send_audio_out(chan_info& chan, uint32_t intr_mask, write_st
|
||||
}
|
||||
if (LOG_ES_FILE && m_tempCount<1000000) {
|
||||
m_tempCount++;
|
||||
//logerror("es1373_device::sound_stream_update_legacy count: %i samp16: %X\n", i, samp16);
|
||||
//logerror("es1373_device::sound_stream_update count: %i samp16: %X\n", i, samp16);
|
||||
//if (LOG_ES_FILE && m_eslog)
|
||||
//fprintf(m_eslog, "%i\n", samp16);
|
||||
}
|
||||
|
@ -2092,7 +2092,7 @@ u16 es5505_device::read(offs_t offset)
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// sound_stream_update_legacy - handle a stream update
|
||||
// sound_stream_update - handle a stream update
|
||||
//-------------------------------------------------
|
||||
|
||||
void es550x_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs)
|
||||
|
@ -52,7 +52,7 @@ void filter_rc_device::device_start()
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// sound_stream_update_legacy - handle a stream update
|
||||
// sound_stream_update - handle a stream update
|
||||
//-------------------------------------------------
|
||||
|
||||
void filter_rc_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs)
|
||||
|
@ -1211,7 +1211,7 @@ void cgb04_apu_device::apu_power_off()
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// sound_stream_update_legacy - handle a stream update
|
||||
// sound_stream_update - handle a stream update
|
||||
//-------------------------------------------------
|
||||
|
||||
void gameboy_sound_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs)
|
||||
|
@ -242,7 +242,7 @@ int hc55516_device::clock_state_r()
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// sound_stream_update_legacy - handle a stream update
|
||||
// sound_stream_update - handle a stream update
|
||||
//-------------------------------------------------
|
||||
|
||||
void hc55516_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs)
|
||||
|
@ -421,7 +421,7 @@ void k053260_device::KDSC_Voice::update_pan_volume()
|
||||
void k053260_device::KDSC_Voice::key_on()
|
||||
{
|
||||
m_position = m_kadpcm ? 1 : 0; // for kadpcm low bit is nybble offset, so must start at 1 due to preincrement
|
||||
m_counter = 0x1000 - CLOCKS_PER_SAMPLE; // force update on next sound_stream_update_legacy
|
||||
m_counter = 0x1000 - CLOCKS_PER_SAMPLE; // force update on next sound_stream_update
|
||||
m_output = 0;
|
||||
m_playing = true;
|
||||
if (LOG) m_device.logerror("K053260: start = %06x, length = %06x, pitch = %04x, vol = %02x:%x, loop = %s, %s\n",
|
||||
|
@ -171,7 +171,7 @@ void lmc1992_device::device_start()
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// sound_stream_update_legacy - handle update requests for
|
||||
// sound_stream_update - handle update requests for
|
||||
// our sound stream
|
||||
//-------------------------------------------------
|
||||
|
||||
|
@ -884,7 +884,7 @@ void mos6560_device::device_timer(emu_timer &timer, device_timer_id id, int para
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// sound_stream_update_legacy - handle a stream update
|
||||
// sound_stream_update - handle a stream update
|
||||
//-------------------------------------------------
|
||||
|
||||
void mos6560_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs)
|
||||
|
@ -235,7 +235,7 @@ void mos6581_device::device_post_load()
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// sound_stream_update_legacy - handle update requests for
|
||||
// sound_stream_update - handle update requests for
|
||||
// our sound stream
|
||||
//-------------------------------------------------
|
||||
|
||||
|
@ -138,7 +138,7 @@ void okim6258_device::device_reset()
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// sound_stream_update_legacy - handle a stream update
|
||||
// sound_stream_update - handle a stream update
|
||||
//-------------------------------------------------
|
||||
|
||||
void okim6258_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs)
|
||||
|
@ -48,7 +48,7 @@ void pcd3311_device::device_start()
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// sound_stream_update_legacy - handle update requests for
|
||||
// sound_stream_update - handle update requests for
|
||||
// our sound stream
|
||||
//-------------------------------------------------
|
||||
|
||||
|
@ -466,7 +466,7 @@ void qs1000_device::wave_w(offs_t offset, uint8_t data)
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// sound_stream_update_legacy -
|
||||
// sound_stream_update -
|
||||
//-------------------------------------------------
|
||||
void qs1000_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs)
|
||||
{
|
||||
|
@ -158,7 +158,7 @@ void qsound_hle_device::device_reset()
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// sound_stream_update_legacy - handle a stream update
|
||||
// sound_stream_update - handle a stream update
|
||||
//-------------------------------------------------
|
||||
|
||||
void qsound_hle_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs)
|
||||
|
@ -218,7 +218,7 @@ void rp2c33_sound_device::write(offs_t offset, u8 data)
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// sound_stream_update_legacy - handle a stream update
|
||||
// sound_stream_update - handle a stream update
|
||||
//-------------------------------------------------
|
||||
|
||||
void rp2c33_sound_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs)
|
||||
|
@ -226,7 +226,7 @@ ALLOW_SAVE_TYPE(s14001a_device::states); // allow save_item on a non-fundamental
|
||||
|
||||
void s14001a_device::device_start()
|
||||
{
|
||||
m_stream = stream_alloc_legacy(0, 1, clock() ? clock() : machine().sample_rate());
|
||||
m_stream = stream_alloc(0, 1, clock() ? clock() : machine().sample_rate());
|
||||
|
||||
// resolve callbacks
|
||||
m_ext_read_handler.resolve();
|
||||
@ -311,16 +311,16 @@ void s14001a_device::device_start()
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// sound_stream_update_legacy - handle a stream update
|
||||
// sound_stream_update - handle a stream update
|
||||
//-------------------------------------------------
|
||||
|
||||
void s14001a_device::sound_stream_update_legacy(sound_stream &stream, stream_sample_t const * const *inputs, stream_sample_t * const *outputs, int samples)
|
||||
void s14001a_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs)
|
||||
{
|
||||
for (int i = 0; i < samples; i++)
|
||||
for (int i = 0; i < outputs[0].samples(); i++)
|
||||
{
|
||||
Clock();
|
||||
int16_t sample = m_uOutputP2 - 7; // range -7..8
|
||||
outputs[0][i] = sample * 0xf00;
|
||||
outputs[0].put_int(i, sample, 8);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,7 @@ protected:
|
||||
virtual void device_start() override;
|
||||
|
||||
// sound stream update overrides
|
||||
virtual void sound_stream_update_legacy(sound_stream &stream, stream_sample_t const * const *inputs, stream_sample_t * const *outputs, int samples) override;
|
||||
virtual void sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs) override;
|
||||
|
||||
private:
|
||||
uint8_t readmem(uint16_t offset, bool phase);
|
||||
|
@ -160,7 +160,7 @@ void s_dsp_device::device_start()
|
||||
space().cache(m_cache);
|
||||
space().specific(m_data);
|
||||
|
||||
m_channel = stream_alloc_legacy(0, 2, clock() / 64);
|
||||
m_channel = stream_alloc(0, 2, clock() / 64);
|
||||
|
||||
state_register();
|
||||
}
|
||||
@ -1061,20 +1061,20 @@ void s_dsp_device::state_register()
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// sound_stream_update_legacy - handle a stream update
|
||||
// sound_stream_update - handle a stream update
|
||||
//-------------------------------------------------
|
||||
|
||||
void s_dsp_device::sound_stream_update_legacy(sound_stream &stream, stream_sample_t const * const *inputs, stream_sample_t * const *outputs, int samples)
|
||||
void s_dsp_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs)
|
||||
{
|
||||
s16 mix[2];
|
||||
|
||||
for (int i = 0; i < samples; i++)
|
||||
for (int i = 0; i < outputs[0].samples(); i++)
|
||||
{
|
||||
mix[0] = mix[1] = 0;
|
||||
dsp_update(mix);
|
||||
|
||||
/* Update the buffers */
|
||||
outputs[0][i] = (stream_sample_t)mix[0];
|
||||
outputs[1][i] = (stream_sample_t)mix[1];
|
||||
outputs[0].put_int(i, (stream_sample_t)mix[0], 32768);
|
||||
outputs[1].put_int(i, (stream_sample_t)mix[1], 32768);
|
||||
}
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ protected:
|
||||
virtual void device_clock_changed() override;
|
||||
|
||||
// sound stream update overrides
|
||||
virtual void sound_stream_update_legacy(sound_stream &stream, stream_sample_t const * const *inputs, stream_sample_t * const *outputs, int samples) override;
|
||||
virtual void sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs) override;
|
||||
|
||||
// device_memory_interface configuration
|
||||
virtual space_config_vector memory_space_config() const override;
|
||||
|
@ -161,7 +161,7 @@ saa1099_device::saa1099_device(const machine_config &mconfig, const char *tag, d
|
||||
void saa1099_device::device_start()
|
||||
{
|
||||
/* for each chip allocate one stream */
|
||||
m_stream = stream_alloc_legacy(0, 2, clock()/clock_divider);
|
||||
m_stream = stream_alloc(0, 2, clock()/clock_divider);
|
||||
|
||||
save_item(NAME(m_noise_params));
|
||||
save_item(NAME(m_env_enable));
|
||||
@ -200,18 +200,18 @@ void saa1099_device::device_clock_changed()
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// sound_stream_update_legacy - handle a stream update
|
||||
// sound_stream_update - handle a stream update
|
||||
//-------------------------------------------------
|
||||
|
||||
void saa1099_device::sound_stream_update_legacy(sound_stream &stream, stream_sample_t const * const *inputs, stream_sample_t * const *outputs, int samples)
|
||||
void saa1099_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs)
|
||||
{
|
||||
int j, ch;
|
||||
/* if the channels are disabled we're done */
|
||||
if (!m_all_ch_enable)
|
||||
{
|
||||
/* init output data */
|
||||
memset(outputs[LEFT],0,samples*sizeof(*outputs[LEFT]));
|
||||
memset(outputs[RIGHT],0,samples*sizeof(*outputs[RIGHT]));
|
||||
outputs[LEFT].fill(0);
|
||||
outputs[RIGHT].fill(0);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -227,7 +227,7 @@ void saa1099_device::sound_stream_update_legacy(sound_stream &stream, stream_sam
|
||||
}
|
||||
|
||||
/* fill all data needed */
|
||||
for( j = 0; j < samples; j++ )
|
||||
for( j = 0; j < outputs[0].samples(); j++ )
|
||||
{
|
||||
int output_l = 0, output_r = 0;
|
||||
|
||||
@ -285,8 +285,8 @@ void saa1099_device::sound_stream_update_legacy(sound_stream &stream, stream_sam
|
||||
m_noise[ch].counter -= clock_divider;
|
||||
}
|
||||
/* write sound data to the buffer */
|
||||
outputs[LEFT][j] = output_l / 6;
|
||||
outputs[RIGHT][j] = output_r / 6;
|
||||
outputs[LEFT].put_int(j, output_l, 32768 * 6);
|
||||
outputs[RIGHT].put_int(j, output_r, 32768 * 6);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ protected:
|
||||
virtual void device_clock_changed() override;
|
||||
|
||||
// sound stream update overrides
|
||||
virtual void sound_stream_update_legacy(sound_stream &stream, stream_sample_t const * const *inputs, stream_sample_t * const *outputs, int samples) override;
|
||||
virtual void sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs) override;
|
||||
|
||||
private:
|
||||
struct saa1099_channel
|
||||
|
@ -36,9 +36,6 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
static constexpr s32 clip16(int x) { return std::min(32767, std::max(-32768, x)); }
|
||||
static constexpr s32 clip18(int x) { return std::min(131071, std::max(-131072, x)); }
|
||||
|
||||
#define SHIFT 12
|
||||
#define LFO_SHIFT 8
|
||||
#define FIX(v) ((u32) ((float) (1 << SHIFT) * (v)))
|
||||
@ -165,11 +162,6 @@ scsp_device::scsp_device(const machine_config &mconfig, const char *tag, device_
|
||||
m_timerC(nullptr),
|
||||
m_mcieb(0),
|
||||
m_mcipd(0),
|
||||
m_bufferl(nullptr),
|
||||
m_bufferr(nullptr),
|
||||
m_exts0(nullptr),
|
||||
m_exts1(nullptr),
|
||||
m_length(0),
|
||||
m_RBUFDST(nullptr)
|
||||
{
|
||||
std::fill(std::begin(m_RINGBUF), std::end(m_RINGBUF), 0);
|
||||
@ -212,7 +204,7 @@ void scsp_device::device_start()
|
||||
m_main_irq_cb.resolve_safe();
|
||||
|
||||
// Stereo output with EXTS0,1 Input (External digital audio output)
|
||||
m_stream = stream_alloc_legacy(2, 2, clock() / 512);
|
||||
m_stream = stream_alloc(2, 2, clock() / 512);
|
||||
|
||||
for (int slot = 0; slot < 32; slot++)
|
||||
{
|
||||
@ -317,17 +309,12 @@ void scsp_device::rom_bank_updated()
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// sound_stream_update_legacy - handle a stream update
|
||||
// sound_stream_update - handle a stream update
|
||||
//-------------------------------------------------
|
||||
|
||||
void scsp_device::sound_stream_update_legacy(sound_stream &stream, stream_sample_t const * const *inputs, stream_sample_t * const *outputs, int samples)
|
||||
void scsp_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs)
|
||||
{
|
||||
m_exts0 = inputs[0];
|
||||
m_exts1 = inputs[1];
|
||||
m_bufferl = outputs[0];
|
||||
m_bufferr = outputs[1];
|
||||
m_length = samples;
|
||||
DoMasterSamples(samples);
|
||||
DoMasterSamples(inputs, outputs);
|
||||
}
|
||||
|
||||
u8 scsp_device::DecodeSCI(u8 irq)
|
||||
@ -1276,17 +1263,12 @@ inline s32 scsp_device::UpdateSlot(SCSP_SLOT *slot)
|
||||
return sample;
|
||||
}
|
||||
|
||||
void scsp_device::DoMasterSamples(int nsamples)
|
||||
void scsp_device::DoMasterSamples(std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs)
|
||||
{
|
||||
stream_sample_t *bufr,*bufl;
|
||||
stream_sample_t const *exts[2];
|
||||
auto &bufr = outputs[1];
|
||||
auto &bufl = outputs[0];
|
||||
|
||||
bufr = m_bufferr;
|
||||
bufl = m_bufferl;
|
||||
exts[0] = m_exts0;
|
||||
exts[1] = m_exts1;
|
||||
|
||||
for (int s = 0; s < nsamples; ++s)
|
||||
for (int s = 0; s < bufl.samples(); ++s)
|
||||
{
|
||||
s32 smpl = 0, smpr = 0;
|
||||
|
||||
@ -1342,7 +1324,7 @@ void scsp_device::DoMasterSamples(int nsamples)
|
||||
SCSP_SLOT *slot = m_Slots + i + 16; // 100217, 100237 EFSDL, EFPAN for EXTS0/1
|
||||
if (EFSDL(slot))
|
||||
{
|
||||
m_DSP.EXTS[i] = exts[i][s];
|
||||
m_DSP.EXTS[i] = s32(inputs[i].get(s) * 32768.0);
|
||||
u16 Enc = ((EFPAN(slot)) << 0x8) | ((EFSDL(slot)) << 0xd);
|
||||
smpl += (m_DSP.EXTS[i] * m_LPANTABLE[Enc]) >> SHIFT;
|
||||
smpr += (m_DSP.EXTS[i] * m_RPANTABLE[Enc]) >> SHIFT;
|
||||
@ -1351,17 +1333,14 @@ void scsp_device::DoMasterSamples(int nsamples)
|
||||
|
||||
if (DAC18B())
|
||||
{
|
||||
smpl = clip18(smpl);
|
||||
smpr = clip18(smpr);
|
||||
bufl.put_int_clamp(s, smpl, 131072);
|
||||
bufr.put_int_clamp(s, smpr, 131072);
|
||||
}
|
||||
else
|
||||
{
|
||||
smpl = clip16(smpl >> 2);
|
||||
smpr = clip16(smpr >> 2);
|
||||
bufl.put_int_clamp(s, smpl >> 2, 32768);
|
||||
bufr.put_int_clamp(s, smpr >> 2, 32768);
|
||||
}
|
||||
|
||||
*bufl++ = smpl;
|
||||
*bufr++ = smpr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@ protected:
|
||||
virtual void rom_bank_updated() override;
|
||||
|
||||
// sound stream update overrides
|
||||
virtual void sound_stream_update_legacy(sound_stream &stream, stream_sample_t const * const *inputs, stream_sample_t * const *outputs, int samples) override;
|
||||
virtual void sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs) override;
|
||||
|
||||
private:
|
||||
enum SCSP_STATE { SCSP_ATTACK, SCSP_DECAY1, SCSP_DECAY2, SCSP_RELEASE };
|
||||
@ -148,13 +148,6 @@ private:
|
||||
|
||||
SCSPDSP m_DSP;
|
||||
|
||||
stream_sample_t *m_bufferl;
|
||||
stream_sample_t *m_bufferr;
|
||||
stream_sample_t const *m_exts0;
|
||||
stream_sample_t const *m_exts1;
|
||||
|
||||
int m_length;
|
||||
|
||||
s16 *m_RBUFDST; //this points to where the sample will be stored in the RingBuf
|
||||
|
||||
//LFO
|
||||
@ -187,7 +180,7 @@ private:
|
||||
void w16(u32 addr, u16 val);
|
||||
u16 r16(u32 addr);
|
||||
inline s32 UpdateSlot(SCSP_SLOT *slot);
|
||||
void DoMasterSamples(int nsamples);
|
||||
void DoMasterSamples(std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs);
|
||||
|
||||
//LFO
|
||||
void LFO_Init();
|
||||
|
@ -39,7 +39,7 @@ void segapcm_device::device_start()
|
||||
|
||||
std::fill(&m_ram[0], &m_ram[0x800], 0xff);
|
||||
|
||||
m_stream = stream_alloc_legacy(0, 2, clock() / 128);
|
||||
m_stream = stream_alloc(0, 2, clock() / 128);
|
||||
|
||||
save_item(NAME(m_low));
|
||||
save_pointer(NAME(m_ram), 0x800);
|
||||
@ -68,14 +68,14 @@ void segapcm_device::rom_bank_updated()
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// sound_stream_update_legacy - handle a stream update
|
||||
// sound_stream_update - handle a stream update
|
||||
//-------------------------------------------------
|
||||
|
||||
void segapcm_device::sound_stream_update_legacy(sound_stream &stream, stream_sample_t const * const *inputs, stream_sample_t * const *outputs, int samples)
|
||||
void segapcm_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs)
|
||||
{
|
||||
/* clear the buffers */
|
||||
memset(outputs[0], 0, samples*sizeof(*outputs[0]));
|
||||
memset(outputs[1], 0, samples*sizeof(*outputs[1]));
|
||||
outputs[0].fill(0);
|
||||
outputs[1].fill(0);
|
||||
|
||||
// reg function
|
||||
// ------------------------------------------------
|
||||
@ -113,7 +113,7 @@ void segapcm_device::sound_stream_update_legacy(sound_stream &stream, stream_sam
|
||||
int i;
|
||||
|
||||
/* loop over samples on this channel */
|
||||
for (i = 0; i < samples; i++)
|
||||
for (i = 0; i < outputs[0].samples(); i++)
|
||||
{
|
||||
int8_t v;
|
||||
|
||||
@ -132,8 +132,8 @@ void segapcm_device::sound_stream_update_legacy(sound_stream &stream, stream_sam
|
||||
v = read_byte(offset + (addr >> 8)) - 0x80;
|
||||
|
||||
/* apply panning and advance */
|
||||
outputs[0][i] += v * (regs[2] & 0x7f);
|
||||
outputs[1][i] += v * (regs[3] & 0x7f);
|
||||
outputs[0].add_int(i, v * (regs[2] & 0x7f), 32768);
|
||||
outputs[1].add_int(i, v * (regs[3] & 0x7f), 32768);
|
||||
addr = (addr + regs[7]) & 0xffffff;
|
||||
}
|
||||
|
||||
|
@ -41,7 +41,7 @@ protected:
|
||||
virtual void device_clock_changed() override;
|
||||
|
||||
// sound stream update overrides
|
||||
virtual void sound_stream_update_legacy(sound_stream &stream, stream_sample_t const * const *inputs, stream_sample_t * const *outputs, int samples) override;
|
||||
virtual void sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs) override;
|
||||
|
||||
// device_rom_interface overrides
|
||||
virtual void rom_bank_updated() override;
|
||||
|
@ -203,7 +203,7 @@ sn76477_device::sn76477_device(const machine_config &mconfig, const char *tag, d
|
||||
|
||||
void sn76477_device::device_start()
|
||||
{
|
||||
m_channel = stream_alloc_legacy(0, 1, machine().sample_rate());
|
||||
m_channel = stream_alloc(0, 1, machine().sample_rate());
|
||||
|
||||
if (clock() > 0)
|
||||
{
|
||||
@ -1698,10 +1698,10 @@ void sn76477_device::state_save_register()
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// sound_stream_update_legacy - handle a stream update
|
||||
// sound_stream_update - handle a stream update
|
||||
//-------------------------------------------------
|
||||
|
||||
void sn76477_device::sound_stream_update_legacy(sound_stream &stream, stream_sample_t const * const *inputs, stream_sample_t * const *outputs, int samples)
|
||||
void sn76477_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs)
|
||||
{
|
||||
double one_shot_cap_charging_step;
|
||||
double one_shot_cap_discharging_step;
|
||||
@ -1720,7 +1720,7 @@ void sn76477_device::sound_stream_update_legacy(sound_stream &stream, stream_sam
|
||||
double voltage_out;
|
||||
double center_to_peak_voltage_out;
|
||||
|
||||
stream_sample_t *buffer = outputs[0];
|
||||
auto &buffer = outputs[0];
|
||||
|
||||
/* compute charging values, doing it here ensures that we always use the latest values */
|
||||
one_shot_cap_charging_step = compute_one_shot_cap_charging_rate() / m_our_sample_rate;
|
||||
@ -1744,7 +1744,7 @@ void sn76477_device::sound_stream_update_legacy(sound_stream &stream, stream_sam
|
||||
|
||||
|
||||
/* process 'samples' number of samples */
|
||||
while (samples--)
|
||||
for (int sampindex = 0; sampindex < buffer.samples(); sampindex++)
|
||||
{
|
||||
/* update the one-shot cap voltage */
|
||||
if (!m_one_shot_cap_voltage_ext)
|
||||
@ -1993,10 +1993,10 @@ void sn76477_device::sound_stream_update_legacy(sound_stream &stream, stream_sam
|
||||
32767 = 2 * OUT_CENTER_LEVEL_VOLTAGE + OUT_LOW_CLIP_THRESHOLD
|
||||
|
||||
/ Vout - Vmin \
|
||||
sample = | ----------- - 1 | * 32767
|
||||
sample = | ----------- - 1 |
|
||||
\ Vcen - Vmin /
|
||||
*/
|
||||
*buffer++ = (((voltage_out - OUT_LOW_CLIP_THRESHOLD) / (OUT_CENTER_LEVEL_VOLTAGE - OUT_LOW_CLIP_THRESHOLD)) - 1) * 32767;
|
||||
buffer.put(sampindex, ((voltage_out - OUT_LOW_CLIP_THRESHOLD) / (OUT_CENTER_LEVEL_VOLTAGE - OUT_LOW_CLIP_THRESHOLD)) - 1);
|
||||
|
||||
if (LOG_WAV && (!m_enable || !LOG_WAV_ENABLED_ONLY))
|
||||
{
|
||||
|
@ -147,7 +147,7 @@ protected:
|
||||
virtual void device_stop() override;
|
||||
|
||||
// sound stream update overrides
|
||||
virtual void sound_stream_update_legacy(sound_stream &stream, stream_sample_t const * const *inputs, stream_sample_t * const *outputs, int samples) override;
|
||||
virtual void sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs) override;
|
||||
|
||||
private:
|
||||
/* chip's external interface */
|
||||
|
@ -44,7 +44,7 @@ void snkwave_device::device_start()
|
||||
m_sample_rate = m_external_clock >> CLOCK_SHIFT;
|
||||
|
||||
/* get stream channels */
|
||||
m_stream = stream_alloc_legacy(0, 1, m_sample_rate);
|
||||
m_stream = stream_alloc(0, 1, m_sample_rate);
|
||||
|
||||
/* reset all the voices */
|
||||
m_frequency = 0;
|
||||
@ -60,26 +60,26 @@ void snkwave_device::device_start()
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// sound_stream_update_legacy - handle update requests
|
||||
// sound_stream_update - handle update requests
|
||||
// for our sound stream
|
||||
//-------------------------------------------------
|
||||
|
||||
void snkwave_device::sound_stream_update_legacy(sound_stream &stream, stream_sample_t const * const *inputs, stream_sample_t * const *outputs, int samples)
|
||||
void snkwave_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];
|
||||
|
||||
/* zap the contents of the buffer */
|
||||
memset(buffer, 0, samples * sizeof(*buffer));
|
||||
auto &buffer = outputs[0];
|
||||
|
||||
assert(m_counter < 0x1000);
|
||||
assert(m_frequency < 0x1000);
|
||||
|
||||
/* if no sound, we're done */
|
||||
if (m_frequency == 0xfff)
|
||||
{
|
||||
buffer.fill(0);
|
||||
return;
|
||||
}
|
||||
|
||||
/* generate sound into buffer while updating the counter */
|
||||
while (samples-- > 0)
|
||||
for (int sampindex = 0; sampindex < buffer.samples(); sampindex++)
|
||||
{
|
||||
int loops;
|
||||
int16_t out = 0;
|
||||
@ -104,7 +104,7 @@ void snkwave_device::sound_stream_update_legacy(sound_stream &stream, stream_sam
|
||||
}
|
||||
}
|
||||
|
||||
*buffer++ = out;
|
||||
buffer.put_int(sampindex, out, 32768);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,7 @@ protected:
|
||||
virtual void device_start() override;
|
||||
|
||||
// sound stream update overrides
|
||||
virtual void sound_stream_update_legacy(sound_stream &stream, stream_sample_t const * const *inputs, stream_sample_t * const *outputs, int samples) override;
|
||||
virtual void sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs) override;
|
||||
|
||||
private:
|
||||
static constexpr unsigned WAVEFORM_LENGTH = 16;
|
||||
|
@ -74,7 +74,7 @@ void sp0256_device::device_start()
|
||||
m_drq_cb(1);
|
||||
m_sby_cb(1);
|
||||
|
||||
m_stream = stream_alloc_legacy(0, 1, clock() / CLOCK_DIVIDER);
|
||||
m_stream = stream_alloc(0, 1, clock() / CLOCK_DIVIDER);
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/* Configure our internal variables. */
|
||||
@ -1260,16 +1260,16 @@ TIMER_CALLBACK_MEMBER(sp0256_device::set_lrq_timer_proc)
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// sound_stream_update_legacy - handle a stream update
|
||||
// sound_stream_update - handle a stream update
|
||||
//-------------------------------------------------
|
||||
|
||||
void sp0256_device::sound_stream_update_legacy(sound_stream &stream, stream_sample_t const * const *inputs, stream_sample_t * const *outputs, int samples)
|
||||
void sp0256_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs)
|
||||
{
|
||||
stream_sample_t *output = outputs[0];
|
||||
auto &output = outputs[0];
|
||||
int output_index = 0;
|
||||
int length, did_samp/*, old_idx*/;
|
||||
|
||||
while (output_index < samples)
|
||||
while (output_index < output.samples())
|
||||
{
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* First, drain as much of our scratch buffer as we can into the */
|
||||
@ -1278,20 +1278,20 @@ void sp0256_device::sound_stream_update_legacy(sound_stream &stream, stream_samp
|
||||
|
||||
while (m_sc_tail != m_sc_head)
|
||||
{
|
||||
output[output_index++] = m_scratch[m_sc_tail++ & SCBUF_MASK];
|
||||
output.put_int(output_index++, m_scratch[m_sc_tail++ & SCBUF_MASK], 32768);
|
||||
m_sc_tail &= SCBUF_MASK;
|
||||
|
||||
if (output_index > samples)
|
||||
if (output_index >= output.samples())
|
||||
break;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* If output outputs is full, then we're done. */
|
||||
/* ---------------------------------------------------------------- */
|
||||
if (output_index > samples)
|
||||
if (output_index > output.samples())
|
||||
break;
|
||||
|
||||
length = samples - output_index;
|
||||
length = output.samples() - output_index;
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* Process the current set of filter coefficients as long as the */
|
||||
|
@ -61,7 +61,7 @@ protected:
|
||||
virtual void device_reset() override;
|
||||
|
||||
// sound stream update overrides
|
||||
virtual void sound_stream_update_legacy(sound_stream &stream, stream_sample_t const * const *inputs, stream_sample_t * const *outputs, int samples) override;
|
||||
virtual void sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs) override;
|
||||
|
||||
private:
|
||||
struct lpc12_t
|
||||
|
@ -76,7 +76,7 @@
|
||||
#include "sound/spkrdev.h"
|
||||
|
||||
|
||||
static constexpr int16_t default_levels[2] = {0, 32767};
|
||||
static constexpr double default_levels[2] = {0.0, 1.0};
|
||||
|
||||
// Internal oversampling factor (interm. samples vs stream samples)
|
||||
static constexpr int RATE_MULTIPLIER = 4;
|
||||
@ -102,7 +102,7 @@ void speaker_sound_device::device_start()
|
||||
int i;
|
||||
double x;
|
||||
|
||||
m_channel = stream_alloc_legacy(0, 1, machine().sample_rate());
|
||||
m_channel = stream_alloc(0, 1, machine().sample_rate());
|
||||
|
||||
m_level = 0;
|
||||
for (i = 0; i < FILTER_LENGTH; i++)
|
||||
@ -198,23 +198,23 @@ void speaker_sound_device::device_post_load()
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// sound_stream_update_legacy - handle a stream update
|
||||
// sound_stream_update - handle a stream update
|
||||
//-------------------------------------------------
|
||||
|
||||
// This can be triggered by the core (based on emulated time) or via level_w().
|
||||
void speaker_sound_device::sound_stream_update_legacy(sound_stream &stream, stream_sample_t const * const *inputs, stream_sample_t * const *outputs, int samples)
|
||||
void speaker_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];
|
||||
int volume = m_levels[m_level];
|
||||
auto &buffer = outputs[0];
|
||||
double volume = m_levels[m_level];
|
||||
double filtered_volume;
|
||||
attotime sampled_time = attotime::zero;
|
||||
|
||||
if (samples > 0)
|
||||
if (buffer.samples() > 0)
|
||||
{
|
||||
/* Prepare to update time state */
|
||||
sampled_time = attotime(0, m_channel_sample_period);
|
||||
if (samples > 1)
|
||||
sampled_time *= samples;
|
||||
if (buffer.samples() > 1)
|
||||
sampled_time *= buffer.samples();
|
||||
|
||||
/* Note: since the stream is in the process of being updated,
|
||||
* stream->sample_time() will return the time before the update! (MAME 0.130)
|
||||
@ -222,19 +222,19 @@ void speaker_sound_device::sound_stream_update_legacy(sound_stream &stream, stre
|
||||
*/
|
||||
}
|
||||
|
||||
if (samples-- > 0)
|
||||
for (int sampindex = 0; sampindex < buffer.samples(); )
|
||||
{
|
||||
/* Note that first interm. sample may be composed... */
|
||||
filtered_volume = update_interm_samples_get_filtered_volume(volume);
|
||||
|
||||
/* Composite volume is now quantized to the stream resolution */
|
||||
*buffer++ = (stream_sample_t)filtered_volume;
|
||||
buffer.put(sampindex++, filtered_volume);
|
||||
|
||||
/* Any additional samples will be homogeneous, however may need filtering across samples: */
|
||||
while (samples-- > 0)
|
||||
while (sampindex < buffer.samples())
|
||||
{
|
||||
filtered_volume = update_interm_samples_get_filtered_volume(volume);
|
||||
*buffer++ = (stream_sample_t)filtered_volume;
|
||||
buffer.put(sampindex++, filtered_volume);
|
||||
}
|
||||
|
||||
/* Update the time state */
|
||||
@ -322,7 +322,7 @@ void speaker_sound_device::update_interm_samples(const attotime &time, int volum
|
||||
}
|
||||
|
||||
|
||||
double speaker_sound_device::update_interm_samples_get_filtered_volume(int volume)
|
||||
double speaker_sound_device::update_interm_samples_get_filtered_volume(double volume)
|
||||
{
|
||||
double filtered_volume, tempx;
|
||||
|
||||
@ -355,7 +355,7 @@ double speaker_sound_device::update_interm_samples_get_filtered_volume(int volum
|
||||
}
|
||||
|
||||
|
||||
void speaker_sound_device::finalize_interm_sample(int volume)
|
||||
void speaker_sound_device::finalize_interm_sample(double volume)
|
||||
{
|
||||
double fraction;
|
||||
|
||||
|
@ -21,7 +21,7 @@ public:
|
||||
~speaker_sound_device() {}
|
||||
|
||||
// configuration
|
||||
void set_levels(int num_levels, const int16_t *levels) { m_num_levels = num_levels; m_levels = levels; }
|
||||
void set_levels(int num_levels, const double *levels) { m_num_levels = num_levels; m_levels = levels; }
|
||||
|
||||
void level_w(int new_level); // can use as writeline
|
||||
|
||||
@ -32,7 +32,7 @@ protected:
|
||||
virtual void device_post_load() override;
|
||||
|
||||
// sound stream update overrides
|
||||
virtual void sound_stream_update_legacy(sound_stream &stream, stream_sample_t const * const *inputs, stream_sample_t * const *outputs, int samples) override;
|
||||
virtual void sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs) override;
|
||||
|
||||
private:
|
||||
// Length of anti-aliasing filter kernel, measured in number of intermediate samples
|
||||
@ -47,9 +47,9 @@ private:
|
||||
void update_interm_samples(const attotime &time, int volume);
|
||||
|
||||
// Updates the composed volume array and returns final filtered volume of next stream sample
|
||||
double update_interm_samples_get_filtered_volume(int volume);
|
||||
double update_interm_samples_get_filtered_volume(double volume);
|
||||
|
||||
void finalize_interm_sample(int volume);
|
||||
void finalize_interm_sample(double volume);
|
||||
void init_next_interm_sample();
|
||||
inline double make_fraction(const attotime &a, const attotime &b, double timediv);
|
||||
double get_filtered_volume();
|
||||
@ -80,7 +80,7 @@ private:
|
||||
double m_prevx, m_prevy;
|
||||
|
||||
int m_num_levels; /* optional: number of levels (if not two) */
|
||||
const int16_t *m_levels; /* optional: pointer to level lookup table */
|
||||
const double *m_levels; /* optional: pointer to level lookup table */
|
||||
};
|
||||
|
||||
DECLARE_DEVICE_TYPE(SPEAKER_SOUND, speaker_sound_device)
|
||||
|
@ -1093,7 +1093,7 @@ void spu_device::init_stream()
|
||||
{
|
||||
const unsigned int hz=44100;
|
||||
|
||||
m_stream = stream_alloc_legacy(0, 2, hz);
|
||||
m_stream = stream_alloc(0, 2, hz);
|
||||
|
||||
rev=new reverb(hz);
|
||||
|
||||
@ -2761,21 +2761,20 @@ void spu_device::update_timing()
|
||||
//
|
||||
//
|
||||
|
||||
void spu_device::sound_stream_update_legacy(sound_stream &stream, stream_sample_t const * const *inputs, stream_sample_t * const *outputs, int samples)
|
||||
void spu_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs)
|
||||
{
|
||||
stream_sample_t *outL, *outR;
|
||||
int16_t temp[44100], *src;
|
||||
|
||||
outL = outputs[0];
|
||||
outR = outputs[1];
|
||||
auto &outL = outputs[0];
|
||||
auto &outR = outputs[1];
|
||||
|
||||
generate(temp, samples*4); // second parameter is bytes, * 2 (size of int16_t) * 2 (stereo)
|
||||
generate(temp, outputs[0].samples()*4); // second parameter is bytes, * 2 (size of int16_t) * 2 (stereo)
|
||||
|
||||
src = &temp[0];
|
||||
for (int i = 0; i < samples; i++)
|
||||
for (int i = 0; i < outputs[0].samples(); i++)
|
||||
{
|
||||
*outL++ = *src++;
|
||||
*outR++ = *src++;
|
||||
outL.put_int(i, *src++, 32768);
|
||||
outR.put_int(i, *src++, 32768);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3034,7 +3033,7 @@ bool spu_device::play_cdda(const unsigned int sector, const unsigned char *cdda)
|
||||
flip[i] = flip[i+1];
|
||||
flip[i+1] = temp;
|
||||
}
|
||||
// this should be done in generate but sound_stream_update_legacy may not be called frequently enough
|
||||
// this should be done in generate but sound_stream_update may not be called frequently enough
|
||||
if(((spureg.irq_addr << 3) < 0x800) && (spureg.ctrl & spuctrl_irq_enable))
|
||||
m_irq_handler(1);
|
||||
|
||||
|
@ -35,7 +35,7 @@ protected:
|
||||
virtual void device_post_load() override;
|
||||
virtual void device_stop() override;
|
||||
|
||||
virtual void sound_stream_update_legacy(sound_stream &stream, stream_sample_t const * const *inputs, stream_sample_t * const *outputs, int samples) override;
|
||||
virtual void sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs) override;
|
||||
|
||||
static constexpr float ms_to_rate(float ms) { return 1.0f / (ms * (float(spu_base_frequency_hz) / 1000.0f)); }
|
||||
static constexpr float s_to_rate(float s) { return ms_to_rate(s * 1000.0f); }
|
||||
|
@ -43,7 +43,7 @@ st0016_device::st0016_device(const machine_config &mconfig, const char *tag, dev
|
||||
|
||||
void st0016_device::device_start()
|
||||
{
|
||||
m_stream = stream_alloc_legacy(0, 2, 44100);
|
||||
m_stream = stream_alloc(0, 2, 44100);
|
||||
m_ram_read_cb.resolve_safe(0);
|
||||
|
||||
save_item(NAME(m_vpos));
|
||||
@ -54,10 +54,10 @@ void st0016_device::device_start()
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// sound_stream_update_legacy - handle a stream update
|
||||
// sound_stream_update - handle a stream update
|
||||
//-------------------------------------------------
|
||||
|
||||
void st0016_device::sound_stream_update_legacy(sound_stream &stream, stream_sample_t const * const *inputs, stream_sample_t * const *outputs, int samples)
|
||||
void st0016_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs)
|
||||
{
|
||||
int v, i, snum;
|
||||
unsigned char *slot;
|
||||
@ -66,7 +66,7 @@ void st0016_device::sound_stream_update_legacy(sound_stream &stream, stream_samp
|
||||
int16_t sample;
|
||||
int sptr, eptr, freq, lsptr, leptr;
|
||||
|
||||
memset(mix, 0, sizeof(mix[0])*samples*2);
|
||||
memset(mix, 0, sizeof(mix[0])*outputs[0].samples()*2);
|
||||
|
||||
for (v = 0; v < 8; v++)
|
||||
{
|
||||
@ -82,7 +82,7 @@ void st0016_device::sound_stream_update_legacy(sound_stream &stream, stream_samp
|
||||
lsptr = slot[0x06]<<16 | slot[0x05]<<8 | slot[0x04];
|
||||
leptr = slot[0x0a]<<16 | slot[0x09]<<8 | slot[0x08];
|
||||
|
||||
for (snum = 0; snum < samples; snum++)
|
||||
for (snum = 0; snum < outputs[0].samples(); snum++)
|
||||
{
|
||||
sample = m_ram_read_cb((sptr + m_vpos[v]) & 0x1fffff) << 8;
|
||||
|
||||
@ -124,10 +124,10 @@ void st0016_device::sound_stream_update_legacy(sound_stream &stream, stream_samp
|
||||
}
|
||||
|
||||
mixp = &mix[0];
|
||||
for (i = 0; i < samples; i++)
|
||||
for (i = 0; i < outputs[0].samples(); i++)
|
||||
{
|
||||
outputs[0][i] = (*mixp++)>>4;
|
||||
outputs[1][i] = (*mixp++)>>4;
|
||||
outputs[0].put_int(i, *mixp++, 32768<<4);
|
||||
outputs[1].put_int(i, *mixp++, 32768<<4);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ protected:
|
||||
virtual void device_start() override;
|
||||
|
||||
// sound stream update overrides
|
||||
virtual void sound_stream_update_legacy(sound_stream &stream, stream_sample_t const * const *inputs, stream_sample_t * const *outputs, int samples) override;
|
||||
virtual void sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs) override;
|
||||
|
||||
private:
|
||||
sound_stream *m_stream;
|
||||
|
@ -21,7 +21,7 @@ void swp00_device::device_add_mconfig(machine_config &config)
|
||||
|
||||
void swp00_device::device_start()
|
||||
{
|
||||
m_stream = stream_alloc_legacy(0, 2, 44100);
|
||||
m_stream = stream_alloc(0, 2, 44100);
|
||||
}
|
||||
|
||||
void swp00_device::device_reset()
|
||||
@ -97,6 +97,6 @@ void swp00_device::snd_w(offs_t offset, u8 data)
|
||||
|
||||
// Synthesis
|
||||
|
||||
void swp00_device::sound_stream_update_legacy(sound_stream &stream, stream_sample_t const * const *inputs, stream_sample_t * const *outputs, int samples)
|
||||
void swp00_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs)
|
||||
{
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ public:
|
||||
protected:
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
virtual void sound_stream_update_legacy(sound_stream &stream, stream_sample_t const * const *inputs, stream_sample_t * const *outputs, int samples) override;
|
||||
virtual void sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs) override;
|
||||
virtual void rom_bank_updated() override;
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
|
||||
|
@ -69,7 +69,7 @@ void swp20_device::snd_w(offs_t offset, u8 data)
|
||||
logerror("w %02x, %02x %s\n", offset, data, machine().describe_context());
|
||||
}
|
||||
|
||||
void swp20_device::sound_stream_update_legacy(sound_stream &stream, stream_sample_t const * const *inputs, stream_sample_t * const *outputs, int samples)
|
||||
void swp20_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@ public:
|
||||
protected:
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
virtual void sound_stream_update_legacy(sound_stream &stream, stream_sample_t const * const *inputs, stream_sample_t * const *outputs, int samples) override;
|
||||
virtual void sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs) override;
|
||||
virtual void rom_bank_updated() override;
|
||||
|
||||
private:
|
||||
|
@ -163,7 +163,7 @@ void swp30_device::device_add_mconfig(machine_config &config)
|
||||
|
||||
void swp30_device::device_start()
|
||||
{
|
||||
m_stream = stream_alloc_legacy(0, 2, 44100);
|
||||
m_stream = stream_alloc(0, 2, 44100);
|
||||
|
||||
// Attenuantion for panning is 4.4 floating point. That means 0
|
||||
// to -96.3dB. Since it's a nice range, we assume it's the same
|
||||
@ -761,12 +761,12 @@ void swp30_device::snd_w(offs_t offset, u16 data)
|
||||
|
||||
// Synthesis
|
||||
|
||||
void swp30_device::sound_stream_update_legacy(sound_stream &stream, stream_sample_t const * const *inputs, stream_sample_t * const *outputs, int samples)
|
||||
void swp30_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs)
|
||||
{
|
||||
// Loop first on the samples and not on the channels otherwise
|
||||
// effects will be annoying to implement.
|
||||
|
||||
for(int sample = 0; sample < samples; sample++) {
|
||||
for(int sample = 0; sample < outputs[0].samples(); sample++) {
|
||||
// Accumulate on 64 bits, shift/clamp at the end
|
||||
s64 acc_left = 0, acc_right = 0;
|
||||
|
||||
@ -871,17 +871,9 @@ void swp30_device::sound_stream_update_legacy(sound_stream &stream, stream_sampl
|
||||
// Global EQ is missing (it's done in the MEG)
|
||||
|
||||
acc_left >>= (16+6);
|
||||
if(acc_left < -0x8000)
|
||||
acc_left = -0x8000;
|
||||
else if(acc_left > 0x7fff)
|
||||
acc_left = 0x7fff;
|
||||
outputs[0][sample] = acc_left;
|
||||
outputs[0].put_int_clamp(sample, acc_left, 32768);
|
||||
|
||||
acc_right >>= (16+6);
|
||||
if(acc_right < -0x8000)
|
||||
acc_right = -0x8000;
|
||||
else if(acc_right > 0x7fff)
|
||||
acc_right = 0x7fff;
|
||||
outputs[1][sample] = acc_right;
|
||||
outputs[1].put_int_clamp(sample, acc_right, 32768);
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ public:
|
||||
protected:
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
virtual void sound_stream_update_legacy(sound_stream &stream, stream_sample_t const * const *inputs, stream_sample_t * const *outputs, int samples) override;
|
||||
virtual void sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs) override;
|
||||
virtual void rom_bank_updated() override;
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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()
|
||||
{
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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);
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user