VOGONS


Reply 40 of 79, by sethmeisterg

User metadata
Rank Newbie
Rank
Newbie

Sorry to bump this thread, but I was wondering if this code has made it into the DOSBOX core yet. Also, has anyone tried creating a custom piece of hardware that sits between the MT-32 and the MIDI host and inserts the proper delay (only for SYSEX messages)? (I can build just such a device, but I'm not sure if that will be good enough if that just shifts the timing and will therefore skew the sync of the music to the game). Also, just to clarify, must there be a 40ms delay between each byte of SYSEX messages *OR* between entire SYSEX messages (i.e. say you have a SYSEX with 10 bytes then a totally new SYSEX message of 8-byte length. Is the 40ms delay required between the 10th byte of SYSEX1 and byte 1 of SYSEX2 or between each of the 10 and 8 bytes of each of the SYSEX message streams)? Thanks.

Reply 42 of 79, by rcblanke

User metadata
Rank Oldbie
Rank
Oldbie

Here's some midi recordings from SpeedBall 2 as you requested (only took 2 years). Dvwjr, did the patch progress any furthur, since? Would you please be as kind to put the source of your patch online, so it can be used in a recent DOSBox version?! Thanks in advance!

Attachments

  • Filename
    sb2.zip
    File size
    7.04 KiB
    Downloads
    702 downloads
    File comment
    SpeedBall 2 midi recordings which require high delay settings to prevent Exc. Buffer overflow
    File license
    Fair use/fair dealing exception

Reply 43 of 79, by rcblanke

User metadata
Rank Oldbie
Rank
Oldbie

Hi all,

I've also tried to implement a solution to this problem; currently it seem to be working _on my system_ for the following games:

[snap]see thread below[/snap]

For the record, I'm using Windows 7, USB Cakewalk UM-1G midi interface, MT-32 rev.0 version 1.07

Some games do not play music correctly with the patch, for example Monkey Island2 (while it works fine in the official v0.74). Maybe I'll make the functionality configurable, we'll see.

The patched exe and source (against SVN r3650) are attached. I would be very interested in other people's results!

Regards,
Ronald

Last edited by rcblanke on 2011-01-13, 17:22. Edited 2 times in total.

Reply 46 of 79, by robertmo

User metadata
Rank l33t++
Rank
l33t++

you should also say what games it is currently not working for on your system so we know whether we are discovering sth you don't already know.

it still has buffer overflow with dark sun 1

mortal kombat had two errors: buffer overflow and later checksum err.
buffer overflow no longer happens but checksum err still happens.

Reply 47 of 79, by rcblanke

User metadata
Rank Oldbie
Rank
Oldbie

Thanks for your feedback, robertmo.

I've no idea what games were not working correctly, I can only test so much. Still, as dvwjr also mentioned before, using the busy bit may not be the way to go, because some games test this bit and might give up on sending the sysex data to the device if the timing is not perfect.

Thus, I also tried the buffered rotating list solution, but couldn't get it working well (normal notes playing while still handling sysex data, etc.). So I opted for another approach - to simply stall the emulation if a sysex is arriving too soon. That gives the MT-32 some air, and the emulated game won't notice. This seems to be working (somewhat) better, as I haven't found a game yet that doesn't work properly here. Tested are:

Aces of the Pacific & Expansion Disk: WWII: 1946
Advanced Tactical Air Command (ATAC)
Astro Chicken (from Space Quest 3)
Beneath a Steel Sky
Car and Driver
Code Name: ICEMAN
Colonization
Conquests of Camelot: The Search for the Grail
DaemonsGate
Dark Sun 1: Shattered Lands
Fire & Ice
Flight of the Amazon Queen: Interviewer for Hire
Flight of the Amazon Queen (CD version)
Gods
Heart of China
Hero Quest
Hoyle's Book of Games Volume 1
Hoyle's Book of Games Volume 2
Inferno
Jurassic Park
Leisure Suit Larry 3: Passionate Patty In Pursuit of the Pulsating Pectorals
Lemmings 2: The Tribes
Lure of the Temptress
Might and Magic 4: Clouds of Xeen
Might and Magic 4+5: World of Xeen

Mortal Kombat 1
Operation Stealth (aka James Bond: The Stealth Affair)
Prince of Persia 1 (v1.3)
Prince of Persia 2: The Shadow & The Flame
Prophecy: The Viking Child
Quest for Glory 2: Trial by Fire
Space Quest 1 SCI EGA
Space Quest 1 SCI VGA
Speedball 2: Brutal Deluxe
Tactical Fighter Experiment (TFX)
Tempest 2000
X-Wing

All work fine for me now, using the updated patch (attached).

Note that Mortal Kombat sends invalid sysex data right after the "probe" logo, causing the checksum error - the new patch skips this invalid message now.

Please provide any feedback you can; does the patched exe work reliably on your machine, what games are still problematic, anything.

Regards,
Ronald

EDIT: updated the list

Last edited by rcblanke on 2011-01-13, 18:08. Edited 4 times in total.

Reply 48 of 79, by rcblanke

User metadata
Rank Oldbie
Rank
Oldbie

Another update; now the delay behavior is configurable. Use the [midi] 'sysexdelay' option to specify no delay (none), a stalling delay (stall) or delay using the MPU401 'ready to send' bit (statusbit). Timings remain unchanged. If anyone can find a game that still shows 'Exc. buffer overflow' on an 'old' MT-32 using this patch, I'd like to know.

Regards,
Ronald

Last edited by rcblanke on 2011-01-13, 17:15. Edited 1 time in total.

Reply 49 of 79, by rcblanke

User metadata
Rank Oldbie
Rank
Oldbie

More minor changes; the delay for Dark Sun is slightly enlarged, and the config setting was moved to [midi]midiconfig; add "delaysysex" or "delayreadystate" to enable the patch.

Regards,
Ronald

Last edited by rcblanke on 2011-01-13, 17:15. Edited 1 time in total.

Reply 50 of 79, by HunterZ

User metadata
Rank l33t++
Rank
l33t++

Decided to try this because my E-MU / Creative XMIDI 1x1 Tab is acting up with QFG1 and QFG2.

Results using max cycles and Win7 x64:

E-MU / Creative XMIDI 1x1 Tab:

Quest for Glory I (SCI0 EGA):
- DOSBox 0.74: "Exc. Checksum error", music when first exiting town sounds horrible.
- your build, delaysysex: no error, music sounds correct.
- your build, delayreadystate: no error, music sounds correct.

Might & Magic: Worlds of Xeen:
- DOSBox 0.74: "Exc. Checksum error", main menu music sounds wrong some of the time.
- your build, delaysysex: "Exc. Checksum error", main menu music sounds wrong some of the time.
- your build, delayreadystate: "Exc. Checksum error", main menu music sounds wrong some of the time.

M-Audio MIDISport Uno (old):

Quest for Glory I (SCI0 EGA):
- DOSBox 0.74: Occasional "Exc. Buffer overflow", music sounds fine as far as I can tell.
- your build, delaysysex: Try 1: "Exc. Buffer overflow", music sounded slightly off; Try 2: no error, sounds fine.
- your build, delayreadystate: no error, sounds fine.

Might & Magic: Worlds of Xeen:
- DOSBox 0.74: "Exc. Buffer overflow", main menu music sometimes sounds weird.
- your build, delaysysex: no error, sounds fine.
- your build, delayreadystate: no error, sounds fine.

I also tried DOSBox 0.74 and QFG1 on the E-MU XMIDI 1x1 Tab with LoopBe1 Monitor (loopback driver) with MIDI-OX and SendSX, but it didn't help because it seems they only slow down SysEx when it originates from the tools themselves and not when it's just being passed through 🙁 LoopBe1 also likes to freak out and claim that I've short-circuited it when I haven't; I'd ditch it, but I'm not sure if there are any other MIDI loopback drivers that run under Win7 x64.

I would recommend testing with Prince of Persia 1, as I remember it being highly sensitive to overflow issues. I don't have it handy though.

Reply 51 of 79, by Mau1wurf1977

User metadata
Rank l33t++
Rank
l33t++

GODS is another one and also Lure of Temptress (which is free ware and a excellent game!)

My website with reviews, demos, drivers, tutorials and more...
My YouTube channel

Reply 52 of 79, by rcblanke

User metadata
Rank Oldbie
Rank
Oldbie

Thanks for the feedback HunterZ. I'll retest the games you mentioned in your post. Please note that you should always reset (turn off/on, or Master Volume+Rhythm and Part 1) your MT-32 device after a checksum error, or it will be much more likely to fail again, even with the patch enabled.

Gods and LotT were already on my test-list, thank you Mau1wurf1977 !

Reply 53 of 79, by HunterZ

User metadata
Rank l33t++
Rank
l33t++

I'm pretty sure I was resetting just to be sure. I'm not too worried about Xeen in any case, as it's a CM-32/64 game anyways. In any case, I've switched back to my M-Audio as the primary interface for my synths because buffer overflows are less aggravating than checksum errors.

Reply 54 of 79, by rcblanke

User metadata
Rank Oldbie
Rank
Oldbie

Hmm, Xeen does indeed seem problematic. After skipping the first part of the introduction, a second batch of sysexes are loaded, among which a 267 byte large one. No amount of delay prevents the buffer overflow on my device after that particular sysex. Skipping the sysex prevents the problem, but AFAIK sysexes can be up to 1024 bytes, and thus should be no problem for the MT-32?

Prince of Persia 1 has no MT-32 support, but POP2 does. Works with the patch here.

Another minor improvement (very small sysexes are valid when not meant for the MT-32); I removed the old patches.

regards,
Ronald

Attachments

  • Filename
    DOSBox.zip
    File size
    1.29 MiB
    Downloads
    616 downloads
    File comment
    Patched dosbox.exe
    File license
    Fair use/fair dealing exception
  • Filename
    sysex5.zip
    File size
    2.66 KiB
    Downloads
    581 downloads
    File comment
    Patch no.5
    File license
    Fair use/fair dealing exception

Reply 57 of 79, by HunterZ

User metadata
Rank l33t++
Rank
l33t++

I wouldn't worry too much about Xeen since it's a CM-32/64 game rather than plain MT-32, although I do wonder if CM-32/64 could have buffer overflow issues with DOSBox. I'm not sure how you'd know other than the sound being wrong since they don't have a display.

Reply 58 of 79, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Cm32/64 shouldn't have buffer overflow, same as the Mt32 v2 shouldn't have the issue (if I haven't forgotten parts of the discussion here 😉)

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 59 of 79, by Mau1wurf1977

User metadata
Rank l33t++
Rank
l33t++

Yes no buffer overflows on these devices...

The max data transfer is limited by the MIDI adapter and these Roland modules are all capable of keeping up.

The MT-32 (Old) can't keep up though and needs little pauses which some games don't have.