diff options
author | Jamieson Christian | 2002-12-20 13:09:01 +0000 |
---|---|---|
committer | Jamieson Christian | 2002-12-20 13:09:01 +0000 |
commit | 799da2baeff6dc35990bfbf85fa4531c1b3bc8ed (patch) | |
tree | 12fddc7b09ac769ec9bfb39192cc85a2c2772b1d /scumm/imuse.cpp | |
parent | e347600e115cf6c50e9c3c56472138f6b7b8bba3 (diff) | |
download | scummvm-rg350-799da2baeff6dc35990bfbf85fa4531c1b3bc8ed.tar.gz scummvm-rg350-799da2baeff6dc35990bfbf85fa4531c1b3bc8ed.tar.bz2 scummvm-rg350-799da2baeff6dc35990bfbf85fa4531c1b3bc8ed.zip |
[Bug #656635] fixed.
Adlib global instrument assignments are now correct.
svn-id: r6028
Diffstat (limited to 'scumm/imuse.cpp')
-rw-r--r-- | scumm/imuse.cpp | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/scumm/imuse.cpp b/scumm/imuse.cpp index 095f858913..08d47112ad 100644 --- a/scumm/imuse.cpp +++ b/scumm/imuse.cpp @@ -272,6 +272,7 @@ struct Part { void silence(); void set_instrument(uint b); void set_instrument(byte * data); + void load_global_instrument (byte b); void set_transpose(int8 transpose); void set_vol(uint8 volume); @@ -366,6 +367,7 @@ public: void on_timer() {} void set_instrument(uint slot, byte *instr); + void part_load_global_instrument (Part *part, byte slot); void part_set_param(Part *part, byte param, int value) {} void part_key_on(Part *part, byte note, byte velocity); void part_key_off(Part *part, byte note); @@ -2073,8 +2075,12 @@ byte *Player::parse_midi(byte *s) case 0xC: // Program Change value = *s++; part = get_part(chan); - if (part) - part->set_program(value); + if (part) { + if (_isGM || value >= 32) + part->set_program(value); + else + part->load_global_instrument (value); + } break; case 0xD: // Channel Pressure @@ -3277,6 +3283,11 @@ void Part::set_instrument(byte * data) changed(IMuseDriver::pcProgram); } +void Part::load_global_instrument (byte slot) +{ + _drv->part_load_global_instrument (this, slot); +} + void Part::key_on(byte note, byte velocity) { _drv->part_key_on(this, note, velocity); @@ -3695,6 +3706,14 @@ void IMuseDriver::set_instrument(uint slot, byte *data) } } +void IMuseDriver::part_load_global_instrument (Part *part, byte slot) +{ + if (slot >= 32) + return; + _glob_instr [slot].copy_to (&part->_instrument); + part->changed (pcProgram); +} + void IMuseDriver::part_changed(Part *part, uint16 what) { MidiChannel *mc; |