AdLib: Support fo DOSBox AdLib Emulator
|Reported by:||lordhoto||Owned by:||lordhoto|
this WIP patch adds support for the new DOSBox AdLib emulator. This one for example plays a sound effect in Kyrandia 1 fine, while our old FMOPL doesn't. Indy4 intro sounds a bit different too, I don't know which one is more accurate here though, since I don't have any recording from an real AdLib to compare with. The DOSBox emulator code can be disabled via DISABLE_DOSBOX_ADLIB for small devices without floating point support.
ADVANTAGES: - Should have better AdLib emulation overall (I know of at least one sound effect fixed in Kyra1 and in Lands of Lore some sound effects sound different/better too) - We still can use the old emulator, through our new abstract AdLib API.
DISADVANTAGES: - the DOSBox emulator depends on floating point math (as far as I can tell), this prevents it from being used on small devices like NDS.
TODO: - I added a new abstraction layer to support both the old and new emulator, it needs to be documented and maybe moved to sound/fmopl.h again (I would prefer sound/adlib.h though). Currently the new API is in sound/softsynth/adlib/adlib.h. This isn't the best place for that though, since *theoretically* we could even support hardware OPL devices with it now. - there is *no* support for switching the emulators on runtime currently. We need to think about a nice way to do so. Maybe we want to use a config entry for that (and create the GUI to change it). I'm open for comments on this one. - we might want to make all the emulator code plugin based, like we plan/do with MIDI too - currently the DOSBox emulator depends on static variables, this prevents us from creating two instances of it at once and it also bloats binary size. I don't know if the DOSBox guys plan any major changes to the emulator, thus I wouldn't want to touch this area for now. I'll contact them about that soon. - SCI seems to depend heavily on the old FMOPL API, thus I had to include it directly there. I don't know whether SCI just wants an DualOPL2 support though, which could be easily achieved with the DOSBox AdLib emulator. At least the code looked like it creates two OPL instances to play stereo sound, which is exactly what DualOPL2 should do AFAIK. - the code could need an overall cleanup
NOTES: - the old FM OPL code was moved to sound/softsynth/adlib/mame[.cpp/.h] - you can change the AdLib emulator used at bottom of sound/softsynth/adlib/adlib.cpp - there are some more TODOs in the code :-)
I'm open for comments and suggestions.
Ticket imported from: #2773359. Ticket imported from: patches/1115.