From 9c01af9fa45cd724666909c75580e20057de5b25 Mon Sep 17 00:00:00 2001 From: Olivier Galibert Date: Sun, 29 Oct 2023 15:51:36 +0100 Subject: ks0164: Correct loop flag and pan swap --- src/devices/sound/ks0164.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/devices/sound/ks0164.cpp b/src/devices/sound/ks0164.cpp index 0a609ef3794..5b6f073b295 100644 --- a/src/devices/sound/ks0164.cpp +++ b/src/devices/sound/ks0164.cpp @@ -328,7 +328,7 @@ void ks0164_device::voice_w(offs_t offset, u16 data, u16 mem_mask) m_stream->update(); u16 old = m_sregs[m_voice_select & 0x1f][offset]; COMBINE_DATA(&m_sregs[m_voice_select & 0x1f][offset]); - if(0 && m_sregs[m_voice_select & 0x1f][offset] != old) + if(1 && m_sregs[m_voice_select & 0x1f][offset] != old && offset == 0) logerror("voice %02x.%02x = %04x @ %04x (%04x)\n", m_voice_select & 0x1f, offset, m_sregs[m_voice_select & 0x1f][offset], mem_mask, m_cpu->pc()); if(offset == 0 && (data & 1) && !(old & 1)) logerror("keyon %02x mode=%04x (%s %c %c %c %c) cur=%02x%04x.%04x loop=%02x%04x.%04x end=%02x%04x.%04x pitch=%02x.%03x 10=%02x/%02x:%02x/%02x 14=%03x/%03x:%03x/%03x 18=%04x/%04x c=%04x %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x\n", @@ -338,8 +338,8 @@ void ks0164_device::voice_w(offs_t offset, u16 data, u16 mem_mask) m_sregs[m_voice_select & 0x1f][0x00] & 0x8000 ? " 8" : "16", // 8-bit/16-bit samples m_sregs[m_voice_select & 0x1f][0x00] & 0x0400 ? 'c' : 'l', // compressed/linear samples - m_sregs[m_voice_select & 0x1f][0x00] & 0x0010 ? 'r' : '-', // loop - m_sregs[m_voice_select & 0x1f][0x00] & 0x0008 ? '3' : '-', + m_sregs[m_voice_select & 0x1f][0x00] & 0x0010 ? '4' : '-', + m_sregs[m_voice_select & 0x1f][0x00] & 0x0008 ? 'l' : '-', // loop m_sregs[m_voice_select & 0x1f][0x00] & 0x0004 ? '2' : '-', m_sregs[m_voice_select & 0x1f][0x01], // cur @@ -470,10 +470,6 @@ void ks0164_device::sound_stream_update(sound_stream &stream, std::vector> 16; s16 samp0, samp1; switch(regs[0] & 0x8400) { @@ -503,7 +499,7 @@ void ks0164_device::sound_stream_update(sound_stream &stream, std::vector= end) { - if (!(regs[0] & 0x10)) { + if (regs[0] & 8) { u64 loop = (u64(regs[9]) << 32) | (regs[0xa] << 16) | regs[0xb]; current = current - end + loop; } else { @@ -514,8 +510,8 @@ void ks0164_device::sound_stream_update(sound_stream &stream, std::vector> 16; regs[3] = current; - suml += (s64(samp) * regs[0x10] * regs[0x14]) >> 32; - sumr += (s64(samp) * regs[0x12] * regs[0x16]) >> 32; + suml += (s64(samp) * regs[0x12] * regs[0x16]) >> 32; + sumr += (s64(samp) * regs[0x10] * regs[0x14]) >> 32; if(regs[0xc]) { regs[0x10] += regs[0x11]; -- cgit v1.2.3