mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-04 09:56:30 +00:00
SCI: make channel remapping stop using channel 0 for mt32 - fixes playback accordingly (like lsl1 at the start)
svn-id: r50056
This commit is contained in:
parent
996bd693e0
commit
ed50ecd62d
@ -55,6 +55,7 @@ public:
|
||||
bool hasRhythmChannel() const { return true; }
|
||||
byte getPlayId();
|
||||
int getPolyphony() const { return kVoices; }
|
||||
int getFirstChannel();
|
||||
void setVolume(byte volume);
|
||||
int getVolume();
|
||||
void setReverb(byte reverb);
|
||||
@ -317,6 +318,13 @@ void MidiPlayer_Midi::send(uint32 b) {
|
||||
}
|
||||
}
|
||||
|
||||
// We return 1 for mt32, because if we remap channels to 0 for mt32, those won't get played at all
|
||||
int MidiPlayer_Midi::getFirstChannel() {
|
||||
if (_isMt32)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void MidiPlayer_Midi::setVolume(byte volume) {
|
||||
_masterVolume = volume;
|
||||
|
||||
|
@ -86,6 +86,7 @@ public:
|
||||
|
||||
virtual byte getPlayId() = 0;
|
||||
virtual int getPolyphony() const = 0;
|
||||
virtual int getFirstChannel() { return 0; };
|
||||
|
||||
virtual void setVolume(byte volume) {
|
||||
if(_driver)
|
||||
|
@ -103,6 +103,9 @@ void SciMusic::init() {
|
||||
}
|
||||
|
||||
_bMultiMidi = ConfMan.getBool("multi_midi");
|
||||
|
||||
// Find out what the first possible channel is (used, when doing channel remapping)
|
||||
_driverFirstChannel = _pMidiDrv->getFirstChannel();
|
||||
}
|
||||
|
||||
void SciMusic::clearPlayList() {
|
||||
@ -241,7 +244,7 @@ int16 SciMusic::tryToOwnChannel(MusicEntry *caller, int16 bestChannel) {
|
||||
return bestChannel;
|
||||
}
|
||||
// otherwise look for unused channel
|
||||
for (int channelNr = 0; channelNr < 15; channelNr++) {
|
||||
for (int channelNr = _driverFirstChannel; channelNr < 15; channelNr++) {
|
||||
if (!_usedChannel[channelNr]) {
|
||||
_usedChannel[channelNr] = caller;
|
||||
return channelNr;
|
||||
|
@ -216,6 +216,8 @@ private:
|
||||
bool _soundOn;
|
||||
byte _masterVolume;
|
||||
MusicEntry *_usedChannel[16];
|
||||
|
||||
int _driverFirstChannel;
|
||||
};
|
||||
|
||||
} // End of namespace Sci
|
||||
|
Loading…
x
Reference in New Issue
Block a user