The title says it all - I've fixed the sound problems in the just updated
ElectrEm and now
the emulator is back to being sufficiently good that the sampled speech in Exile
works
properly. Incidentally, if anybody knows of any other games or programs with
samples or
other high end sound trickery that I can use to check the emulator against then
I'd be
grateful to hear about them.
Other than the sound fix, nothing else has changed - except that I've properly
unified and
tidied the source directory tree and uploaded the latest code with both MSVC 6
and XCode
2.x project files.
Quick file links:
Windows
http://electrem.acornelectron.co.uk/files/future/ElectrEmWin32-20060413.zip
http://electrem.emuunlim.com/files/future/ElectrEmWin32-20060413.zip
Mac OS X
http://electrem.acornelectron.co.uk/files/future/ElectrEm-20060413.dmg
http://electrem.emuunlim.com/files/future/ElectrEm-20060413.dmg
Source Code
http://electrem.acornelectron.co.uk/files/future/ElectrEmSource-20060413.zip
http://electrem.emuunlim.com/files/future/ElectrEmSource-20060413.zip
Now a boring technical description of the problem and the fix for those that are
interested. ElectrEm aims for 100% accurate timing of everything which in sound
terms
means that everytime a sound event occurs (i.e. a change of tone or a sound
on/off
command) it is logged into an event queue. A separate sound processing thread
reads
from the queue and generates a sound wave as and when the host hardware requires
it.
This introduces some latency, but there is no realistic way to avoid that with
an emulator
given the precision of timers and the granularity of allowed process sleep
times.
The problem is that the two threads need to each keep track of their time
separately, as
the thing writing sound to the queue is obviously "in front" of the thing
reading the events
and acting on them. The problem was that the thing reading events was racing
miles
ahead while the thing that would ultimately generate events paused doing other
startup
activities. As a result, instead of stepping through events and properly obeying
the relative
times at which each occurred the thing reading stored events was just doing them
all at
once, believing itself to have advanced beyond all of them.
-Thomas