schellingb / dosbox-pure

DOSBox Pure is a new fork of DOSBox built for RetroArch/Libretro aiming for simplicity and ease of use.
GNU General Public License v2.0
775 stars 65 forks source link

MIDI output issue in "Road Rash" (Windows 98 + MPU-401) #518

Closed Ric-82 closed 3 months ago

Ric-82 commented 3 months ago

Hi,

I'm having a weird problem with the 1996 Windows game "Road Rash". The game plays midi files during the levels, so it benefits greatly from the ability to use Soundfonts instead of the standard Creative Music Synt output. Setting the Roland MPU-401 option as a midi output device in Windows actually allows me to load and correctly use all the Soundfonts present inside my "System" subfolder.

However, unlike Creative Music Synth, when game music is played through the MPU-401 it keeps playing in a loop, even after exiting the levels and returning to the main menu. The only way to stop it is to exit the game (and even then, it continues to play for a few seconds before stopping).

I did some research and saw that the game exhibits this same behavior with external MIDI mappers such as Coolsoft VirtualMIDISynth. From what I understood reading this thread on Vogons, the problem seems to be related to the lack of support for the midiOutSetVolume function, which is not implemented in synthesizers such as MPU-401.

Eventually, Coolsoft's technical support managed to bypass the problem in VirtualMIDISynth (as you can see from his post on Vogons: "I suppose the game does not really need for a full implementation of midiOutSetVolume() function, but it only needs that its calls to modMessage() to return MMSYSERR_NOERROR instead of the current MMSYSERR_NOTSUPPORTED. That said, I've built a test version with this change: the modMessage() function of MIDIMapper now always returns MMSYSERR_NOERROR (even if it does nothing at all with the given data).").

Do you think it is possible to solve this problem in the same way on DosBox Pure?

schellingb commented 3 months ago

It looks like the issue isn't in the hardware emulated, but rather in the software. The set volume function is not implemented in the Roland MPU-401 that ships with Windows 98. You would need a different driver with more capabilities that still sends MIDI commands to the same MPU-401 port. Maybe such a driver is out there somewhere?

Ric-82 commented 3 months ago

I have no idea.

I can only hope for the advice of someone more experienced than me.

schellingb commented 3 months ago

What I mean is, this would probably also happen on a real computer with a MIDI synth connected. So it's not something that can be fixed in DOSBox Pure because the emulator is doing everything correct. I can leave the issue open for now, maybe someone knows of such a Windows 98 driver that would make things work.