[Scummvm-cvs-logs] SF.net SVN: scummvm:[50035] scummvm/trunk/engines/sci/sound/drivers/adlib. cpp
waltervn at users.sourceforge.net
waltervn at users.sourceforge.net
Sat Jun 19 03:16:25 CEST 2010
Revision: 50035
http://scummvm.svn.sourceforge.net/scummvm/?rev=50035&view=rev
Author: waltervn
Date: 2010-06-19 01:16:25 +0000 (Sat, 19 Jun 2010)
Log Message:
-----------
SCI: AdLib: add dummy instruments when there are only 48 in the patch
Modified Paths:
--------------
scummvm/trunk/engines/sci/sound/drivers/adlib.cpp
Modified: scummvm/trunk/engines/sci/sound/drivers/adlib.cpp
===================================================================
--- scummvm/trunk/engines/sci/sound/drivers/adlib.cpp 2010-06-18 22:16:05 UTC (rev 50034)
+++ scummvm/trunk/engines/sci/sound/drivers/adlib.cpp 2010-06-19 01:16:25 UTC (rev 50035)
@@ -703,11 +703,8 @@
void MidiDriver_AdLib::setPatch(int voice, int patch) {
if ((patch < 0) || ((uint)patch >= _patches.size())) {
- // This happens with songs 1 and 23 in PQ2. Song 1 (the title song) uses an invalid
- // instrument 80, and song 23 (car horn when the car runs over you at the airport,
- // rooms 14/15) an invalid instrument 89. These are probably leftovers from MT32.
- warning("ADLIB: Invalid patch %i requested (patch.003 contains %d instruments)",
- patch, _patches.size());
+ warning("ADLIB: Invalid patch %i requested", patch);
+ // Substitute instrument 0
patch = 0;
}
@@ -760,10 +757,16 @@
for (int i = 0; i < 48; i++)
loadInstrument(data + (28 * i));
- if (size == 2690) {
+ if (size == 1344) {
+ byte dummy[28] = {0};
+
+ // Only 48 instruments, add dummies
+ for (int i = 0; i < 48; i++)
+ loadInstrument(dummy);
+ } else if (size == 2690) {
for (int i = 48; i < 96; i++)
loadInstrument(data + 2 + (28 * i));
- } else if (size == 5382) {
+ } else {
// SCI1.1 and later
for (int i = 48; i < 190; i++)
loadInstrument(data + (28 * i));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list