Opened 20 years ago

Closed 20 years ago

Last modified 5 years ago

#8363 closed patch

Better MT-32 support

Reported by: sev- Owned by: fingolfin
Priority: normal Component: Audio: MT32
Version: Keywords:
Cc: Game:

Description

This is a patch which incorporates MT-32 emulator into ScummVM.

Current code has some flaws which I haven't fixed: o It runs correctly only with --output-rate=32000. I tried to resample it on the fly without success. o There are sound glitches in mi2 - Sound cracks, due to some bug in freeverb - It hangs in intro due to unknown reason to me

Otherwise it works perfect.

Ticket imported from: #1048326. Ticket imported from: patches/468.

Attachments (7)

mt-32.v1.patch.bz2 (42.8 KB ) - added by sev- 20 years ago.
Vesrion1 of MT-32 patch
mt-32.v2.patch.bz2 (43.2 KB ) - added by sev- 20 years ago.
Version 2 of MT-32 patch
mt-32.v3.patch.bz2 (43.2 KB ) - added by sev- 20 years ago.
Version 3 of MT-32 patch
mt32.endian.v3.patch (10.0 KB ) - added by fingolfin 20 years ago.
Endian patch for V3
mt32.endian.v4.patch (9.7 KB ) - added by fingolfin 20 years ago.
Endian patch for Sev's patch V3 (revised)
mt-32.v5.patch.bz2 (42.9 KB ) - added by sev- 20 years ago.
Version 5 of MT-32 patch
mt-32.v6.patch.bz2 (45.9 KB ) - added by sev- 20 years ago.
Version 6 of MT-32 patch

Download all attachments as: .zip

Change History (25)

by sev-, 20 years ago

Attachment: mt-32.v1.patch.bz2 added

Vesrion1 of MT-32 patch

comment:1 by sev-, 20 years ago

Forgot to mention that code will not work as is until bug #1048129 (Bug in File class) is fixed. For a workaround comment 'clearerr(_handle)' in read() method.

comment:2 by fingolfin, 20 years ago

This code is currently x86 only (and in fact, even more limited, namely to compilers which support that special __asm__ syntax in backends/ midi/MT32Structures.h).

As such, it's definitely not yet ready for CVS :-)

by sev-, 20 years ago

Attachment: mt-32.v2.patch.bz2 added

Version 2 of MT-32 patch

comment:3 by sev-, 20 years ago

I corrected it. In configure I define #HAVE_X86 if on appropriate platform and use it in the code.

comment:4 by sev-, 20 years ago

Ah, and mentioned bug is already fixed, so the patch should work ritght out of the box.

by sev-, 20 years ago

Attachment: mt-32.v3.patch.bz2 added

Version 3 of MT-32 patch

comment:5 by sev-, 20 years ago

Oops. patch v2 doesn't apply correctly. Here is an updated version without any changes.

by fingolfin, 20 years ago

Attachment: mt32.endian.v3.patch added

Endian patch for V3

comment:6 by fingolfin, 20 years ago

Here is a patch to be applied atop sev's v3 patch (i.e. first apply his patch, then mine inside the backends/midi directory). It fixes endian issues, and adds support for output rates other than 32000.

by fingolfin, 20 years ago

Attachment: mt32.endian.v4.patch added

Endian patch for Sev's patch V3 (revised)

comment:7 by fingolfin, 20 years ago

A new revision of my patch (mt32.endian.v4.patch), still to be applied atop V3 of Eugene's patch (beware of the V3 / V4 confusion :-).

It makes use of the newly added MidiDriver_Emulated base class.

by sev-, 20 years ago

Attachment: mt-32.v5.patch.bz2 added

Version 5 of MT-32 patch

comment:8 by sev-, 20 years ago

Updated version of the patch.

- Endian patch included - files moved to mt32/ subdir and renamed - _native_mt32 is set if emulator is active - sound buffermemory is properly initialized, so there is no noise at the beginning

comment:9 by sev-, 20 years ago

Ok. in backends/module.mk.

backends/mt32 -> backends/midi/mt32

Anything else?

comment:10 by fingolfin, 20 years ago

Owner: set to fingolfin

comment:11 by fingolfin, 20 years ago

OK, from my POV, we are almost there. While the MT32 emulation isn't usable on my machine, I think it's just because it's too slow (1.5 Ghz G4) -- that is, at least using the generic C version, maybe if we added some PowerPC asm, it would work fine over here, too :-).

The remaining issues, in my eyes: * Legal stuff: This patch is based on GPL code, I assume? In any case, we should still mention the author in the README, I guess (under credits) * Documentation: a patch for the README and the .tex files mentioning the mt32 driver, and maybe explaining it a little bit (including a note which states that this is very power hungry, so you need a fast machine). Also, we need to explain how it relates to the --native-mt32 option * base/gameDetector.cpp: need to add it to the USAGE_STRING * update the manpage, maybe?

comment:12 by sev-, 20 years ago

Yes, I mention author in each file. Actually there should be three of them added. Original MT-32 emulator author (code is GPL, added to dosbox variant and is posted under same license), linux porter which version I base on and freeverb author (that code is public domain).

So I will add all mentioned documentation modifications and commit. No objections?

by sev-, 20 years ago

Attachment: mt-32.v6.patch.bz2 added

Version 6 of MT-32 patch

comment:13 by sev-, 20 years ago

Ok, here it goes for checking once more.

I didn't renamed 07_ subsections in tex documentations, though having section numbers as file names isn't convenient.

I didn't update USAGE_STRING as it now states "(see README)" for -e command line option.

As of --native-mt32, i dont' know what to mention as it will not affect emulation since it gets set intentionally by it neverthless command line option specified or not.

comment:14 by fingolfin, 20 years ago

* I agree on the .tex filenames. They are bad. The whole TeX stuff is suboptimal, and I wouldn't have checked it in that way in the first place, but done is done. Don't worry about renaming those files for now...

* USAGE_STRING -> fine

* --native-mt32 -> that's exactly what you should write in the README -- I am sure people will wonder whether they need to use it or not. So we should tell them (i.e. that it doesn't matter :-)

* I'd clarify "enough processor power" in the README ("1-2 GHz" maybe?)

* Authors: Canadacow, Jezar, Tristan -> do they really prefer the nick names only, or should we add them as FIRST "NICK" LAST to the credits?

* Whether to commit: it's fine by me now. Can't speak for Ender of course, but I don't think he'd object...

comment:15 by sev-, 20 years ago

Status: newclosed

comment:16 by sev-, 20 years ago

o --native-mt32. Added.

o Processor power . I don't really know. Works no problem on my Athlon 1900+. We need some feedback to put an estimate.

o Authors. I couldn't find real names anywhere on their sites.

o Ender had no objections. Commited.

comment:17 by SF/kaminari, 20 years ago

http://sourceforge.net/users/canadacow/

You'll probably have to ask him whether it's ok to display his full name or not, since I'm not sure what finally happened to his legal struggles with Roland.

That may not be a reliable information as far as ScummVM is concerned, but the MT-32 enabled DOSBox build used to work ok on my P3/1Ghz (with no graphic filter, no fancy setting). CC says on his website it "runs fine on either my Celeron 1333Mhz laptop and my Athlon 1400Mhz".

comment:18 by digitall, 5 years ago

Component: Audio: MT32
Note: See TracTickets for help on using tickets.