summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/sound/k007232.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/sound/k007232.cpp')
-rw-r--r--src/devices/sound/k007232.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/devices/sound/k007232.cpp b/src/devices/sound/k007232.cpp
index 32623f187df..125ebc1352e 100644
--- a/src/devices/sound/k007232.cpp
+++ b/src/devices/sound/k007232.cpp
@@ -70,13 +70,11 @@ void k007232_device::device_start()
space(0).cache(m_cache);
/* Set up the chips */
- m_port_write_handler.resolve_safe();
-
for (int i = 0; i < KDAC_A_PCM_MAX; i++)
{
m_channel[i].addr = 0;
m_channel[i].start = 0;
- m_channel[i].counter = 0x200;
+ m_channel[i].counter = 0x1000;
m_channel[i].step = 0;
m_channel[i].play = 0;
m_channel[i].bank = 0;
@@ -151,7 +149,8 @@ void k007232_device::write(offs_t offset, u8 data)
{
case 0: // address step, LSB
case 1: // address step, MSB
- channel->step = (BIT(m_wreg[reg_index + 1], 0) << 8) | m_wreg[reg_index];
+ channel->step = (BIT(m_wreg[reg_index + 1], 0, 4) << 8) | m_wreg[reg_index];
+ // TODO: Bit 4-5 is frequency divider, but not implemented now
break;
case 2:
case 3:
@@ -164,7 +163,7 @@ void k007232_device::write(offs_t offset, u8 data)
{
channel->play = true;
channel->addr = channel->start;
- channel->counter = 0x200;
+ channel->counter = 0x1000;
}
break;
}
@@ -185,7 +184,7 @@ u8 k007232_device::read(offs_t offset)
{
channel->play = true;
channel->addr = channel->start;
- channel->counter = 0x200;
+ channel->counter = 0x1000;
}
}
return 0;
@@ -251,7 +250,7 @@ void k007232_device::sound_stream_update(sound_stream &stream, std::vector<read_
int vol_b = channel->vol[1] * 2;
u32 addr = channel->addr & 0x1ffff;
- while (channel->counter <= channel->step) // result : clock / (4 * (512 - frequency))
+ while (channel->counter <= channel->step) // result : clock / (4 * (4096 - frequency))
{
if (BIT(read_sample(i, addr++), 7) || addr >= m_pcmlimit)
{
@@ -268,7 +267,7 @@ void k007232_device::sound_stream_update(sound_stream &stream, std::vector<read_
break;
}
}
- channel->counter += (0x200 - channel->step);
+ channel->counter += (0x1000 - channel->step);
}
channel->addr = addr;