[Scummvm-git-logs] scummvm master -> 8f3222f73ce4da09afe2889c8b8c28891ea31c1e

kelmer44 noreply at scummvm.org
Mon Oct 13 20:24:56 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:
8f3222f73c TOT: Implements demo support


Commit: 8f3222f73ce4da09afe2889c8b8c28891ea31c1e
    https://github.com/scummvm/scummvm/commit/8f3222f73ce4da09afe2889c8b8c28891ea31c1e
Author: kelmer (kelmer at gmail.com)
Date: 2025-10-13T22:24:38+02:00

Commit Message:
TOT: Implements demo support

Changed paths:
    engines/tot/detection_tables.h
    engines/tot/engine.cpp
    engines/tot/graphics.cpp
    engines/tot/statics.h
    engines/tot/tot.cpp
    engines/tot/tot.h
    engines/tot/util.h


diff --git a/engines/tot/detection_tables.h b/engines/tot/detection_tables.h
index 1b37d2d5cd2..32177e56b4d 100644
--- a/engines/tot/detection_tables.h
+++ b/engines/tot/detection_tables.h
@@ -54,7 +54,22 @@ const ADGameDescription gameDescriptions[] = {
 		ADGF_TESTING,
 		GUIO5(GUIO_NOSPEECH, GAMEOPTION_COPY_PROTECTION, GAMEOPTION_NO_TRANSITIONS, GAMEOPTION_ORIGINAL_SAVELOAD_DIALOG, GAMEOPTION_OPL3_MODE)
 	},
+	{
+		"tot",
+		"Demo",
+		AD_ENTRY3s(
+			"CREDITOS.DAT", "6885c1fadd25a0c0da1c88f071a30e63", 130080,
+			"PERSONAJ.SPT", "e5e1a2caa4ba3439fa0492cff772a318", 326050,
+			"ANIMA.EXE",  "08b1495d89ef7f05990541edf8754d94", 212880
+		),
+		Common::ES_ESP,
+		Common::kPlatformDOS,
+		ADGF_TESTING|ADGF_DEMO,
+		GUIO4(GUIO_NOSPEECH, GAMEOPTION_NO_TRANSITIONS, GAMEOPTION_ORIGINAL_SAVELOAD_DIALOG, GAMEOPTION_OPL3_MODE)
+	},
 	AD_TABLE_END_MARKER
 };
 
 } // End of namespace Tot
+
+
diff --git a/engines/tot/engine.cpp b/engines/tot/engine.cpp
index ffa5e3cbfbf..4dec463328b 100644
--- a/engines/tot/engine.cpp
+++ b/engines/tot/engine.cpp
@@ -5020,7 +5020,7 @@ static void buttonPress(uint xx1, uint yy1, uint xx2, uint yy2, bool pressed) {
 }
 
 void TotEngine::copyProtection() {
-	if (!ConfMan.getBool("copy_protection")) {
+	if (!ConfMan.getBool("copy_protection") || isDemo()) {
 		return;
 	}
 	const char *message = isLanguageSpanish() ? hardcodedTexts_ES[12] : hardcodedTexts_EN[12];
diff --git a/engines/tot/graphics.cpp b/engines/tot/graphics.cpp
index b514930ea10..f1eda746071 100644
--- a/engines/tot/graphics.cpp
+++ b/engines/tot/graphics.cpp
@@ -37,19 +37,28 @@ GraphicsManager::GraphicsManager() {
 
 	// loads fonts
 	Common::File exeFile;
-	if (!exeFile.open(Common::Path("TOT.EXE"))) {
+	Common::String exeFilename = isDemo() ? "ANIMA.EXE" : "TOT.EXE";
+	if (!exeFile.open(Common::Path(exeFilename))) {
 		error("Could not open executable file!");
 	}
 
 	if (isLanguageSpanish()) {
-		exeFile.seek(FONT_LITT_OFFSET_ES);
+		if (isDemo()) {
+			exeFile.seek(FONT_LITT_OFFSET_DEMO);
+		} else {
+			exeFile.seek(FONT_LITT_OFFSET_ES);
+		}
 	} else {
 		exeFile.seek(FONT_LITT_OFFSET_EN);
 	}
 	_litt = new Graphics::BgiFont();
 	_litt->loadChr(exeFile);
 	if (isLanguageSpanish()) {
-		exeFile.seek(FONT_EURO_OFFSET_ES);
+		if (isDemo()) {
+			exeFile.seek(FONT_EURO_OFFSET_DEMO);
+		} else {
+			exeFile.seek(FONT_EURO_OFFSET_ES);
+		}
 	} else {
 		exeFile.seek(FONT_EURO_OFFSET_EN);
 	}
diff --git a/engines/tot/statics.h b/engines/tot/statics.h
index 1a5f8a1fba7..9dd863a1d96 100644
--- a/engines/tot/statics.h
+++ b/engines/tot/statics.h
@@ -1189,6 +1189,9 @@ const int FONT_LITT_OFFSET_ES = 153584;
 const int FONT_EURO_OFFSET_ES = 159681;
 const int FONT_LITT_OFFSET_EN = 153010;
 const int FONT_EURO_OFFSET_EN = 159107;
+const int FONT_LITT_OFFSET_DEMO = 159073;
+const int FONT_EURO_OFFSET_DEMO = 165170;
+
 
 static const int32 menuOffsets_ES[8][2] = {
 	{0, 16004},
diff --git a/engines/tot/tot.cpp b/engines/tot/tot.cpp
index 7ed247563ed..6a50302331f 100644
--- a/engines/tot/tot.cpp
+++ b/engines/tot/tot.cpp
@@ -493,45 +493,50 @@ int TotEngine::startGame() {
 		switch (_gamePart) {
 		case 1:
 			if (_list1Complete && _list2Complete) {
-				_list1Complete = false;
-				_list2Complete = false;
-				_cpCounter = _cpCounter2;
-				_gamePart = 2;
-				_iframe = 0;
-				freeInventory();
-				clearAnimation();
-				clearScreenLayers();
-				_mouse->hide();
-				_graphics->partialFadeOut(234);
-				_sound->fadeOutMusic();
-				_sound->playMidi("CREDITOS", true);
-				_sound->fadeInMusic();
-				if (_cpCounter2 > 43)
-					showError(274);
-				sacrificeScene();
-				_graphics->clear();
-				loadInventory();
-				_graphics->loadPaletteFromFile("SEGUNDA");
-				_currentTrajectoryIndex = 0;
-				_characterPosX = 160;
-				_characterPosY = 60;
-				_trajectory[_currentTrajectoryIndex].x = _characterPosX;
-				_trajectory[_currentTrajectoryIndex].y = _characterPosY;
-				loadScreenData(20);
-				_sound->fadeOutMusic();
-				_sound->playMidi("SEGUNDA", true);
-				_sound->fadeInMusic();
-				_graphics->sceneTransition(false, _sceneBackground, 1);
-				drawInventoryMask();
-				_inventoryPosition = 0;
-				drawInventory();
-				_mouse->show();
-   				copyProtection();
-				_firstTimeTopicA[8] = true;
-				_oldGridX = 0;
-				_oldGridY = 0;
-				checkMouseGrid();
+				if (!isDemo()) {
+					_list1Complete = false;
+					_list2Complete = false;
+					_cpCounter = _cpCounter2;
+					_gamePart = 2;
+					_iframe = 0;
+					freeInventory();
+					clearAnimation();
+					clearScreenLayers();
+					_mouse->hide();
+					_graphics->partialFadeOut(234);
+					_sound->fadeOutMusic();
+					_sound->playMidi("CREDITOS", true);
+					_sound->fadeInMusic();
+					if (_cpCounter2 > 43)
+						showError(274);
+					sacrificeScene();
+					_graphics->clear();
+					loadInventory();
+					_graphics->loadPaletteFromFile("SEGUNDA");
+					_currentTrajectoryIndex = 0;
+					_characterPosX = 160;
+					_characterPosY = 60;
+					_trajectory[_currentTrajectoryIndex].x = _characterPosX;
+					_trajectory[_currentTrajectoryIndex].y = _characterPosY;
+					loadScreenData(20);
+					_sound->fadeOutMusic();
+					_sound->playMidi("SEGUNDA", true);
+					_sound->fadeInMusic();
+					_graphics->sceneTransition(false, _sceneBackground, 1);
+					drawInventoryMask();
+					_inventoryPosition = 0;
+					drawInventory();
+					_mouse->show();
+					copyProtection();
+					_firstTimeTopicA[8] = true;
+					_oldGridX = 0;
+					_oldGridY = 0;
+					checkMouseGrid();
+				} else {
+					_shouldQuitGame = true;
+				}
 			}
+
 			break;
 		}
 
@@ -571,7 +576,7 @@ int TotEngine::startGame() {
 		g_system->delayMillis(10);
 	}
 	_mouse->hide();
-	if (!shouldQuit()) {
+	if (!shouldQuit() && !isDemo()) {
 		ending();
 	}
 	Common::String photoFileName;
@@ -581,7 +586,7 @@ int TotEngine::startGame() {
 	if (!shouldQuit()) {
 		generateDiploma(photoFileName);
 	}
-	if (!shouldQuit()) {
+	if (!shouldQuit() && !isDemo()) {
 		credits();
 	}
 	return EXIT_SUCCESS;
diff --git a/engines/tot/tot.h b/engines/tot/tot.h
index ae68217a48b..89b218006c3 100644
--- a/engines/tot/tot.h
+++ b/engines/tot/tot.h
@@ -65,7 +65,6 @@ enum TotAction {
 class TotEngine : public Engine {
 
 private:
-	const ADGameDescription *_gameDescription;
 	Common::RandomSource _randomSource;
 
 	void handleEvent(Common::Event e);
@@ -192,6 +191,7 @@ public:
 	MouseManager *_mouse = nullptr;
 	ChronoManager *_chrono = nullptr;
 	Tot::TotEventManager *_events = nullptr;
+	const ADGameDescription *_gameDescription;
 
 	bool _showMouseGrid = false;
 	bool _showScreenGrid = false;
diff --git a/engines/tot/util.h b/engines/tot/util.h
index 84183b699fa..a2a2c86332d 100644
--- a/engines/tot/util.h
+++ b/engines/tot/util.h
@@ -84,6 +84,10 @@ inline bool isLanguageSpanish() {
 	return g_engine->_lang == Common::ES_ESP;
 };
 
+inline bool isDemo() {
+	return g_engine->_gameDescription->flags & ADGF_DEMO;
+};
+
 } // End of namespace Tot
 
 #endif




More information about the Scummvm-git-logs mailing list