@@ -703,11 +703,8 @@ void MidiDriver_AdLib::setVelocityReg(int regOffset, int velocity, int kbScaleLe
703
703
704
704
void MidiDriver_AdLib::setPatch (int voice, int patch) {
705
705
if ((patch < 0 ) || ((uint)patch >= _patches.size ())) {
706
- // This happens with songs 1 and 23 in PQ2. Song 1 (the title song) uses an invalid
707
- // instrument 80, and song 23 (car horn when the car runs over you at the airport,
708
- // rooms 14/15) an invalid instrument 89. These are probably leftovers from MT32.
709
- warning (" ADLIB: Invalid patch %i requested (patch.003 contains %d instruments)" ,
710
- patch, _patches.size ());
706
+ warning (" ADLIB: Invalid patch %i requested" , patch);
707
+ // Substitute instrument 0
711
708
patch = 0 ;
712
709
}
713
710
@@ -760,10 +757,16 @@ bool MidiDriver_AdLib::loadResource(const byte *data, uint size) {
760
757
for (int i = 0 ; i < 48 ; i++)
761
758
loadInstrument (data + (28 * i));
762
759
763
- if (size == 2690 ) {
760
+ if (size == 1344 ) {
761
+ byte dummy[28 ] = {0 };
762
+
763
+ // Only 48 instruments, add dummies
764
+ for (int i = 0 ; i < 48 ; i++)
765
+ loadInstrument (dummy);
766
+ } else if (size == 2690 ) {
764
767
for (int i = 48 ; i < 96 ; i++)
765
768
loadInstrument (data + 2 + (28 * i));
766
- } else if (size == 5382 ) {
769
+ } else {
767
770
// SCI1.1 and later
768
771
for (int i = 48 ; i < 190 ; i++)
769
772
loadInstrument (data + (28 * i));
0 commit comments