VOGONS


First post, by Sgeo

User metadata
Rank Newbie
Rank
Newbie

WorldsPlayer users have long complained about weird pauses. So I figured out the causes, and released https://github.com/Sgeo/worlds_sound_fix

This may be useful for other games.

There were two issues.

One was with MIDIs: MCI_OPEN was taking a few seconds, causing the game to pause. This issue has been discussed on these forums (Re: Problematic Windows games list) and elsewhere (https://www.virtualdub.org/blog2/entry_077.html). midi_patch.exe copies the mciseq.dll from Windows and patches it accordingly, copying it into the current directory (NOT replacing the system-wide version). It might not be particularly robust, I'm just looking for the relevant series of bytes.

The other was with PlaySound: Worlds was using PlaySound(filename, SND_PURGE) to stop sounds. SND_PURGE stopped being meaningful, around 2000 or NT? The result was instead of an immediate stop, the sound did one more play-through, in a blocking fashion. I used MS Detours to check for SND_PURGE and replace with PlaySound(NULL, SND_ASYNC). (I probably don't really need it to be async). I made a bat file that attaches the detouring dll with setdll to gamma.dll (the WorldsPlayer DLL), but presumably attaching it to other games should work fine. If there are even any other games that have this issue.