diff options
-rw-r--r-- | src/emu/resampler.cpp | 2 | ||||
-rw-r--r-- | src/emu/sound.cpp | 18 | ||||
-rw-r--r-- | src/mame/phoenix/phoenix.cpp | 9 | ||||
-rw-r--r-- | src/osd/modules/sound/pulse_sound.cpp | 14 |
4 files changed, 15 insertions, 28 deletions
diff --git a/src/emu/resampler.cpp b/src/emu/resampler.cpp index d319c4c0eb9..b86e028ce04 100644 --- a/src/emu/resampler.cpp +++ b/src/emu/resampler.cpp @@ -417,7 +417,7 @@ void audio_resampler_lofi::apply(const emu::detail::output_buffer_flat<sample_t> sample_t *d = dest.data(); for(u32 sample = 0; sample != samples; sample++) { - *d++ = gain * (- s0 * interpolation_table[0][0x1000-phase] + s1 * interpolation_table[1][0x1000-phase] + s2 * interpolation_table[1][phase] - s3 * interpolation_table[0][phase]); + *d++ += gain * (- s0 * interpolation_table[0][0x1000-phase] + s1 * interpolation_table[1][0x1000-phase] + s2 * interpolation_table[1][phase] - s3 * interpolation_table[0][phase]); phase += m_step; if(phase & 0x1000) { diff --git a/src/emu/sound.cpp b/src/emu/sound.cpp index e64941f558c..1d0d3d753b8 100644 --- a/src/emu/sound.cpp +++ b/src/emu/sound.cpp @@ -844,13 +844,7 @@ void sound_manager::after_devices_init() m_record_buffer.resize(m_outputs_count * machine().sample_rate(), 0); m_record_samples = 0; - // Have all streams create their initial resamplers - for(auto &stream : m_stream_list) - stream->create_resamplers(); - - // Then get the initial history sizes - for(auto &stream : m_stream_list) - stream->lookup_history_sizes(); + // Resamplers will be created at config load time m_effects_done = false; @@ -917,6 +911,7 @@ void sound_manager::output_push(int id, sound_stream &stream) *outb1 = std::clamp(int(*inb++ * 32768), -32768, 32767); outb1 += m_outputs_count; } + outb++; } } @@ -1119,6 +1114,7 @@ void sound_manager::config_load(config_type cfg_type, config_level cfg_level, ut break; case config_type::DEFAULT: { + fprintf(stderr, "loading resampler config\n"); // In the global config, get the default effect chain configuration util::xml::data_node const *efl_node = parentnode->get_child("default_audio_effects"); @@ -1138,6 +1134,7 @@ void sound_manager::config_load(config_type cfg_type, config_level cfg_level, ut m_resampler_hq_latency = rs_node->get_attribute_float("hq_latency", 0.0050); m_resampler_hq_length = rs_node->get_attribute_int("hq_length", 400); m_resampler_hq_phases = rs_node->get_attribute_int("hq_phases", 200); + rebuild_all_resamplers(); } break; } @@ -1219,6 +1216,8 @@ void sound_manager::config_save(config_type cfg_type, util::xml::data_node *pare break; case config_type::DEFAULT: { + fprintf(stderr, "saving resampler config\n"); + // In the global config, save the default effect chain configuration util::xml::data_node *const efl_node = parentnode->add_child("default_audio_effects", nullptr); for(u32 ei = 0; ei != m_default_effects.size(); ei++) { @@ -2413,7 +2412,7 @@ void sound_manager::mapping_update() u64 sound_manager::rate_and_time_to_index(attotime time, u32 sample_rate) const { - return time.m_seconds * sample_rate + ((time.m_attoseconds / 100'000'000) * sample_rate) / 10'000'000'000LL; + return time.m_seconds * sample_rate + ((time.m_attoseconds / 100'000'000) * sample_rate) / 10'000'000'000LL; //' } void sound_manager::update(s32) @@ -2479,7 +2478,7 @@ void sound_manager::streams_update() machine().osd().add_audio_to_recording(m_record_buffer.data(), m_record_samples); machine().video().add_sound_to_recording(m_record_buffer.data(), m_record_samples); if(m_wavfile) - util::wav_add_data_16(*m_wavfile, m_record_buffer.data(), m_record_samples); + util::wav_add_data_16(*m_wavfile, m_record_buffer.data(), m_record_samples * m_outputs_count); m_effects_condition.notify_all(); } @@ -2491,6 +2490,7 @@ const audio_resampler *sound_manager::get_resampler(u32 fs, u32 ft) auto i = m_resamplers.find(key); if(i != m_resamplers.end()) return i->second.get(); + fprintf(stderr, "creating %d %d (%d)\n", fs, ft, m_resampler_type); audio_resampler *res; if(m_resampler_type == RESAMPLER_HQ) res = new audio_resampler_hq(fs, ft, m_resampler_hq_latency, m_resampler_hq_length, m_resampler_hq_phases); diff --git a/src/mame/phoenix/phoenix.cpp b/src/mame/phoenix/phoenix.cpp index b169b73c689..63e62fec3dc 100644 --- a/src/mame/phoenix/phoenix.cpp +++ b/src/mame/phoenix/phoenix.cpp @@ -1349,17 +1349,16 @@ ROM_START( nextfase ) ROM_LOAD( "7910cg", 0x000, 0x800, NO_DUMP ) // actual size unknown, needs decapping ROM_REGION( 0x1000, "bgtiles", 0 ) - ROM_LOAD( "nf11.bin", 0x0000, 0x0800, CRC(3c7e623f) SHA1(e7ff5fc371664af44785c079e92eeb2d8530187b) ) - ROM_LOAD( "nf12.bin", 0x0800, 0x0800, CRC(59916d3b) SHA1(71aec70a8e096ed1f0c2297b3ae7dca1b8ecc38d) ) + ROM_LOAD( "nf11.bin", 0x0000, 0x0800, CRC(3c7e623f) SHA1(e7ff5fc371664af44785c079e92eeb2d8530187b) ) + ROM_LOAD( "nf12.bin", 0x0800, 0x0800, CRC(59916d3b) SHA1(71aec70a8e096ed1f0c2297b3ae7dca1b8ecc38d) ) ROM_REGION( 0x1000, "fgtiles", 0 ) ROM_LOAD( "nf09.bin", 0x0000, 0x0800, CRC(bacbfa88) SHA1(bf378a729726db01448f2cc4820f06e17659d674) ) ROM_LOAD( "nf10.bin", 0x0800, 0x0800, CRC(3143a9ee) SHA1(371bb314dc9e4ec6ed469eb81391061296c547ec) ) - // PROMs were missing from this dump, these might not be correct ROM_REGION( 0x0200, "proms", 0 ) - ROM_LOAD( "mmi6301.ic40", 0x0000, 0x0100, CRC(79350b25) SHA1(57411be4c1d89677f7919ae295446da90612c8a8) ) // palette low bits - ROM_LOAD( "mmi6301.ic41", 0x0100, 0x0100, CRC(e176b768) SHA1(e2184dd495ed579f10b6da0b78379e02d7a6229f) ) // palette high bits + ROM_LOAD( "nf.ic40", 0x0000, 0x0100, CRC(725747be) SHA1(c8a4cc47149230ac859c19a24d2860d7d58885f2) ) // palette low bits + ROM_LOAD( "nf.ic41", 0x0100, 0x0100, CRC(a91055ab) SHA1(14273bde9e05b7e2e14e77cac400ffda0ce7e71f) ) // palette high bits ROM_END ROM_START( phoenixs ) diff --git a/src/osd/modules/sound/pulse_sound.cpp b/src/osd/modules/sound/pulse_sound.cpp index 4b7c87b6b9b..820ca149c39 100644 --- a/src/osd/modules/sound/pulse_sound.cpp +++ b/src/osd/modules/sound/pulse_sound.cpp @@ -152,7 +152,6 @@ void sound_pulse::generic_pa_error(const char *msg, int err) void sound_pulse::context_notify() { - fprintf(stderr, "context notify\n"); pa_context_state state = pa_context_get_state(m_context); if(state == PA_CONTEXT_READY) { pa_context_subscribe(m_context, PA_SUBSCRIPTION_MASK_ALL, nullptr, this); @@ -173,7 +172,6 @@ void sound_pulse::stream_notify(stream_info *stream) { pa_stream_state state = pa_stream_get_state(stream->m_stream); - fprintf(stderr, "stream notify\n"); if(state == PA_STREAM_READY || state == PA_STREAM_FAILED || state == PA_STREAM_TERMINATED) { m_wait_stream = false; pa_threaded_mainloop_signal(m_mainloop, 0); @@ -216,7 +214,6 @@ void sound_pulse::server_info(const pa_server_info *i) { m_default_audio_sink = i->default_sink_name; m_default_audio_source = i->default_source_name; - fprintf(stderr, "defaults %s %s\n", i->default_sink_name, i->default_source_name); m_generation++; if(m_wait_init) { m_wait_init = false; @@ -243,7 +240,6 @@ void sound_pulse::source_info(const pa_source_info *i, int eol) return; } - fprintf(stderr, "new source %d (%s)\n", i->index, i->description); m_node_osdid_to_id[m_node_current_id] = i->index; auto &node = m_nodes.emplace(i->index, node_info(this, i->index, m_node_current_id++, AREC, i->name, i->description)).first->second; @@ -274,8 +270,6 @@ void sound_pulse::sink_info_new(const pa_sink_info *i, int eol) return; } - fprintf(stderr, "new sink %d (%s)\n", i->index, i->description); - fprintf(stderr, "rate %d\n", i->sample_spec.rate); m_node_osdid_to_id[m_node_current_id] = i->index; auto &node = m_nodes.emplace(i->index, node_info(this, i->index, m_node_current_id++, APLAY, i->name, i->description)).first->second; @@ -312,13 +306,11 @@ void sound_pulse::sink_input_info_change(stream_info *stream, const pa_sink_inpu for(uint32_t port = 0; port != stream->m_channels; port++) stream->m_volumes[port] = pa_sw_volume_to_dB(i->volume.values[port]); - fprintf(stderr, "change stream %d/%d sink=%s [%f %f]\n", stream->m_osdid, stream->m_pulse_id, stream->m_target_node->m_desc.c_str(), stream->m_volumes[0], stream->m_volumes[1]); m_generation++; } void sound_pulse::i_sink_input_info_change(pa_context *, const pa_sink_input_info *i, int eol, void *self) { - fprintf(stderr, "i_sink_input_info_change %p %d\n", i, eol); stream_info *stream = static_cast<stream_info *>(self); stream->m_pulse->sink_input_info_change(stream, i, eol); } @@ -326,15 +318,12 @@ void sound_pulse::i_sink_input_info_change(pa_context *, const pa_sink_input_inf void sound_pulse::context_subscribe(pa_subscription_event_type_t t, uint32_t idx) { // This is called with the thread locked - static const char *const evt[] = { "sink", "source", "sink-input", "source-output", "module", "client", "cache", "server", "autoload", "card" }; - static const char *const evt2[] = { "new", "change", "remove" }; switch(int(t)) { case PA_SUBSCRIPTION_EVENT_REMOVE | PA_SUBSCRIPTION_EVENT_SINK: case PA_SUBSCRIPTION_EVENT_REMOVE | PA_SUBSCRIPTION_EVENT_SOURCE: { auto si = m_nodes.find(idx); if(si == m_nodes.end()) break; - fprintf(stderr, "removing %s\n", si->second.m_desc.c_str()); for(auto &istream : m_streams) if(istream.second.m_target_node == &si->second) istream.second.m_target_node = nullptr; @@ -367,7 +356,7 @@ void sound_pulse::context_subscribe(pa_subscription_event_type_t t, uint32_t idx } default: - fprintf(stderr, "event %s %s %d\n", evt2[t>>4], evt[t&15], idx); + break; } } @@ -489,7 +478,6 @@ uint32_t sound_pulse::stream_sink_open(uint32_t node, std::string name, uint32_t stream.m_pulse_id = pa_stream_get_index(stream.m_stream); m_stream_pulse_id_to_osdid[stream.m_pulse_id] = id; - fprintf(stderr, "stream id %d\n", stream.m_pulse_id); pa_threaded_mainloop_unlock(m_mainloop); return id; |