[Scummvm-git-logs] scummvm master -> 152445e622a6aa83a61c7aa16c3e62f3d3f1ea2a

AndywinXp noreply at scummvm.org
Thu Jan 8 19:53:45 UTC 2026


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

Summary:
152445e622 SWORD1: Attempt at fixing #16393


Commit: 152445e622a6aa83a61c7aa16c3e62f3d3f1ea2a
    https://github.com/scummvm/scummvm/commit/152445e622a6aa83a61c7aa16c3e62f3d3f1ea2a
Author: AndywinXp (andywinxp at gmail.com)
Date: 2026-01-08T20:53:39+01:00

Commit Message:
SWORD1: Attempt at fixing #16393

This should fix #16393 for good

"SWORD1: Harsh noise for some Broken Sword 1 releases on big-endian ports"

Changed paths:
    engines/sword1/sound.cpp


diff --git a/engines/sword1/sound.cpp b/engines/sword1/sound.cpp
index d38ce46512c..fae66a8da88 100644
--- a/engines/sword1/sound.cpp
+++ b/engines/sword1/sound.cpp
@@ -571,6 +571,13 @@ bool Sound::expandSpeech(byte *src, byte *dst, uint32 dstSize, bool *endiannessC
 	if (_cowMode == CowPSX) {
 		Audio::RewindableAudioStream *stream = Audio::makeXAStream(new Common::MemoryReadStream(src, dstSize), 11025);
 		stream->readBuffer((int16 *)_speechSample, _speechSize);
+
+#ifdef SCUMM_BIG_ENDIAN
+		for (int i = 0; i < _speechSize / 2; i++) {
+			((int16 *)_speechSample)[i] = TO_LE_16(((int16 *)_speechSample)[i]);
+		}
+#endif
+
 		return true;
 	} else if (_cowMode != CowWave && _cowMode != CowDemo) {
 		Audio::RewindableAudioStream *stream = nullptr;
@@ -591,6 +598,13 @@ bool Sound::expandSpeech(byte *src, byte *dst, uint32 dstSize, bool *endiannessC
 #endif
 		if (stream) {
 			stream->readBuffer((int16 *)_speechSample, _speechSize);
+
+#ifdef SCUMM_BIG_ENDIAN
+			for (int i = 0; i < _speechSize / 2; i++) {
+				((int16 *)_speechSample)[i] = TO_LE_16(((int16 *)_speechSample)[i]);
+			}
+#endif
+
 			return true;
 		} else {
 			return false;
@@ -1310,6 +1324,12 @@ void Sound::serveSample(Common::File *file, int32 i) {
 							debug(5, "Sound::serveSample(): Finished feeding music file %s", file->getName());
 					}
 				}
+
+#ifdef SCUMM_BIG_ENDIAN
+				for (int j = 0; j < len; j++) {
+					((int16 *)buf)[j] = TO_LE_16(((int16 *)buf)[j]);
+				}
+#endif
 			}
 
 			if (_musicStreamFormat[i] != MusWav)




More information about the Scummvm-git-logs mailing list