Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

M&M's: The Lost Formulas MIDI playback doesn't work when using Xidi #96

Open
Hackinator20 opened this issue Jan 18, 2025 · 2 comments
Open

Comments

@Hackinator20
Copy link

Using winmm.dll form. Input-wise, works perfectly for using the d-pad instead of the stick for movement. Unfortunately with Xidi being used, the game's MIDI soundtrack is completely absent. I've tried many different things:
-All the workarounds in some capacity (ActiveVirtualControllerMask = 0x01, PollReturnCode = 0 and 1, yes to IgnoreEnumObjectsCallbackReturnCode and UseShortVirtualControllerNames)
-Trying to use various previous versions
-Using the latest version of Hookshot

The only way I've been able to bring back MIDI playback is removing the Xidi dll from the game directory, so it's definitely influencing the behavior.

Of note, in case the above behavior is not happening for you:
I recently installed Coolsoft's VirtualMIDISynth and MIDI Mapper programs, with the latter being used to set the former as the default MIDI device. The device was working without Xidi just fine, and using MIDI mapper to map the default device back to GS Wavetable Synth does not resolve the issue with Xidi, nor did putzing with some of the VirtualMIDISynth settings. Regardless of VirtualMIDISynth's possible effects on this, Xidi's presence is still preventing MIDI playback that would otherwise be unaffected, so I believe it should still be looked into.

Log:
Xidi_WinMM_MnMs.exe_4968.log

@samuelgr
Copy link
Owner

It turns out this specific game is accessing uninitialized stack memory, and that's why inserting Xidi between the game and the system's winmm library causes the midi output to break. In other words, the game is declaring variables and then reading from them without properly initializing them. I found this out by running it through a debugger and stepping through its disassembly as it starts up.

The Coolsoft tools have nothing to do with it - the issue is reproducible when using Xidi with and without them. It also isn't a bug in Xidi. Other games that use midi work just fine with Xidi's WinMM form.

That being said, we can work around this problem. I have a proper solution in mind for a future release, but for now, please try this:

  1. Download the attached HookModule and put it in the game's directory, replacing the HookModule that comes with Xidi v4.3.1
  2. Rename Xidi's "winmm.dll" to "xidi-winmm.dll" in the game's directory
  3. Launch the game using Hookshot

Xidi-v4.3.2-dev.7.1+cdb0c41e.dirty.zip

The configuration file workarounds like ActiveVirtualControllerMask, PollReturnCode, IgnoreEnumObjectsCallbackReturnCode and UseShortVirtualControllerNames won't make a difference here.

@Hackinator20
Copy link
Author

Works great, thank you for your work!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants