aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/imuse/imuse.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2011-07-14 00:48:30 +0200
committerJohannes Schickel2011-07-14 00:49:32 +0200
commitf814dc971ca9f6526b4f6049642b79d6371dcfb8 (patch)
tree254ec12a9dd2e914d4daed1daebbc60c594f01da /engines/scumm/imuse/imuse.cpp
parent9565af1ae42674b67fd1ed744ae4855991ba8473 (diff)
downloadscummvm-rg350-f814dc971ca9f6526b4f6049642b79d6371dcfb8.tar.gz
scummvm-rg350-f814dc971ca9f6526b4f6049642b79d6371dcfb8.tar.bz2
scummvm-rg350-f814dc971ca9f6526b4f6049642b79d6371dcfb8.zip
SCUMM: Handle default instrument set up in iMuse like the original.
Diffstat (limited to 'engines/scumm/imuse/imuse.cpp')
-rw-r--r--engines/scumm/imuse/imuse.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/engines/scumm/imuse/imuse.cpp b/engines/scumm/imuse/imuse.cpp
index 451721cf70..5ad4798578 100644
--- a/engines/scumm/imuse/imuse.cpp
+++ b/engines/scumm/imuse/imuse.cpp
@@ -1682,7 +1682,21 @@ void IMuseInternal::setGlobalInstrument(byte slot, byte *data) {
void IMuseInternal::copyGlobalInstrument(byte slot, Instrument *dest) {
if (slot >= 32)
return;
- _global_instruments[slot].copy_to(dest);
+
+ // Both the AdLib code and the PC Speaker code use an all zero instrument
+ // as default in the original, thus we do the same.
+ // PC Speaker instrument size is 23, while AdLib instrument size is 30.
+ // Thus we just use a 30 byte instrument data array as default.
+ const byte defaultInstr[30] = { 0 };
+
+ if (_global_instruments[slot].isValid()) {
+ // In case we have an valid instrument set up, copy it to the part.
+ _global_instruments[slot].copy_to(dest);
+ } else if (_pcSpeaker) {
+ dest->pcspk(defaultInstr);
+ } else {
+ dest->adlib(defaultInstr);
+ }
}