From 513fffe950bbe979bd8052ce3438e954ed09b81f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torbj=C3=B6rn=20Andersson?= Date: Mon, 22 Nov 2021 14:00:52 +0100 Subject: [PATCH] SCUMM: Check for the appropriate audio tracks for indyzak and zakloom The FM Towns demos use audio tracks, but neither have a track 1. This caused ScummVM to warn that the audio tracks had not been properly ripped from the CD. --- engines/engine.cpp | 4 ++-- engines/engine.h | 2 +- engines/scumm/scumm.cpp | 16 +++++++++++++++- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/engines/engine.cpp b/engines/engine.cpp index e60769a50a4..bfaa53f3e0d 100644 --- a/engines/engine.cpp +++ b/engines/engine.cpp @@ -486,8 +486,8 @@ void GUIErrorMessageFormat(Common::U32String fmt, ...) { * @return true if audio files of the expected naming scheme are found, as long as ScummVM * is also built with support to the respective audio format (eg. ogg, flac, mad/mp3) */ -bool Engine::existExtractedCDAudioFiles() { - return g_system->getAudioCDManager()->existExtractedCDAudioFiles(); +bool Engine::existExtractedCDAudioFiles(uint track) { + return g_system->getAudioCDManager()->existExtractedCDAudioFiles(track); } /** diff --git a/engines/engine.h b/engines/engine.h index e0d124a4beb..1a45553a41c 100644 --- a/engines/engine.h +++ b/engines/engine.h @@ -602,7 +602,7 @@ public: /** * Check if extracted CD Audio files are found. */ - bool existExtractedCDAudioFiles(); + bool existExtractedCDAudioFiles(uint track = 1); /** * On some systems, check whether the game appears to be run * from the same CD drive, which also should play CD audio. diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index 9c5d81ef2fc..8f0ae01ef9d 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -1514,7 +1514,21 @@ void ScummEngine::setupScumm(const Common::String &macResourceFile) { // On some systems it's not safe to run CD audio games from the CD. if (_game.features & GF_AUDIOTRACKS && !Common::File::exists("CDDA.SOU")) { - if (!existExtractedCDAudioFiles() + uint track; + + // Usually we check if track 1 is present, but the FM Towns demos use + // different ones. + + if (strcmp(_game.gameid, "indyzak") == 0) { + // Has only track 17 and 18 + track = 17; + } else if (strcmp(_game.gameid, "zakloom") == 0) { + // Has only track 15 and 16 + track = 15; + } else + track = 1; + + if (!existExtractedCDAudioFiles(track) && !isDataAndCDAudioReadFromSameCD()) { warnMissingExtractedCDAudio(); }