[Scummvm-git-logs] scummvm master -> df6a43d233901de594a0f840e32b9e597fdb3361

bluegr noreply at scummvm.org
Fri May 23 15:39:11 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:
df6a43d233 BACKENDS: ATARI: Introduce AtariFilesystemNode


Commit: df6a43d233901de594a0f840e32b9e597fdb3361
    https://github.com/scummvm/scummvm/commit/df6a43d233901de594a0f840e32b9e597fdb3361
Author: Miro Kropáček (miro.kropacek at gmail.com)
Date: 2025-05-23T18:39:08+03:00

Commit Message:
BACKENDS: ATARI: Introduce AtariFilesystemNode

Currently it only uses available OS/2 code for presenting disk drives in a nicer (and unified) way.

Changed paths:
  A backends/fs/atari/atari-fs-factory.cpp
  A backends/fs/atari/atari-fs-factory.h
  A backends/fs/atari/atari-fs.cpp
  A backends/fs/atari/atari-fs.h
    backends/fs/posix-drives/posix-drives-fs-factory.h
    backends/module.mk
    backends/platform/atari/build-release.sh
    backends/platform/atari/build-release.sh.in
    backends/platform/atari/build-release030.sh
    backends/platform/atari/build-release030.sh.in
    backends/platform/atari/osystem_atari.cpp
    backends/platform/atari/readme.txt
    backends/platform/atari/readme.txt.in
    common/path.cpp


diff --git a/backends/fs/atari/atari-fs-factory.cpp b/backends/fs/atari/atari-fs-factory.cpp
new file mode 100644
index 00000000000..239d94fa85b
--- /dev/null
+++ b/backends/fs/atari/atari-fs-factory.cpp
@@ -0,0 +1,80 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+// Disable symbol overrides so that we can use system headers.
+#define FORBIDDEN_SYMBOL_ALLOW_ALL
+
+#include "backends/fs/atari/atari-fs-factory.h"
+#include "backends/fs/atari/atari-fs.h"
+
+#include <mint/osbind.h>
+#include <unistd.h>	// getcwd
+
+#if defined(ATARI)
+
+AtariFilesystemFactory::AtariFilesystemFactory() {
+	_fileHashMap["cryomni3.dat"] = "cryomni3d.dat";
+	_fileHashMap["neverhoo.dat"] = "neverhood.dat";
+	_fileHashMap["supernov.dat"] = "supernova.dat";
+	_fileHashMap["teenagen.dat"] = "teenagent.dat";
+
+	uint32 drvMap = Drvmap();
+	for (int i = 0; i < 26; i++) {
+		if (drvMap & 1) {
+			char driveRoot[] = "A:";
+			driveRoot[0] += i;
+
+			addDrive(driveRoot);
+		}
+
+		drvMap >>= 1;
+	}
+}
+
+AbstractFSNode *AtariFilesystemFactory::makeRootFileNode() const {
+	return new AtariFilesystemNode(_config, _fileHashMap);
+}
+
+AbstractFSNode *AtariFilesystemFactory::makeCurrentDirectoryFileNode() const {
+	char buf[MAXPATHLEN];
+	if (getcwd(buf, MAXPATHLEN) != NULL) {
+		if (buf[0] == '/') {
+			// de-mintlib'ize the path
+			if (buf[1] == 'd' && buf[2] == 'e' && buf[3] == 'v') {
+				// /dev/<drive>/<path> -> /<drive>/<path>
+				strcpy(buf, &buf[4]);
+			}
+			// /<drive>/<path> -> <DRIVE>:/<path>
+			buf[0] = toupper(buf[1]);
+			buf[1] = ':';
+		}
+		return new AtariFilesystemNode(buf, _config, _fileHashMap);
+	} else {
+		return nullptr;
+	}
+}
+
+AbstractFSNode *AtariFilesystemFactory::makeFileNodePath(const Common::String &path) const {
+	assert(!path.empty());
+	return new AtariFilesystemNode(path, _config, _fileHashMap);
+}
+
+#endif	// ATARI
diff --git a/backends/fs/atari/atari-fs-factory.h b/backends/fs/atari/atari-fs-factory.h
new file mode 100644
index 00000000000..b1cc35b4f3a
--- /dev/null
+++ b/backends/fs/atari/atari-fs-factory.h
@@ -0,0 +1,45 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef ATARI_FILESYSTEM_FACTORY_H
+#define ATARI_FILESYSTEM_FACTORY_H
+
+#include "backends/fs/posix-drives/posix-drives-fs-factory.h"
+#include "backends/fs/atari/atari-fs.h"
+
+/**
+ * Creates AtariFilesystemNode objects.
+ *
+ * Parts of this class are documented in the base interface class, FilesystemFactory.
+ */
+class AtariFilesystemFactory final : public DrivesPOSIXFilesystemFactory {
+public:
+	AtariFilesystemFactory();
+
+	AbstractFSNode *makeRootFileNode() const override;
+	AbstractFSNode *makeCurrentDirectoryFileNode() const override;
+	AbstractFSNode *makeFileNodePath(const Common::String &path) const override;
+
+private:
+	AtariFilesystemNode::FileHashMap _fileHashMap;
+};
+
+#endif /*ATARI_FILESYSTEM_FACTORY_H*/
diff --git a/backends/fs/atari/atari-fs.cpp b/backends/fs/atari/atari-fs.cpp
new file mode 100644
index 00000000000..36b0031f348
--- /dev/null
+++ b/backends/fs/atari/atari-fs.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+// Disable symbol overrides so that we can use system headers.
+#define FORBIDDEN_SYMBOL_ALLOW_ALL
+
+#include "backends/fs/atari/atari-fs.h"
+
+#if defined(ATARI)
+
+void AtariFilesystemNode::setFlags() {
+	DrivePOSIXFilesystemNode::setFlags();
+
+	if (!_displayNameChecked) {
+		if (_fileHashMap.contains(_displayName))
+			_displayName = _fileHashMap[_displayName];
+
+		_displayNameChecked = true;
+	}
+}
+
+#endif	// ATARI
diff --git a/backends/fs/atari/atari-fs.h b/backends/fs/atari/atari-fs.h
new file mode 100644
index 00000000000..f9a41abb0da
--- /dev/null
+++ b/backends/fs/atari/atari-fs.h
@@ -0,0 +1,64 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef ATARI_FILESYSTEM_H
+#define ATARI_FILESYSTEM_H
+
+#include "backends/fs/posix-drives/posix-drives-fs.h"
+
+#include "common/hash-str.h"
+#include "common/hashmap.h"
+
+/**
+ * Implementation of the ScummVM file system API based on DrivePOSIX with translation to 8+3 filenames.
+ *
+ * Parts of this class are documented in the base interface class, AbstractFSNode.
+ */
+class AtariFilesystemNode final : public DrivePOSIXFilesystemNode {
+protected:
+	AbstractFSNode *makeNode() const override {
+		return new AtariFilesystemNode(_config, _fileHashMap);
+	}
+	AbstractFSNode *makeNode(const Common::String &path) const override {
+		return new AtariFilesystemNode(path, _config, _fileHashMap);
+	}
+
+public:
+	typedef Common::HashMap<Common::String, Common::String, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> FileHashMap;
+
+	AtariFilesystemNode(const Config &config, const FileHashMap &fileHashMap)
+		: DrivePOSIXFilesystemNode(config)
+		, _fileHashMap(fileHashMap) {
+	}
+	AtariFilesystemNode(const Common::String &path, const Config &config, const FileHashMap &fileHashMap)
+		: DrivePOSIXFilesystemNode(path, config)
+		, _fileHashMap(fileHashMap) {
+	}
+
+protected:
+	void setFlags() override;
+
+private:
+	const FileHashMap &_fileHashMap;
+	bool _displayNameChecked = false;
+};
+
+#endif
diff --git a/backends/fs/posix-drives/posix-drives-fs-factory.h b/backends/fs/posix-drives/posix-drives-fs-factory.h
index 11633f7b66d..34ef6200159 100644
--- a/backends/fs/posix-drives/posix-drives-fs-factory.h
+++ b/backends/fs/posix-drives/posix-drives-fs-factory.h
@@ -57,7 +57,6 @@ protected:
 	AbstractFSNode *makeCurrentDirectoryFileNode() const override;
 	AbstractFSNode *makeFileNodePath(const Common::String &path) const override;
 
-private:
 	typedef Common::Array<Common::String> DrivesArray;
 	struct StaticDrivesConfig : public DrivePOSIXFilesystemNode::Config {
 		StaticDrivesConfig(const DrivesPOSIXFilesystemFactory *factory) : _factory(factory) { }
diff --git a/backends/module.mk b/backends/module.mk
index 2d3a0f26fac..ca6a5dd4c0c 100644
--- a/backends/module.mk
+++ b/backends/module.mk
@@ -387,6 +387,8 @@ endif
 ifeq ($(BACKEND),atari)
 MODULE_OBJS += \
 	events/atari/atari-events.o \
+	fs/atari/atari-fs.o \
+	fs/atari/atari-fs-factory.o \
 	graphics/atari/atari-c2p-asm.o \
 	graphics/atari/atari-cursor.o \
 	graphics/atari/atari-graphics.o \
diff --git a/backends/platform/atari/build-release.sh b/backends/platform/atari/build-release.sh
index ec42f60998c..1e6d591d1d4 100755
--- a/backends/platform/atari/build-release.sh
+++ b/backends/platform/atari/build-release.sh
@@ -58,6 +58,12 @@ ${PLATFORM}-strip -s dist-generic/scummvm/scummvm.ttp
 # remove unused files; absent gui-icons.dat massively speeds up startup time (used for the grid mode)
 rm dist-generic/scummvm/data/{achievements,encoding,gui-icons,macgui,shaders}.dat
 
+# rename remaining files still not fitting into the 8+3 limit (this has to be supported by the backend, too)
+mv dist-generic/scummvm/data/cryomni3d.dat dist-generic/scummvm/data/cryomni3.dat
+mv dist-generic/scummvm/data/neverhood.dat dist-generic/scummvm/data/neverhoo.dat
+mv dist-generic/scummvm/data/supernova.dat dist-generic/scummvm/data/supernov.dat
+mv dist-generic/scummvm/data/teenagent.dat dist-generic/scummvm/data/teenagen.dat
+
 # move themes into 'themes' folder (with compression level zero for faster depacking)
 mkdir -p dist-generic/scummvm/themes
 cd dist-generic/scummvm/themes
diff --git a/backends/platform/atari/build-release.sh.in b/backends/platform/atari/build-release.sh.in
index 12f8267d821..a2722c15a68 100755
--- a/backends/platform/atari/build-release.sh.in
+++ b/backends/platform/atari/build-release.sh.in
@@ -56,6 +56,12 @@ ${PLATFORM}-strip -s dist-generic/scummvm/scummvm.ttp
 # remove unused files; absent gui-icons.dat massively speeds up startup time (used for the grid mode)
 rm dist-generic/scummvm/data/{achievements,encoding,gui-icons,macgui,shaders}.dat
 
+# rename remaining files still not fitting into the 8+3 limit (this has to be supported by the backend, too)
+mv dist-generic/scummvm/data/cryomni3d.dat dist-generic/scummvm/data/cryomni3.dat
+mv dist-generic/scummvm/data/neverhood.dat dist-generic/scummvm/data/neverhoo.dat
+mv dist-generic/scummvm/data/supernova.dat dist-generic/scummvm/data/supernov.dat
+mv dist-generic/scummvm/data/teenagent.dat dist-generic/scummvm/data/teenagen.dat
+
 # move themes into 'themes' folder (with compression level zero for faster depacking)
 mkdir -p dist-generic/scummvm/themes
 cd dist-generic/scummvm/themes
diff --git a/backends/platform/atari/build-release030.sh b/backends/platform/atari/build-release030.sh
index 4ebf8de867e..8391f3619ae 100755
--- a/backends/platform/atari/build-release030.sh
+++ b/backends/platform/atari/build-release030.sh
@@ -60,6 +60,10 @@ ${PLATFORM}-strip -s dist-generic/scummvm/scummvm.ttp
 # remove unused files
 rm dist-generic/scummvm/data/*.zip dist-generic/scummvm/data/{achievements,encoding,gui-icons,macgui,shaders}.dat
 
+# rename remaining files still not fitting into the 8+3 limit (this has to be supported by the backend, too)
+mv dist-generic/scummvm/data/supernova.dat dist-generic/scummvm/data/supernov.dat
+mv dist-generic/scummvm/data/teenagent.dat dist-generic/scummvm/data/teenagen.dat
+
 # readme.txt
 cp ../backends/platform/atari/readme.txt dist-generic/scummvm
 unix2dos dist-generic/scummvm/readme.txt
diff --git a/backends/platform/atari/build-release030.sh.in b/backends/platform/atari/build-release030.sh.in
index b6ecbc0ab2d..6717f43ef95 100755
--- a/backends/platform/atari/build-release030.sh.in
+++ b/backends/platform/atari/build-release030.sh.in
@@ -58,6 +58,10 @@ ${PLATFORM}-strip -s dist-generic/scummvm/scummvm.ttp
 # remove unused files
 rm dist-generic/scummvm/data/*.zip dist-generic/scummvm/data/{achievements,encoding,gui-icons,macgui,shaders}.dat
 
+# rename remaining files still not fitting into the 8+3 limit (this has to be supported by the backend, too)
+mv dist-generic/scummvm/data/supernova.dat dist-generic/scummvm/data/supernov.dat
+mv dist-generic/scummvm/data/teenagent.dat dist-generic/scummvm/data/teenagen.dat
+
 # readme.txt
 cp ../backends/platform/atari/readme.txt dist-generic/scummvm
 unix2dos dist-generic/scummvm/readme.txt
diff --git a/backends/platform/atari/osystem_atari.cpp b/backends/platform/atari/osystem_atari.cpp
index bfbfd00cb6b..d6d0b6b8b64 100644
--- a/backends/platform/atari/osystem_atari.cpp
+++ b/backends/platform/atari/osystem_atari.cpp
@@ -64,7 +64,7 @@
 /*
  * Include header files needed for the getFilesystemFactory() method.
  */
-#include "backends/fs/posix/posix-fs-factory.h"
+#include "backends/fs/atari/atari-fs-factory.h"
 
 bool g_unalignedPitch = false;
 bool g_gameEngineActive = false;
@@ -164,7 +164,7 @@ static void exit_restore() {
 }
 
 OSystem_Atari::OSystem_Atari() {
-	_fsFactory = new POSIXFilesystemFactory();
+	_fsFactory = new AtariFilesystemFactory();
 
 	nf_init();
 
diff --git a/backends/platform/atari/readme.txt b/backends/platform/atari/readme.txt
index 0ba876d3767..1a280f8d5b7 100644
--- a/backends/platform/atari/readme.txt
+++ b/backends/platform/atari/readme.txt
@@ -456,10 +456,6 @@ There is a few features that have been disabled or changed and are not possible
 Known issues
 ------------
 
-- adding a game in TOS and loading it in FreeMiNT (and vice versa) generates
-  incompatible paths. Either use only one system or edit scummvm.ini and set
-  there only relative paths (mintlib bug/limitation).
-
 - when run on TT, screen contains horizontal black lines. That is due to the
   fact that TT offers only 320x480 in 256 colours. Possibly fixable by a Timer B
   interrupt.
@@ -508,8 +504,6 @@ Known issues
 Future plans
 ------------
 
-- unified file paths in scummvm.ini
-
 - DSP-based sample mixer (WAV, FLAC, MP2)
 
 - avoid loading music/speech files (and thus slowing down everything) if muted
diff --git a/backends/platform/atari/readme.txt.in b/backends/platform/atari/readme.txt.in
index 30083a4a8e1..8167c9a9910 100644
--- a/backends/platform/atari/readme.txt.in
+++ b/backends/platform/atari/readme.txt.in
@@ -456,10 +456,6 @@ There is a few features that have been disabled or changed and are not possible
 Known issues
 ------------
 
-- adding a game in TOS and loading it in FreeMiNT (and vice versa) generates
-  incompatible paths. Either use only one system or edit scummvm.ini and set
-  there only relative paths (mintlib bug/limitation).
-
 - when run on TT, screen contains horizontal black lines. That is due to the
   fact that TT offers only 320x480 in 256 colours. Possibly fixable by a Timer B
   interrupt.
@@ -508,8 +504,6 @@ Known issues
 Future plans
 ------------
 
-- unified file paths in scummvm.ini
-
 - DSP-based sample mixer (WAV, FLAC, MP2)
 
 - avoid loading music/speech files (and thus slowing down everything) if muted
diff --git a/common/path.cpp b/common/path.cpp
index fda9e758c1f..07e3bafa368 100644
--- a/common/path.cpp
+++ b/common/path.cpp
@@ -1176,7 +1176,7 @@ String Path::toConfig() const {
 			return toString(Path::kNativeSeparator);
 		}
 	}
-#elif defined(__3DS__) || defined(__amigaos4__) || defined(__DS__) || defined(__MORPHOS__) || defined(NINTENDO_SWITCH) || defined(__PSP__) || defined(PSP2) || defined(RISCOS) || defined(__WII__) || defined(WIN32)
+#elif defined(__3DS__) || defined(__amigaos4__) || defined(ATARI) || defined(__DS__) || defined(__MORPHOS__) || defined(NINTENDO_SWITCH) || defined(__PSP__) || defined(PSP2) || defined(RISCOS) || defined(__WII__) || defined(WIN32)
 	// For all platforms making use of : as a drive separator, avoid useless punycoding
 	if (!isEscaped()) {
 		// If we are escaped, we have forbidden characters which must be encoded




More information about the Scummvm-git-logs mailing list