summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/sound
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/sound')
-rw-r--r--src/devices/sound/315-5641.cpp2
-rw-r--r--src/devices/sound/315-5641.h2
-rw-r--r--src/devices/sound/disc_sys.inc2
-rw-r--r--src/devices/sound/discrete.cpp17
-rw-r--r--src/devices/sound/esqpump.cpp10
-rw-r--r--src/devices/sound/samples.cpp2
6 files changed, 19 insertions, 16 deletions
diff --git a/src/devices/sound/315-5641.cpp b/src/devices/sound/315-5641.cpp
index df5341c7382..dbec291779f 100644
--- a/src/devices/sound/315-5641.cpp
+++ b/src/devices/sound/315-5641.cpp
@@ -1,3 +1,5 @@
+// license:BSD-3-Clause
+// copyright-holders:Angelo Salese
/* Sega 315-5641 / D77591 / 9442CA010 */
#include "emu.h"
diff --git a/src/devices/sound/315-5641.h b/src/devices/sound/315-5641.h
index 49e068fb4ac..e8349236421 100644
--- a/src/devices/sound/315-5641.h
+++ b/src/devices/sound/315-5641.h
@@ -1,3 +1,5 @@
+// license:BSD-3-Clause
+// copyright-holders:Angelo Salese
/* Sega 315-5641 / D77591 / 9442CA010 */
// this is the PICO sound chip, we are not sure if it's the same as a 7759 or not, it requires FIFO logic
diff --git a/src/devices/sound/disc_sys.inc b/src/devices/sound/disc_sys.inc
index 92b00c30383..a166f71ce49 100644
--- a/src/devices/sound/disc_sys.inc
+++ b/src/devices/sound/disc_sys.inc
@@ -61,7 +61,7 @@ DISCRETE_STEP( dso_csvlog )
int nodenum;
/* Dump any csv logs */
- fprintf(m_csv_file, "%" I64FMT "d", ++m_sample_num);
+ fprintf(m_csv_file, "%s", string_format("%I64d", ++m_sample_num).c_str());
for (nodenum = 0; nodenum < this->active_inputs(); nodenum++)
{
fprintf(m_csv_file, ", %f", *this->m_input[nodenum]);
diff --git a/src/devices/sound/discrete.cpp b/src/devices/sound/discrete.cpp
index 926db3a4a40..e09c47c9bf0 100644
--- a/src/devices/sound/discrete.cpp
+++ b/src/devices/sound/discrete.cpp
@@ -39,6 +39,7 @@
#include "sound/wavwrite.h"
#include "discrete.h"
#include <atomic>
+#include <iostream>
/* for_each collides with c++ standard libraries - include it here */
#define for_each(_T, _e, _l) for (_T _e = (_l)->begin_ptr() ; _e <= (_l)->end_ptr(); _e++)
@@ -647,15 +648,15 @@ void discrete_device::display_profiling(void)
total = list_run_time(m_node_list);
count = m_node_list.count();
/* print statistics */
- printf("Total Samples : %16" I64FMT "d\n", m_total_samples);
+ util::stream_format(std::cout, "Total Samples : %16d\n", m_total_samples);
tresh = total / count;
- printf("Threshold (mean): %16" I64FMT "d\n", tresh / m_total_samples );
+ util::stream_format(std::cout, "Threshold (mean): %16d\n", tresh / m_total_samples );
for_each(discrete_base_node **, node, &m_node_list)
{
discrete_step_interface *step;
if ((*node)->interface(step))
if (step->run_time > tresh)
- printf("%3d: %20s %8.2f %10.2f\n", (*node)->index(), (*node)->module_name(), (double) step->run_time / (double) total * 100.0, ((double) step->run_time) / (double) m_total_samples);
+ util::stream_format(std::cout, "%3d: %20s %8.2f %10.2f\n", (*node)->index(), (*node)->module_name(), double(step->run_time) / double(total) * 100.0, double(step->run_time) / double(m_total_samples));
}
/* Task information */
@@ -663,10 +664,10 @@ void discrete_device::display_profiling(void)
{
tt = step_list_run_time((*task)->step_list);
- printf("Task(%d): %8.2f %15.2f\n", (*task)->task_group, tt / (double) total * 100.0, tt / (double) m_total_samples);
+ util::stream_format(std::cout, "Task(%d): %8.2f %15.2f\n", (*task)->task_group, tt / double(total) * 100.0, tt / double(m_total_samples));
}
- printf("Average samples/double->update: %8.2f\n", (double) m_total_samples / (double) m_total_stream_updates);
+ util::stream_format(std::cout, "Average samples/double->update: %8.2f\n", double(m_total_samples) / double(m_total_stream_updates));
}
@@ -737,7 +738,7 @@ void discrete_device::init_nodes(const sound_block_list_t &block_list)
task->task_group = block->initial[0];
if (task->task_group < 0 || task->task_group >= DISCRETE_MAX_TASK_GROUPS)
fatalerror("discrete_dso_task: illegal task_group %d\n", task->task_group);
- //printf("task group %d\n", task->task_group);
+ //util::stream_format(std::cout, "task group %d\n", task->task_group);
task_list.add(task);
}
break;
@@ -870,7 +871,6 @@ void discrete_device::device_start()
//m_stream = machine().sound().stream_alloc(*this, 0, 2, 22257);
const discrete_block *intf_start = m_intf;
- char name[128];
/* If a clock is specified we will use it, otherwise run at the audio sample rate. */
if (this->clock())
@@ -884,9 +884,8 @@ void discrete_device::device_start()
m_total_stream_updates = 0;
/* create the logfile */
- sprintf(name, "discrete%s.log", this->tag());
if (DISCRETE_DEBUGLOG)
- m_disclogfile = fopen(name, "w");
+ m_disclogfile = fopen(util::string_format("discrete%s.log", this->tag()).c_str(), "w");
/* enable profiling */
m_profiling = 0;
diff --git a/src/devices/sound/esqpump.cpp b/src/devices/sound/esqpump.cpp
index 496cc5c832a..9873029e056 100644
--- a/src/devices/sound/esqpump.cpp
+++ b/src/devices/sound/esqpump.cpp
@@ -112,7 +112,7 @@ void esq_5505_5510_pump::sound_stream_update(sound_stream &stream, stream_sample
e[(ei + 0x1d0f) % 0x4000] = e_next;
if (l != e[ei]) {
- fprintf(stderr, "expected (%d) but have (%d)\n", e[ei], l);
+ util::stream_format(std::cerr, "expected (%d) but have (%d)\n", e[ei], l);
}
ei = (ei + 1) % 0x4000;
#endif
@@ -133,9 +133,9 @@ void esq_5505_5510_pump::sound_stream_update(sound_stream &stream, stream_sample
bool silence = silent_for >= 500;
if (was_silence != silence) {
if (!silence) {
- fprintf(stderr, ".-*\n");
+ util::stream_format(std::cerr, ".-*\n");
} else {
- fprintf(stderr, "*-.\n");
+ util::stream_format(std::cerr, "*-.\n");
}
was_silence = silence;
}
@@ -148,7 +148,7 @@ void esq_5505_5510_pump::sound_stream_update(sound_stream &stream, stream_sample
{
osd_ticks_t elapsed = now - last_ticks;
osd_ticks_t tps = osd_ticks_per_second();
- fprintf(stderr, "Pump: %d samples in %" I64FMT "d ticks for %f Hz\n", last_samples, elapsed, last_samples * (double)tps / (double)elapsed);
+ util::stream_format(std::cerr, "Pump: %d samples in %d ticks for %f Hz\n", last_samples, elapsed, last_samples * (double)tps / (double)elapsed);
last_ticks = now;
while (next_report_ticks <= now) {
next_report_ticks += tps;
@@ -156,7 +156,7 @@ void esq_5505_5510_pump::sound_stream_update(sound_stream &stream, stream_sample
last_samples = 0;
#if !PUMP_FAKE_ESP_PROCESSING
- fprintf(stderr, " ESP spent %" I64FMT "d ticks on %d samples, %f ticks per sample\n", ticks_spent_processing, samples_processed, (double)ticks_spent_processing / (double)samples_processed);
+ util::stream_format(std::cerr, " ESP spent %d ticks on %d samples, %f ticks per sample\n", ticks_spent_processing, samples_processed, (double)ticks_spent_processing / (double)samples_processed);
ticks_spent_processing = 0;
samples_processed = 0;
#endif
diff --git a/src/devices/sound/samples.cpp b/src/devices/sound/samples.cpp
index 7a756dbb0fe..62bd8e02657 100644
--- a/src/devices/sound/samples.cpp
+++ b/src/devices/sound/samples.cpp
@@ -571,7 +571,7 @@ bool samples_device::read_flac_sample(emu_file &file, sample_t &sample)
file.seek(0, SEEK_SET);
// create the FLAC decoder and fill in the sample data
- flac_decoder decoder((core_file&) file);
+ flac_decoder decoder((util::core_file &)file);
sample.frequency = decoder.sample_rate();
// error if more than 1 channel or not 16bpp