#15849 closed defect (fixed)

SCUMM: INDY3: Unsupported IMuseDriver_Macintosh() game ID with indy3-steam-mac

Reported by: dwatteau Owned by: dwatteau
Priority: normal Component: Engine: SCUMM
Version: Keywords:
Cc: Game: Indiana Jones 3

Description

On ScummVM 2.10.0git, trying to run the Steam/Macintosh/English release of Indy3 (i.e. the DOS VGA release, ported to 32-bit macOS through Steam) fails with the following fatal error:

IMuseDriver_Macintosh(): Unsupported game ID 3!

The following diff appears to fix this:

diff --git a/engines/scumm/metaengine.cpp b/engines/scumm/metaengine.cpp
index 288b8993d4b..37da39ebf50 100644
--- a/engines/scumm/metaengine.cpp
+++ b/engines/scumm/metaengine.cpp
@@ -444,7 +444,7 @@ Common::Error ScummMetaEngine::createInstance(OSystem *syst, Engine **engine,
 	// TODO: Maybe allow the null driver, too?
 	if (res.game.platform == Common::kPlatformFMTowns && res.game.version == 3)
 		res.game.midi = MDT_TOWNS;
-	else if (res.game.platform == Common::kPlatformMacintosh && res.game.version < 7 && res.game.heversion == 0)
+	else if (res.game.platform == Common::kPlatformMacintosh && res.game.version < 7 && res.game.heversion == 0 && res.extra && strcmp(res.extra, "Steam") != 0)
 		res.game.midi = MDT_MACINTOSH;
 
 	// Finally, we have massaged the GameDescriptor to our satisfaction, and can

But since there are already various checks for the "Steam" and Common::kPlatformMacintosh case in the engine setup code, but also there is this "internally we force the platform to DOS" part inside ScummEngine::init(), I'd rather have someone double check it's OK.

Change History (7)

comment:1 by athrxx, 15 months ago

I have no way of testing any such Steam Mac version, but maybe the code line in ScummEngine::init() that would change the platform to kPlatformDOS is not reached in INDY3?

Anyway, your fix should be fine. These Steam Mac versions aren't real Mac versions, they use DOS resources.

comment:2 by eriktorbjorn, 14 months ago

I have that version, and can confirm the error message. It used to work, so this must be a regression. (I could be misremembering, but I think the platform change may have been added so that the Steam versions of Indy 3 and Loom wouldn't break when the Mac GUI was added for the old Mac versions.)

The error happens while initializing the sound driver for the game. Perhaps this is the correct way of fixing it?

diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 614d3e0c6c9..5248bd44ab1 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -1219,8 +1219,10 @@ Common::Error ScummEngine::init() {
        // Steam Win and Mac versions share the same DOS data files. We show Windows or Mac
        // for the platform the detector, but internally we force the platform to DOS, so that
        // the code for handling the original DOS data files is used.
-       if (_filenamePattern.genMethod == kGenDiskNumSteam || _filenamePattern.genMethod == kGenRoomNumSteam)
+       if (_filenamePattern.genMethod == kGenDiskNumSteam || _filenamePattern.genMethod == kGenRoomNumSteam) {
                _game.platform = Common::kPlatformDOS;
+               _game.midi = MDT_PCSPK | MDT_PCJR | MDT_CMS | MDT_ADLIB;
+       }
 
        // Load CJK font, if present
        // Load it earlier so _useCJKMode variable could be set

in reply to:  1 comment:3 by dwatteau, 14 months ago

Replying to athrxx:

I have no way of testing any such Steam Mac version, but maybe the code line in ScummEngine::init() that would change the platform to kPlatformDOS is not reached in INDY3?

The ScummEngine::init() check succeeds, but it only resets the platform, not the midi driver. ScummMetaEngine::createInstance() is called first, so at this point res.game.platform == Common::kPlatformMacintosh would still evaluate to true there, thus setting MDT_MACINTOSH anyway.

Replying to eriktorbjorn

[...]
Perhaps this is the correct way of fixing it?
[...]

Thanks, either is fine to me. I was wondering which approach felt cleaner. This one puts all the reset logic in the same place, but duplicates MDT_PCSPK | MDT_PCJR | MDT_CMS | MDT_ADLIB from the detection tables. I'm not sure it's such an issue, though.

Anyway, I can commit any preferred approach if necessary. Thanks!

comment:4 by eriktorbjorn, 14 months ago

I like having the whole fix in one place, but of course I'm biased.

comment:5 by dwatteau, 14 months ago

In 2193b80:

SCUMM: Fix support of the macOS Steam releases using DOS resources (Trac#15849)

Back when modern macOS still had 32-bit support, Steam provided macOS
ports of some LEC titles, such as indy3-steam-mac.

Although marked as "Steam/Macintosh", they're not based on the
original Macintosh releases, but they're macOS ports of the original
DOS VGA releases.

Thus, we need to make sure not to override their midi settings with
MDT_MACINTOSH, since they use the usual DOS audio resources.

Fixes a fatal "IMuseDriver_Macintosh(): Unsupported game ID 3!" error,
when trying to start such games.

comment:6 by dwatteau, 14 months ago

Thanks. I've pushed a fix for this in commit 2193b80119678b6067d9ed8e3f6a22a077f22ca2.

I chose to add the check in both places, as a larger safeguard. Otherwise, it felt a bit fragile, to me, to only check for this in a single location, since the state can be modified in different places.

comment:7 by dwatteau, 14 months ago

Owner: set to dwatteau
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.