[Scummvm-git-logs] scummvm master -> 1c4c2a0b1b28664d7ae66b8a61afc783c4bdb23e

sev- noreply at scummvm.org
Wed Oct 15 15:18:53 UTC 2025


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:
1c4c2a0b1b DIRECTOR: XLIBS: Pretend we have CD drives in FileIO


Commit: 1c4c2a0b1b28664d7ae66b8a61afc783c4bdb23e
    https://github.com/scummvm/scummvm/commit/1c4c2a0b1b28664d7ae66b8a61afc783c4bdb23e
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-10-15T17:11:48+02:00

Commit Message:
DIRECTOR: XLIBS: Pretend we have CD drives in FileIO

We make operations with disc E:\ read-only.

Used by some games from Tivola for CD checks. The games
try to open file for reading and if error is returned,
they write it down as a read-only drive.

Also, we return error on any operations with disks beyond E:
This should theoretically save time for file presence checks that
many games do

Changed paths:
    engines/director/lingo/xlibs/f/fileio.cpp


diff --git a/engines/director/lingo/xlibs/f/fileio.cpp b/engines/director/lingo/xlibs/f/fileio.cpp
index 2752bf2b7f2..b57d6f9a4f3 100644
--- a/engines/director/lingo/xlibs/f/fileio.cpp
+++ b/engines/director/lingo/xlibs/f/fileio.cpp
@@ -262,6 +262,18 @@ FileIOError FileObject::open(const Common::String &origpath, const Common::Strin
 		path += ".txt";
 	}
 
+	// We pretend that drive E:\ is a read-only CD-ROM
+	// It helps with CD checks in many games
+	if (option.equalsIgnoreCase("write") || option.equalsIgnoreCase("append")) {
+		if (origpath.hasPrefixIgnoreCase("E:\\"))
+			return kErrorIO;
+	}
+
+	// In general, we assume that there are no drives beyond disk E:
+	if (origpath.size() >= 2 && origpath[1] == ':' && (toupper(origpath[0]) > 'E')) {
+		return kErrorIO;
+	}
+
 	// Enforce target to the created files so they do not mix up
 	Common::String filenameOrig = lastPathComponent(path, dirSeparator);
 




More information about the Scummvm-git-logs mailing list