Open basxto opened 2 years ago
hUGEDriver already supports muting channels for use with a sound FX driver. Basically what you do is call hUGE_mute_channel
before invoking the sound effect, and unmute after. This is compatible with FX Hammer and similar engines like CBT-FX.
FXHammer looks like being designed to work the other way around. It checks if there is currently music playing on that channel and only uses it if it’s unused. But I haven’t checked if the music driver engine does something similar.
FXHammer has a knee point which marks at which point it’s fine to interrupt the sound, but I haven’t found any code for that in FXHammer. So it’s possible that the music driver does something similar and that they coordinate who uses the channel.
https://github.com/DevEd2/FXHammer-Disasm
FXHammer has two RAM registers (Ch2Flags, Ch4Flags) that it uses to see if CH2 or CH4 is currently used by the music driver. It would be practical to use those, FXHammer doesn’t touch those channels when the least significant bit isn’t set.