aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2003-03-10 02:55:50 +0000
committerMax Horn2003-03-10 02:55:50 +0000
commit7c147e4771cbf8ad8216fafe8a889cd3e7170234 (patch)
treefa2ad7a2669f2952cfc7267892ac7d0aca4116f1
parentbce210cc2573cc4b416705f3f8f1eb16119e39cf (diff)
downloadscummvm-rg350-7c147e4771cbf8ad8216fafe8a889cd3e7170234.tar.gz
scummvm-rg350-7c147e4771cbf8ad8216fafe8a889cd3e7170234.tar.bz2
scummvm-rg350-7c147e4771cbf8ad8216fafe8a889cd3e7170234.zip
cleanup CD opcode a bit; slightly increase the 'delay' -> sounds better since speakers are not cut off abruptly anymore
svn-id: r6791
-rw-r--r--scumm/script_v5.cpp24
1 files changed, 14 insertions, 10 deletions
diff --git a/scumm/script_v5.cpp b/scumm/script_v5.cpp
index c8d9d60e40..f82d82def0 100644
--- a/scumm/script_v5.cpp
+++ b/scumm/script_v5.cpp
@@ -2411,21 +2411,25 @@ void Scumm_v5::decodeParseString() {
case 7: /* overhead */
_string[textSlot].overhead = true;
break;
- case 8:{ /* play loom talkie sound - use in other games ? */
- int x = getVarOrDirectWord(0x80);
- int offset;
- int delay;
-
- if (x != 0)
- offset = (int)((x & 0xffff) * 7.5 - 22650);
- else
- offset = 0;
- delay = (int)((getVarOrDirectWord(0x40) & 0xffff) * 7.5);
+ case 8:{ /* play loom talkie sound - used in other games ? */
+ int offset = (uint16)getVarOrDirectWord(0x80);
+ int delay = (uint16)getVarOrDirectWord(0x40);
+
if (_gameId == GID_LOOM256) {
_vars[VAR_MI1_TIMER] = 0;
if (offset == 0 && delay == 0) {
_sound->stopCD();
} else {
+ // Loom specified the offset from the start of the CD;
+ // thus we have to subtract the lenght of the first track
+ // (22500 frames) plus the 2 second = 150 frame leadin.
+ // I.e. in total 22650 frames.
+ offset = (int)(offset * 7.5 - 22650);
+
+ // Slightly increase the delay (5 frames = 1/25 of a second).
+ // This noticably improves the experience in Loom CD.
+ delay = (int)(delay * 7.5 + 5);
+
_sound->playCDTrack(1, 0, offset, delay);
}
} else {