diff options
Diffstat (limited to 'backends')
-rw-r--r-- | backends/midi/adlib.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/backends/midi/adlib.cpp b/backends/midi/adlib.cpp index a95fa8da38..960ad0cd82 100644 --- a/backends/midi/adlib.cpp +++ b/backends/midi/adlib.cpp @@ -102,6 +102,8 @@ public: byte getNumber() { return _channel; } void release() { _allocated = false; } + void send (uint32 b); + // Regular messages void noteOff(byte note); void noteOn(byte note, byte velocity); @@ -559,6 +561,7 @@ public: int open(); void close(); void send(uint32 b); + void send (byte channel, uint32 b); // Supports higher than channel 15 uint32 property(int prop, uint32 param); void setPitchBendRange(byte channel, uint range); @@ -646,6 +649,10 @@ MidiDriver *AdlibPart::device() { return _owner; } +void AdlibPart::send (uint32 b) { + _owner->send (_channel, b); +} + void AdlibPart::noteOff(byte note) { _owner->part_key_off(this, note); } @@ -830,9 +837,9 @@ MidiDriver_ADLIB::MidiDriver_ADLIB(SoundMixer *mixer) } for (i = 0; i < ARRAYSIZE(_parts); ++i) { - _parts[i].init(this, i); + _parts[i].init(this, i + ((i >= 9) ? 1 : 0)); } - _percussion.init(this, 0); + _percussion.init(this, 9); } int MidiDriver_ADLIB::open() { @@ -888,12 +895,15 @@ void MidiDriver_ADLIB::close() { _isOpen = false; } -void MidiDriver_ADLIB::send(uint32 b) { +void MidiDriver_ADLIB::send (uint32 b) { + send (b & 0xF, b & 0xFFFFFFF0); +} + +void MidiDriver_ADLIB::send (byte chan, uint32 b) { //byte param3 = (byte) ((b >> 24) & 0xFF); byte param2 = (byte) ((b >> 16) & 0xFF); byte param1 = (byte) ((b >> 8) & 0xFF); byte cmd = (byte) (b & 0xF0); - byte chan = (byte) (b & 0x0F); AdlibPart *part; if (chan == 9) |