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

neuromancer noreply at scummvm.org
Thu Mar 9 19:10:44 UTC 2023


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

Summary:
9fd7cebe58 FREESCAPE: removed edsk related code to parse cpc releases of driller
ccdad0ca92 FREESCAPE: load and show driller dos demo title image


Commit: 9fd7cebe5836fb5ee98242b7effb9608413df268
    https://github.com/scummvm/scummvm/commit/9fd7cebe5836fb5ee98242b7effb9608413df268
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2023-03-09T20:05:22+01:00

Commit Message:
FREESCAPE: removed edsk related code to parse cpc releases of driller

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


diff --git a/engines/freescape/detection.cpp b/engines/freescape/detection.cpp
index 758267f1f88..cdfcccba49d 100644
--- a/engines/freescape/detection.cpp
+++ b/engines/freescape/detection.cpp
@@ -83,18 +83,6 @@ static const ADGameDescription gameDescriptions[] = {
 		GF_CPC_RETAIL,
 		GUIO2(GUIO_NOMIDI, GAMEOPTION_AUTOMATIC_DRILLING)
 	},
-	{
-		"driller",
-		"VirtualWorlds-A",
-		{
-			{"VIRTUALWORLDS.A.CPC.EDSK", 0, "421d369636984fc209a0969007daa35b", 195635},
-			AD_LISTEND
-		},
-		Common::EN_ANY,
-		Common::kPlatformAmstradCPC,
-		GF_CPC_VIRTUALWORLDS,
-		GUIO2(GUIO_NOMIDI, GAMEOPTION_AUTOMATIC_DRILLING)
-	},
 	{
 		"spacestationoblivion",
 		"",
diff --git a/engines/freescape/games/driller/cpc.cpp b/engines/freescape/games/driller/cpc.cpp
index 68c33eba2e4..bd43a0a1d01 100644
--- a/engines/freescape/games/driller/cpc.cpp
+++ b/engines/freescape/games/driller/cpc.cpp
@@ -27,102 +27,6 @@
 
 namespace Freescape {
 
-byte *parseEDSK(const Common::String filename, int &size) {
-	debugC(1, kFreescapeDebugParser, "Trying to parse edsk file: %s", filename.c_str());
-	Common::File file;
-	file.open(filename);
-	if (!file.isOpen())
-		error("Failed to open %s", filename.c_str());
-
-	int totalSize = file.size();
-	byte *edskBuffer = (byte *)malloc(totalSize);
-	file.read(edskBuffer, totalSize);
-	file.close();
-
-	// We don't know the final size, but we allocate enough
-	byte *memBuffer = (byte *)malloc(totalSize);
-
-	byte nsides = edskBuffer[49];
-	assert(nsides == 1);
-	int ntracks = 0;
-	int i = 256;
-	int j = 0;
-	while (i + 1 < totalSize) {
-		byte ssize = edskBuffer[i + 0x14];
-		debugC(1, kFreescapeDebugParser, "i: %x ssize: %d, number: %d", i, ssize, edskBuffer[i + 0x10]);
-		assert(ssize == 3 || edskBuffer[i + 0x0] == 'T');
-		assert(ssize == 3 || edskBuffer[i + 0x1] == 'r');
-		assert(ssize == 3 || edskBuffer[i + 0x2] == 'a');
-		//assert(ssize == 3 || ntracks == edskBuffer[i + 0x10]);
-		int start = i + 0x100;
-		debugC(1, kFreescapeDebugParser, "sector size: %d", ssize);
-		if (ssize == 2) {
-			i = i + 9 * 512 + 256;
-		} else if (ssize == 5) {
-			i = i + 8 * 512 + 256;
-		} else if (ssize == 0) {
-			i = totalSize - 1;
-		} else if (ssize == 3) {
-			break; // Not sure
-		} else {
-			error("ssize: %d", ssize);
-		}
-		int osize = i - start;
-		debugC(1, kFreescapeDebugParser, "copying track %d start: %x size: %x, dest: %x", ntracks, start, osize, j);
-		memcpy(memBuffer + j, edskBuffer + start, osize);
-		j = j + osize;
-		ntracks++;
-	}
-	size = j;
-
-	if (0) { // Useful to debug where exactly each object is located in memory once it is parsed
-		i = 0;
-		while(i < j) {
-			debugN("%05x: ", i);
-			for (int k = 0; k <= 16; k++) {
-				debugN("%02x ", memBuffer[i]);
-				i++;
-			}
-			debugN("\n");
-		}
-	}
-	free(edskBuffer);
-	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];
-	}
-}
-
 byte kCPCPaletteTitleData[4][3] = {
 	{0x00, 0x00, 0x00},
 	{0x00, 0x80, 0xff},


Commit: ccdad0ca92dcd6d64498c708fdec25713e2dbe08
    https://github.com/scummvm/scummvm/commit/ccdad0ca92dcd6d64498c708fdec25713e2dbe08
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2023-03-09T20:05:22+01:00

Commit Message:
FREESCAPE: load and show driller dos demo title image

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


diff --git a/engines/freescape/games/driller/dos.cpp b/engines/freescape/games/driller/dos.cpp
index 4998673f6a7..fa948e5c330 100644
--- a/engines/freescape/games/driller/dos.cpp
+++ b/engines/freescape/games/driller/dos.cpp
@@ -196,6 +196,11 @@ byte kEGADefaultPaletteData[16][3] = {
 	{0x00, 0x00, 0x00}
 };
 
+/*
+ The following function is only used for decoding images for
+ the Driller DOS demo
+*/
+
 Graphics::ManagedSurface *DrillerEngine::load8bitDemoImage(Common::SeekableReadStream *file, int offset) {
 	Graphics::ManagedSurface *surface = new Graphics::ManagedSurface();
 	surface->create(320, 200, Graphics::PixelFormat::createFormatCLUT8());
@@ -300,6 +305,14 @@ void DrillerEngine::loadAssetsDOSDemo() {
 	_renderMode = Common::kRenderCGA; // DOS demos is CGA only
 	_viewArea = Common::Rect(36, 16, 284, 117); // correct view area
 	_gfx->_renderMode = _renderMode;
+	file.open("d1");
+	if (!file.isOpen())
+		error("Failed to open 'd1' file");
+
+	_title = load8bitDemoImage(&file, 0x0);
+	_title->setPalette((byte*)&kCGAPalettePinkBlueWhiteData, 0, 4);
+
+	file.close();
 	file.open("d2");
 	if (!file.isOpen())
 		error("Failed to open 'd2' file");
diff --git a/engines/freescape/games/driller/driller.cpp b/engines/freescape/games/driller/driller.cpp
index 782506c5ea8..a9fb1974581 100644
--- a/engines/freescape/games/driller/driller.cpp
+++ b/engines/freescape/games/driller/driller.cpp
@@ -91,9 +91,6 @@ DrillerEngine::~DrillerEngine() {
 }
 
 void DrillerEngine::titleScreen() {
-	if (isDOS() && isDemo()) // Demo will not show any title screen
-		return;
-
 	if (isAmiga() || isAtariST()) // TODO: implement these with their own animations
 		return;
 




More information about the Scummvm-git-logs mailing list