First post, by priestlyboy
- Rank
- Oldbie
Hey guys,
Thanks to Gulikoza for giving me the patch to work from to get MT32 emulation into DOSBox. I changed the way he did it some. I split his patch up into two diffs and fixed a few mistakes when he was "#ifdef"ing and "#endif"ing the mt32emu source. I also followed a different procedure in building it into DOSBox.
My way of doing it is to build the mt32emu library as a MinGW lib and then building DOSBox with a link to that library.
If necessary you should get the latest version of MinGW which is being built into a large distribution file at the moment (they've been doing RCs) and then get MSYS and the MSYSDEVKit plus update the automake, autoconf, and libtool librarys from the ftp.gnu.org. (This is how my system is setup at the moment)
The mt32emu patch changes ONLY the synth->printDebug or printDebug statements in various files to the standard DOSBox logging output format. It also puts some in #ifdef blocks so that you won't be bombarded with multiple lines of certain output. It also comments out the functions that would be called by the printDebug statements. The patch puts in a "#define MT32DEBUG" for enabling the more intensive debugging statements in the "mt32emu.h" header which is commented out by default. It also adds the "logging.h" header to the mt32emu source from the DOSBox source to match the DOSBox console/debugger output.
Get the mt32emu CVS source although I don't think it's any different from the current release source.
Put mt32emu.diff in the mt32emu dir source not the mt32emu/src dir.
In MinGW go to the mt32emu dir and type "patch -up1 < mt32emu.diff"
Then "./autogen.sh"
Then "./configure --prefix=/mingw"
Then "make && make install"
That will set you up to build DOSBox with MT32 Emulation.
This dbmt32 patch adds the mt32 option lines to DOSBox.conf, adds the mt32 and mt32samplerate understanding to midi.cpp, and the midi_mt32.h (thanks to Srecko/Gulikoza) tweaked to make it all work.
Get the latest DOSBox CVS source.
Put the dbmt32.diff patch into the DOSBox dir source not DOSBox/src dir.
In MinGW go to the dosbox dir and type "patch -up1 < dbmt32.diff"
Then "./autogen.sh"
Then "export LIBS="-lmt32emu"" so that the mt32emu library links to DOSBox makefiles.
Then "./configure <your options>"
Then "make"
*If the above doesn't seem to work and you get errors about mt32emu. Just edit the 'Makfile' in the dosbox/src directory and put "-lmt32emu" at the end and do "make" again*
- Don't forget to strip dosbox.exe at the end -
Hopefully I didn't mess anything up. I had to fix a few things that Guli did because in a few places he put a #endif or a #ifdef MT32DEBUG in the wrong place which makes his version sound... weird. Although it seems that MT32 emulation needs a lot of work anyways. hehe.
Gulikoza also added in a "mt32rate" option which sets the frequency rate of the MT32 emulation in the DOSBox.conf (which I moved slightly) and DOSBox defaults to "win32" so you have to set "device=" to "mt32" in the DOSBox.conf to enable mt32 emulation.
Note: When you first run DOSBox with mt32 enabled you will have to wait a minute or two because it has to create the waveformcache-<samplerate>-440.00.raw based on the rate you choose. Also the, MT32 Emulation is very CPU intensive and right now the default is 22050 which is decent enough (though it sounds better at 44100.) I think Dynamic Emulation does help out with the CPU load.
You should be able to use DOSBox with MT32 emulation as long as you have a proper MT32_CONTROL.ROM and a MT32_PCM.ROM in the DOSBox directory.
Otherwise you won't get any MT32 emulation.
The patches to the sources are attached below.
Enjoy.
/Ieremiou
Ieremiou
----------
Helping Debug DOSBox.