From f7b67d7fa10ec23ec7d4f44926c37db0af57c10d Mon Sep 17 00:00:00 2001 From: Olivier Galibert Date: Fri, 8 Dec 2023 14:58:03 +0100 Subject: ks0164: reduce the octave bits to 4 --- src/devices/sound/ks0164.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/devices/sound/ks0164.cpp b/src/devices/sound/ks0164.cpp index d1188ce4d55..fc45a2f74cb 100644 --- a/src/devices/sound/ks0164.cpp +++ b/src/devices/sound/ks0164.cpp @@ -338,7 +338,7 @@ void ks0164_device::voice_w(offs_t offset, u16 data, u16 mem_mask) if(0 && 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", + logerror("keyon %02x mode=%04x (%s %c %c %c %c) cur=%02x%04x.%04x loop=%02x%04x.%04x end=%02x%04x.%04x pitch=%x.%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", m_voice_select, m_sregs[m_voice_select & 0x1f][0x00], @@ -361,8 +361,8 @@ void ks0164_device::voice_w(offs_t offset, u16 data, u16 mem_mask) m_sregs[m_voice_select & 0x1f][0x0e], m_sregs[m_voice_select & 0x1f][0x0f], - m_sregs[m_voice_select & 0x1f][0x08] & 0x1f, // pitch - m_sregs[m_voice_select & 0x1f][0x08] >> 5, + m_sregs[m_voice_select & 0x1f][0x08] & 0xf, // pitch + m_sregs[m_voice_select & 0x1f][0x08] >> 4, m_sregs[m_voice_select & 0x1f][0x10] >> 9, m_sregs[m_voice_select & 0x1f][0x12] >> 9, @@ -496,10 +496,10 @@ void ks0164_device::sound_stream_update(sound_stream &stream, std::vector> 16); - u32 step = 0x10000 | (regs[8] & ~0x1f); - u32 shift = regs[8] & 0x1f; - if(shift > 0x10) - step >>= 0x20 - shift; + u32 step = 0x10000 | (regs[8] & ~0xf); + u32 shift = regs[8] & 0xf; + if(shift >= 0x8) + step >>= 0x10 - shift; else if(shift) step <<= shift; current += step; -- cgit v1.2.3