[Scummvm-cvs-logs] SF.net SVN: scummvm: [23653] scummvm/trunk/engines/kyra
eriktorbjorn at users.sourceforge.net
eriktorbjorn at users.sourceforge.net
Tue Aug 1 15:42:39 CEST 2006
Revision: 23653
Author: eriktorbjorn
Date: 2006-08-01 06:42:33 -0700 (Tue, 01 Aug 2006)
ViewCVS: http://svn.sourceforge.net/scummvm/?rev=23653&view=rev
Log Message:
-----------
Kyra 2 has two types of XMIDI files: XMI and C55. It seems C55 are for the
General MIDI instrument set, so use them unless we're in MT-32 mode. This makes
the music sound a bit closer (at least to me) to what DOSbox plays.
Modified Paths:
--------------
scummvm/trunk/engines/kyra/kyra.cpp
scummvm/trunk/engines/kyra/sound.cpp
scummvm/trunk/engines/kyra/sound.h
Modified: scummvm/trunk/engines/kyra/kyra.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra.cpp 2006-08-01 10:25:10 UTC (rev 23652)
+++ scummvm/trunk/engines/kyra/kyra.cpp 2006-08-01 13:42:33 UTC (rev 23653)
@@ -160,10 +160,13 @@
_sound = soundMidiPc;
assert(_sound);
soundMidiPc->hasNativeMT32(native_mt32);
+
+ // C55 appears to be XMIDI for General MIDI instruments
+ soundMidiPc->setUseC55(_game == GI_KYRA2 && !native_mt32);
// Unlike some SCUMM games, it's not that the MIDI sounds are
// missing. It's just that at least at the time of writing they
- // decidedly inferior to the Adlib ones.
+ // are decidedly inferior to the Adlib ones.
if (midiDriver != MD_ADLIB && ConfMan.getBool("multi_midi")) {
SoundAdlibPC *adlib = new SoundAdlibPC(_mixer, this);
Modified: scummvm/trunk/engines/kyra/sound.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sound.cpp 2006-08-01 10:25:10 UTC (rev 23652)
+++ scummvm/trunk/engines/kyra/sound.cpp 2006-08-01 13:42:33 UTC (rev 23653)
@@ -99,7 +99,7 @@
_eventFromMusic = false;
_fadeMusicOut = _sfxIsPlaying = false;
_fadeStartTime = 0;
- _isPlaying = _nativeMT32 = false;
+ _isPlaying = _nativeMT32 = _useC55 = false;
_soundEffect = _parser = 0;
_soundEffectSource = _parserSource = 0;
@@ -193,7 +193,7 @@
_channelVolume[channel] = volume;
volume = volume * _volume / 255;
b = (b & 0xFF00FFFF) | (volume << 16);
- } else if ((b & 0xF0) == 0xC0 && !_nativeMT32) {
+ } else if ((b & 0xF0) == 0xC0 && !_nativeMT32 && !_useC55) {
b = (b & 0xFFFF00FF) | MidiDriver::_mt32ToGm[(b >> 8) & 0xFF] << 8;
} else if ((b & 0xFFF0) == 0x007BB0) {
//Only respond to All Notes Off if this channel
@@ -231,7 +231,7 @@
void SoundMidiPC::loadMusicFile(const char *file) {
char filename[25];
- sprintf(filename, "%s.XMI", file);
+ sprintf(filename, "%s.%s", file, _useC55 ? "C55" : "XMI");
uint32 size;
uint8 *data = (_engine->resource())->fileData(filename, &size);
@@ -269,7 +269,7 @@
void SoundMidiPC::loadSoundEffectFile(const char *file) {
char filename[25];
- sprintf(filename, "%s.XMI", file);
+ sprintf(filename, "%s.%s", file, _useC55 ? "C55" : "XMI");
uint32 size;
uint8 *data = (_engine->resource())->fileData(filename, &size);
Modified: scummvm/trunk/engines/kyra/sound.h
===================================================================
--- scummvm/trunk/engines/kyra/sound.h 2006-08-01 10:25:10 UTC (rev 23652)
+++ scummvm/trunk/engines/kyra/sound.h 2006-08-01 13:42:33 UTC (rev 23653)
@@ -173,6 +173,7 @@
MidiChannel *getPercussionChannel() { return 0; }
void setPassThrough(bool b) { _passThrough = b; }
+ void setUseC55(bool b) { _useC55 = b; }
void hasNativeMT32(bool nativeMT32) { _nativeMT32 = nativeMT32; }
bool isMT32() { return _nativeMT32; }
@@ -192,6 +193,7 @@
uint8 _channelVolume[16];
MidiDriver *_driver;
bool _nativeMT32;
+ bool _useC55;
bool _passThrough;
uint8 _volume;
bool _isPlaying;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list