k005289: fix off by 1 error

This commit is contained in:
hap 2023-07-06 00:30:24 +02:00
parent 8518da9e35
commit eada43fdd4

View File

@ -37,10 +37,6 @@
#include "emu.h"
#include "k005289.h"
// is this an actual hardware limit? or just an arbitrary divider
// to bring the output frequency down to a reasonable value for MAME?
#define CLOCK_DIVIDER 32
// device type definition
DEFINE_DEVICE_TYPE(K005289, k005289_device, "k005289", "K005289 SCC")
@ -97,7 +93,7 @@ void k005289_device::sound_stream_update(sound_stream &stream, std::vector<read_
for (int i = 0; i < 2; i++)
{
voice_t &v = m_voice[i];
if ((v.counter--) < 0)
if ((v.counter--) <= 0)
{
v.waveform = (v.waveform & ~0x1f) | ((v.waveform + 1) & 0x1f);
v.counter = v.frequency;