RCS file: /cvsroot/scummvm/scummvm/scumm/scummvm.cpp,v
retrieving revision 2.401
diff -u -r2.401 scummvm.cpp
|
|
|
734 | 734 | } else if (((_midiDriver == MD_PCJR) || (_midiDriver == MD_PCSPK)) && ((_version > 2) && (_version < 5))) { |
735 | 735 | _musicEngine = _playerV2 = new Player_V2(this); |
736 | 736 | } else if (_version > 2) { |
| 737 | MidiDriver *driver = detector->createMidi(); |
| 738 | if (driver) |
| 739 | driver->property (MidiDriver::PROP_CHANNEL_MASK, 0x03FE); |
737 | 740 | _musicEngine = _imuse = IMuse::create(syst, _mixer, detector->createMidi()); |
738 | 741 | if (_imuse) { |
739 | 742 | if (detector->_gameTempo != 0) |
RCS file: /cvsroot/scummvm/scummvm/sound/mididrv.h,v
retrieving revision 1.26
diff -u -r1.26 mididrv.h
|
|
|
44 | 44 | |
45 | 45 | enum { |
46 | 46 | // PROP_TIMEDIV = 1, |
47 | | PROP_OLD_ADLIB = 2 |
| 47 | PROP_OLD_ADLIB = 2, |
| 48 | PROP_CHANNEL_MASK = 3 |
48 | 49 | }; |
49 | 50 | |
50 | 51 | // Open the midi driver. |
RCS file: /cvsroot/scummvm/scummvm/sound/mpu401.cpp,v
retrieving revision 1.17
diff -u -r1.17 mpu401.cpp
|
|
|
85 | 85 | _started_thread (false), |
86 | 86 | _mutex (0), |
87 | 87 | _timer_proc (0), |
88 | | _timer_param (0) |
| 88 | _timer_param (0), |
| 89 | _channel_mask (0xFFFF) // Permit all 16 channels by default |
89 | 90 | { |
90 | 91 | |
91 | 92 | uint i; |
… |
… |
|
106 | 107 | send (0x7B << 8 | 0xB0 | i); |
107 | 108 | } |
108 | 109 | |
| 110 | uint32 MidiDriver_MPU401::property (int prop, uint32 param) { |
| 111 | switch (prop) { |
| 112 | case PROP_CHANNEL_MASK: |
| 113 | _channel_mask = param & 0xFFFF; |
| 114 | return 1; |
| 115 | } |
| 116 | |
| 117 | return 0; |
| 118 | } |
| 119 | |
109 | 120 | MidiChannel *MidiDriver_MPU401::allocateChannel() { |
110 | 121 | MidiChannel_MPU401 *chan; |
111 | 122 | uint i; |
112 | 123 | |
113 | 124 | for (i = 0; i < ARRAYSIZE(_midi_channels); ++i) { |
114 | | if (i == 9) |
| 125 | if (i == 9 || !(_channel_mask & (1 << i))) |
115 | 126 | continue; |
116 | 127 | chan = &_midi_channels[i]; |
117 | 128 | if (!chan->_allocated) { |
RCS file: /cvsroot/scummvm/scummvm/sound/mpu401.h,v
retrieving revision 1.13
diff -u -r1.13 mpu401.h
|
|
|
85 | 85 | OSystem::MutexRef _mutex; // Concurrent shutdown barrier |
86 | 86 | volatile TimerCallback _timer_proc; |
87 | 87 | void *_timer_param; |
| 88 | uint16 _channel_mask; |
88 | 89 | |
89 | 90 | static int midi_driver_thread (void *param); |
90 | 91 | |
… |
… |
|
94 | 95 | virtual void close(); |
95 | 96 | void setTimerCallback(void *timer_param, TimerCallback timer_proc); |
96 | 97 | uint32 getBaseTempo(void) { return 10000; } |
| 98 | uint32 property(int prop, uint32 param); |
97 | 99 | |
98 | 100 | MidiChannel *allocateChannel(); |
99 | 101 | MidiChannel *getPercussionChannel() { return &_midi_channels [9]; } |