[Scummvm-git-logs] scummvm master -> 99393f0bcc9a438bfeaa688a653945b1e09d5e63

bluegr noreply at scummvm.org
Sat Apr 16 11:20:31 UTC 2022


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
99393f0bcc SCUMM: Don't restrict the Indy4 MONSTER.SOU workaround to English versions


Commit: 99393f0bcc9a438bfeaa688a653945b1e09d5e63
    https://github.com/scummvm/scummvm/commit/99393f0bcc9a438bfeaa688a653945b1e09d5e63
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2022-04-16T14:20:26+03:00

Commit Message:
SCUMM: Don't restrict the Indy4 MONSTER.SOU workaround to English versions

LucasArts released (at least) an official Japanese version with Japanese
text and English voices; plus, there are some fan-made translations made
for the original English Talkie version.  They appear to use the same
MONSTER.SOU (or INDY4.SOU) file.

So, instead of only applying the Trac#10559 workaround to Common::EN_ANY
releases, accept any (talkie) version, as long as we can find the broken
VOC header at that offset.

Changed paths:
    engines/scumm/sound.cpp


diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp
index 9af1f078a69..50e0435b82f 100644
--- a/engines/scumm/sound.cpp
+++ b/engines/scumm/sound.cpp
@@ -822,7 +822,7 @@ void Sound::startTalkSound(uint32 offset, uint32 b, int mode, Audio::SoundHandle
 			// but raw PCM s16be at (this is a guess) 44.1 kHz with a bogus VOC header.
 			// To work around this we skip the VOC header and decode the raw PCM data.
 			// Fixes Trac#10559
-			if (mode == 2 && (_vm->_game.id == GID_INDY4) && (_vm->_language == Common::EN_ANY) && offset == 0x76ccbca) {
+			if (mode == 2 && _vm->_game.id == GID_INDY4 && offset == 0x76ccbca) {
 				_sampleIsPCMS16BE44100 = true;
 				size = 86016; // size of speech sample
 			}
@@ -890,7 +890,20 @@ void Sound::startTalkSound(uint32 offset, uint32 b, int mode, Audio::SoundHandle
 			break;
 		default:
 			if (_sampleIsPCMS16BE44100) {
-				offset += 32; // size of VOC header
+				byte *vocHeader = new byte[32];
+
+				file->read(vocHeader, 32);
+				// Don't apply the Indy4 MONSTER.SOU workaround if we don't find the bogus VOC header
+				if (memcmp(vocHeader, "Creative Voice File\x1a\x1a\x00\x0a\x01\x29\x11\x01\x02\x50\x01\xa6\x00", 32) != 0) {
+					_sampleIsPCMS16BE44100 = false;
+				}
+
+				delete[] vocHeader;
+				file->seek(-32, SEEK_CUR);
+			}
+
+			if (_sampleIsPCMS16BE44100) {
+				offset += 32;
 				input = Audio::makeRawStream(new Common::SeekableSubReadStream(file.release(), offset, offset + size, DisposeAfterUse::YES), 44100, Audio::FLAG_16BITS, DisposeAfterUse::YES);
 			} else {
 				input = Audio::makeVOCStream(file.release(), Audio::FLAG_UNSIGNED, DisposeAfterUse::YES);




More information about the Scummvm-git-logs mailing list