mirror of
https://github.com/holub/mame
synced 2025-07-01 16:19:38 +03:00
rf5c68: update stream before writing to wave ram
This commit is contained in:
parent
7065e73b8d
commit
1cc65ff1c9
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user