diff options
author | Jerome Fisher | 2004-12-02 23:00:15 +0000 |
---|---|---|
committer | Jerome Fisher | 2004-12-02 23:00:15 +0000 |
commit | 470a83e024ac06edf21ffc7cd979da5f2dde9a8b (patch) | |
tree | 24f0bbba2ba5cc4f310f008c64cb52037b34ba0a /backends/midi/mt32/synth.cpp | |
parent | 5884c6735dc911fcf732b564324feebc4cf1c0cf (diff) | |
download | scummvm-rg350-470a83e024ac06edf21ffc7cd979da5f2dde9a8b.tar.gz scummvm-rg350-470a83e024ac06edf21ffc7cd979da5f2dde9a8b.tar.bz2 scummvm-rg350-470a83e024ac06edf21ffc7cd979da5f2dde9a8b.zip |
Synched with upstream (Munt 0.1.1).
Memory timbres are now loaded into the correct location again, and reaching the end of a PCM sample has been improved. The latter change is probably the only one relevant to ScummVM, and even that is unlikely to be audible.
svn-id: r15972
Diffstat (limited to 'backends/midi/mt32/synth.cpp')
-rw-r--r-- | backends/midi/mt32/synth.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/backends/midi/mt32/synth.cpp b/backends/midi/mt32/synth.cpp index b2e4e31048..1ba543b581 100644 --- a/backends/midi/mt32/synth.cpp +++ b/backends/midi/mt32/synth.cpp @@ -344,9 +344,17 @@ bool Synth::open(SynthProperties &useProp) { return false; myProp = useProp; + if (useProp.baseDir != NULL) { + myProp.baseDir = new char[strlen(useProp.baseDir) + 1]; + strcpy(myProp.baseDir, useProp.baseDir); + } // This is to help detect bugs memset(&mt32ram, '?', sizeof(mt32ram)); + for (int i = 128; i < 192; i++) { + // If something sets a patch to point to an uninitialised memory timbre, don't play anything + mt32ram.timbres[i].timbre.common.pmute = 0; + } printDebug("Loading Control ROM"); if (!loadControlROM("MT32_CONTROL.ROM")) { @@ -476,7 +484,10 @@ void Synth::close(void) { parts[i] = NULL; } } - + if (myProp.baseDir != NULL) { + delete myProp.baseDir; + myProp.baseDir = NULL; + } isOpen = false; } @@ -794,18 +805,7 @@ void Synth::playSysexWithoutHeader(unsigned char device, const Bit8u *sysex, Bit } unsigned int firstTimbre = off / sizeof (MemParams::PaddedTimbre); off %= sizeof (MemParams::PaddedTimbre); - switch (initmode) { - case 0: - // Write into first built-in timbre group - break; - case 1: - // Write into second built-in timbre group - firstTimbre += 64; - break; - default: - firstTimbre += 128; - // Write into user timbre group - } + firstTimbre += 128; for (unsigned int m = 0; m < len; m++) ((Bit8u *)&mt32ram.timbres[firstTimbre])[off + m] = sysex[m]; unsigned int lastTimbre = firstTimbre + NUMTOUCHED(len + off, MemParams::PaddedTimbre) - 1; |