Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/devices/sound/es5506.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1039,7 +1039,8 @@ void es5506_device::generate_samples(sound_stream &stream)
}

for (int c = 0; c < stream.output_count(); c++)
stream.put_int(c, sampindex, cursample[c], 32768);
// generated samples are 20-bit signed, range is [-2^19 .. 2^19-1]
stream.put_int_clamp(c, sampindex, cursample[c], (1 << 19));
}
}

Expand Down Expand Up @@ -1077,7 +1078,8 @@ void es5505_device::generate_samples(sound_stream &stream)
}

for (int c = 0; c < stream.output_count(); c++)
stream.put_int(c, sampindex, cursample[c], 32768);
// generated samples are 20-bit signed, range is [-2^19 .. 2^19-1]
stream.put_int_clamp(c, sampindex, cursample[c], (1 << 19));
}
}

Expand Down
12 changes: 6 additions & 6 deletions src/devices/sound/esqpump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ void esq_5505_5510_pump_device::device_clock_changed()

void esq_5505_5510_pump_device::sound_stream_update(sound_stream &stream)
{
#define SAMPLE_SHIFT 4
constexpr sound_stream::sample_t input_scale = 32768.0 / (1 << SAMPLE_SHIFT);
constexpr sound_stream::sample_t input_scale = 32768.0;
constexpr sound_stream::sample_t output_scale = 1.0 / input_scale;

// Push the 'Aux' output samples directly into the output stream
stream.put(2, 0, stream.get(0, 0) * (1.0 / (1 << SAMPLE_SHIFT)));
stream.put(3, 0, stream.get(1, 0) * (1.0 / (1 << SAMPLE_SHIFT)));
stream.put(2, 0, stream.get(0, 0));
stream.put(3, 0, stream.get(1, 0));

// Push the 'FX1', 'FX2' and 'DRY' samples into the ESP
m_esp->ser_w(0, s32(stream.get(2, 0) * input_scale));
Expand All @@ -92,8 +92,8 @@ void esq_5505_5510_pump_device::sound_stream_update(sound_stream &stream)
#endif

// Read the processed result from the ESP.
sound_stream::sample_t l = sound_stream::sample_t(m_esp->ser_r(6)) * (1.0 / 32768.0);
sound_stream::sample_t r = sound_stream::sample_t(m_esp->ser_r(7)) * (1.0 / 32768.0);
sound_stream::sample_t l = sound_stream::sample_t(m_esp->ser_r(6)) * output_scale;
sound_stream::sample_t r = sound_stream::sample_t(m_esp->ser_r(7)) * output_scale;

#if !PUMP_FAKE_ESP_PROCESSING && PUMP_REPLACE_ESP_PROGRAM
// if we're processing the fake program through the ESP, the result should just be that of adding the inputs
Expand Down
8 changes: 4 additions & 4 deletions src/mame/itech/itech32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1797,8 +1797,8 @@ void itech32_state::base_devices(machine_config &config)
m_ensoniq->set_region2("ensoniq.2");
m_ensoniq->set_region3("ensoniq.3");
m_ensoniq->set_channels(1); // channels
m_ensoniq->add_route(0, "speaker", 0.1, 1); // swapped stereo
m_ensoniq->add_route(1, "speaker", 0.1, 0);
m_ensoniq->add_route(0, "speaker", 1.6, 1); // swapped stereo
m_ensoniq->add_route(1, "speaker", 1.6, 0);
}

void itech32_state::via(machine_config &config)
Expand Down Expand Up @@ -1872,8 +1872,8 @@ void drivedge_state::drivedge(machine_config &config)
SPEAKER(config, "back", 2).rear();

m_ensoniq->set_channels(2);
m_ensoniq->add_route(2, "back", 0.1, 1); // swapped stereo
m_ensoniq->add_route(3, "back", 0.1, 0);
m_ensoniq->add_route(2, "back", 1.6, 1); // swapped stereo
m_ensoniq->add_route(3, "back", 1.6, 0);
}

void shoottv_state::shoottv(machine_config &config)
Expand Down
4 changes: 2 additions & 2 deletions src/mame/nmk/macrossp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1025,8 +1025,8 @@ void macrossp_state::macrossp(machine_config &config)
ensoniq.set_addrmap(1, &macrossp_state::es5506_bank1_map);
ensoniq.set_channels(1);
ensoniq.irq_cb().set(FUNC(macrossp_state::irqhandler));
ensoniq.add_route(0, "speaker", 0.1, 0);
ensoniq.add_route(1, "speaker", 0.1, 1);
ensoniq.add_route(0, "speaker", 1.6, 0);
ensoniq.add_route(1, "speaker", 1.6, 1);
}

void macrossp_state::quizmoon(machine_config &config)
Expand Down
4 changes: 2 additions & 2 deletions src/mame/seta/ssv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2453,8 +2453,8 @@ void ssv_state::ssv(machine_config &config)
m_ensoniq->set_region2("ensoniq.2");
m_ensoniq->set_region3("ensoniq.3");
m_ensoniq->set_channels(1);
m_ensoniq->add_route(0, "speaker", 0.075, 0);
m_ensoniq->add_route(1, "speaker", 0.075, 1);
m_ensoniq->add_route(0, "speaker", 1.2, 0);
m_ensoniq->add_route(1, "speaker", 1.2, 1);
}

void drifto94_state::drifto94(machine_config &config)
Expand Down
8 changes: 4 additions & 4 deletions src/mame/virtual/vgmplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4050,15 +4050,15 @@ void vgmplay_state::vgmplay(machine_config &config)
// TODO m_es5505[0]->set_addrmap(0, &vgmplay_state::es5505_map<0>);
// TODO m_es5505[0]->set_addrmap(1, &vgmplay_state::es5505_map<0>);
m_es5505[0]->set_channels(1);
m_es5505[0]->add_route(0, m_viz, 0.5, 0);
m_es5505[0]->add_route(1, m_viz, 0.5, 1);
m_es5505[0]->add_route(0, m_viz, 8.0, 0);
m_es5505[0]->add_route(1, m_viz, 8.0, 1);

ES5505(config, m_es5505[1], 0);
// TODO m_es5505[1]->set_addrmap(0, &vgmplay_state::es5505_map<1>);
// TODO m_es5505[1]->set_addrmap(1, &vgmplay_state::es5505_map<1>);
m_es5505[1]->set_channels(1);
m_es5505[1]->add_route(0, m_viz, 0.5, 0);
m_es5505[1]->add_route(1, m_viz, 0.5, 1);
m_es5505[1]->add_route(0, m_viz, 8.0, 0);
m_es5505[1]->add_route(1, m_viz, 8.0, 1);

X1_010(config, m_x1_010[0], 0);
m_x1_010[0]->set_addrmap(0, &vgmplay_state::x1_010_map<0>);
Expand Down
Loading