[Scummvm-cvs-logs] CVS: scummvm/sky mt32music.cpp,NONE,1.1 mt32music.h,NONE,1.1 gmchannel.cpp,1.1,1.2 gmchannel.h,1.1,1.2 gmmusic.cpp,1.1,1.2 gmmusic.h,1.1,1.2 musicbase.cpp,1.1,1.2 musicbase.h,1.2,1.3 sky.cpp,1.31,1.32 sky.h,1.22,1.23
Robert G?ffringmann
lavosspawn at users.sourceforge.net
Mon May 12 16:26:06 CEST 2003
Update of /cvsroot/scummvm/scummvm/sky
In directory sc8-pr-cvs1:/tmp/cvs-serv32084/sky
Modified Files:
gmchannel.cpp gmchannel.h gmmusic.cpp gmmusic.h musicbase.cpp
musicbase.h sky.cpp sky.h
Added Files:
mt32music.cpp mt32music.h
Log Message:
changed some internal structures, added support for true MT32 (though not yet used by main prog)
--- NEW FILE: mt32music.cpp ---
/* ScummVM - Scumm Interpreter
* Copyright (C) 2003 The ScummVM project
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Header: /cvsroot/scummvm/scummvm/sky/mt32music.cpp,v 1.1 2003/05/12 23:25:54 lavosspawn Exp $
*
*/
#include "sky/mt32music.h"
void SkyMT32Music::passTimerFunc(void *param) {
((SkyMT32Music*)param)->timerCall();
}
SkyMT32Music::SkyMT32Music(MidiDriver *pMidiDrv, SkyDisk *pSkyDisk)
: SkyMusicBase(pSkyDisk) {
_driverFileBase = 60200;
_midiDrv = pMidiDrv;
int midiRes = _midiDrv->open();
if (midiRes != 0) {
error("Can't open midi device. Errorcode: %d\n",midiRes);
}
_midiDrv->setTimerCallback(this, passTimerFunc);
_ignoreNextPoll = false;
for (uint8 cnt = 0; cnt < 128; cnt++)
_dummyMap[cnt] = cnt;
}
SkyMT32Music::~SkyMT32Music(void) {
_midiDrv->close();
_midiDrv->setTimerCallback(NULL, NULL);
delete _midiDrv;
}
void SkyMT32Music::timerCall(void) {
// midi driver polls hundred times per sec. We only want 50 times.
_ignoreNextPoll = !_ignoreNextPoll;
if (!_ignoreNextPoll) return;
if (_musicData != NULL)
pollMusic();
}
void SkyMT32Music::setupPointers(void) {
_musicDataLoc = (_musicData[0x7DD] << 8) | _musicData[0x7DC];
_sysExSequence = ((_musicData[0x7E1] << 8) | _musicData[0x7E0]) + _musicData;
}
void SkyMT32Music::setupChannels(uint8 *channelData) {
_numberOfChannels = channelData[0];
channelData++;
for (uint8 cnt = 0; cnt < _numberOfChannels; cnt++) {
uint16 chDataStart = ((channelData[(cnt << 1) | 1] << 8) | channelData[cnt << 1]) + _musicDataLoc;
_channels[cnt] = new SkyGmChannel(_musicData, chDataStart, _midiDrv, _dummyMap);
}
}
#define MIDI_PACK(a,b,c,d) ((a) | ((b) << 8) | ((c) << 16) | ((d) << 24))
bool SkyMT32Music::processPatchSysEx(uint8 *sysExData) {
uint8 crc = 0;
if (sysExData[0] & 0x80) return false;
uint8 patchNum = sysExData[0];
sysExData++;
uint8 timbreGroup = sysExData[0] >> 6;
uint8 timbreNumber = sysExData[0] & 0x3F;
uint8 keyShift = sysExData[1] & 0x3F;
uint8 fineTune = sysExData[2] & 0x7F;
uint8 benderRange = sysExData[3] & 0x7F;
uint8 assignMode = sysExData[1] >> 6;
uint8 reverbSwitch = sysExData[2] >> 7;
_midiDrv->send(MIDI_PACK(0xF0, 0x41, 0x10, 0x16));
_midiDrv->send(MIDI_PACK(0x12, 5, patchNum >> 4, (patchNum & 0xF) << 3));
crc -= 5 + (patchNum >> 4) + ((patchNum & 0xF) << 3);
crc -= timbreGroup + timbreNumber + keyShift + fineTune;
crc -= benderRange + assignMode + reverbSwitch;
_midiDrv->send(MIDI_PACK(timbreGroup, timbreNumber, keyShift, fineTune));
_midiDrv->send(MIDI_PACK(benderRange, assignMode, reverbSwitch, crc));
_midiDrv->send(0xF7);
debug(3," Patch %02X:\n",patchNum);
debug(3," Timbre Group: %d\n",timbreGroup);
debug(3," Timbre Number: %d\n",timbreNumber);
debug(3," Key Shift: %d\n",keyShift);
debug(3," Fine Tune: %d\n",fineTune);
debug(3," Bender Range: %d\n",benderRange);
debug(3," Assign Mode: %d\n",assignMode);
debug(3," Reverb Switch: %d\n\n",reverbSwitch);
return true;
}
void SkyMT32Music::startDriver(void) {
_midiDrv->send(0xFF); // reset midi device
// setup timbres and patches using SysEx data
uint8* sysExData = _sysExSequence;
uint8 timbreNum = sysExData[0];
uint8 cnt, crc;
uint32 sysComb;
sysExData++;
for (cnt = 0; cnt < timbreNum; cnt++) {
crc = 0;
_midiDrv->send(MIDI_PACK(0xF0, 0x41, 0x10, 0x16));
//- sendTimbreAddress
sysComb = (0x2 << 16) | (sysExData[0] << 8) | 0xA;
sysExData++;
uint8 sysByte1 = (uint8)(sysComb >> 14);
uint8 sysByte2 = (uint8)((sysComb & 0x3FFF) >> 7);
uint8 sysByte3 = (uint8)(sysComb & 0x7F);
_midiDrv->send(MIDI_PACK(0x12, sysByte1, sysByte2, sysByte3));
debug(3,"InitBySysEx: Timbre address: %02X:%02X:%02X (%02X)\n",sysByte1,sysByte2,sysByte3,(sysExData-1)[0]);
crc -= sysByte1 + sysByte2 + sysByte3;
//- sendTimbreData
uint8 dataLen = sysExData[0];
debug(3,"[%02X]",dataLen);
sysExData++;
uint32 nextSend = 0;
uint8 bytesInSend = 0;
debug(3," Timbre Data:");
do {
uint8 rlVal = 1;
uint8 codeVal = sysExData[0];
sysExData++;
if (codeVal & 0x80) {
codeVal &= 0x7F;
rlVal = sysExData[0];
sysExData++;
dataLen--;
}
for (uint8 cnt = 0; cnt < rlVal; cnt++) {
nextSend |= codeVal << (bytesInSend << 3);
crc -= codeVal;
debug(3," %02X",codeVal);
bytesInSend++;
if (bytesInSend == 4) {
_midiDrv->send(nextSend);
nextSend = bytesInSend = 0;
}
}
dataLen--;
} while (dataLen > 0);
crc &= 0x7F;
debug(3," %02X F7\n",crc);
nextSend |= crc << (bytesInSend << 3);
bytesInSend++;
if (bytesInSend == 4) {
_midiDrv->send(nextSend);
nextSend = bytesInSend = 0;
}
nextSend |= 0xF7 << (bytesInSend << 3);
_midiDrv->send(nextSend);
}
while (processPatchSysEx(sysExData))
sysExData += 5;
}
--- NEW FILE: mt32music.h ---
/* ScummVM - Scumm Interpreter
* Copyright (C) 2003 The ScummVM project
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Header: /cvsroot/scummvm/scummvm/sky/mt32music.h,v 1.1 2003/05/12 23:25:54 lavosspawn Exp $
*
*/
#ifndef MT32MUSIC_H
#define MT32MUSIC_H
#include "stdafx.h"
#include "common/engine.h"
#include "musicbase.h"
#include "sound/mididrv.h"
#include "gmchannel.h"
class SkyMT32Music : public SkyMusicBase {
public:
SkyMT32Music(MidiDriver *pMidiDrv, SkyDisk *pSkyDisk);
~SkyMT32Music(void);
private:
static void passTimerFunc(void *param);
void timerCall(void);
bool processPatchSysEx(uint8 *sysExData);
bool _ignoreNextPoll;
uint8 *_sysExSequence;
MidiDriver *_midiDrv;
uint8 _dummyMap[128];
virtual void setupPointers(void);
virtual void setupChannels(uint8 *channelData);
virtual void startDriver(void);
};
#endif //MT32MUSIC_H
Index: gmchannel.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/gmchannel.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- gmchannel.cpp 3 May 2003 02:59:45 -0000 1.1
+++ gmchannel.cpp 12 May 2003 23:25:54 -0000 1.2
@@ -21,21 +21,7 @@
#include "gmchannel.h"
-// instrument map copied from scumm/instrument.cpp
-
-const byte SkyGmChannel::_mt32_to_gm[128] = {
-// 0 1 2 3 4 5 6 7 8 9 A B C D E F
- 0, 1, 0, 2, 4, 4, 5, 3, 16, 17, 18, 16, 16, 19, 20, 21, // 0x
- 6, 6, 6, 7, 7, 7, 8, 112, 62, 62, 63, 63, 38, 38, 39, 39, // 1x
- 88, 95, 52, 98, 97, 99, 14, 54, 102, 96, 53, 102, 81, 100, 14, 80, // 2x
- 48, 48, 49, 45, 41, 40, 42, 42, 43, 46, 45, 24, 25, 28, 27, 104, // 3x
- 32, 32, 34, 33, 36, 37, 35, 35, 79, 73, 72, 72, 74, 75, 64, 65, // 4x
- 66, 67, 71, 71, 68, 69, 70, 22, 56, 59, 57, 57, 60, 60, 58, 61, // 5x
- 61, 11, 11, 98, 14, 9, 14, 13, 12, 107, 107, 77, 78, 78, 76, 76, // 6x
- 47, 117, 127, 118, 118, 116, 115, 119, 115, 112, 55, 124, 123, 0, 14, 117 // 7x
-};
-
-SkyGmChannel::SkyGmChannel(uint8 *pMusicData, uint16 startOfData, MidiDriver *pMidiDrv)
+SkyGmChannel::SkyGmChannel(uint8 *pMusicData, uint16 startOfData, MidiDriver *pMidiDrv, byte *pInstMap)
{
_musicData = pMusicData;
_midiDrv = pMidiDrv;
@@ -43,6 +29,7 @@
_channelData.eventDataPtr = startOfData;
_channelData.channelActive = 1;
_channelData.nextEventTime = getNextEventTime();
+ _mt32_to_gm = pInstMap;
_musicVolume = 0x100;
}
Index: gmchannel.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/gmchannel.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- gmchannel.h 3 May 2003 02:59:45 -0000 1.1
+++ gmchannel.h 12 May 2003 23:25:54 -0000 1.2
@@ -38,12 +38,12 @@
class SkyGmChannel : public SkyChannelBase {
public:
- SkyGmChannel(uint8 *pMusicData, uint16 startOfData, MidiDriver *pMidiDrv);
+ SkyGmChannel(uint8 *pMusicData, uint16 startOfData, MidiDriver *pMidiDrv, byte *pInstMap);
virtual void stopNote(void);
virtual uint8 process(uint16 aktTime);
virtual void updateVolume(uint16 pVolume);
private:
- static const byte _mt32_to_gm[128];
+ byte *_mt32_to_gm;
MidiDriver *_midiDrv;
uint8 *_musicData;
uint16 _musicVolume;
Index: gmmusic.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/gmmusic.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- gmmusic.cpp 3 May 2003 02:59:45 -0000 1.1
+++ gmmusic.cpp 12 May 2003 23:25:54 -0000 1.2
@@ -33,10 +33,10 @@
_midiDrv = pMidiDrv;
int midiRes = _midiDrv->open();
if (midiRes != 0) {
- printf("Error code: %d\n",midiRes);
+ error("Can't open midi device. Errorcode: %d\n",midiRes);
}
_midiDrv->setTimerCallback(this, passTimerFunc);
- ignoreNextPoll = false;
+ _ignoreNextPoll = false;
}
SkyGmMusic::~SkyGmMusic(void) {
@@ -49,8 +49,8 @@
void SkyGmMusic::timerCall(void) {
// midi driver polls hundred times per sec. We only want 50 times.
- ignoreNextPoll = !ignoreNextPoll;
- if (!ignoreNextPoll) return;
+ _ignoreNextPoll = !_ignoreNextPoll;
+ if (!_ignoreNextPoll) return;
if (_musicData != NULL)
pollMusic();
@@ -68,11 +68,79 @@
channelData++;
for (uint8 cnt = 0; cnt < _numberOfChannels; cnt++) {
uint16 chDataStart = ((channelData[(cnt << 1) | 1] << 8) | channelData[cnt << 1]) + _musicDataLoc;
- _channels[cnt] = new SkyGmChannel(_musicData, chDataStart, _midiDrv);
+ _channels[cnt] = new SkyGmChannel(_musicData, chDataStart, _midiDrv, _mt32_to_gm + 128 * _currentSection);
}
}
void SkyGmMusic::startDriver(void) {
_midiDrv->send(0xFF);
+ // skip all sysEx as it can't be handled anyways.
}
+
+// each section has its own custom instruments setup, so we need one translation table
+// per section. Need an MT32 to make correct tables, though.
+
+byte SkyGmMusic::_mt32_to_gm[6*128] = {
+// Section 0:
+// 0 1 2 3 4 5 6 7 8 9 A B C D E F
+ 0, 1, 0, 2, 4, 4, 5, 3, 16, 17, 18, 16, 16, 19, 20, 21, // 0x
+ 6, 6, 6, 7, 7, 7, 8, 112, 62, 62, 63, 63, 38, 38, 39, 39, // 1x
+ 88, 95, 52, 98, 97, 99, 14, 54, 102, 96, 53, 102, 81, 100, 14, 80, // 2x
+ 48, 48, 49, 45, 41, 40, 42, 42, 43, 46, 45, 24, 25, 28, 27, 104, // 3x
+ 32, 32, 34, 33, 36, 37, 35, 35, 79, 73, 72, 72, 74, 75, 64, 65, // 4x
+ 66, 67, 71, 71, 57, 69, 70, 22, 56, 59, 57, 57, 60, 60, 60, 63, // 5x
+ 61, 11, 11, 98, 14, 9, 14, 13, 12, 107, 107, 77, 78, 78, 76, 76, // 6x
+ 47, 117, 127, 118, 118, 116, 115, 119, 115, 112, 55, 124, 123, 0, 14, 117, // 7x
+
+// Section 1:
+// 0 1 2 3 4 5 6 7 8 9 A B C D E F
+ 0, 1, 0, 2, 4, 4, 5, 3, 16, 17, 18, 16, 16, 19, 20, 21, // 0x
+ 6, 6, 6, 7, 7, 7, 8, 112, 62, 62, 63, 63, 38, 38, 39, 39, // 1x
+ 88, 95, 52, 98, 97, 99, 14, 54, 102, 96, 53, 102, 81, 100, 14, 80, // 2x
+ 48, 48, 49, 45, 41, 40, 42, 42, 43, 46, 45, 24, 25, 28, 27, 104, // 3x
+ 32, 32, 34, 33, 36, 37, 35, 35, 79, 73, 72, 72, 74, 75, 64, 65, // 4x
+ 66, 67, 71, 71, 68, 69, 70, 22, 56, 59, 57, 57, 60, 60, 58, 61, // 5x
+ 61, 11, 11, 98, 14, 9, 14, 13, 12, 107, 107, 77, 78, 78, 76, 76, // 6x
+ 47, 117, 127, 118, 118, 116, 115, 119, 115, 112, 55, 124, 123, 0, 14, 117, // 7x
+// Section 2:
+// 0 1 2 3 4 5 6 7 8 9 A B C D E F
+ 0, 1, 0, 2, 4, 4, 5, 3, 16, 17, 18, 16, 16, 19, 20, 21, // 0x
+ 6, 6, 6, 7, 7, 7, 8, 112, 62, 62, 63, 63, 38, 38, 39, 39, // 1x
+ 88, 95, 52, 98, 97, 99, 14, 54, 102, 96, 53, 102, 81, 100, 14, 80, // 2x
+ 48, 48, 49, 45, 41, 40, 42, 42, 43, 46, 45, 24, 25, 28, 27, 104, // 3x
+ 32, 32, 34, 33, 36, 37, 35, 35, 79, 73, 72, 72, 74, 75, 64, 65, // 4x
+ 66, 67, 71, 71, 68, 69, 70, 22, 56, 59, 57, 57, 60, 60, 58, 61, // 5x
+ 61, 11, 11, 98, 14, 9, 14, 13, 12, 107, 107, 77, 78, 78, 76, 76, // 6x
+ 47, 117, 127, 118, 118, 116, 115, 119, 115, 112, 55, 124, 123, 0, 14, 117, // 7x
+// Section 3:
+// 0 1 2 3 4 5 6 7 8 9 A B C D E F
+ 0, 1, 0, 2, 4, 4, 5, 3, 16, 17, 18, 16, 16, 19, 20, 21, // 0x
+ 6, 6, 6, 7, 7, 7, 8, 112, 62, 62, 63, 63, 38, 38, 39, 39, // 1x
+ 88, 95, 52, 98, 97, 99, 14, 54, 102, 96, 53, 102, 81, 100, 14, 80, // 2x
+ 48, 48, 49, 45, 41, 40, 42, 42, 43, 46, 45, 24, 25, 28, 27, 104, // 3x
+ 32, 32, 34, 33, 36, 37, 35, 35, 79, 73, 72, 72, 74, 75, 64, 65, // 4x
+ 66, 67, 71, 71, 68, 69, 70, 22, 56, 59, 57, 57, 60, 60, 58, 61, // 5x
+ 61, 11, 11, 98, 14, 9, 14, 13, 12, 107, 107, 77, 78, 78, 76, 76, // 6x
+ 47, 117, 127, 118, 118, 116, 115, 119, 115, 112, 55, 124, 123, 0, 14, 117, // 7x
+// Section 4:
+// 0 1 2 3 4 5 6 7 8 9 A B C D E F
+ 0, 1, 0, 2, 4, 4, 5, 3, 16, 17, 18, 16, 16, 19, 20, 21, // 0x
+ 6, 6, 6, 7, 7, 7, 8, 112, 62, 62, 63, 63, 38, 38, 39, 39, // 1x
+ 88, 95, 52, 98, 97, 99, 14, 54, 102, 96, 53, 102, 81, 100, 14, 80, // 2x
+ 48, 48, 49, 45, 41, 40, 42, 42, 43, 46, 45, 24, 25, 28, 27, 104, // 3x
+ 32, 32, 34, 33, 36, 37, 35, 35, 79, 73, 72, 72, 74, 75, 64, 65, // 4x
+ 66, 67, 71, 71, 68, 69, 70, 22, 56, 59, 57, 57, 60, 60, 58, 61, // 5x
+ 61, 11, 11, 98, 14, 9, 14, 13, 12, 107, 107, 77, 78, 78, 76, 76, // 6x
+ 47, 117, 127, 118, 118, 116, 115, 119, 115, 112, 55, 124, 123, 0, 14, 117, // 7x
+// Section 5:
+// 0 1 2 3 4 5 6 7 8 9 A B C D E F
+ 0, 1, 0, 2, 4, 4, 5, 3, 16, 17, 18, 16, 16, 19, 20, 21, // 0x
+ 6, 6, 6, 7, 7, 7, 8, 112, 62, 62, 63, 63, 38, 38, 39, 39, // 1x
+ 88, 95, 52, 98, 97, 99, 14, 54, 102, 96, 53, 102, 81, 100, 14, 80, // 2x
+ 48, 48, 49, 45, 41, 40, 42, 42, 43, 46, 45, 24, 25, 28, 27, 104, // 3x
+ 32, 32, 34, 33, 36, 37, 35, 35, 79, 73, 72, 72, 74, 75, 64, 65, // 4x
+ 66, 67, 71, 71, 68, 69, 70, 22, 56, 59, 57, 57, 60, 60, 58, 61, // 5x
+ 61, 11, 11, 98, 14, 9, 14, 13, 12, 107, 107, 77, 78, 78, 76, 76, // 6x
+ 47, 117, 127, 118, 118, 116, 115, 119, 115, 112, 55, 124, 123, 0, 14, 117 // 7x
+};
Index: gmmusic.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/gmmusic.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- gmmusic.h 3 May 2003 02:59:45 -0000 1.1
+++ gmmusic.h 12 May 2003 23:25:54 -0000 1.2
@@ -35,9 +35,12 @@
private:
static void passTimerFunc(void *param);
void timerCall(void);
- bool ignoreNextPoll;
+
+ bool _ignoreNextPoll;
uint8 *_sysExSequence;
MidiDriver *_midiDrv;
+ static byte _mt32_to_gm[6*128];
+
virtual void setupPointers(void);
virtual void setupChannels(uint8 *channelData);
virtual void startDriver(void);
Index: musicbase.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/musicbase.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- musicbase.cpp 3 May 2003 02:59:45 -0000 1.1
+++ musicbase.cpp 12 May 2003 23:25:54 -0000 1.2
@@ -38,6 +38,7 @@
{
if (_currentMusic) stopMusic();
if (_musicData) free(_musicData);
+ _currentSection = pSection;
_musicData = _skyDisk->loadFile(_driverFileBase + FILES_PER_SECTION * pSection, NULL);
_allowedCommands = 0;
_musicTempo0 = 0x78; // init constants taken from idb file, area ~0x1060
Index: musicbase.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/musicbase.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- musicbase.h 3 May 2003 10:23:12 -0000 1.2
+++ musicbase.h 12 May 2003 23:25:54 -0000 1.3
@@ -57,7 +57,7 @@
uint16 _driverFileBase;
uint16 _musicVolume, _numberOfChannels;
- uint8 _currentMusic;
+ uint8 _currentMusic, _currentSection;
uint8 _musicTempo0; // can be changed by music stream
uint8 _musicTempo1; // given once per music
uint32 _tempo; // calculated from musicTempo0 and musicTempo1
Index: sky.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/sky.cpp,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- sky.cpp 9 May 2003 22:06:37 -0000 1.31
+++ sky.cpp 12 May 2003 23:25:54 -0000 1.32
@@ -110,22 +110,14 @@
_skySound = new SkySound(_mixer);
_skyDisk = new SkyDisk(_gameDataPath);
- // FIXME: This is *ugly* (and maybe even incorrect?)
- // We need to know if we have to use adlib for midi or not.
-
- if (_detector->_midi_driver == MD_ADLIB) {
- _skyMusic = new SkyAdlibMusic(_mixer, _skyDisk);
+ if (_detector->getMidiDriverType() == MD_ADLIB) {
+ _skyMusic = new SkyAdlibMusic(_mixer, _skyDisk);
} else {
- if (_detector->_midi_driver == MD_AUTO) {
-#if defined (_WIN32_WCE) || defined(UNIX) || defined(X11_BACKEND)
- _skyMusic = new SkyAdlibMusic(_mixer, _skyDisk);
-#else
- _skyMusic = new SkyGmMusic(_detector->createMidi(), _skyDisk);
-#endif
- } else {
- _skyMusic = new SkyGmMusic(_detector->createMidi(), _skyDisk);
- }
+ _skyMusic = new SkyGmMusic(_detector->createMidi(), _skyDisk);
}
+ // TODO: Add option for users with real MT32 to use it. Driver is done.
+ // _skyMusic = new SkyMT32Music(_detector->createMidi(), _skyDisk);
+
_gameVersion = _skyDisk->determineGameVersion();
_skyText = new SkyText(_skyDisk, _gameVersion, _language);
Index: sky.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/sky.h,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- sky.h 5 May 2003 13:19:59 -0000 1.22
+++ sky.h 12 May 2003 23:25:54 -0000 1.23
@@ -35,6 +35,7 @@
#include "sky/musicbase.h"
#include "sky/adlibmusic.h"
#include "sky/gmmusic.h"
+#include "sky/mt32music.h"
#include "sky/mouse.h"
class SkyLogic;
More information about the Scummvm-git-logs
mailing list