[Scummvm-git-logs] scummvm branch-2-9 -> c1367156ef0bb5b86353f3cd3ba9ca42f485a418

dwatteau noreply at scummvm.org
Mon Apr 28 17:46:19 UTC 2025


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

Summary:
a201b35bc1 SCUMM: HE: Fix alloc-dealloc mismatch in ResExtractor
a9ece36075 SCUMM: Allow using the Amiga palette again for Loom/Monkey1/Passport (Trac#15458)
e22a559269 SCUMM: Simplify the condition for allowing the Amiga palette in DOS/EGA titles
f1156cdf49 SCUMM: LOOM (FM-Towns): Ignore trim_fmtowns_to_200_pixels setting (Trac#15666)
f828a6fdfb SCUMM: Fix excessive MIDI messages
f40b485020 SCUMM: Fix audio pops at the end of Sega CD MI1 (bug #15369)
860c3cfdd2 SCUMM: get rid of UBSan warnings
49b9404f57 SCUMM: fix bug no. 15766
03d6efc760 SCUMM: Drop unused _freq_current from Player_V1
7b0c7c2e6b SCUMM: NES: Remove unused private fields from Player_NES
28d2b38446 JANITORIAL: SCUMM: Fix a misleading indentation
0a7bb14dae SCUMM: HE: Add proper detection code for Macintosh French Freddi4 (Trac#15611)
602434391d SCUMM: Add detection entry for fan-made Italian translation of Loom FM-TOWNS
923a0a288b SCUMM: Add detection entry for fan-made Italian translation of Indy3 VGA
37b24ff680 SCUMM: Add detection entry for fan-made Italian translation of Indy3 TOWNS
254681e7c4 SCUMM: Try to improve the workaround for Smirk's cigar smoke in MI1
1a1ea4a4e0 SCUMM: Fix UBSan warning in canLoadGameStateCurrently() (e.g. with indy3-mac)
1e8c1d373d SCUMM: Fix UBSan warning in writeVar() enhancement for SAMNMAX
46080107d2 SCUMM: fix bug no. 15885
b96922b3db SCUMM: fix UBSan warning
5ef2c69fd2 SCUMM: MONKEY1: Make the Jolly Roger enhancement work on the floppy VGA release
88448c6dd9 KYRA: Give the name of the original SJIS font when reporting it can't be found
8a29fe7e7a KYRA: Fix typo in previous commit
9b05d7c444 KYRA: fix bug no. 15901
a6d8818ff2 KYRA: fix previous commit
9ee920b115 CONFIGURE: Add -ffat-lto-objects to the endianness check for LTO builds
5bf60f2e2f CONFIGURE: Remove tmp_endianness_check.dwo leftover
e5e14afee9 CONFIGURE: MACOS: Link with -headerpad_max_install_names for OSX <= 10.5
2dc989cf53 ANDROID: Build with optimizations when requested even in debug mode
82298d7e76 BUILD: Fix build on mingw with libcurl
4afefd28f5 CONFIGURE: MACOSX: Use -fno-var-tracking-assignments for OSXPPC
96c2b44763 CONFIGURE: Use -Wno-maybe-uninitialized for GCC 4.9 too
c1367156ef CONFIGURE: Make --disable-gold the default, now that Binutils deprecated it


Commit: a201b35bc13cfe314605ce70e883a60c25b86d6c
    https://github.com/scummvm/scummvm/commit/a201b35bc13cfe314605ce70e883a60c25b86d6c
Author: tunnelsociety (150493071+tunnelsociety at users.noreply.github.com)
Date: 2025-04-28T18:08:28+02:00

Commit Message:
SCUMM: HE: Fix alloc-dealloc mismatch in ResExtractor

CachedCursor->bitmap and palette are allocated via new[] in ::extractResource

(cherry picked from commit dc0207dc0405d99d92001c49e99ce056d7b540a7)

Changed paths:
    engines/scumm/he/resource_he.cpp


diff --git a/engines/scumm/he/resource_he.cpp b/engines/scumm/he/resource_he.cpp
index aef61c6d5d5..c94331cdb49 100644
--- a/engines/scumm/he/resource_he.cpp
+++ b/engines/scumm/he/resource_he.cpp
@@ -49,8 +49,8 @@ ResExtractor::~ResExtractor() {
 	for (int i = 0; i < MAX_CACHED_CURSORS; ++i) {
 		CachedCursor *cc = &_cursorCache[i];
 		if (cc->valid) {
-			free(cc->bitmap);
-			free(cc->palette);
+			delete[] cc->bitmap;
+			delete[] cc->palette;
 		}
 	}
 


Commit: a9ece36075edf1e6c3688174f037c803f597b5a9
    https://github.com/scummvm/scummvm/commit/a9ece36075edf1e6c3688174f037c803f597b5a9
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2025-04-28T18:10:33+02:00

Commit Message:
SCUMM: Allow using the Amiga palette again for Loom/Monkey1/Passport (Trac#15458)

This restores the popular ScummVM < 2.7.0 behavior of allowing the Amiga
renderer mode to be used for all the DOS v2-v4 EGA titles (that is:
Maniac Mansion V2, Zak V2, Indy3 EGA, Loom EGA, Monkey Island 1 EGA, and
the Passport to Adventure EGA demo).

Many players like it for the softer palette and/or more natural skin tone
it gives to most characters.

This relaxes commit 2fe65d95ef86433460c2c59eca9de022564c2926 a bit.

(cherry picked from commit 6f7f61aff9ff2a22ccb163f305d87ff959f80bd8)

Changed paths:
    engines/scumm/detection_tables.h
    engines/scumm/scumm.cpp


diff --git a/engines/scumm/detection_tables.h b/engines/scumm/detection_tables.h
index 4ec2c769c54..335700807e9 100644
--- a/engines/scumm/detection_tables.h
+++ b/engines/scumm/detection_tables.h
@@ -176,22 +176,22 @@ static const GameSettings gameVariantsTable[] = {
 	{"indy3", "Steam",  "steam", GID_INDY3, 3, 0, MDT_PCSPK | MDT_PCJR | MDT_CMS | MDT_ADLIB, GF_OLD256 | GF_FEW_LOCALS, UNK, GUIO4(GUIO_NOSPEECH, GUIO_NOMIDI, GAMEOPTION_ENHANCEMENTS, GAMEOPTION_ORIGINALGUI)},
 	{"indy3", "FM-TOWNS",     0, GID_INDY3, 3, 0, MDT_TOWNS,             GF_OLD256 | GF_FEW_LOCALS | GF_AUDIOTRACKS, Common::kPlatformFMTowns, GUIO6(GUIO_NOSPEECH, GUIO_NOMIDI, GUIO_MIDITOWNS, GAMEOPTION_TRIM_FMTOWNS_TO_200_PIXELS, GAMEOPTION_ENHANCEMENTS, GAMEOPTION_ORIGINALGUI)},
 
-	{"loom", "EGA",      "ega", GID_LOOM, 3, 0, MDT_PCSPK | MDT_PCJR | MDT_CMS | MDT_ADLIB | MDT_MIDI | MDT_PREFER_MT32, 0, UNK, GUIO5(GUIO_NOSPEECH, GUIO_RENDERCGA, GAMEOPTION_ENHANCEMENTS, GAMEOPTION_ORIGINALGUI, GAMEOPTION_COPY_PROTECTION)},
+	{"loom", "EGA",      "ega", GID_LOOM, 3, 0, MDT_PCSPK | MDT_PCJR | MDT_CMS | MDT_ADLIB | MDT_MIDI | MDT_PREFER_MT32, 0, UNK, GUIO6(GUIO_NOSPEECH, GUIO_RENDERCGA, GUIO_RENDERAMIGA, GAMEOPTION_ENHANCEMENTS, GAMEOPTION_ORIGINALGUI, GAMEOPTION_COPY_PROTECTION)},
 	{"loom", "Mac",      "ega", GID_LOOM, 3, 0, MDT_PCSPK | MDT_PCJR,                                  0, UNK, GUIO6(GUIO_NOSPEECH, GUIO_RENDERMACINTOSHBW, GUIO_NOMIDI, GAMEOPTION_ENHANCEMENTS, GAMEOPTION_ORIGINALGUI, GUIO_NOASPECT)},
 	{"loom", "No AdLib", "ega", GID_LOOM, 3, 0, MDT_PCSPK | MDT_PCJR | MDT_CMS,                        0, UNK, GUIO4(GUIO_NOSPEECH, GUIO_NOMIDI, GAMEOPTION_ENHANCEMENTS, GAMEOPTION_ORIGINALGUI)},
 	{"loom", "PC-Engine",    0, GID_LOOM, 3, 0, MDT_NONE,                         GF_AUDIOTRACKS | GF_OLD256 | GF_16BIT_COLOR, Common::kPlatformPCEngine, GUIO3(GUIO_NOSPEECH, GUIO_NOMIDI, GAMEOPTION_ENHANCEMENTS)},
 	{"loom", "FM-TOWNS",     0, GID_LOOM, 3, 0, MDT_TOWNS,                        GF_AUDIOTRACKS | GF_OLD256, Common::kPlatformFMTowns, GUIO6(GUIO_NOSPEECH, GUIO_NOMIDI, GUIO_MIDITOWNS, GUIO_NOASPECT, GAMEOPTION_ENHANCEMENTS, GAMEOPTION_ORIGINALGUI)},
 	{"loom", "VGA",      "vga", GID_LOOM, 4, 0, MDT_NONE,                         GF_AUDIOTRACKS,             Common::kPlatformDOS, GUIO5(GUIO_NOSPEECH, GUIO_NOMIDI, GUIO_RENDEREGA, GAMEOPTION_ENHANCEMENTS, GAMEOPTION_ORIGINALGUI)},
 	{"loom", "Steam",  "steam", GID_LOOM, 4, 0, MDT_NONE,                         GF_AUDIOTRACKS,  UNK, GUIO5(GUIO_NOSPEECH, GUIO_NOMIDI, GUIO_RENDEREGA, GAMEOPTION_ENHANCEMENTS, GAMEOPTION_ORIGINALGUI)},
-	{"loom", "Demo",      "ega", GID_LOOM, 3, 0, MDT_PCSPK | MDT_PCJR | MDT_CMS | MDT_ADLIB | MDT_MIDI | MDT_PREFER_MT32, GF_DEMO, UNK, GUIO3(GUIO_NOSPEECH, GUIO_RENDERCGA, GAMEOPTION_ORIGINALGUI)},
+	{"loom", "Demo",      "ega", GID_LOOM, 3, 0, MDT_PCSPK | MDT_PCJR | MDT_CMS | MDT_ADLIB | MDT_MIDI | MDT_PREFER_MT32, GF_DEMO, UNK, GUIO4(GUIO_NOSPEECH, GUIO_RENDERCGA, GUIO_RENDERAMIGA, GAMEOPTION_ORIGINALGUI)},
 
-	{"pass", 0, 0, GID_PASS, 4, 0, MDT_PCSPK | MDT_PCJR | MDT_CMS | MDT_ADLIB, GF_16COLOR, Common::kPlatformDOS, GUIO4(GUIO_NOSPEECH, GUIO_RENDERCGA, GUIO_NOMIDI, GAMEOPTION_ORIGINALGUI)},
+	{"pass", 0, 0, GID_PASS, 4, 0, MDT_PCSPK | MDT_PCJR | MDT_CMS | MDT_ADLIB, GF_16COLOR, Common::kPlatformDOS, GUIO5(GUIO_NOSPEECH, GUIO_RENDERCGA, GUIO_RENDERAMIGA, GUIO_NOMIDI, GAMEOPTION_ORIGINALGUI)},
 
 	{"monkey", "VGA",      "vga", GID_MONKEY_VGA, 4, 0, MDT_PCSPK | MDT_PCJR | MDT_CMS | MDT_ADLIB | MDT_MIDI | MDT_PREFER_MT32, 0, UNK, GUIO5(GUIO_NOSPEECH, GUIO_RENDEREGA, GAMEOPTION_ENHANCEMENTS, GAMEOPTION_ORIGINALGUI, GAMEOPTION_COPY_PROTECTION)},
 	{"monkey", "VGA Demo",      "vga", GID_MONKEY_VGA, 4, 0, MDT_PCSPK | MDT_PCJR | MDT_CMS | MDT_ADLIB | MDT_MIDI | MDT_PREFER_MT32, GF_DEMO, UNK, GUIO3(GUIO_NOSPEECH, GUIO_RENDEREGA, GAMEOPTION_ORIGINALGUI)},
-	{"monkey", "EGA",      "ega", GID_MONKEY_EGA, 4, 0, MDT_PCSPK | MDT_PCJR | MDT_CMS | MDT_ADLIB | MDT_MIDI | MDT_PREFER_MT32, GF_16COLOR,     Common::kPlatformDOS, GUIO6(GUIO_NOSPEECH, GUIO_RENDERHERCGREEN, GUIO_RENDERHERCAMBER, GUIO_RENDERCGA, GAMEOPTION_ENHANCEMENTS, GAMEOPTION_ORIGINALGUI)},
+	{"monkey", "EGA",      "ega", GID_MONKEY_EGA, 4, 0, MDT_PCSPK | MDT_PCJR | MDT_CMS | MDT_ADLIB | MDT_MIDI | MDT_PREFER_MT32, GF_16COLOR,     Common::kPlatformDOS, GUIO7(GUIO_NOSPEECH, GUIO_RENDERHERCGREEN, GUIO_RENDERHERCAMBER, GUIO_RENDERCGA, GUIO_RENDERAMIGA, GAMEOPTION_ENHANCEMENTS, GAMEOPTION_ORIGINALGUI)},
 	{"monkey", "No AdLib", "ega", GID_MONKEY_EGA, 4, 0, MDT_PCSPK | MDT_PCJR,                        GF_16COLOR,     Common::kPlatformAtariST, GUIO4(GUIO_NOSPEECH, GUIO_NOMIDI, GAMEOPTION_ENHANCEMENTS, GAMEOPTION_ORIGINALGUI)},
-	{"monkey", "Demo",     "ega", GID_MONKEY_EGA, 4, 0, MDT_PCSPK | MDT_PCJR | MDT_CMS | MDT_ADLIB,            GF_16COLOR | GF_DEMO,     Common::kPlatformDOS, GUIO6(GUIO_NOSPEECH, GUIO_NOMIDI, GUIO_RENDERHERCGREEN, GUIO_RENDERHERCAMBER, GUIO_RENDERCGA, GAMEOPTION_ORIGINALGUI)},
+	{"monkey", "Demo",     "ega", GID_MONKEY_EGA, 4, 0, MDT_PCSPK | MDT_PCJR | MDT_CMS | MDT_ADLIB,            GF_16COLOR | GF_DEMO,     Common::kPlatformDOS, GUIO7(GUIO_NOSPEECH, GUIO_NOMIDI, GUIO_RENDERHERCGREEN, GUIO_RENDERHERCAMBER, GUIO_RENDERCGA, GUIO_RENDERAMIGA, GAMEOPTION_ORIGINALGUI)},
 	{"monkey", "CD",           0, GID_MONKEY,     5, 0, MDT_ADLIB,                        GF_AUDIOTRACKS, UNK, GUIO5(GUIO_NOSPEECH, GUIO_NOMIDI, GUIO_RENDEREGA, GAMEOPTION_ENHANCEMENTS, GAMEOPTION_ORIGINALGUI)},
 	{"monkey", "Mac",		   0, GID_MONKEY,     5, 0, MDT_MACINTOSH,                    0, UNK, GUIO6(GUIO_NOSPEECH, GUIO_NOMIDI, GAMEOPTION_ENHANCEMENTS, GAMEOPTION_ORIGINALGUI, GAMEOPTION_COPY_PROTECTION, GUIO_NOASPECT)},
 	{"monkey", "FM-TOWNS",     0, GID_MONKEY,     5, 0, MDT_TOWNS,                        GF_AUDIOTRACKS, Common::kPlatformFMTowns, GUIO6(GUIO_NOSPEECH, GUIO_NOMIDI, GUIO_MIDITOWNS, GAMEOPTION_TRIM_FMTOWNS_TO_200_PIXELS, GAMEOPTION_ENHANCEMENTS, GAMEOPTION_ORIGINALGUI)},
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index b672013b3a8..79cebc14d30 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -338,11 +338,18 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
 		break;
 
 	case Common::kRenderAmiga:
-		// Allow v2 games to be rendered in forced Amiga mode; this works, and
-		// doing this to avoid the "sunburn effect" in MM/Zak is popular.
-		// Also allow this for Indy3 EGA.
-		if (_game.platform != Common::kPlatformAmiga && _game.version != 2 &&
-(_game.version != 3 || _game.id != GID_INDY3 || _game.platform == Common::kPlatformMacintosh))
+		// Allow V2 DOS/EGA games to be rendered with the Amiga palette; this works,
+		// and doing so to avoid the "sunburnt" effect in MM/Zak is popular to the
+		// point of being suggested in some online guides. Some players also like
+		// this setting for the V3/V4 EGA titles (especially since ScummVM < 2.7.0
+		// allowed it; see Trac#15458) and one may say that LucasArts made this
+		// option "canon" if you read the `Common::kRenderEGA` case above.
+		if (_game.platform == Common::kPlatformDOS && (_game.version == 2 ||
+			(_game.version == 3 && !(_game.features & GF_OLD256)) ||
+			(_game.version == 4 && (_game.features & GF_16COLOR))))
+			break;
+
+		if (_game.platform != Common::kPlatformAmiga)
 			_renderMode = Common::kRenderDefault;
 		break;
 


Commit: e22a5592699d724c8ea3cb3c55c10a24b342af5d
    https://github.com/scummvm/scummvm/commit/e22a5592699d724c8ea3cb3c55c10a24b342af5d
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2025-04-28T18:11:27+02:00

Commit Message:
SCUMM: Simplify the condition for allowing the Amiga palette in DOS/EGA titles

bluegr suggested this simpler approach. The previous one *may* work a
bit better for users with "old" game libraries (i.e. those who don't
delete/re-add their games so that the detection code is triggered
again to update some feature flags in the configuration file), but
I'm not that sure about this.  And anyway, improving the SCUMM
detection code is a different concern, not the subject of this change.

The current commit can be reverted if the previous one is proven to work
better for end-users.

(cherry picked from commit 4e3afee0d2de0a2fab2054c3fbe9a033546d817e)

Changed paths:
    engines/scumm/scumm.cpp


diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 79cebc14d30..d63fb09e6e9 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -338,15 +338,12 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
 		break;
 
 	case Common::kRenderAmiga:
-		// Allow V2 DOS/EGA games to be rendered with the Amiga palette; this works,
-		// and doing so to avoid the "sunburnt" effect in MM/Zak is popular to the
-		// point of being suggested in some online guides. Some players also like
-		// this setting for the V3/V4 EGA titles (especially since ScummVM < 2.7.0
-		// allowed it; see Trac#15458) and one may say that LucasArts made this
-		// option "canon" if you read the `Common::kRenderEGA` case above.
-		if (_game.platform == Common::kPlatformDOS && (_game.version == 2 ||
-			(_game.version == 3 && !(_game.features & GF_OLD256)) ||
-			(_game.version == 4 && (_game.features & GF_16COLOR))))
+		// Allow V2-V4 DOS/EGA games to be rendered with the Amiga palette; doing
+		// so to avoid the "sunburnt" effect is popular to the point of being
+		// suggested in some online guides, and ScummVM < 2.7.0 allowed it. One
+		// may say that LucasArts made this option "canon" anyway, if you read
+		// the `Common::kRenderEGA` case above.
+		if (Common::String(_game.guioptions).contains(GUIO_RENDERAMIGA))
 			break;
 
 		if (_game.platform != Common::kPlatformAmiga)


Commit: f1156cdf49e1b78628fe4b5c5df2fc545c0fc09e
    https://github.com/scummvm/scummvm/commit/f1156cdf49e1b78628fe4b5c5df2fc545c0fc09e
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2025-04-28T18:13:44+02:00

Commit Message:
SCUMM: LOOM (FM-Towns): Ignore trim_fmtowns_to_200_pixels setting (Trac#15666)

`trim_fmtowns_to_200_pixels` support for Loom FM-Towns was not meant to
happen (see GH-2913 PR comments), and it has no TRIM_FMTOWNS_TO_200_PIXELS
game-option in its detection tables anyway.

But one could force this setting through the configuration file, hitting
the expected issues coming from the fact that Loom _does_ use the extra
40 pixels, in various places. See Trac#11290 and the original comments in
<https://forums.scummvm.org/viewtopic.php?p=97395#p97395> for more info.

So, unless someone wants to finish the original work to fix Loom with this
setting, we're going to ignore it for Loom, for now.

(cherry picked from commit 0e1a96346462ddd5982c9acb5addc29ce2427f87)

Changed paths:
    engines/scumm/scumm.cpp


diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index d63fb09e6e9..ab2bf6e1b3b 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -376,7 +376,10 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
 
 	if (_game.platform == Common::kPlatformFMTowns && _game.version == 3) {
 		// FM-TOWNS V3 games originally use 320x240, and we have an option to trim to 200
-		if (!ConfMan.getBool("trim_fmtowns_to_200_pixels"))
+		// FIXME: Don't allow this for Loom yet, though; it used the extra 40 pixels for
+		// various things, and so this option currently causes various issues (see bugs
+		// #15666, #11290, and <https://forums.scummvm.org/viewtopic.php?p=97395#p97395>).
+		if (_game.id == GID_LOOM || !ConfMan.getBool("trim_fmtowns_to_200_pixels"))
 			_screenHeight = 240;
 	} else if (_game.version == 8 || _game.heversion >= 71) {
 		// COMI uses 640x480. Likewise starting from version 7.1, HE games use


Commit: f828a6fdfb3b144dad08e92b18a811cb3abbdc9c
    https://github.com/scummvm/scummvm/commit/f828a6fdfb3b144dad08e92b18a811cb3abbdc9c
Author: Coen Rampen (crampen at gmail.com)
Date: 2025-04-28T18:15:19+02:00

Commit Message:
SCUMM: Fix excessive MIDI messages

The code for reducing music volume levels during speech was sending out volume
change messages every MIDI timer tick, regardless of whether the volume had
actually changed. This caused problems for older MIDI hardware, which can only
process a limited number of MIDI events in a given time period.

Fixed this by checking if any of the volume levels set by musicVolumeReduction
has actually changed before calling update_volumes. Looking at the MIDI output
of the original interpreter, this also seems a better match to the original
behavior.

This fixes issue #15724.

(cherry picked from commit fb7e7539d4ba735ea5ad30e189a6380d4874667e)

Changed paths:
    engines/scumm/imuse/imuse.cpp


diff --git a/engines/scumm/imuse/imuse.cpp b/engines/scumm/imuse/imuse.cpp
index f96c4bf74cd..11ca26673c1 100644
--- a/engines/scumm/imuse/imuse.cpp
+++ b/engines/scumm/imuse/imuse.cpp
@@ -1379,11 +1379,17 @@ void IMuseInternal::musicVolumeReduction(MidiDriver *midi) {
 			_music_volume_eff = (curEffVol + 1) * factor;
 	}
 
+	bool volumeChanged = false;
 	for (uint i = 0; i < ARRAYSIZE(_channel_volume); i++) {
-		_channel_volume_eff[i] = _channel_volume[i] * (_master_volume * _music_volume_eff / 255) / 255;
+		uint16 newChannelVolume = _channel_volume[i] * (_master_volume * _music_volume_eff / 255) / 255;
+		if (_channel_volume_eff[i] != newChannelVolume) {
+			_channel_volume_eff[i] = newChannelVolume;
+			volumeChanged = true;
+		}
 	}
 
-	update_volumes();
+	if (volumeChanged)
+		update_volumes();
 }
 
 int IMuseInternal::set_volchan_entry(uint a, uint b) {


Commit: f40b4850201ea2b9aedaeb48941da2e5c1c5d324
    https://github.com/scummvm/scummvm/commit/f40b4850201ea2b9aedaeb48941da2e5c1c5d324
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2025-04-28T18:16:59+02:00

Commit Message:
SCUMM: Fix audio pops at the end of Sega CD MI1 (bug #15369)

A error in how the size of the audio data was calculated meant that the
last eight bytes were never decrypted. As far as I can tell, this bug
was there for more than twenty years! Other than the encryption, the
sound resources appear to be identical to the VGA CD ones.

(cherry picked from commit e96f022cfdf0bca276fc304c098260419ccd870c)

Changed paths:
    engines/scumm/sound.cpp


diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp
index 62771592c90..30fdf2bb217 100644
--- a/engines/scumm/sound.cpp
+++ b/engines/scumm/sound.cpp
@@ -443,7 +443,12 @@ void Sound::triggerSound(int soundID) {
 		// 80 80 80 80 80 80 80 80  |........|
 		// 80 80 80 80 80 80 80 80  |........|
 
-		size = READ_BE_UINT32(ptr + 4) - 27;
+		// Skip to the VOC header, and adjust the size. Note that while
+		// ptr points to the beginning of the resource, 'size' refers
+		// to the size of the SBL data. That is why there it an eight
+		// byte difference. See bug #15369.
+
+		size = READ_BE_UINT32(ptr + 4) - 19;
 		ptr += 27;
 
 		// Fingolfin says: after eyeballing a single SEGA


Commit: 860c3cfdd29e7b2ffa5787eaec7f379bf6b39b16
    https://github.com/scummvm/scummvm/commit/860c3cfdd29e7b2ffa5787eaec7f379bf6b39b16
Author: athrxx (athrxx at scummvm.org)
Date: 2025-04-28T18:17:43+02:00

Commit Message:
SCUMM: get rid of UBSan warnings

(about left shifts on negative values)

(cherry picked from commit b5451ca5a1e6957d12eb4b44ca769031de2fe865)

Changed paths:
    engines/scumm/actor.cpp


diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp
index ae990aaa732..c54bfc2a79f 100644
--- a/engines/scumm/actor.cpp
+++ b/engines/scumm/actor.cpp
@@ -659,11 +659,11 @@ int Actor::actorWalkStep() {
 		return 0;
 	}
 
-	int tmpX = (_pos.x << 16) + _walkdata.xfrac + (_walkdata.deltaXFactor >> 8) * _scalex;
+	int tmpX = _pos.x * 0x10000 + _walkdata.xfrac + (_walkdata.deltaXFactor >> 8) * _scalex;
 	_walkdata.xfrac = (uint16)tmpX;
 	_pos.x = (tmpX >> 16);
 
-	int tmpY = (_pos.y << 16) + _walkdata.yfrac + (_walkdata.deltaYFactor >> 8) * _scaley;
+	int tmpY = _pos.y * 0x10000 + _walkdata.yfrac + (_walkdata.deltaYFactor >> 8) * _scaley;
 	_walkdata.yfrac = (uint16)tmpY;
 	_pos.y = (tmpY >> 16);
 


Commit: 49b9404f57c110f1e0f70db5c7ba4aa8da4ad4fc
    https://github.com/scummvm/scummvm/commit/49b9404f57c110f1e0f70db5c7ba4aa8da4ad4fc
Author: athrxx (athrxx at scummvm.org)
Date: 2025-04-28T18:18:21+02:00

Commit Message:
SCUMM: fix bug no. 15766

(ZAK: Wrong positioning of the devotee)

(cherry picked from commit a0ee0af22747e3167d50e30fe9ffbd8878addc5b)

Changed paths:
    engines/scumm/actor.cpp


diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp
index c54bfc2a79f..7b7c0b4f08f 100644
--- a/engines/scumm/actor.cpp
+++ b/engines/scumm/actor.cpp
@@ -1662,7 +1662,7 @@ void Actor::faceToObject(int obj) {
 	} else {
 		_vm->getObjectOrActorWidth(obj, width);
 		dir = (_pos.x < x2) ? 1 : 0;
-		if (abs(_pos.x - x2) < width / 2)
+		if (abs(_pos.x - x2) < (_vm->_game.version > 2 ? width / 2 : 2))
 			dir = (_pos.y > y2) ? 3 : 2;
 
 		dir = oldDirToNewDir(dir);


Commit: 03d6efc7603871b95b01981ec1bd5f4d2a0fb67b
    https://github.com/scummvm/scummvm/commit/03d6efc7603871b95b01981ec1bd5f4d2a0fb67b
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2025-04-28T18:19:02+02:00

Commit Message:
SCUMM: Drop unused _freq_current from Player_V1

Reported by -Wunused-private-field on Clang 15.

Unused since commit fa457b95c107838f11728c84fc1e97779adcdfdb.

(cherry picked from commit cb7694d73e9ed63257dedfd4fb4441ac56f28c3d)

Changed paths:
    engines/scumm/players/player_v1.h


diff --git a/engines/scumm/players/player_v1.h b/engines/scumm/players/player_v1.h
index 7e8023b0a11..774ed49821d 100644
--- a/engines/scumm/players/player_v1.h
+++ b/engines/scumm/players/player_v1.h
@@ -76,7 +76,6 @@ private:
 	uint  _mplex_step;
 	uint  _mplex;
 	uint  _repeat_ctr;
-	uint  _freq_current;
 	int   _forced_level;
 	uint16 _random_lsr;
 	uint  *_value_ptr;


Commit: 7b0c7c2e6bd634734da631634e366ac2c4e31534
    https://github.com/scummvm/scummvm/commit/7b0c7c2e6bd634734da631634e366ac2c4e31534
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2025-04-28T18:19:09+02:00

Commit Message:
SCUMM: NES: Remove unused private fields from Player_NES

Reported by -Wunused-private-field on Clang 15.

(cherry picked from commit 1447e799a15ce235d7c71c70a80a7e6eb32cb548)

Changed paths:
    engines/scumm/players/player_nes.h


diff --git a/engines/scumm/players/player_nes.h b/engines/scumm/players/player_nes.h
index 11918688c6b..80beacd0ad4 100644
--- a/engines/scumm/players/player_nes.h
+++ b/engines/scumm/players/player_nes.h
@@ -99,12 +99,9 @@ private:
 
 	bool isSFXplaying, wasSFXplaying;
 
-	byte *dataStart;
 	int numNotes;
 	byte *auxData1;
 	byte *auxData2;
-
-	byte *soundptr;
 };
 
 } // End of namespace Scumm


Commit: 28d2b38446250aa8424f95384f79a74c4e0a7209
    https://github.com/scummvm/scummvm/commit/28d2b38446250aa8424f95384f79a74c4e0a7209
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2025-04-28T18:20:32+02:00

Commit Message:
JANITORIAL: SCUMM: Fix a misleading indentation

(and a small comment while there)

(cherry picked from commit b9fd88d0af7c9b458b75653e77fa87c5ac3a331a)

Changed paths:
    engines/scumm/saveload.cpp


diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp
index a9f4763d5a9..dba4fe1f5e4 100644
--- a/engines/scumm/saveload.cpp
+++ b/engines/scumm/saveload.cpp
@@ -1492,9 +1492,9 @@ void ScummEngine::saveLoadWithSerializer(Common::Serializer &s) {
 				for (i = 0; i < 4096; ++i) {
 					*pos = SWAP_BYTES_16(*pos);
 					pos++;
+				}
 			}
 		}
-	}
 	} else {
 		s.syncBytes(_grabbedCursor, 8192, VER(20));
 	}
@@ -1905,7 +1905,7 @@ void ScummEngine::saveLoadWithSerializer(Common::Serializer &s) {
 	}
 
 	// Before version 109, palette cycling for v4 games was handled in a different
-	// way (which is, by retrofitting v5 code, which caused a class of bugs like #10854).
+	// way (which, by retrofitting v5 code, caused a class of bugs like #10854).
 	// The proper v4 code has now been implemented from disasm (specifically, only the
 	// LOOM CD and MI1 VGA executables have said code).
 	//


Commit: 0a7bb14dae7074c20af12c97794c9285130c8f36
    https://github.com/scummvm/scummvm/commit/0a7bb14dae7074c20af12c97794c9285130c8f36
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2025-04-28T18:21:59+02:00

Commit Message:
SCUMM: HE: Add proper detection code for Macintosh French Freddi4 (Trac#15611)

>From my own 'FFISH4PCMCF' PC/Mac copy found at a thrift store.

(cherry picked from commit 1d20be75a48adc9a273ffda26cd37b3cc4507ce2)

Changed paths:
    devtools/scumm-md5.txt
    engines/scumm/detection_tables.h
    engines/scumm/scumm-md5.h


diff --git a/devtools/scumm-md5.txt b/devtools/scumm-md5.txt
index d744aa8aa40..2c6ea8e113f 100644
--- a/devtools/scumm-md5.txt
+++ b/devtools/scumm-md5.txt
@@ -630,7 +630,7 @@ freddi4	Freddi Fish 4: The Case of the Hogfish Rustlers of Briny Gulch
 	07b810e37be7489263f7bc7627d4765d	-1	ru	Windows	unenc	Unencrypted	-	sev
 	a336134914eaab4892d35625aa15ad1d	-1	ru	Windows	HE 99	-	-	George Kormendi
 	b5298a5c15ffbe8b381d51ea4e26d35c	44233	de	All	HE 99	-	-	Joachim Eberhard
-	4f138ac6f9b2ac5a41bc68b2c3296064	44233	fr	Windows	HE 99	-	-	gist974
+	4f138ac6f9b2ac5a41bc68b2c3296064	44233	fr	All	HE 99	-	-	gist974
 	e9271b3d0694c7101f10d675ab7c0133	-1	it	Windows	HE 99	-	-	George Q. Greg
 	78bd5f036ea35a878b74e4f47941f784	44035	ru	Windows	HE 99	-	-	sev
 
diff --git a/engines/scumm/detection_tables.h b/engines/scumm/detection_tables.h
index 335700807e9..9c0f59635d9 100644
--- a/engines/scumm/detection_tables.h
+++ b/engines/scumm/detection_tables.h
@@ -694,6 +694,7 @@ static const GameFilenamePattern gameFilenamesTable[] = {
 	{ "freddi4", "FreddiMini", kGenHEPC, UNK_LANG, UNK, 0 },
 	{ "freddi4", "Malice4", kGenHEMac, Common::FR_FRA, Common::kPlatformMacintosh, 0 },
 	{ "freddi4", "MaliceMRC", kGenHEPC, Common::FR_FRA, UNK, 0 },
+	{ "freddi4", "MaliceMRC", kGenHEMac, Common::FR_FRA, UNK, 0 },
 	{ "freddi4", "Mm4demo", kGenHEPC, Common::FR_FRA, UNK, 0 },
 
 	{ "FreddisFunShop", "FreddisFunShop", kGenHEPC, UNK_LANG, Common::kPlatformWindows, 0 },
diff --git a/engines/scumm/scumm-md5.h b/engines/scumm/scumm-md5.h
index 095471b8cd5..3df3cd4ccf4 100644
--- a/engines/scumm/scumm-md5.h
+++ b/engines/scumm/scumm-md5.h
@@ -1,5 +1,5 @@
 /*
-  This file was generated by the md5table tool on Sat Nov  9 11:25:26 2024
+  This file was generated by the md5table tool on Mon Mar 24 17:34:20 2025
   DO NOT EDIT MANUALLY!
  */
 
@@ -267,7 +267,7 @@ static const MD5Table md5table[] = {
 	{ "4e859d3ef1e146b41e7d93c35cd6cc62", "puttzoo", "HE 100", "Lite", -1, Common::EN_ANY, Common::kPlatformIOS },
 	{ "4edbf9d03550f7ba01e7f34d69b678dd", "spyfox", "HE 98.5", "Demo", 20141, Common::NL_NLD, Common::kPlatformUnknown },
 	{ "4f04b321a95d4315ce6d65f8e1dd0368", "maze", "HE 80", "", 23479, Common::EN_USA, Common::kPlatformUnknown },
-	{ "4f138ac6f9b2ac5a41bc68b2c3296064", "freddi4", "HE 99", "", 44233, Common::FR_FRA, Common::kPlatformWindows },
+	{ "4f138ac6f9b2ac5a41bc68b2c3296064", "freddi4", "HE 99", "", 44233, Common::FR_FRA, Common::kPlatformUnknown },
 	{ "4f1d6f8b38343dba405472538b5037ed", "fbear", "HE 62", "", 7717, Common::EN_ANY, Common::kPlatformDOS },
 	{ "4f267a901719623de7dde83e47d5b474", "atlantis", "Amiga", "Floppy", 12035, Common::DE_DEU, Common::kPlatformAmiga },
 	{ "4f580a021eee026f3b4589e17d130d78", "freddi4", "", "", 44190, Common::EN_USA, Common::kPlatformUnknown },


Commit: 602434391d205ebf4a06d0a51a9daf0acb2b7485
    https://github.com/scummvm/scummvm/commit/602434391d205ebf4a06d0a51a9daf0acb2b7485
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2025-04-28T18:23:16+02:00

Commit Message:
SCUMM: Add detection entry for fan-made Italian translation of Loom FM-TOWNS

This is the 'tsm/Carmine' translation from OldGamesItalia.

Reported by luke-70it in Trac#15744.

(cherry picked from commit 3c20a0cb0509ea66201b8f622be095e257aeb8c3)

Changed paths:
    devtools/scumm-md5.txt
    engines/scumm/scumm-md5.h


diff --git a/devtools/scumm-md5.txt b/devtools/scumm-md5.txt
index 2c6ea8e113f..63db7c2058b 100644
--- a/devtools/scumm-md5.txt
+++ b/devtools/scumm-md5.txt
@@ -201,6 +201,7 @@ loom	Loom
 #	37f56ceb13e401a7ac7d9e6b37fecaf7	5748	ru	DOS	EGA	EGA	Fan translation	PRCA RuSCUMM v1.1 (uses custom launcher)
 	cd46c9f122272d02bbf79332ff521898	5748	ru	DOS	EGA	EGA	Fan translation	PRCA RuSCUMM v1.2 16 Mar 07
 	303708df4166067540a5c481eceb04ef	7540	ru	FM-TOWNS	FM-TOWNS	-	Fan translation	PRCA RuSCUMM v1.0 16 Mar 07
+	2edee19abf8ab2868b09c5959683dbd4	7540	it	FM-TOWNS	FM-TOWNS	-	Fan translation	tsm/Carmine OldGamesItalia
 
 monkey	The Secret of Monkey Island
 	c666a998af90d81db447eccba9f72c8d	-1	en	Atari	No AdLib	EGA	-
diff --git a/engines/scumm/scumm-md5.h b/engines/scumm/scumm-md5.h
index 3df3cd4ccf4..79f89eca443 100644
--- a/engines/scumm/scumm-md5.h
+++ b/engines/scumm/scumm-md5.h
@@ -1,5 +1,5 @@
 /*
-  This file was generated by the md5table tool on Mon Mar 24 17:34:20 2025
+  This file was generated by the md5table tool on Thu Mar 27 21:33:00 2025
   DO NOT EDIT MANUALLY!
  */
 
@@ -169,6 +169,7 @@ static const MD5Table md5table[] = {
 	{ "2d9d46f23cb07bbc90b8ad464d3e4ff8", "atlantis", "Mac", "CD", -1, Common::EN_ANY, Common::kPlatformMacintosh },
 	{ "2e85f7aa054930c692a5b1bed1dfc295", "football2002", "", "Patched", -1, Common::EN_ANY, Common::kPlatformUnknown },
 	{ "2e8a1f76ea33bc5e04347646feee173d", "pajama3", "", "", -1, Common::DE_DEU, Common::kPlatformUnknown },
+	{ "2edee19abf8ab2868b09c5959683dbd4", "loom", "FM-TOWNS", "", 7540, Common::IT_ITA, Common::kPlatformFMTowns },
 	{ "2f7583da072d027057983c43bb3fa53f", "spyfox", "HE 100", "", 49742, Common::EN_GRB, Common::kPlatformWii },
 	{ "2fe369ad70f52a8cf7ad6077ee64f81a", "loom", "EGA", "EGA", 5748, Common::DE_DEU, Common::kPlatformAmiga },
 	{ "303708df4166067540a5c481eceb04ef", "loom", "FM-TOWNS", "", 7540, Common::RU_RUS, Common::kPlatformFMTowns },


Commit: 923a0a288b9804995128959450b565bc90bd9306
    https://github.com/scummvm/scummvm/commit/923a0a288b9804995128959450b565bc90bd9306
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2025-04-28T18:23:27+02:00

Commit Message:
SCUMM: Add detection entry for fan-made Italian translation of Indy3 VGA

2007 translation from OldGamesItalia.

Reported by luke-70it in Trac#15744.

(cherry picked from commit 4c5242e6c384ad47d0e2fdccc6969e404fef878c)

Changed paths:
    devtools/scumm-md5.txt
    engines/scumm/scumm-md5.h


diff --git a/devtools/scumm-md5.txt b/devtools/scumm-md5.txt
index 63db7c2058b..5be87586687 100644
--- a/devtools/scumm-md5.txt
+++ b/devtools/scumm-md5.txt
@@ -159,6 +159,7 @@ indy3	Indiana Jones and the Last Crusade
 
 	f3c4ed6101b4c26c762b2dfb16b1481d	6295	fr	DOS	VGA	VGA	Fan translation	atp-fr.com, v0.9a
 	cb8feea195746e042368e2b738766d8b	-1	ko	DOS	VGA	VGA	Fan translation	ScummVM-Kor
+	e893df6788fc63fef936dd531f9712ec	6295	it	DOS	VGA	VGA	Fan translation	OldGamesItalia (2007)
 	275786f0f6894d1fe1ab5f1d103bb814	6295	ru	DOS	VGA	VGA	Fan translation
 
 loom	Loom
diff --git a/engines/scumm/scumm-md5.h b/engines/scumm/scumm-md5.h
index 79f89eca443..40f76fa1bf6 100644
--- a/engines/scumm/scumm-md5.h
+++ b/engines/scumm/scumm-md5.h
@@ -1,5 +1,5 @@
 /*
-  This file was generated by the md5table tool on Thu Mar 27 21:33:00 2025
+  This file was generated by the md5table tool on Fri Mar 28 02:49:06 2025
   DO NOT EDIT MANUALLY!
  */
 
@@ -718,6 +718,7 @@ static const MD5Table md5table[] = {
 	{ "e6cd81b25ab1453a8a6d3482118c391e", "pass", "", "", 7857, Common::EN_ANY, Common::kPlatformDOS },
 	{ "e72bb4c2b613db2cf50f89ff6350e70a", "ft", "", "", -1, Common::ES_ESP, Common::kPlatformUnknown },
 	{ "e781230da44a44e2f0770edb2b3b3633", "maniac", "V2", "V2", 1988, Common::EN_ANY, Common::kPlatformAmiga },
+	{ "e893df6788fc63fef936dd531f9712ec", "indy3", "VGA", "VGA", 6295, Common::IT_ITA, Common::kPlatformDOS },
 	{ "e8d0697906e53fee8b7e9f5652696da8", "atlantis", "", "CD", 11915, Common::JA_JPN, Common::kPlatformDOS },
 	{ "e9271b3d0694c7101f10d675ab7c0133", "freddi4", "HE 99", "", -1, Common::IT_ITA, Common::kPlatformWindows },
 	{ "e94c7cc3686fce406d3c91b5eae5a72d", "zak", "V2", "V2", 1916, Common::EN_ANY, Common::kPlatformAmiga },


Commit: 37b24ff680b040efc8ee9270f6d85e6ad7fd4efd
    https://github.com/scummvm/scummvm/commit/37b24ff680b040efc8ee9270f6d85e6ad7fd4efd
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2025-04-28T18:23:33+02:00

Commit Message:
SCUMM: Add detection entry for fan-made Italian translation of Indy3 TOWNS

v1.0 2007 translation from Glorifindel at OldGamesItalia/IAGTG.

Reported by luke-70it in Trac#15744.

(cherry picked from commit 0f9f9d25688d3ada7e5d03fdfa06447822554a47)

Changed paths:
    devtools/scumm-md5.txt
    engines/scumm/scumm-md5.h


diff --git a/devtools/scumm-md5.txt b/devtools/scumm-md5.txt
index 5be87586687..9536ad58e74 100644
--- a/devtools/scumm-md5.txt
+++ b/devtools/scumm-md5.txt
@@ -161,6 +161,7 @@ indy3	Indiana Jones and the Last Crusade
 	cb8feea195746e042368e2b738766d8b	-1	ko	DOS	VGA	VGA	Fan translation	ScummVM-Kor
 	e893df6788fc63fef936dd531f9712ec	6295	it	DOS	VGA	VGA	Fan translation	OldGamesItalia (2007)
 	275786f0f6894d1fe1ab5f1d103bb814	6295	ru	DOS	VGA	VGA	Fan translation
+	b27efc535df2bc2db998947c15ce57fb	7552	it	FM-TOWNS	FM-TOWNS	-	Fan translation	Glorifindel at OldGamesItalia/IAGTG (2007), v1.0
 
 loom	Loom
 	4dc780f1bc587a193ce8a97652791438	5748	en	Amiga	EGA	EGA	-	Antti Leimi, Andrea Petrucci
diff --git a/engines/scumm/scumm-md5.h b/engines/scumm/scumm-md5.h
index 40f76fa1bf6..dd3fd9f1ed3 100644
--- a/engines/scumm/scumm-md5.h
+++ b/engines/scumm/scumm-md5.h
@@ -1,5 +1,5 @@
 /*
-  This file was generated by the md5table tool on Fri Mar 28 02:49:06 2025
+  This file was generated by the md5table tool on Fri Mar 28 03:02:43 2025
   DO NOT EDIT MANUALLY!
  */
 
@@ -572,6 +572,7 @@ static const MD5Table md5table[] = {
 	{ "b100abf7ff83146df50db78dbd5e9cfa", "freddicove", "HE 100", "", 41182, Common::FR_FRA, Common::kPlatformUnknown },
 	{ "b23f7cd7c304d7dff08e92a96120d5b4", "zak", "V1", "V1", 1896, Common::EN_ANY, Common::kPlatformDOS },
 	{ "b250d0f9cc83f80ced56fe11a4fb057c", "maniac", "V2", "V2", 1988, Common::EN_ANY, Common::kPlatformDOS },
+	{ "b27efc535df2bc2db998947c15ce57fb", "indy3", "FM-TOWNS", "", 7552, Common::IT_ITA, Common::kPlatformFMTowns },
 	{ "b289a2a8cbedbf45786e0b4ad2f510f1", "samnmax", "Floppy", "Floppy", -1, Common::IT_ITA, Common::kPlatformDOS },
 	{ "b2bc1df014ca9a563396cce691e9f23a", "socks", "HE 99", "", 13668, Common::FR_FRA, Common::kPlatformWindows },
 	{ "b47be81e39a9710f6f595f7b527b60f8", "puttrace", "HE 99", "", 32923, Common::EN_GRB, Common::kPlatformWindows },


Commit: 254681e7c45f37f3225177612dfb0478064dd695
    https://github.com/scummvm/scummvm/commit/254681e7c45f37f3225177612dfb0478064dd695
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2025-04-28T18:24:37+02:00

Commit Message:
SCUMM: Try to improve the workaround for Smirk's cigar smoke in MI1

Instead of hard-coding the colors, look for the closest one to the one
we want. Apparently this is needed for the FM Towns version, and only
that one. I don't have it, but I'm told it works better now. I've
verified that the versions I do own (VGA CD, Mac, Sega CD, Special
Edition) still work.

(cherry picked from commit 70282edd4c83dea57b470bb04c62edaddcb5d858)

Changed paths:
    engines/scumm/script_v5.cpp


diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp
index b8ca033f3ec..6d67eeb0740 100644
--- a/engines/scumm/script_v5.cpp
+++ b/engines/scumm/script_v5.cpp
@@ -549,16 +549,27 @@ void ScummEngine_v5::o5_actorOps() {
 			// CD animation uses colors 1-3, where the floppy
 			// version uses 2, 3, and 9.
 			//
-			// We don't touch the colours in general - the Special
-			// edition have pretty much made them canon anyway -
-			// but for the Smirk close-up we want the same colors
-			// as the floppy version.
+			// So we have to adjust which colors are remapped. We
+			// also need to make sure they are remapped to the
+			// correct colors, because not only does the GUI occupy
+			// some colors, apparently the FM Towns version has a
+			// different palette altogether. So we look up the
+			// closest available color to the ones we want.
+			//
+			// We could use this to get back the original smoke
+			// colors for other scenes as well, but we currently do
+			// not. The Special Edition kept the new colors too.
 
 			if (_game.id == GID_MONKEY && _currentRoom == 76 && enhancementEnabled(kEnhVisualChanges)) {
 				if (i == 3)
 					i = 1;
 				else if (i == 9)
 					i = 3;
+
+				if (j == 3)
+					j = findClosestPaletteColor(_currentPalette, 256, 0, 171, 171);
+				else if (j == 7)
+					j = findClosestPaletteColor(_currentPalette, 256, 171, 171, 171);
 			}
 
 			// WORKAROUND for original bug. The original interpreter has a color fix for CGA mode which can be seen
@@ -2277,11 +2288,12 @@ void ScummEngine_v5::o5_roomOps() {
 			_opcode = fetchScriptByte();
 			d = getVarOrDirectByte(PARAM_1);
 
-			// WORKAROUND: The CD version of Monkey Island 1 will
-			// set a couple of default colors, presumably for the
-			// GUI to use. But in the close-up of captain Smirk,
-			// we want the original color 3 for the cigar smoke. It
-			// should be ok since there is no GUI in this scene.
+			// WORKAROUND: The CD versions of Monkey Island 1 may
+			// set a few colors, presumably for the GUI. But this is
+			// the close-up of captain Smirk, so it doesn't need all
+			// of those colors. Only the ones used by the dialog
+			// boxes and such. The others we may need for the cigar
+			// smoke.
 
 			if (_game.id == GID_MONKEY && _currentRoom == 76 && d == 3 && enhancementEnabled(kEnhVisualChanges)) {
 				// Do nothing


Commit: 1a1ea4a4e0d3750366e67dde5a4ece42a8f364c5
    https://github.com/scummvm/scummvm/commit/1a1ea4a4e0d3750366e67dde5a4ece42a8f364c5
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2025-04-28T18:32:27+02:00

Commit Message:
SCUMM: Fix UBSan warning in canLoadGameStateCurrently() (e.g. with indy3-mac)

(cherry picked from commit bbb55196559db0de0223051c2655c9ef7d8a6206)

Changed paths:
    engines/scumm/saveload.cpp


diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp
index dba4fe1f5e4..2487a5f57c3 100644
--- a/engines/scumm/saveload.cpp
+++ b/engines/scumm/saveload.cpp
@@ -132,7 +132,7 @@ bool ScummEngine::canLoadGameStateCurrently(Common::U32String *msg) {
 		}
 
 		// Also deny persistence operations while the script opening the save menu is running...
-		isOriginalMenuActive = _currentRoom == saveRoom || vm.slot[_currentScript].number == saveMenuScript;
+		isOriginalMenuActive = _currentRoom == saveRoom || (_currentScript != 0xFF && vm.slot[_currentScript].number == saveMenuScript);
 	}
 
 	return (VAR_MAINMENU_KEY == 0xFF || VAR(VAR_MAINMENU_KEY) != 0) && !isOriginalMenuActive;


Commit: 1e8c1d373de513481c4d4b8d43a807a4fb6d543f
    https://github.com/scummvm/scummvm/commit/1e8c1d373de513481c4d4b8d43a807a4fb6d543f
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2025-04-28T18:33:40+02:00

Commit Message:
SCUMM: Fix UBSan warning in writeVar() enhancement for SAMNMAX

(cherry picked from commit a3bff044fa5b8efe0fe8111831d4b1bc3ff40172)

Changed paths:
    engines/scumm/script.cpp


diff --git a/engines/scumm/script.cpp b/engines/scumm/script.cpp
index c41a0a713ed..9315dcbdc22 100644
--- a/engines/scumm/script.cpp
+++ b/engines/scumm/script.cpp
@@ -748,7 +748,7 @@ void ScummEngine::writeVar(uint var, int value) {
 		// Any modifications here depend on knowing if the script will
 		// set the timer value back to something sensible afterwards.
 
-		if (_game.id == GID_SAMNMAX && vm.slot[_currentScript].number == 65 && var == VAR_TIMER_NEXT && enhancementEnabled(kEnhTimingChanges)) {
+		if (_game.id == GID_SAMNMAX && _currentScript != 0xFF && vm.slot[_currentScript].number == 65 && var == VAR_TIMER_NEXT && enhancementEnabled(kEnhTimingChanges)) {
 			// "Wirst Du brutzeln, wie eine grobe Bratwurst!"
 			if (value == 1 && _language == Common::DE_DEU)
 				value = 4;


Commit: 46080107d27c2c2c6b6a410aa2470a026489de8a
    https://github.com/scummvm/scummvm/commit/46080107d27c2c2c6b6a410aa2470a026489de8a
Author: athrxx (athrxx at scummvm.org)
Date: 2025-04-28T18:50:30+02:00

Commit Message:
SCUMM: fix bug no. 15885

(cherry picked from commit eaaddaf22040472daa75eb1ef328dc3e85812a5f)

Changed paths:
    engines/scumm/imuse/imuse_player.cpp


diff --git a/engines/scumm/imuse/imuse_player.cpp b/engines/scumm/imuse/imuse_player.cpp
index e04bd4acac8..4ffda6aee04 100644
--- a/engines/scumm/imuse/imuse_player.cpp
+++ b/engines/scumm/imuse/imuse_player.cpp
@@ -1119,6 +1119,10 @@ static void syncWithSerializer(Common::Serializer &s, ParameterFader &pf) {
 		s.syncAsUint32LE(ct, VER(17));
 		int32 diff = end - start;
 		if (pf.param && diff && tt) {
+			if (tt < 10000) {
+				tt = 10000;
+				ct = tt - diff;
+			}
 			pf.dir = diff / ABS<int>(diff);
 			pf.incr = diff / (tt / 10000);
 			pf.ifrac = ABS<int>(diff) % (tt / 10000);


Commit: b96922b3db130986cac3a1be08524bc8f849b154
    https://github.com/scummvm/scummvm/commit/b96922b3db130986cac3a1be08524bc8f849b154
Author: athrxx (athrxx at scummvm.org)
Date: 2025-04-28T18:50:30+02:00

Commit Message:
SCUMM: fix UBSan warning

(adding an offset to a nullptr)

(cherry picked from commit f79f06de22dc8956d1a570afc446f1aba65a8d5b)

Changed paths:
    engines/scumm/gfx.h


diff --git a/engines/scumm/gfx.h b/engines/scumm/gfx.h
index ce0c62eda0c..c4ba35cec01 100644
--- a/engines/scumm/gfx.h
+++ b/engines/scumm/gfx.h
@@ -271,7 +271,7 @@ struct VirtScreen : Graphics::Surface {
 	}
 
 	byte *getBackPixels(int x, int y) const {
-		return (byte *)backBuf + y * pitch + (xstart + x) * format.bytesPerPixel;
+		return (backBuf != nullptr) ? (byte *)backBuf + y * pitch + (xstart + x) * format.bytesPerPixel : nullptr;
 	}
 };
 


Commit: 5ef2c69fd23aaf1402fe65041dd34f95d03c28b9
    https://github.com/scummvm/scummvm/commit/5ef2c69fd23aaf1402fe65041dd34f95d03c28b9
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2025-04-28T18:50:30+02:00

Commit Message:
SCUMM: MONKEY1: Make the Jolly Roger enhancement work on the floppy VGA release

AFAIK, the English VGA floppy release of Monkey1 is the only official
release which tried to fix the continuity error with the Joller Roger.

The enhancement I added a couple of years ago reused the change they
made to the entry script of room 87. But this change is incomplete,
as it didn't take care of removing the Jolly Roger from the screen
once it's been displayed for the first time at the start of Part II.

So, fix the official fix, by making sure to always remove the flag
from the screen, if not right at the start of Part II.

(The irony being that the release where I took this game fix was the
only one where it wouldn't properly work.)

Reported by eriktorbjorn, thanks!

(cherry picked from commit 68e51663fdd9f3534f9ea8a5bf36a874590cc025)
(with a tiny bit of commit 6eb94422cf5cd365833fc62c07b29f6a5c1d06c0)

Changed paths:
    engines/scumm/script_v5.cpp
    engines/scumm/scumm_v5.h


diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp
index 6d67eeb0740..fe4c88b9ea5 100644
--- a/engines/scumm/script_v5.cpp
+++ b/engines/scumm/script_v5.cpp
@@ -437,24 +437,9 @@ void ScummEngine_v5::o5_actorOps() {
 	Actor *a = derefActor(act, "o5_actorOps");
 	int i, j;
 
-	// WORKAROUND: There's a continuity error in Monkey 1, in that the Jolly Roger should
-	// only appear in the first scene showing the Sea Monkey in the middle of the sea,
-	// since Guybrush must have picked it for the two other ship cutscenes to happen.
-	//
-	// Some official releases appear to have a fix for this (e.g. the English floppy VGA
-	// version), but most releases don't. The fixed release would check whether the
-	// script describing that "the crew begins to plan their voyage" is running in order
-	// to display the flag, so we just reuse this check. The Ultimate Talkie also fixed
-	// this, but in a different way which doesn't look as portable between releases.
-	if ((_game.id == GID_MONKEY_EGA || _game.id == GID_MONKEY_VGA || (_game.id == GID_MONKEY && !(_game.features & GF_ULTIMATE_TALKIE))) &&
-		_roomResource == 87 && vm.slot[_currentScript].number == 10002 && act == 9 &&
-		enhancementEnabled(kEnhVisualChanges)) {
-		const int scriptNr = (_game.version == 5) ? 122 : 119;
-		if (!isScriptRunning(scriptNr)) {
-			a->putActor(0);
-			stopObjectCode();
-			return;
-		}
+	if (workaroundMonkey1JollyRoger(_opcode, a->_number)) {
+		stopObjectCode();
+		return;
 	}
 
 	while ((_opcode = fetchScriptByte()) != 0xFF) {
@@ -1447,7 +1432,8 @@ void ScummEngine_v5::o5_getRandomNr() {
 
 void ScummEngine_v5::o5_isScriptRunning() {
 	getResultPos();
-	setResult(isScriptRunning(getVarOrDirectByte(PARAM_1)));
+	int scriptNr = getVarOrDirectByte(PARAM_1);
+	setResult(isScriptRunning(scriptNr));
 
 	// WORKAROUND bug #346 (also occurs in original): Object stopped with active cutscene
 	// In script 204 room 25 (Cannibal Village) a crash can occur when you are
@@ -1474,6 +1460,8 @@ void ScummEngine_v5::o5_isScriptRunning() {
 			}
 		}
 	}
+
+	(void)workaroundMonkey1JollyRoger(_opcode, scriptNr);
 }
 
 void ScummEngine_v5::o5_getVerbEntrypoint() {
@@ -3526,6 +3514,10 @@ void ScummEngine_v5::decodeParseStringTextString(int textSlot) {
 	}
 }
 
+#pragma mark -
+#pragma mark --- Enhancements & workarounds ---
+#pragma mark -
+
 void ScummEngine_v5::printPatchedMI1CannibalString(int textSlot, const byte *ptr) {
 	const char *msg = (const char *)ptr;
 
@@ -3554,4 +3546,48 @@ void ScummEngine_v5::printPatchedMI1CannibalString(int textSlot, const byte *ptr
 	printString(textSlot, (const byte *)msg);
 }
 
+bool ScummEngine_v5::workaroundMonkey1JollyRoger(byte callerOpcode, int arg) {
+	// WORKAROUND: There's a continuity error in Monkey 1, in that the Jolly Roger should
+	// only appear in the *first* scene showing the Sea Monkey in the middle of the sea,
+	// since Guybrush must have picked it for the two other ship cutscenes to happen.
+	//
+	// Most (all?) releases are impacted by this; the English floppy VGA release made a
+	// change to check whether the script describing that "the crew begins to plan their
+	// voyage" is running before displaying the flag, but it's an incomplete fix, as it'd
+	// also need to remove the flag from the room, once it's been shown for the first time.
+	// We fix both issues.
+	if ((_game.id == GID_MONKEY_EGA || _game.id == GID_MONKEY_VGA || (_game.id == GID_MONKEY && !(_game.features & GF_ULTIMATE_TALKIE))) &&
+		_roomResource == 87 && _currentScript != 0xFF && vm.slot[_currentScript].number == 10002 &&
+		enhancementEnabled(kEnhVisualChanges)) {
+		// The script that's only run the first time the flag is shown
+		const int defaultExpectedScriptNr = (_game.version == 5) ? 122 : 119;
+		// Jolly Roger actor number
+		const int defaultExpectedActNr = 9;
+		int scriptNr = -1, actNr = -1;
+
+		if (callerOpcode == 0x13) {
+			// called before o5_actorOps is done
+			actNr = arg;
+			scriptNr = defaultExpectedScriptNr;
+		} else if (callerOpcode == 0x68) {
+			// called after o5_isScriptRunning is done
+			scriptNr = arg;
+			actNr = defaultExpectedActNr;
+		}
+
+		// Unmet conditions; abort any workaround attempt
+		if (scriptNr != defaultExpectedScriptNr || actNr != defaultExpectedActNr)
+			return false;
+
+		// Remove the Jolly Roger from the screen, if not right at the start of Part II
+		Actor *a = derefActorSafe(actNr, "workaroundMonkey1JollyRoger");
+		if (a && !isScriptRunning(scriptNr)) {
+			a->putActor(0);
+			return true;
+		}
+	}
+
+	return false;
+}
+
 } // End of namespace Scumm
diff --git a/engines/scumm/scumm_v5.h b/engines/scumm/scumm_v5.h
index 2bed37ddeb1..23a64582a1f 100644
--- a/engines/scumm/scumm_v5.h
+++ b/engines/scumm/scumm_v5.h
@@ -90,6 +90,8 @@ protected:
 
 	void walkActorToActor(int actor, int toActor, int dist);
 
+	bool workaroundMonkey1JollyRoger(byte callerOpcode, int arg);
+
 	/**
 	 * Fetch the next script word, then if cond is *false*, perform a relative jump.
 	 * So this corresponds to a "jne" jump instruction.


Commit: 88448c6dd937a13104703ef15afe0ce183a9b51b
    https://github.com/scummvm/scummvm/commit/88448c6dd937a13104703ef15afe0ce183a9b51b
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2025-04-28T18:53:26+02:00

Commit Message:
KYRA: Give the name of the original SJIS font when reporting it can't be found

More helpful this way.

Tested with my own Japanese FM-TOWNS CD of Kyrandia II.

(cherry picked from commit 812bf6770676489f005b0480d760dc7312aa8e63)

Changed paths:
    engines/kyra/graphics/screen.cpp


diff --git a/engines/kyra/graphics/screen.cpp b/engines/kyra/graphics/screen.cpp
index 606ca9f973a..efbc6742a84 100644
--- a/engines/kyra/graphics/screen.cpp
+++ b/engines/kyra/graphics/screen.cpp
@@ -194,9 +194,11 @@ bool Screen::init() {
 		}
 
 		if (_useSJIS) {
+			assert(_vm->gameFlags().platform == Common::kPlatformPC98 || _vm->gameFlags().platform == Common::kPlatformFMTowns);
+
 			_sjisFontShared = Common::SharedPtr<Graphics::FontSJIS>(Graphics::FontSJIS::createFont(_vm->gameFlags().platform));
 			if (!_sjisFontShared.get())
-				error("Could not load any SJIS font, neither the original nor ScummVM's 'SJIS.FNT'");
+				error("Could not load any SJIS font, neither the original %s nor ScummVM's 'SJIS.FNT'", _vm->gameFlags().platform == Common::kPlatformPC98 ? "'FONT.ROM'/'FONT.BMP'" : "'FMT_FMT.ROM'");
 
 			if (_use16ColorMode)
 				_fonts[FID_SJIS_TEXTMODE_FNT] = new SJISFont(_sjisFontShared, _sjisInvisibleColor, true, false, 0);


Commit: 8a29fe7e7a63f0407024727843d22f69173b499c
    https://github.com/scummvm/scummvm/commit/8a29fe7e7a63f0407024727843d22f69173b499c
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2025-04-28T18:53:31+02:00

Commit Message:
KYRA: Fix typo in previous commit

(cherry picked from commit e7e6e02555e1440eb9f069a51153fd30807ce8bb)

Changed paths:
    engines/kyra/graphics/screen.cpp


diff --git a/engines/kyra/graphics/screen.cpp b/engines/kyra/graphics/screen.cpp
index efbc6742a84..98633cdc522 100644
--- a/engines/kyra/graphics/screen.cpp
+++ b/engines/kyra/graphics/screen.cpp
@@ -198,7 +198,7 @@ bool Screen::init() {
 
 			_sjisFontShared = Common::SharedPtr<Graphics::FontSJIS>(Graphics::FontSJIS::createFont(_vm->gameFlags().platform));
 			if (!_sjisFontShared.get())
-				error("Could not load any SJIS font, neither the original %s nor ScummVM's 'SJIS.FNT'", _vm->gameFlags().platform == Common::kPlatformPC98 ? "'FONT.ROM'/'FONT.BMP'" : "'FMT_FMT.ROM'");
+				error("Could not load any SJIS font, neither the original %s nor ScummVM's 'SJIS.FNT'", _vm->gameFlags().platform == Common::kPlatformPC98 ? "'FONT.ROM'/'FONT.BMP'" : "'FMT_FNT.ROM'");
 
 			if (_use16ColorMode)
 				_fonts[FID_SJIS_TEXTMODE_FNT] = new SJISFont(_sjisFontShared, _sjisInvisibleColor, true, false, 0);


Commit: 9b05d7c444363b572c7efe35aab293138c891812
    https://github.com/scummvm/scummvm/commit/9b05d7c444363b572c7efe35aab293138c891812
Author: athrxx (athrxx at scummvm.org)
Date: 2025-04-28T18:53:38+02:00

Commit Message:
KYRA: fix bug no. 15901

(KYRA: SoundTownsPC98_v2::playTrack() heap
buffer-overflow (ASan))

(cherry picked from commit 13c182379a110431e94ddb56dc9419a67d21df22)

Changed paths:
    engines/kyra/sound/sound_intern.h
    engines/kyra/sound/sound_pc98_v2.cpp


diff --git a/engines/kyra/sound/sound_intern.h b/engines/kyra/sound/sound_intern.h
index f25c88676ae..b1b8696d3e0 100644
--- a/engines/kyra/sound/sound_intern.h
+++ b/engines/kyra/sound/sound_intern.h
@@ -238,7 +238,7 @@ private:
 	uint8 *_sfxTrackData;
 	TownsPC98_AudioDriver *_driver;
 
-	const SoundResourceInfo_TownsPC98V2 *res() const {return _resInfo[_currentResourceSet]; }
+	const SoundResourceInfo_TownsPC98V2 *res() const { return _resInfo[_currentResourceSet]; }
 	SoundResourceInfo_TownsPC98V2 *_resInfo[3];
 	int _currentResourceSet;
 };
diff --git a/engines/kyra/sound/sound_pc98_v2.cpp b/engines/kyra/sound/sound_pc98_v2.cpp
index 9da52b43a57..fe5d4f5eb42 100644
--- a/engines/kyra/sound/sound_pc98_v2.cpp
+++ b/engines/kyra/sound/sound_pc98_v2.cpp
@@ -122,9 +122,9 @@ void SoundTownsPC98_v2::playTrack(uint8 track) {
 
 	int trackNum = -1;
 	if (_vm->gameFlags().platform == Common::kPlatformFMTowns) {
-		for (uint i = 0; i < res()->cdaTableSize; i++) {
-			if (track == (uint8)READ_LE_UINT16(&res()->cdaTable[i * 2])) {
-				trackNum = (int)READ_LE_UINT16(&res()->cdaTable[i * 2 + 1]) - 1;
+		for (uint i = 0; i < res()->cdaTableSize >> 1; i++) {
+			if (track == (uint8)res()->cdaTable[i * 2]) {
+				trackNum = (int8)res()->cdaTable[i * 2 + 1] - 1;
 				break;
 			}
 		}


Commit: a6d8818ff22c3d29cf6e83c57da8080c95b6a6d7
    https://github.com/scummvm/scummvm/commit/a6d8818ff22c3d29cf6e83c57da8080c95b6a6d7
Author: athrxx (athrxx at scummvm.org)
Date: 2025-04-28T18:53:43+02:00

Commit Message:
KYRA: fix previous commit

(for BE systems)

(cherry picked from commit b92ed30b5c58ac1e2cedea61f6ddbef937f56c10)

Changed paths:
    engines/kyra/sound/sound_pc98_v2.cpp


diff --git a/engines/kyra/sound/sound_pc98_v2.cpp b/engines/kyra/sound/sound_pc98_v2.cpp
index fe5d4f5eb42..139ab92fc0b 100644
--- a/engines/kyra/sound/sound_pc98_v2.cpp
+++ b/engines/kyra/sound/sound_pc98_v2.cpp
@@ -123,8 +123,8 @@ void SoundTownsPC98_v2::playTrack(uint8 track) {
 	int trackNum = -1;
 	if (_vm->gameFlags().platform == Common::kPlatformFMTowns) {
 		for (uint i = 0; i < res()->cdaTableSize >> 1; i++) {
-			if (track == (uint8)res()->cdaTable[i * 2]) {
-				trackNum = (int8)res()->cdaTable[i * 2 + 1] - 1;
+			if (track == (uint8)READ_LE_UINT16(&res()->cdaTable[i * 2])) {
+				trackNum = (int8)READ_LE_UINT16(&res()->cdaTable[i * 2 + 1]) - 1;
 				break;
 			}
 		}


Commit: 9ee920b1157a01b8e8b7dc03060fdfb371c5d6bc
    https://github.com/scummvm/scummvm/commit/9ee920b1157a01b8e8b7dc03060fdfb371c5d6bc
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2025-04-28T18:56:40+02:00

Commit Message:
CONFIGURE: Add -ffat-lto-objects to the endianness check for LTO builds

Some Linux distributions enable compiler Link Time Optimization by default,
but our endianness check may fail there, if the object that is created only
contains Intermediate Representation and no regular Machine Code, especially
as not all 'strings' utilities are guaranteed to understand IR-only objects.

The -ffat-lto-objects flag (added in GCC 4.7) makes sure that this object
will always contain regular machine code, even when LTO is turned on.

>From Fedora.

(cherry picked from commit 0979284958e60c13c2323115694c99c40c2af9bd)

Changed paths:
    configure


diff --git a/configure b/configure
index 9e495d6bfdb..975182dd91d 100755
--- a/configure
+++ b/configure
@@ -2654,7 +2654,10 @@ __attribute__ ((used)) unsigned short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x
 const char * _ebcdic() { char* s = (char*) ebcdic_mm; s = (char*) ebcdic_ii; return s; }
 int main() { _ascii (); _ebcdic (); return 0; }
 EOF
-$CXX $LDFLAGS $CXXFLAGS -o $TMPO$HOSTEXEEXT tmp_endianness_check.cpp >> "$TMPLOG" 2>&1
+# Make sure that this particular object always has regular machine code content,
+# so that the checks below can be done, even with LTO on.
+test "$have_gcc" = yes && no_lto_regular_machine_code_removal=-ffat-lto-objects
+$CXX $LDFLAGS $CXXFLAGS $no_lto_regular_machine_code_removal -o $TMPO$HOSTEXEEXT tmp_endianness_check.cpp >> "$TMPLOG" 2>&1
 if $_strings $TMPO$HOSTEXEEXT 2>> "$TMPLOG"| grep BIGenDianSyS >/dev/null; then
 	_endian=big
 elif $_strings $TMPO$HOSTEXEEXT 2>> "$TMPLOG" | grep LiTTleEnDian >/dev/null; then


Commit: 5bf60f2e2f49cf5697ad46639ecf0b32c4783979
    https://github.com/scummvm/scummvm/commit/5bf60f2e2f49cf5697ad46639ecf0b32c4783979
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2025-04-28T18:56:50+02:00

Commit Message:
CONFIGURE: Remove tmp_endianness_check.dwo leftover

Seen with GCC 5.5.0.

(cherry picked from commit 6041d7e455e847832c484e2ed9e5138109ff6e31)

Changed paths:
    configure


diff --git a/configure b/configure
index 975182dd91d..acc9eaecec4 100755
--- a/configure
+++ b/configure
@@ -2663,8 +2663,8 @@ if $_strings $TMPO$HOSTEXEEXT 2>> "$TMPLOG"| grep BIGenDianSyS >/dev/null; then
 elif $_strings $TMPO$HOSTEXEEXT 2>> "$TMPLOG" | grep LiTTleEnDian >/dev/null; then
 	_endian=little
 fi
-echo $_endian;
-cc_check_clean tmp_endianness_check.cpp $TMPO-tmp_endianness_check.dwo
+echo $_endian
+cc_check_clean tmp_endianness_check.cpp $TMPO-tmp_endianness_check.dwo tmp_endianness_check.dwo
 
 case $_endian in
 	big)


Commit: e5e14afee9d49a27f47cf27752a632d43778df51
    https://github.com/scummvm/scummvm/commit/e5e14afee9d49a27f47cf27752a632d43778df51
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2025-04-28T18:57:03+02:00

Commit Message:
CONFIGURE: MACOS: Link with -headerpad_max_install_names for OSX <= 10.5

(cherry picked from commit 25f8cf5ebada2145e4840124aed0ce2ab637b9c3)

Changed paths:
    configure


diff --git a/configure b/configure
index acc9eaecec4..20a9df98b74 100755
--- a/configure
+++ b/configure
@@ -3076,6 +3076,13 @@ EOF
 			# When building for MacOS X 10.5 or below
 			if test "$_macos_min_version" -lt 1060 ; then
 				add_line_to_config_mk 'MACOSX_LEOPARD_OR_BELOW = 1'
+
+				# OSX 10.4/10.5 has no native C++11 support, thus we need to
+				# embed an updated libstdc++ in the bundle, and fix its
+				# dynamic references with install_name_tool(1), which requires
+				# linking with a bit of padding for the updated references.
+				append_var LDFLAGS "-Wl,-headerpad_max_install_names"
+
 				if test "$_debug_build" != no ; then
 					# Prefer DWARF over stabs on older OSX; this requires a
 					# newer GDB, but we need it for the updated toolchain


Commit: 2dc989cf535b5840b6f04d2c7555b7fb6f2f2b2b
    https://github.com/scummvm/scummvm/commit/2dc989cf535b5840b6f04d2c7555b7fb6f2f2b2b
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2025-04-28T18:59:06+02:00

Commit Message:
ANDROID: Build with optimizations when requested even in debug mode

(cherry picked from commit 546f097ff5ba46b3e98a1fdd63abc2fec2e24a3b)

Changed paths:
    configure


diff --git a/configure b/configure
index 20a9df98b74..372cf3635d8 100755
--- a/configure
+++ b/configure
@@ -2885,7 +2885,7 @@ case $_host_os in
 		append_var CXXFLAGS "-fpic"
 		append_var CXXFLAGS "-ffunction-sections"
 		append_var CXXFLAGS "-funwind-tables"
-		if test "$_debug_build" = no; then
+		if test "$_optimizations" = "yes"; then
 			_optimization_level=-Os
 			append_var CXXFLAGS "-fomit-frame-pointer"
 			append_var CXXFLAGS "-fstrict-aliasing"


Commit: 82298d7e76dec15cfc4a8bf8281eccda3f13e81b
    https://github.com/scummvm/scummvm/commit/82298d7e76dec15cfc4a8bf8281eccda3f13e81b
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2025-04-28T19:01:15+02:00

Commit Message:
BUILD: Fix build on mingw with libcurl

waitOnSocket in socket.cpp uses select, which is implemented in ws2_32.

(cherry picked from commit 063209a962aa30c1b072636e55ece427de41bd67)

Changed paths:
    configure
    devtools/create_project/cmake.cpp


diff --git a/configure b/configure
index 372cf3635d8..e39804926bb 100755
--- a/configure
+++ b/configure
@@ -5706,6 +5706,10 @@ if test "$_libcurl" != "no"; then
 			darwin*)
 				LIBCURL_LIBS=`$_libcurlconfig --libs`
 			;;
+			mingw*)
+				# Needed for select (used in socket.cpp), when curl is linked dynamically
+				append_var LIBCURL_LIBS "-lws2_32"
+				;;
 			psp2*)
 				append_var LIBCURL_LIBS "-lssl -lcrypto"
 			;;
diff --git a/devtools/create_project/cmake.cpp b/devtools/create_project/cmake.cpp
index 25c2d2f3922..3cf4f1e1777 100644
--- a/devtools/create_project/cmake.cpp
+++ b/devtools/create_project/cmake.cpp
@@ -43,7 +43,7 @@ const CMakeProvider::Library *CMakeProvider::getLibraryFromFeature(const char *f
 		{ "jpeg",       "libjpeg",           kSDLVersionAny, "FindJPEG",     "JPEG",     "JPEG_INCLUDE_DIRS",     "JPEG_LIBRARIES",      nullptr, nullptr },
 		{ "mpeg2",      "libmpeg2",          kSDLVersionAny, "FindMPEG2",    "MPEG2",    "MPEG2_INCLUDE_DIRS",    "MPEG2_mpeg2_LIBRARY", nullptr, nullptr },
 		{ "opengl",     nullptr,             kSDLVersionAny, "FindOpenGL",   "OpenGL",   "OPENGL_INCLUDE_DIR",    "OPENGL_gl_LIBRARY",   nullptr, nullptr },
-		{ "libcurl",    "libcurl",           kSDLVersionAny, "FindCURL",     "CURL",     "CURL_INCLUDE_DIRS",     "CURL_LIBRARIES",      nullptr, nullptr },
+		{ "libcurl",    "libcurl",           kSDLVersionAny, "FindCURL",     "CURL",     "CURL_INCLUDE_DIRS",     "CURL_LIBRARIES",      nullptr, "ws2_32" },
 		{ "sdlnet",     nullptr,             kSDLVersion1,   "FindSDL_net",  "SDL_net",  "SDL_NET_INCLUDE_DIRS",  "SDL_NET_LIBRARIES",   nullptr, nullptr },
 		LibraryProps("sdlnet", "SDL2_net", kSDLVersion2).Libraries("SDL2_net"),
 		LibraryProps("flac", "flac").Libraries("FLAC"),
@@ -323,6 +323,10 @@ void CMakeProvider::createProjectFile(const std::string &name, const std::string
 		project << "if (WIN32)\n";
 		project << "\ttarget_sources(" << name << " PUBLIC " << setup.filePrefix << "/dists/" << name << ".rc)\n";
 		project << "\ttarget_link_libraries(" << name << " winmm)\n";
+		// Needed for select (used in socket.cpp), when curl is linked dynamically
+		project << "\tif (libcurl_FOUND)\n";
+		project << "\t\ttarget_link_libraries(" << name << " ws2_32)\n";
+		project << "\tendif()\n";
 		project << "endif()\n";
 		project << "\n";
 


Commit: 4afefd28f55a3ecbe150bc013f0b7f823ae55b01
    https://github.com/scummvm/scummvm/commit/4afefd28f55a3ecbe150bc013f0b7f823ae55b01
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2025-04-28T19:05:05+02:00

Commit Message:
CONFIGURE: MACOSX: Use -fno-var-tracking-assignments for OSXPPC

On OSXPPC, a newer toolchain is required for C++11 support.
This, in turn, requires an updated GDB for the newer symbols.

OSX Tiger can't use anything newer than DWARF v2, it seems, so
that's why we're already using -gdwarf-2 (older 'stabs' formats
weren't reliable with these toolchain and GDB releases).

I've been hitting internal GDB errors when analyzing a backtrace
in the TWP engine, until I dropped the -fvar-tracking-assignments
flag we enable by default.  The GCC manual page says that "Use of
-gdwarf-4 is recommended" along with this option, so that's
probably why I was having issues.

(Debug builds on OSXPPC already have an implicit '-O0' requirement,
anyway, as so the GDB release's so old and clunky that it's unwise
to hope anything about '-O2 -g', so -fvar-tracking-assignments
wasn't that useful there anyway.)

(cherry picked from commit b85fa35036254c2c5a8e277bace570061d0a93f8)

Changed paths:
    configure


diff --git a/configure b/configure
index e39804926bb..b72ed68cd52 100755
--- a/configure
+++ b/configure
@@ -3088,8 +3088,10 @@ EOF
 					# newer GDB, but we need it for the updated toolchain
 					# anyway. This improves the debugging experience quite
 					# a lot, and it still creates meaningful traces for the
-					# Crash Reporter of OSX 10.4.
-					append_var CXXFLAGS "-gdwarf-2"
+					# Crash Reporter of OSX 10.4. -fvar-tracking-assignments
+					# should be disabled then, as it seems to cause issues
+					# and we can't use the later DWARF version it recommends.
+					append_var CXXFLAGS "-gdwarf-2 -fno-var-tracking-assignments"
 				fi
 			fi
 


Commit: 96c2b4476300db43be9d949b17c9074da1a45101
    https://github.com/scummvm/scummvm/commit/96c2b4476300db43be9d949b17c9074da1a45101
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2025-04-28T19:05:33+02:00

Commit Message:
CONFIGURE: Use -Wno-maybe-uninitialized for GCC 4.9 too

I see many false positives with GCC 4.9.4.

(cherry picked from commit 9145343729dc576e65978d6cd08900355db18658)

Changed paths:
    configure


diff --git a/configure b/configure
index b72ed68cd52..4383b69729b 100755
--- a/configure
+++ b/configure
@@ -2341,7 +2341,8 @@ if test "$have_gcc" = yes; then
 					append_var CXXFLAGS "-Wno-array-bounds"
 				fi
 
-				if test $_cxx_minor -le 8; then
+				# Many false positives with Common::Serializer
+				if test $_cxx_minor -le 9; then
 					append_var CXXFLAGS "-Wno-maybe-uninitialized"
 				fi
 			fi


Commit: c1367156ef0bb5b86353f3cd3ba9ca42f485a418
    https://github.com/scummvm/scummvm/commit/c1367156ef0bb5b86353f3cd3ba9ca42f485a418
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2025-04-28T19:08:56+02:00

Commit Message:
CONFIGURE: Make --disable-gold the default, now that Binutils deprecated it

This is a follow-up to previous commit eb904f67e59eecb00eb5e7e81cdd469dc91a3d8a.

GNU Binutils 2.44 officially deprecated the (mostly unmaintained for
some years) Gold linker:

https://lists.gnu.org/archive/html/info-gnu/2025-02/msg00001.html

So, make --disable-gold the default, now.  Users having good reasons to
try linking with Gold anyway now need to set an explicit --enable-gold,
since we'll try to revert to GNU BFD if it's found, and if Gold appears
to be the default for some reason.

(cherry picked from commit 63d903d0378af9ecac856ca7e4de35960890a06a)

Changed paths:
    configure


diff --git a/configure b/configure
index 4383b69729b..a9b2525d782 100755
--- a/configure
+++ b/configure
@@ -206,7 +206,7 @@ _pandoc=no
 _curl=yes
 _lld=no
 _mold=no
-_gold=auto
+_gold=no
 # Default vkeybd/eventrec options
 _vkeybd=no
 _eventrec=no
@@ -2508,19 +2508,6 @@ else
 	define_in_config_if_yes yes 'NO_CXX11_ALIGNAS'
 fi
 
-# The Gold linker had known issues on at least i386 and ppc32, in some cases.
-# Since this linker is not very maintained anymore, and since alternatives exist,
-# avoid using it on non-mainstream archs, unless --enable-gold was explicitly given.
-if test "$_gold" = auto; then
-	case $_host_cpu in
-		aarch64 | x86_64 | amd64)
-			;;
-		*)
-			_gold=no
-			;;
-	esac
-fi
-
 #
 # Determine extra build flags for debug and/or release builds
 #
@@ -2556,7 +2543,7 @@ if test "$_debug_build" != no; then
 			append_var LDFLAGS "-fuse-ld=mold"
 			append_var LDFLAGS "-Wl,--gdb-index"
 			echo_n -- " + Mold"
-		elif test "$_gold" != no && cc_check_no_clean $debug_mode -gsplit-dwarf -fuse-ld=gold -Wl,--gdb-index; then
+		elif test "$_gold" = yes && cc_check_no_clean $debug_mode -gsplit-dwarf -fuse-ld=gold -Wl,--gdb-index; then
 			append_var LDFLAGS "-fuse-ld=gold"
 			append_var LDFLAGS "-Wl,--gdb-index"
 			echo_n -- " + Gold"
@@ -2585,6 +2572,28 @@ if ! echo "$LDFLAGS" | grep -q -e -fuse-ld; then
 	fi
 fi
 
+if ! echo "$LDFLAGS" | grep -q -e -fuse-ld; then
+	echo "Using Gold linker... $_gold"
+	if test "$_gold" = yes ; then
+		append_var LDFLAGS -fuse-ld=gold
+	fi
+fi
+
+# The Gold linker has known issues on at least i386 and ppc32, in some
+# cases. Since it's mostly unmaintained and now deprecated with GNU
+# Binutils 2.44, avoid using it, unless --enable-gold was explicitly
+# given (and then you're on your own).
+if $LD $LDFLAGS -Wl,--version 2>/dev/null | grep -q -e 'GNU gold'; then
+	# Trying to help systems where Gold may (unwisely) be the default;
+	# thus we only try to provide a GNU LD (BFD) fallback in that case,
+	# since it appears to only impact some (past?) GNU systems anyway.
+	if test "$_gold" != yes && $LD $LDFLAGS -fuse-ld=bfd -Wl,--version >/dev/null 2>&1; then
+		append_var LDFLAGS -fuse-ld=bfd
+	else
+		echo "WARNING: Using deprecated Gold linker; build may fail on some platforms"
+	fi
+fi
+
 if test "$_release_build" = yes; then
 	# Add a define, which indicates we are doing
 	# a build for a release version.




More information about the Scummvm-git-logs mailing list