alinebee / Boxer

The DOS game emulator that's fit for your Mac.
http://boxerapp.com/
774 stars 139 forks source link

Roland MT-32 initialization causing ~18 second delay #20

Closed josephknight closed 11 years ago

josephknight commented 11 years ago

This is experienced in at least the versions 1.3.2 and 1.4pre. Can be replicated by playing Master of Magic or Master of Orion and setting music to use either Roland device.

Note: The music is great once finally running, but when launching these games or when the game changes executables and re-initializes MT-32, the wait is so long that I'm sure many will believe the game has frozen and quit the app.

Same issue after reinstalling and deleting App Support and Pref items. Suspect Munt issue although console message that Roland was successfully initialized briefly appears before the black-screen freeze occurs.

Oh, and using fast-forward actually reduces the delay... interesting.

Feel free to ask questions regarding my experiences with this problem. Thank you for the incredible software and for making it open source. Epic.

alinebee commented 11 years ago

Sorry for the slow response on this issue, I just got back from a month's vacation.

So to make sure, you are using the MT-32 emulation rather than a real MT-32 MIDI device?

Here's a bit of technical background: games with custom MT-32 instrument sets have a delay of several seconds when starting up as they upload their new instruments to the device. There is a limit to how fast data can be sent over the MIDI interface and a limit to how fast a real MT-32 can process the data, so games typically try to throttle the speed at which they send data (which is why fast-forwarding makes the process go faster: it's fast-forwarding the game's own delays.)

In addition, cheap MIDI adapters have been found to drop MIDI messages if they are sent too fast: so when Boxer is talking to a real MT-32 device (not the MT-32 emulation) it applies its own throttling as well to ensure it doesn't flood the MIDI connection. Boxer's own throttling is not sped up by fast-forwarding.

Now, all that said: I've tested Master of Orion and Master of Magic before on the MT-32 and I don't remember noticing an extreme delay that made me suspect any problem. I also seem to remember both games displaying some kind of "initializing MT-32" message while they're uploading instrument data, is that correct?

alinebee commented 11 years ago

OK, I've finally sourced copies of these games to test with. There is indeed a lengthy delay during loading, and contrary to what I remembered, no "initializing MT-32" message appears during the process (though it is printed at the DOS prompt just before the screen is cleared).

As I described above, this is normal for the games and there's no emulation problem with Boxer or Munt here: this is just how long the games think they need in order to upload their custom instruments to the (emulated or real) MT-32.

It does however prompt the thought that some sort of upload indicator would be helpful, so that games which do this don't look like they've hung. (A real-life MT-32/CM-32L would keep flashing a message light during this process, for instance.) I'm redesigning the statusbar for the next version, so some sort of general purpose things-are-happening indicator could go there.

I'm closing the issue now but I'll give the UI some further thought in that direction; in the meantime, I suggest just fast-forwarding through the process.