aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/imuse/imuse.cpp
diff options
context:
space:
mode:
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);
+ }
}