[Scummvm-devel] Addressing Hardware bugs in old MT-32's

Hubert Maier raziel_nosgoth at web.de
Tue May 17 16:38:43 CEST 2011

Hello Gang,

as requested by Max i drop this for discussion and possible help on -devel.

Thanks Max

> I don't really know much about MT-32 and the MIDI stuff, so I am not the
> best person to ask.

> BTW, the patch you attach on that tracker item seems to be "backwards", it
> removes your changes instead of adding them...

Yes, i need to use a pristine copy of the file and a changed one and often mix up
the first and second...but you get the idea :-)

> Anyway, you asked for delays in the midi code. Well, as I understand it, we
> use some delay for *sysex*, e.g. consider this in audio/mididrv.cpp:

> void MidiDriver::sendMT32Reset() {
>   static const byte resetSysEx[] = { 0x41, 0x10, 0x16, 0x12, 0x7F, 0x00,
> 0x00, 0x01, 0x00 };   sysEx(resetSysEx, sizeof(resetSysEx));
>   g_system->delayMillis(100);
> }

> void MidiDriver::sendGMReset() {
>   static const byte resetSysEx[] = { 0x7E, 0x7F, 0x09, 0x01 };
>   sysEx(resetSysEx, sizeof(resetSysEx));
>   g_system->delayMillis(100);
> }

> As you can see, they delay even longer. And if you look at
> engines/scumm/imuse/i*.cpp, then some of the sysEx calls there use large
> delays, too (in fact, in some cases so large that they add up to multiple
> seconds, so maybe they are *too* long, but that's a different matter).

Yes, it grows if i up the delay in CAMD.
The funny thing is there is a little MIDI tune played *while* the explosion is
going off...it normally can't be heard because 1) the explosion sound is far too
loud and 2) the tune is played and immidiately cancelled due to the fast sending
of sysExes and notes.
I can only hear it if i delay the data to an extreme where playing is a pain and
speech output sounds like a dia-show :-)

Not sure if that is intended...but *if* the little tune is meant to be heard i
found the problem in my bug, because then the notes/sysExes are sent far too

> But not even all sysex calls are "protected" by a delay. And AFAIK, no
> send() is "protected" in this way at all. 

It seems so that it works with the delays that has been added.
Maybe someone with more insight in MIDI can point me to a line i could
change/play with wo find a working change?

> Anyway, I think a better approach to understanding this would be to get
> other people with an MT-32 to look at your bug, and see if they can
> reproduce this on other platforms (Linux, Win, Mac...). I recommend writing
> to -devel about this.

Two People (Win7 with MPU-401 and Linux with a USB adapterĀ [got one myself])
already checked and don't have that behaviour, so i start to think it may be
only affecting the CAMD driver, which would be good :-)

>> i'd like to request your worthy opinion on a commit/change which would only
>> affect the CAMD part of the AmigaOS4 port of ScummVM.
>> It's outlined in this bug tracker item:



More information about the Scummvm-devel mailing list