The underlying issue was that we tracked used sequences for each ADS segment
using sequence pointers, but the 0x4000 and 0x4010 ADS opcodes re-arranged the
array of sequences. Because arrays don't get re-allocated much this by chance
left the usage pointers valid but now pointing to the wrong sequence, so the
correct sequences were not started and stopped after a re-order operation.
Replaced the array of sequence objects and the used sequence tracker with
shared pointers so we can reorder the sequences without breaking the usage
pointers.
The tap and coat rendering in RotD now both work right and so does the
bar scroll in HoC.
DGDS basically uses the same midi and patch code as SCI. This change copies
the midi driver out of SCI. It now mostly works, but there is still an
instrument mismatch to fix out with SFX.
This is the initial import of the sources from vcosta's implementation.
Work has progressed on that base, so that it forms into an actual engine.
There has been heavy refactoring into classes, but there's still loads of
work to be done.
The status is almost the same the original vcosta's engine: it's possible
to play the intro Rise of the Dragon, and parts of the intro of Heart of
China and Willy Beamish. The DOS VQT images are still not decoded, so only
the Mac versions work for now - or the DOS versions with the Mac images
as patches