summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author arbee <rb6502@users.noreply.github.com>2022-01-06 20:27:01 -0500
committer arbee <rb6502@users.noreply.github.com>2022-01-06 20:27:01 -0500
commit20adc731c24b8be2f7b963c8ed6a41829f7f5617 (patch)
treeb2b5564d8d42e0cb02f839927757cbfc327771f7 /src
parent3745fcb6904b225204810e5f954a47fde53f5ad5 (diff)
es5503: fix interpretation of oscillator enable register. (GitHub bug #9045) [R. Belmont]
Diffstat (limited to 'src')
-rw-r--r--src/devices/sound/es5503.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/devices/sound/es5503.cpp b/src/devices/sound/es5503.cpp
index 4efe61a0d7d..d4fc9a422ef 100644
--- a/src/devices/sound/es5503.cpp
+++ b/src/devices/sound/es5503.cpp
@@ -2,7 +2,7 @@
// copyright-holders:R. Belmont
/*
- ES5503 - Ensoniq ES5503 "DOC" emulator v2.1.2
+ ES5503 - Ensoniq ES5503 "DOC" emulator v2.1.3
By R. Belmont.
Copyright R. Belmont.
@@ -33,6 +33,7 @@
2.1.2 (RB) - Fixed SoundSmith POLY.SYNTH inst where one-shot on the even oscillator and swap on the odd should loop.
Conversely, the intro voice in FTA Delta Demo has swap on the even and one-shot on the odd and doesn't
want to loop.
+ 2.1.3 (RB) - Fixed oscillator enable register off-by-1 which caused everything to be half a step sharp.
*/
#include "emu.h"
@@ -144,7 +145,7 @@ void es5503_device::sound_stream_update(sound_stream &stream, std::vector<read_s
for (int chan = 0; chan < output_channels; chan++)
{
- for (osc = 0; osc < (oscsenabled+1); osc++)
+ for (osc = 0; osc < oscsenabled; osc++)
{
ES5503Osc *pOsc = &oscillators[osc];
@@ -231,7 +232,7 @@ void es5503_device::device_start()
save_pointer(STRUCT_MEMBER(oscillators, irqpend), 32);
oscsenabled = 1;
- output_rate = (clock() / 8) / (2 + oscsenabled);
+ output_rate = (clock() / 8) / (oscsenabled + 2);
m_stream = stream_alloc(0, output_channels, output_rate);
m_timer = timer_alloc(0, nullptr);
@@ -239,7 +240,7 @@ void es5503_device::device_start()
void es5503_device::device_clock_changed()
{
- output_rate = (clock() / 8) / (2 + oscsenabled);
+ output_rate = (clock() / 8) / (oscsenabled + 2);
m_stream->set_sample_rate(output_rate);
m_mix_buffer.resize((output_rate/50)*8);
@@ -427,7 +428,9 @@ void es5503_device::write(offs_t offset, u8 data)
break;
case 0xe1: // oscillator enable
- oscsenabled = (data>>1) & 0x1f;
+ // The number here is the number of oscillators to enable -1 times 2. You can never
+ // have zero oscilllators enabled. So a value of 62 enables all 32 oscillators.
+ oscsenabled = ((data>>1) & 0x3f) + 1;
notify_clock_changed();
break;