Peel loops, aka only unroll loops if their number of iterations is a compile-time constant.
ds2sound.h: Set the interrupt interval to 15.36 milliseconds and explain why.
Fix a buffer overflow in audio handling code that corrupted memory used to carry the state of the GUI.
Remove 2 extraneous delays. The 100-millisecond delays before ds2_setBacklight() MUST STAY, however, otherwise the emulator can crash with the bottom backlight off if a touch is recognised twice in a row. That happens with some broken styluses, so it's not unexpected.
soundux.cpp: Inline MixStereo (into S9xMixSamples).
Stop using the deprecated function S9xMixSamplesO and use S9xMixSamples instead.
Wrap the offset into the audio buffer less often.
Reverse an audio rendering loop for fewer memory accesses.

for (channel) { for (sample) { buffer[sample] += channelVolume; } }
->
for (sample) { sampleVolume = 0; for (channel) { sampleVolume += channelVolume; } buffer[sample] = sampleVolume; }