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

neuromancer noreply at scummvm.org
Thu Feb 23 07:28:28 UTC 2023


This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
1fc909ca30 FREESCAPE: renamed game data file for driller detection in several platforms
77ad898b53 FREESCAPE: small adjustments for driller ui for zx
fa21ac6740 FREESCAPE: refactored deobfuscation code for driller cpc


Commit: 1fc909ca30ba6fa2e71492b1474b5c45da12546f
    https://github.com/scummvm/scummvm/commit/1fc909ca30ba6fa2e71492b1474b5c45da12546f
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2023-02-23T08:30:04+01:00

Commit Message:
FREESCAPE: renamed game data file for driller detection in several platforms

Changed paths:
    engines/freescape/detection.cpp
    engines/freescape/games/driller.cpp


diff --git a/engines/freescape/detection.cpp b/engines/freescape/detection.cpp
index 7dd8000c377..f3faa281ae6 100644
--- a/engines/freescape/detection.cpp
+++ b/engines/freescape/detection.cpp
@@ -39,7 +39,7 @@ static const ADGameDescription gameDescriptions[] = {
 		"driller",
 		"",
 		{
-			{"DRILLER.ZX.EXTRACTED", 0, "396c1789a7da3db5058d18eb8d2d35a3", 37590},
+			{"DRILLER.ZX.DATA", 0, "396c1789a7da3db5058d18eb8d2d35a3", 37590},
 			AD_LISTEND
 		},
 		Common::EN_ANY,
@@ -51,7 +51,7 @@ static const ADGameDescription gameDescriptions[] = {
 		"driller",
 		"",
 		{
-			{"DRILLER.ZX.EXTRACTED", 0, "6876fc03e754137f428bd4d5f16452b5", 37888},
+			{"DRILLER.ZX.DATA", 0, "6876fc03e754137f428bd4d5f16452b5", 37888},
 			AD_LISTEND
 		},
 		Common::EN_ANY,
@@ -63,7 +63,7 @@ static const ADGameDescription gameDescriptions[] = {
 		"driller",
 		"",
 		{
-			{"DRILLER.ZX.EXTRACTED", 0, "2b996ab877f45414f8e2ae4c862746f3", 35214},
+			{"DRILLER.ZX.DATA", 0, "2b996ab877f45414f8e2ae4c862746f3", 35214},
 			AD_LISTEND
 		},
 		Common::EN_ANY,
@@ -123,7 +123,7 @@ static const ADGameDescription gameDescriptions[] = {
 		"spacestationoblivion",
 		"",
 		{
-			{"SPACESTATIONOBLIVION.C64.EXTRACTED", 0, "85680576865e211f868885e9997a08b8", 22782},
+			{"SPACESTATIONOBLIVION.C64.DATA", 0, "85680576865e211f868885e9997a08b8", 22782},
 			AD_LISTEND
 		},
 		Common::EN_ANY,
@@ -136,7 +136,7 @@ static const ADGameDescription gameDescriptions[] = {
 		"spacestationoblivion",
 		"",
 		{
-			{"SPACESTATIONOBLIVION.C64.EXTRACTED", 0, "2b3537e21b8b871ec074df2962999781", 64514},
+			{"SPACESTATIONOBLIVION.C64.DATA", 0, "2b3537e21b8b871ec074df2962999781", 64514},
 			AD_LISTEND
 		},
 		Common::EN_ANY,
@@ -148,7 +148,7 @@ static const ADGameDescription gameDescriptions[] = {
 		"driller", // Commodore Force - Jan 94
 		"",
 		{
-			{"DRILLER.C64.EXTRACTED", 0, "511778d3167ff7504d905df507a03ac5", 63490},
+			{"DRILLER.C64.DATA", 0, "511778d3167ff7504d905df507a03ac5", 63490},
 			AD_LISTEND
 		},
 		Common::EN_ANY,
@@ -160,7 +160,7 @@ static const ADGameDescription gameDescriptions[] = {
 		"driller",
 		"",
 		{
-			{"DRILLER.C64.EXTRACTED", 0, "73a6f206e54fb13245fe6d92f60fbb34", 41071},
+			{"DRILLER.C64.DATA", 0, "73a6f206e54fb13245fe6d92f60fbb34", 41071},
 			AD_LISTEND
 		},
 		Common::EN_ANY,
diff --git a/engines/freescape/games/driller.cpp b/engines/freescape/games/driller.cpp
index 5650a51e3a5..ba40a2a0975 100644
--- a/engines/freescape/games/driller.cpp
+++ b/engines/freescape/games/driller.cpp
@@ -553,10 +553,10 @@ void DrillerEngine::loadAssetsFullGame() {
 			error("Unable to find driller.zx.border");
 		file.close();
 
-		file.open("driller.zx.extracted");
+		file.open("driller.zx.data");
 
 		if (!file.isOpen())
-			error("Failed to open driller.zx.extracted");
+			error("Failed to open driller.zx.data");
 
 		if (_variant & GF_ZX_DISC)
 			loadMessagesFixedSize(&file, 0x2164, 14, 20);
@@ -648,13 +648,13 @@ void DrillerEngine::loadAssetsFullGame() {
 	} else if (isC64()) {
 		if (_targetName.hasPrefix("spacestationoblivion")) {
 			loadBundledImages();
-			file.open("spacestationoblivion.c64.extracted");
+			file.open("spacestationoblivion.c64.data");
 			loadMessagesFixedSize(&file, 0x167a, 14, 20);
 			//loadFonts(&file, 0xae54);
 			load8bitBinary(&file, 0x8e02, 4);
 			loadGlobalObjects(&file, 0x1855);
 		} else if (_targetName.hasPrefix("driller")) {
-			file.open("driller.c64.extracted");
+			file.open("driller.c64.data");
 			loadMessagesFixedSize(&file, 0x167a - 0x400, 14, 20);
 			//loadFonts(&file, 0xae54);
 			load8bitBinary(&file, 0x8e02 - 0x400, 4);


Commit: 77ad898b53580f63396f5e57ffe1af3261608ac4
    https://github.com/scummvm/scummvm/commit/77ad898b53580f63396f5e57ffe1af3261608ac4
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2023-02-23T08:30:04+01:00

Commit Message:
FREESCAPE: small adjustments for driller ui for zx

Changed paths:
    engines/freescape/games/driller.cpp


diff --git a/engines/freescape/games/driller.cpp b/engines/freescape/games/driller.cpp
index ba40a2a0975..ddc463130ce 100644
--- a/engines/freescape/games/driller.cpp
+++ b/engines/freescape/games/driller.cpp
@@ -106,7 +106,7 @@ DrillerEngine::DrillerEngine(OSystem *syst, const ADGameDescription *gd) : Frees
 	else if (isAmiga() || isAtariST())
 		_viewArea = Common::Rect(36, 16, 284, 118);
 	else if (isSpectrum())
-		_viewArea = Common::Rect(58, 20, 266, 124);
+		_viewArea = Common::Rect(56, 20, 264, 124);
 	else if (isCPC())
 		_viewArea = Common::Rect(36, 19, 284, 120);
 	else if (isC64())
@@ -1037,30 +1037,30 @@ void DrillerEngine::drawZXUI(Graphics::Surface *surface) {
 	uint32 white = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0xFF, 0xFF, 0xFF);
 
 	int score = _gameStateVars[k8bitVariableScore];
-	drawStringInSurface(_currentArea->_name, 176, 188, front, back, surface);
-	drawStringInSurface(Common::String::format("%04d", int(2 * _position.x())), 152, 149, front, back, surface);
-	drawStringInSurface(Common::String::format("%04d", int(2 * _position.z())), 152, 157, front, back, surface);
-	drawStringInSurface(Common::String::format("%04d", int(2 * _position.y())), 152, 165, front, back, surface);
+	drawStringInSurface(_currentArea->_name, 174, 188, front, back, surface);
+	drawStringInSurface(Common::String::format("%04d", int(2 * _position.x())), 150, 149, front, back, surface);
+	drawStringInSurface(Common::String::format("%04d", int(2 * _position.z())), 150, 157, front, back, surface);
+	drawStringInSurface(Common::String::format("%04d", int(2 * _position.y())), 150, 165, front, back, surface);
 	if (_playerHeightNumber >= 0)
-		drawStringInSurface(Common::String::format("%d", _playerHeightNumber), 74, 165, front, back, surface);
+		drawStringInSurface(Common::String::format("%d", _playerHeightNumber), 72, 165, front, back, surface);
 	else
-		drawStringInSurface(Common::String::format("%s", "J"), 74, 165, front, back, surface);
+		drawStringInSurface(Common::String::format("%s", "J"), 72, 165, front, back, surface);
 
-	drawStringInSurface(Common::String::format("%02d", int(_angleRotations[_angleRotationIndex])), 64, 149, front, back, surface);
-	drawStringInSurface(Common::String::format("%3d", _playerSteps[_playerStepIndex]), 65, 157, front, back, surface);
-	drawStringInSurface(Common::String::format("%07d", score), 217, 133, white, back, surface);
+	drawStringInSurface(Common::String::format("%02d", int(_angleRotations[_angleRotationIndex])), 62, 149, front, back, surface);
+	drawStringInSurface(Common::String::format("%3d", _playerSteps[_playerStepIndex]), 63, 157, front, back, surface);
+	drawStringInSurface(Common::String::format("%07d", score), 215, 133, white, back, surface);
 
 	int seconds, minutes, hours;
 	getTimeFromCountdown(seconds, minutes, hours);
-	drawStringInSurface(Common::String::format("%02d", hours), 187, 12, front, back, surface);
-	drawStringInSurface(Common::String::format("%02d", minutes), 209, 12, front, back, surface);
-	drawStringInSurface(Common::String::format("%02d", seconds), 232, 12, front, back, surface);
+	drawStringInSurface(Common::String::format("%02d", hours), 185, 12, front, back, surface);
+	drawStringInSurface(Common::String::format("%02d", minutes), 207, 12, front, back, surface);
+	drawStringInSurface(Common::String::format("%02d", seconds), 230, 12, front, back, surface);
 
 	Common::String message;
 	int deadline;
 	getLatestMessages(message, deadline);
 	if (deadline <= _countdown) {
-		drawStringInSurface(message, 169, 181, back, front, surface);
+		drawStringInSurface(message, 167, 181, back, front, surface);
 		_temporaryMessages.push_back(message);
 		_temporaryMessageDeadlines.push_back(deadline);
 	} else {
@@ -1071,24 +1071,24 @@ void DrillerEngine::drawZXUI(Graphics::Surface *surface) {
 		else
 			message = _messagesList[1];
 
-		drawStringInSurface(message, 169, 181, front, back, surface);
+		drawStringInSurface(message, 167, 181, front, back, surface);
 	}
 
 	int energy = _gameStateVars[k8bitVariableEnergy];
 	int shield = _gameStateVars[k8bitVariableShield];
 
 	if (energy >= 0) {
-		Common::Rect backBar(45, 188, 109 - energy, 194);
+		Common::Rect backBar(43, 188, 107 - energy, 194);
 		surface->fillRect(backBar, back);
-		Common::Rect energyBar(108 - energy, 188, 108, 194);
+		Common::Rect energyBar(106 - energy, 188, 106, 194);
 		surface->fillRect(energyBar, front);
 	}
 
 	if (shield >= 0) {
-		Common::Rect backBar(45, 181, 109 - shield, 187);
+		Common::Rect backBar(43, 181, 107 - shield, 187);
 		surface->fillRect(backBar, back);
 
-		Common::Rect shieldBar(108 - shield, 181, 108, 187);
+		Common::Rect shieldBar(106 - shield, 181, 106, 187);
 		surface->fillRect(shieldBar, front);
 	}
 }


Commit: fa21ac67400953b0da08f36d03b8e5899bbf68c0
    https://github.com/scummvm/scummvm/commit/fa21ac67400953b0da08f36d03b8e5899bbf68c0
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2023-02-23T08:30:04+01:00

Commit Message:
FREESCAPE: refactored deobfuscation code for driller cpc

Changed paths:
    engines/freescape/games/driller.cpp


diff --git a/engines/freescape/games/driller.cpp b/engines/freescape/games/driller.cpp
index ddc463130ce..e6de67e06f7 100644
--- a/engines/freescape/games/driller.cpp
+++ b/engines/freescape/games/driller.cpp
@@ -393,7 +393,6 @@ void DrillerEngine::loadAssetsDemo() {
 	_angleRotationIndex = 0;
 }
 
-
 byte *parseEDSK(const Common::String filename, int &size) {
 	debugC(1, kFreescapeDebugParser, "Trying to parse edsk file: %s", filename.c_str());
 	Common::File file;
@@ -457,6 +456,38 @@ byte *parseEDSK(const Common::String filename, int &size) {
 	return memBuffer;
 }
 
+void deobfuscateDrillerCPCVirtualWorlds(byte *memBuffer) {
+	// Deofuscation / loader code
+	for (int j = 0; j < 0x200; j++) {
+		memBuffer[0x14000 + j] = memBuffer[0x14200 + j];
+		memBuffer[0x14200 + j] = memBuffer[0x13400 + j];
+		memBuffer[0x14400 + j] = memBuffer[0x13800 + j];
+		memBuffer[0x14600 + j] = memBuffer[0x13c00 + j];
+	}
+
+	for (int j = 0; j < 0x200; j++) {
+		memBuffer[0x13c00 + j] = memBuffer[0x13a00 + j];
+		memBuffer[0x13a00 + j] = memBuffer[0x13600 + j];
+		memBuffer[0x13800 + j] = memBuffer[0x13200 + j];
+		memBuffer[0x13600 + j] = memBuffer[0x12e00 + j];
+		memBuffer[0x12e00 + j] = memBuffer[0x13000 + j];
+		memBuffer[0x13000 + j] = memBuffer[0x12200 + j];
+		memBuffer[0x13200 + j] = memBuffer[0x12600 + j];
+		memBuffer[0x13400 + j] = memBuffer[0x12a00 + j];
+	}
+
+	for (int i = 6; i >= 0; i--) {
+		//debug("copying 0x200 bytes to %x from %x", 0x12000 + 0x200*i, 0x11400 + 0x400*i);
+		for (int j = 0; j < 0x200; j++) {
+			memBuffer[0x12000 + 0x200*i + j] = memBuffer[0x11400 + 0x400*i + j];
+		}
+	}
+
+	for (int j = 0; j < 0x200; j++) {
+		memBuffer[0x11c00 + j] = memBuffer[0x11e00 + j];
+		memBuffer[0x11e00 + j] = memBuffer[0x11000 + j];
+	}
+}
 
 void DrillerEngine::loadAssetsFullGame() {
 	Common::File file;
@@ -590,37 +621,7 @@ void DrillerEngine::loadAssetsFullGame() {
 		int memSize = 0;
 		if (_variant & GF_CPC_VIRTUALWORLDS) {
 			memBuffer = parseEDSK("virtualworlds.A.cpc.edsk", memSize);
-
-			// Deofuscation / loader code
-			for (int j = 0; j < 0x200; j++) {
-				memBuffer[0x14000 + j] = memBuffer[0x14200 + j];
-				memBuffer[0x14200 + j] = memBuffer[0x13400 + j];
-				memBuffer[0x14400 + j] = memBuffer[0x13800 + j];
-				memBuffer[0x14600 + j] = memBuffer[0x13c00 + j];
-			}
-
-			for (int j = 0; j < 0x200; j++) {
-				memBuffer[0x13c00 + j] = memBuffer[0x13a00 + j];
-				memBuffer[0x13a00 + j] = memBuffer[0x13600 + j];
-				memBuffer[0x13800 + j] = memBuffer[0x13200 + j];
-				memBuffer[0x13600 + j] = memBuffer[0x12e00 + j];
-				memBuffer[0x12e00 + j] = memBuffer[0x13000 + j];
-				memBuffer[0x13000 + j] = memBuffer[0x12200 + j];
-				memBuffer[0x13200 + j] = memBuffer[0x12600 + j];
-				memBuffer[0x13400 + j] = memBuffer[0x12a00 + j];
-			}
-
-			for (int i = 6; i >= 0; i--) {
-				//debug("copying 0x200 bytes to %x from %x", 0x12000 + 0x200*i, 0x11400 + 0x400*i);
-				for (int j = 0; j < 0x200; j++) {
-					memBuffer[0x12000 + 0x200*i + j] = memBuffer[0x11400 + 0x400*i + j];
-				}
-			}
-
-			for (int j = 0; j < 0x200; j++) {
-				memBuffer[0x11c00 + j] = memBuffer[0x11e00 + j];
-				memBuffer[0x11e00 + j] = memBuffer[0x11000 + j];
-			}
+			deobfuscateDrillerCPCVirtualWorlds(memBuffer);
 		} else
 			memBuffer = parseEDSK("driller.cpc.edsk", memSize);
 		assert(memSize > 0);




More information about the Scummvm-git-logs mailing list