summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author hap <happppp@users.noreply.github.com>2021-04-02 17:03:41 +0200
committer hap <happppp@users.noreply.github.com>2021-04-02 17:03:54 +0200
commit1cc65ff1c94df68b9b679557d1819b377a416b7f (patch)
treec956d6b1c45679d2cd2eed002ae82fde1a57aef0
parent7065e73b8d48db1ad582510d9c4079405fa812f7 (diff)
rf5c68: update stream before writing to wave ram
-rw-r--r--src/devices/sound/multipcm.cpp10
-rw-r--r--src/devices/sound/rf5c68.cpp8
2 files changed, 8 insertions, 10 deletions
diff --git a/src/devices/sound/multipcm.cpp b/src/devices/sound/multipcm.cpp
index 6f12ccf37c0..b3dd084580f 100644
--- a/src/devices/sound/multipcm.cpp
+++ b/src/devices/sound/multipcm.cpp
@@ -44,7 +44,7 @@ ALLOW_SAVE_TYPE(multipcm_device::state_t); // allow save_item on a non-fundament
ENVELOPE SECTION
*******************************/
-//Times are based on a 44100Hz timebase. It's adjusted to the actual sampling rate on startup
+// Times are based on a 44100Hz timebase. It's adjusted to the actual sampling rate on startup
const double multipcm_device::BASE_TIMES[64] = {
0, 0, 0, 0,
@@ -458,7 +458,8 @@ void multipcm_device::write(offs_t offset, uint8_t data)
}
}
-/* MAME/M1 access functions */
+
+/* MAME access functions */
DEFINE_DEVICE_TYPE(MULTIPCM, multipcm_device, "ymw258f", "Yamaha YMW-258-F")
@@ -547,7 +548,7 @@ void multipcm_device::device_start()
}
}
- //Pitch steps
+ // Pitch steps
m_freq_step_table = make_unique_clear<uint32_t[]>(0x400);
for (int32_t i = 0; i < 0x400; ++i)
{
@@ -641,8 +642,7 @@ void multipcm_device::device_clock_changed()
}
//-----------------------------------------------------
-// convert_to_stream_sample - clamp a 32-bit value to
-// 16 bits and convert to a stream_buffer::sample_t
+// dump_sample - dump current sample to WAV file
//-----------------------------------------------------
#if MULTIPCM_LOG_SAMPLES
diff --git a/src/devices/sound/rf5c68.cpp b/src/devices/sound/rf5c68.cpp
index f91e370b95f..09fd397d4fb 100644
--- a/src/devices/sound/rf5c68.cpp
+++ b/src/devices/sound/rf5c68.cpp
@@ -211,10 +211,8 @@ void rf5c68_device::sound_stream_update(sound_stream &stream, std::vector<read_s
// TODO: RF5C164 only?
u8 rf5c68_device::rf5c68_r(offs_t offset)
{
- u8 shift;
-
m_stream->update();
- shift = (offset & 1) ? 11 + 8 : 11;
+ u8 shift = (offset & 1) ? 11 + 8 : 11;
// printf("%08x\n",(m_chan[(offset & 0x0e) >> 1].addr));
@@ -224,7 +222,6 @@ u8 rf5c68_device::rf5c68_r(offs_t offset)
void rf5c68_device::rf5c68_w(offs_t offset, u8 data)
{
pcm_channel &chan = m_chan[m_cbank];
- int i;
/* force the stream to update first */
m_stream->update();
@@ -271,7 +268,7 @@ void rf5c68_device::rf5c68_w(offs_t offset, u8 data)
break;
case 0x08: /* channel on/off reg */
- for (i = 0; i < 8; i++)
+ for (int i = 0; i < 8; i++)
{
m_chan[i].enable = (~data >> i) & 1;
if (!m_chan[i].enable)
@@ -298,5 +295,6 @@ u8 rf5c68_device::rf5c68_mem_r(offs_t offset)
void rf5c68_device::rf5c68_mem_w(offs_t offset, u8 data)
{
+ m_stream->update();
m_cache.write_byte(m_wbank | offset, data);
}