[Scummvm-git-logs] scummvm master -> 5eda37b6d5bbabf1a35fe8bb905d0333cf708adb

neuromancer noreply at scummvm.org
Fri Feb 24 15:05:05 UTC 2023


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

Summary:
2f15fa3c2a FREESCAPE: refactored driller cpc code into a directory
06339a6569 FREESCAPE: refactored driller zx code into a directory
52cac204a5 FREESCAPE: refactored driller amiga/atari code into a directory
4119ec9bb3 FREESCAPE: refactored/moved driller code for loading assets in different platforms code
5eda37b6d5 FREESCAPE: refactored/moved driller code specific for the atari release


Commit: 2f15fa3c2a14d805dec0a55903c3c3cc56f0f51b
    https://github.com/scummvm/scummvm/commit/2f15fa3c2a14d805dec0a55903c3c3cc56f0f51b
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2023-02-24T16:05:33+01:00

Commit Message:
FREESCAPE: refactored driller cpc code into a directory

Changed paths:
  A engines/freescape/games/driller/cpc.cpp
    engines/freescape/games/driller/driller.cpp
    engines/freescape/module.mk


diff --git a/engines/freescape/games/driller/cpc.cpp b/engines/freescape/games/driller/cpc.cpp
new file mode 100644
index 00000000000..dce9d4a6110
--- /dev/null
+++ b/engines/freescape/games/driller/cpc.cpp
@@ -0,0 +1,197 @@
+/* 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/>.
+ *
+ */
+
+#include "common/file.h"
+
+#include "freescape/freescape.h"
+#include "freescape/language/8bitDetokeniser.h"
+
+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];
+	}
+}
+
+void DrillerEngine::drawCPCUI(Graphics::Surface *surface) {
+	uint32 color = 1;
+	uint8 r, g, b;
+
+	_gfx->selectColorFromFourColorPalette(color, r, g, b);
+	uint32 front = _gfx->_texturePixelFormat.ARGBToColor(0xFF, r, g, b);
+
+	color = 0;
+	if (_gfx->_colorRemaps && _gfx->_colorRemaps->contains(color)) {
+		color = (*_gfx->_colorRemaps)[color];
+	}
+
+	_gfx->readFromPalette(color, r, g, b);
+	uint32 back = _gfx->_texturePixelFormat.ARGBToColor(0xFF, r, g, b);
+
+	int score = _gameStateVars[k8bitVariableScore];
+	drawStringInSurface(_currentArea->_name, 200, 188, front, back, surface);
+	drawStringInSurface(Common::String::format("%04d", int(2 * _position.x())), 149, 148, front, back, surface);
+	drawStringInSurface(Common::String::format("%04d", int(2 * _position.z())), 149, 156, front, back, surface);
+	drawStringInSurface(Common::String::format("%04d", int(2 * _position.y())), 149, 164, front, back, surface);
+	if (_playerHeightNumber >= 0)
+		drawStringInSurface(Common::String::format("%d", _playerHeightNumber), 54, 164, front, back, surface);
+	else
+		drawStringInSurface(Common::String::format("%s", "J"), 54, 164, front, back, surface);
+
+	drawStringInSurface(Common::String::format("%02d", int(_angleRotations[_angleRotationIndex])), 46, 148, front, back, surface);
+	drawStringInSurface(Common::String::format("%3d", _playerSteps[_playerStepIndex]), 44, 156, front, back, surface);
+	drawStringInSurface(Common::String::format("%07d", score), 239, 132, front, back, surface);
+
+	int seconds, minutes, hours;
+	getTimeFromCountdown(seconds, minutes, hours);
+	drawStringInSurface(Common::String::format("%02d", hours), 209, 11, front, back, surface);
+	drawStringInSurface(Common::String::format("%02d", minutes), 232, 11, front, back, surface);
+	drawStringInSurface(Common::String::format("%02d", seconds), 254, 11, front, back, surface);
+
+	Common::String message;
+	int deadline;
+	getLatestMessages(message, deadline);
+	if (deadline <= _countdown) {
+		drawStringInSurface(message, 191, 180, back, front, surface);
+		_temporaryMessages.push_back(message);
+		_temporaryMessageDeadlines.push_back(deadline);
+	} else if (_messagesList.size() > 0) {
+		if (_currentArea->_gasPocketRadius == 0)
+			message = _messagesList[2];
+		else if (_drillStatusByArea[_currentArea->getAreaID()])
+			message = _messagesList[0];
+		else
+			message = _messagesList[1];
+
+		drawStringInSurface(message, 191, 180, front, back, surface);
+	}
+
+	int energy = _gameStateVars[k8bitVariableEnergy];
+	int shield = _gameStateVars[k8bitVariableShield];
+
+	if (energy >= 0) {
+		Common::Rect backBar(25, 187, 89 - energy, 194);
+		surface->fillRect(backBar, back);
+		Common::Rect energyBar(88 - energy, 187, 88, 194);
+		surface->fillRect(energyBar, front);
+	}
+
+	if (shield >= 0) {
+		Common::Rect backBar(25, 180, 89 - shield, 186);
+		surface->fillRect(backBar, back);
+
+		Common::Rect shieldBar(88 - shield, 180, 88, 186);
+		surface->fillRect(shieldBar, front);
+	}
+}
+
+} // End of namespace Freescape
\ No newline at end of file
diff --git a/engines/freescape/games/driller/driller.cpp b/engines/freescape/games/driller/driller.cpp
index 06fe7489531..4e8f5cab455 100644
--- a/engines/freescape/games/driller/driller.cpp
+++ b/engines/freescape/games/driller/driller.cpp
@@ -393,101 +393,8 @@ 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;
-	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];
-		debug("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];
-	}
-}
+extern byte *parseEDSK(const Common::String filename, int &size);
+extern void deobfuscateDrillerCPCVirtualWorlds(byte *memBuffer);
 
 void DrillerEngine::loadAssetsFullGame() {
 	Common::File file;
@@ -811,78 +718,6 @@ void DrillerEngine::drawUI() {
 	delete surface;
 }
 
-void DrillerEngine::drawCPCUI(Graphics::Surface *surface) {
-	uint32 color = 1;
-	uint8 r, g, b;
-
-	_gfx->selectColorFromFourColorPalette(color, r, g, b);
-	uint32 front = _gfx->_texturePixelFormat.ARGBToColor(0xFF, r, g, b);
-
-	color = 0;
-	if (_gfx->_colorRemaps && _gfx->_colorRemaps->contains(color)) {
-		color = (*_gfx->_colorRemaps)[color];
-	}
-
-	_gfx->readFromPalette(color, r, g, b);
-	uint32 back = _gfx->_texturePixelFormat.ARGBToColor(0xFF, r, g, b);
-
-	int score = _gameStateVars[k8bitVariableScore];
-	drawStringInSurface(_currentArea->_name, 200, 188, front, back, surface);
-	drawStringInSurface(Common::String::format("%04d", int(2 * _position.x())), 149, 148, front, back, surface);
-	drawStringInSurface(Common::String::format("%04d", int(2 * _position.z())), 149, 156, front, back, surface);
-	drawStringInSurface(Common::String::format("%04d", int(2 * _position.y())), 149, 164, front, back, surface);
-	if (_playerHeightNumber >= 0)
-		drawStringInSurface(Common::String::format("%d", _playerHeightNumber), 54, 164, front, back, surface);
-	else
-		drawStringInSurface(Common::String::format("%s", "J"), 54, 164, front, back, surface);
-
-	drawStringInSurface(Common::String::format("%02d", int(_angleRotations[_angleRotationIndex])), 46, 148, front, back, surface);
-	drawStringInSurface(Common::String::format("%3d", _playerSteps[_playerStepIndex]), 44, 156, front, back, surface);
-	drawStringInSurface(Common::String::format("%07d", score), 239, 132, front, back, surface);
-
-	int seconds, minutes, hours;
-	getTimeFromCountdown(seconds, minutes, hours);
-	drawStringInSurface(Common::String::format("%02d", hours), 209, 11, front, back, surface);
-	drawStringInSurface(Common::String::format("%02d", minutes), 232, 11, front, back, surface);
-	drawStringInSurface(Common::String::format("%02d", seconds), 254, 11, front, back, surface);
-
-	Common::String message;
-	int deadline;
-	getLatestMessages(message, deadline);
-	if (deadline <= _countdown) {
-		drawStringInSurface(message, 191, 180, back, front, surface);
-		_temporaryMessages.push_back(message);
-		_temporaryMessageDeadlines.push_back(deadline);
-	} else if (_messagesList.size() > 0) {
-		if (_currentArea->_gasPocketRadius == 0)
-			message = _messagesList[2];
-		else if (_drillStatusByArea[_currentArea->getAreaID()])
-			message = _messagesList[0];
-		else
-			message = _messagesList[1];
-
-		drawStringInSurface(message, 191, 180, front, back, surface);
-	}
-
-	int energy = _gameStateVars[k8bitVariableEnergy];
-	int shield = _gameStateVars[k8bitVariableShield];
-
-	if (energy >= 0) {
-		Common::Rect backBar(25, 187, 89 - energy, 194);
-		surface->fillRect(backBar, back);
-		Common::Rect energyBar(88 - energy, 187, 88, 194);
-		surface->fillRect(energyBar, front);
-	}
-
-	if (shield >= 0) {
-		Common::Rect backBar(25, 180, 89 - shield, 186);
-		surface->fillRect(backBar, back);
-
-		Common::Rect shieldBar(88 - shield, 180, 88, 186);
-		surface->fillRect(shieldBar, front);
-	}
-}
-
 void DrillerEngine::drawC64UI(Graphics::Surface *surface) {
 	uint32 color = 1;
 	uint8 r, g, b;
diff --git a/engines/freescape/module.mk b/engines/freescape/module.mk
index 52433360c8e..bb36272aaa4 100644
--- a/engines/freescape/module.mk
+++ b/engines/freescape/module.mk
@@ -6,6 +6,7 @@ MODULE_OBJS := \
 	freescape.o \
 	games/castle.o \
 	games/dark.o \
+	games/driller/cpc.o \
 	games/driller/dos.o \
 	games/driller/driller.o \
 	games/eclipse.o \


Commit: 06339a65699a2d956fa75bee01415a15e353eb07
    https://github.com/scummvm/scummvm/commit/06339a65699a2d956fa75bee01415a15e353eb07
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2023-02-24T16:05:34+01:00

Commit Message:
FREESCAPE: refactored driller zx code into a directory

Changed paths:
  A engines/freescape/games/driller/zx.cpp
    engines/freescape/games/driller/driller.cpp
    engines/freescape/module.mk


diff --git a/engines/freescape/games/driller/driller.cpp b/engines/freescape/games/driller/driller.cpp
index 4e8f5cab455..0ece48d0123 100644
--- a/engines/freescape/games/driller/driller.cpp
+++ b/engines/freescape/games/driller/driller.cpp
@@ -790,79 +790,6 @@ void DrillerEngine::drawC64UI(Graphics::Surface *surface) {
 	}
 }
 
-void DrillerEngine::drawZXUI(Graphics::Surface *surface) {
-	uint32 color = 5;
-	uint8 r, g, b;
-
-	_gfx->readFromPalette(color, r, g, b);
-	uint32 front = _gfx->_texturePixelFormat.ARGBToColor(0xFF, r, g, b);
-
-	color = _currentArea->_usualBackgroundColor;
-	if (_gfx->_colorRemaps && _gfx->_colorRemaps->contains(color)) {
-		color = (*_gfx->_colorRemaps)[color];
-	}
-
-	_gfx->readFromPalette(color, r, g, b);
-	uint32 back = _gfx->_texturePixelFormat.ARGBToColor(0xFF, r, g, b);
-	uint32 white = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0xFF, 0xFF, 0xFF);
-
-	int score = _gameStateVars[k8bitVariableScore];
-	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), 72, 165, front, back, surface);
-	else
-		drawStringInSurface(Common::String::format("%s", "J"), 72, 165, front, 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), 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, 167, 181, back, front, surface);
-		_temporaryMessages.push_back(message);
-		_temporaryMessageDeadlines.push_back(deadline);
-	} else {
-		if (_currentArea->_gasPocketRadius == 0)
-			message = _messagesList[2];
-		else if (_drillStatusByArea[_currentArea->getAreaID()])
-			message = _messagesList[0];
-		else
-			message = _messagesList[1];
-
-		drawStringInSurface(message, 167, 181, front, back, surface);
-	}
-
-	int energy = _gameStateVars[k8bitVariableEnergy];
-	int shield = _gameStateVars[k8bitVariableShield];
-
-	if (energy >= 0) {
-		Common::Rect backBar(43, 188, 107 - energy, 194);
-		surface->fillRect(backBar, back);
-		Common::Rect energyBar(106 - energy, 188, 106, 194);
-		surface->fillRect(energyBar, front);
-	}
-
-	if (shield >= 0) {
-		Common::Rect backBar(43, 181, 107 - shield, 187);
-		surface->fillRect(backBar, back);
-
-		Common::Rect shieldBar(106 - shield, 181, 106, 187);
-		surface->fillRect(shieldBar, front);
-	}
-}
-
 void DrillerEngine::drawAmigaAtariSTUI(Graphics::Surface *surface) {
 	uint32 white = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0xFF, 0xFF, 0xFF);
 	uint32 yellow = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0xFF, 0xFF, 0x55);
diff --git a/engines/freescape/games/driller/zx.cpp b/engines/freescape/games/driller/zx.cpp
new file mode 100644
index 00000000000..482bde642bc
--- /dev/null
+++ b/engines/freescape/games/driller/zx.cpp
@@ -0,0 +1,100 @@
+/* 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/>.
+ *
+ */
+
+#include "freescape/freescape.h"
+#include "freescape/language/8bitDetokeniser.h"
+
+namespace Freescape {
+
+void DrillerEngine::drawZXUI(Graphics::Surface *surface) {
+	uint32 color = 5;
+	uint8 r, g, b;
+
+	_gfx->readFromPalette(color, r, g, b);
+	uint32 front = _gfx->_texturePixelFormat.ARGBToColor(0xFF, r, g, b);
+
+	color = _currentArea->_usualBackgroundColor;
+	if (_gfx->_colorRemaps && _gfx->_colorRemaps->contains(color)) {
+		color = (*_gfx->_colorRemaps)[color];
+	}
+
+	_gfx->readFromPalette(color, r, g, b);
+	uint32 back = _gfx->_texturePixelFormat.ARGBToColor(0xFF, r, g, b);
+	uint32 white = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0xFF, 0xFF, 0xFF);
+
+	int score = _gameStateVars[k8bitVariableScore];
+	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), 72, 165, front, back, surface);
+	else
+		drawStringInSurface(Common::String::format("%s", "J"), 72, 165, front, 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), 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, 167, 181, back, front, surface);
+		_temporaryMessages.push_back(message);
+		_temporaryMessageDeadlines.push_back(deadline);
+	} else {
+		if (_currentArea->_gasPocketRadius == 0)
+			message = _messagesList[2];
+		else if (_drillStatusByArea[_currentArea->getAreaID()])
+			message = _messagesList[0];
+		else
+			message = _messagesList[1];
+
+		drawStringInSurface(message, 167, 181, front, back, surface);
+	}
+
+	int energy = _gameStateVars[k8bitVariableEnergy];
+	int shield = _gameStateVars[k8bitVariableShield];
+
+	if (energy >= 0) {
+		Common::Rect backBar(43, 188, 107 - energy, 194);
+		surface->fillRect(backBar, back);
+		Common::Rect energyBar(106 - energy, 188, 106, 194);
+		surface->fillRect(energyBar, front);
+	}
+
+	if (shield >= 0) {
+		Common::Rect backBar(43, 181, 107 - shield, 187);
+		surface->fillRect(backBar, back);
+
+		Common::Rect shieldBar(106 - shield, 181, 106, 187);
+		surface->fillRect(shieldBar, front);
+	}
+}
+
+} // End of namespace Freescape
\ No newline at end of file
diff --git a/engines/freescape/module.mk b/engines/freescape/module.mk
index bb36272aaa4..fd52dedacf2 100644
--- a/engines/freescape/module.mk
+++ b/engines/freescape/module.mk
@@ -9,6 +9,7 @@ MODULE_OBJS := \
 	games/driller/cpc.o \
 	games/driller/dos.o \
 	games/driller/driller.o \
+	games/driller/zx.o \
 	games/eclipse.o \
 	games/palettes.o \
 	gfx.o \


Commit: 52cac204a5b462469abc1459e6038ac37f81505f
    https://github.com/scummvm/scummvm/commit/52cac204a5b462469abc1459e6038ac37f81505f
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2023-02-24T16:05:34+01:00

Commit Message:
FREESCAPE: refactored driller amiga/atari code into a directory

Changed paths:
  A engines/freescape/games/driller/amiga.cpp
    engines/freescape/games/driller/driller.cpp
    engines/freescape/module.mk


diff --git a/engines/freescape/games/driller/amiga.cpp b/engines/freescape/games/driller/amiga.cpp
new file mode 100644
index 00000000000..913c267c33b
--- /dev/null
+++ b/engines/freescape/games/driller/amiga.cpp
@@ -0,0 +1,114 @@
+/* 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/>.
+ *
+ */
+
+#include "freescape/freescape.h"
+#include "freescape/language/8bitDetokeniser.h"
+
+/*
+This file contains specific code for both Ammiga and AtariST implementations of Driller
+*/
+
+namespace Freescape {
+
+void DrillerEngine::drawAmigaAtariSTUI(Graphics::Surface *surface) {
+	uint32 white = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0xFF, 0xFF, 0xFF);
+	uint32 yellow = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0xFF, 0xFF, 0x55);
+	uint32 brownish = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0x9E, 0x80, 0x20);
+	uint32 brown = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0x7E, 0x60, 0x19);
+	uint32 black = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0x00, 0x00, 0x00);
+	uint32 transparent = _gfx->_texturePixelFormat.ARGBToColor(0x00, 0x00, 0x00, 0x00);
+
+	int score = _gameStateVars[k8bitVariableScore];
+	Common::String coords;
+
+	if (!isDemo()) { // It seems demos will not include the complete font?
+		drawStringInSurface("x", 37, 18, white, transparent, surface, 82);
+		coords = Common::String::format("%04d", 2 * int(_position.x()));
+		for (int i = 0; i < 4; i++)
+			drawStringInSurface(Common::String(coords[i]), 47 + 6*i, 18, white, transparent, surface, 112);
+
+		drawStringInSurface("y", 37, 26, white, transparent, surface, 82);
+		coords = Common::String::format("%04d", 2 * int(_position.z())); // Coords y and z are swapped!
+		for (int i = 0; i < 4; i++)
+			drawStringInSurface(Common::String(coords[i]), 47 + 6*i, 26, white, transparent, surface, 112);
+
+		drawStringInSurface("z", 37, 34, white, transparent, surface, 82);
+		coords = Common::String::format("%04d", 2 * int(_position.y())); // Coords y and z are swapped!
+		for (int i = 0; i < 4; i++)
+			drawStringInSurface(Common::String(coords[i]), 47 + 6*i, 34, white, transparent, surface, 112);
+	}
+
+	drawStringInSurface(_currentArea->_name, 188, 185, yellow, black, surface);
+	drawStringInSurface(Common::String::format("%07d", score), 240, 129, yellow, black, surface);
+
+	int seconds, minutes, hours;
+	getTimeFromCountdown(seconds, minutes, hours);
+	drawStringInSurface(Common::String::format("%02d:", hours), 208, 7, yellow, black, surface);
+	drawStringInSurface(Common::String::format("%02d:", minutes), 230, 7, yellow, black, surface);
+	drawStringInSurface(Common::String::format("%02d", seconds), 254, 7, yellow, black, surface);
+
+	Common::String message;
+	int deadline;
+	getLatestMessages(message, deadline);
+	if (deadline <= _countdown) {
+		drawStringInSurface(message, 188, 177, black, yellow, surface);
+		_temporaryMessages.push_back(message);
+		_temporaryMessageDeadlines.push_back(deadline);
+	} else {
+		if (_currentArea->_gasPocketRadius == 0)
+			message = _messagesList[2];
+		else if (_drillStatusByArea[_currentArea->getAreaID()])
+			message = _messagesList[0];
+		else
+			message = _messagesList[1];
+
+		drawStringInSurface(message, 188, 177, yellow, black, surface);
+	}
+
+	int energy = _gameStateVars[k8bitVariableEnergy];
+	int shield = _gameStateVars[k8bitVariableShield];
+
+	if (shield >= 0) {
+		Common::Rect shieldBar;
+		shieldBar = Common::Rect(11, 178, 76 - (k8bitMaxShield - shield), 184);
+		surface->fillRect(shieldBar, brown);
+
+		shieldBar = Common::Rect(11, 179, 76 - (k8bitMaxShield - shield), 183);
+		surface->fillRect(shieldBar, brownish);
+
+		shieldBar = Common::Rect(11, 180, 76 - (k8bitMaxShield - shield), 182);
+		surface->fillRect(shieldBar, yellow);
+	}
+
+	if (energy >= 0) {
+		Common::Rect energyBar;
+		energyBar = Common::Rect(11, 186, 75 - (k8bitMaxEnergy - energy), 192);
+		surface->fillRect(energyBar, brown);
+
+		energyBar = Common::Rect(11, 187, 75 - (k8bitMaxEnergy - energy), 191);
+		surface->fillRect(energyBar, brownish);
+
+		energyBar = Common::Rect(11, 188, 75 - (k8bitMaxEnergy - energy), 190);
+		surface->fillRect(energyBar, yellow);
+	}
+}
+
+} // End of namespace Freescape
\ No newline at end of file
diff --git a/engines/freescape/games/driller/driller.cpp b/engines/freescape/games/driller/driller.cpp
index 0ece48d0123..73179d250e4 100644
--- a/engines/freescape/games/driller/driller.cpp
+++ b/engines/freescape/games/driller/driller.cpp
@@ -790,89 +790,6 @@ void DrillerEngine::drawC64UI(Graphics::Surface *surface) {
 	}
 }
 
-void DrillerEngine::drawAmigaAtariSTUI(Graphics::Surface *surface) {
-	uint32 white = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0xFF, 0xFF, 0xFF);
-	uint32 yellow = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0xFF, 0xFF, 0x55);
-	uint32 brownish = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0x9E, 0x80, 0x20);
-	uint32 brown = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0x7E, 0x60, 0x19);
-	uint32 black = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0x00, 0x00, 0x00);
-	uint32 transparent = _gfx->_texturePixelFormat.ARGBToColor(0x00, 0x00, 0x00, 0x00);
-
-	int score = _gameStateVars[k8bitVariableScore];
-	Common::String coords;
-
-	if (!isDemo()) { // It seems demos will not include the complete font?
-		drawStringInSurface("x", 37, 18, white, transparent, surface, 82);
-		coords = Common::String::format("%04d", 2 * int(_position.x()));
-		for (int i = 0; i < 4; i++)
-			drawStringInSurface(Common::String(coords[i]), 47 + 6*i, 18, white, transparent, surface, 112);
-
-		drawStringInSurface("y", 37, 26, white, transparent, surface, 82);
-		coords = Common::String::format("%04d", 2 * int(_position.z())); // Coords y and z are swapped!
-		for (int i = 0; i < 4; i++)
-			drawStringInSurface(Common::String(coords[i]), 47 + 6*i, 26, white, transparent, surface, 112);
-
-		drawStringInSurface("z", 37, 34, white, transparent, surface, 82);
-		coords = Common::String::format("%04d", 2 * int(_position.y())); // Coords y and z are swapped!
-		for (int i = 0; i < 4; i++)
-			drawStringInSurface(Common::String(coords[i]), 47 + 6*i, 34, white, transparent, surface, 112);
-	}
-
-	drawStringInSurface(_currentArea->_name, 188, 185, yellow, black, surface);
-	drawStringInSurface(Common::String::format("%07d", score), 240, 129, yellow, black, surface);
-
-	int seconds, minutes, hours;
-	getTimeFromCountdown(seconds, minutes, hours);
-	drawStringInSurface(Common::String::format("%02d:", hours), 208, 7, yellow, black, surface);
-	drawStringInSurface(Common::String::format("%02d:", minutes), 230, 7, yellow, black, surface);
-	drawStringInSurface(Common::String::format("%02d", seconds), 254, 7, yellow, black, surface);
-
-	Common::String message;
-	int deadline;
-	getLatestMessages(message, deadline);
-	if (deadline <= _countdown) {
-		drawStringInSurface(message, 188, 177, black, yellow, surface);
-		_temporaryMessages.push_back(message);
-		_temporaryMessageDeadlines.push_back(deadline);
-	} else {
-		if (_currentArea->_gasPocketRadius == 0)
-			message = _messagesList[2];
-		else if (_drillStatusByArea[_currentArea->getAreaID()])
-			message = _messagesList[0];
-		else
-			message = _messagesList[1];
-
-		drawStringInSurface(message, 188, 177, yellow, black, surface);
-	}
-
-	int energy = _gameStateVars[k8bitVariableEnergy];
-	int shield = _gameStateVars[k8bitVariableShield];
-
-	if (shield >= 0) {
-		Common::Rect shieldBar;
-		shieldBar = Common::Rect(11, 178, 76 - (k8bitMaxShield - shield), 184);
-		surface->fillRect(shieldBar, brown);
-
-		shieldBar = Common::Rect(11, 179, 76 - (k8bitMaxShield - shield), 183);
-		surface->fillRect(shieldBar, brownish);
-
-		shieldBar = Common::Rect(11, 180, 76 - (k8bitMaxShield - shield), 182);
-		surface->fillRect(shieldBar, yellow);
-	}
-
-	if (energy >= 0) {
-		Common::Rect energyBar;
-		energyBar = Common::Rect(11, 186, 75 - (k8bitMaxEnergy - energy), 192);
-		surface->fillRect(energyBar, brown);
-
-		energyBar = Common::Rect(11, 187, 75 - (k8bitMaxEnergy - energy), 191);
-		surface->fillRect(energyBar, brownish);
-
-		energyBar = Common::Rect(11, 188, 75 - (k8bitMaxEnergy - energy), 190);
-		surface->fillRect(energyBar, yellow);
-	}
-}
-
 void DrillerEngine::drawInfoMenu() {
 	_savedScreen = _gfx->getScreenshot();
 
diff --git a/engines/freescape/module.mk b/engines/freescape/module.mk
index fd52dedacf2..b3baab38526 100644
--- a/engines/freescape/module.mk
+++ b/engines/freescape/module.mk
@@ -6,6 +6,7 @@ MODULE_OBJS := \
 	freescape.o \
 	games/castle.o \
 	games/dark.o \
+	games/driller/amiga.o \
 	games/driller/cpc.o \
 	games/driller/dos.o \
 	games/driller/driller.o \


Commit: 4119ec9bb38ad32ff82ff2e9913c72cf7e9f2f1d
    https://github.com/scummvm/scummvm/commit/4119ec9bb38ad32ff82ff2e9913c72cf7e9f2f1d
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2023-02-24T16:05:34+01:00

Commit Message:
FREESCAPE: refactored/moved driller code for loading assets in different platforms code

Changed paths:
    engines/freescape/freescape.h
    engines/freescape/games/driller/amiga.cpp
    engines/freescape/games/driller/cpc.cpp
    engines/freescape/games/driller/dos.cpp
    engines/freescape/games/driller/driller.cpp
    engines/freescape/games/driller/zx.cpp


diff --git a/engines/freescape/freescape.h b/engines/freescape/freescape.h
index f45c683dfc4..8b05dd4291b 100644
--- a/engines/freescape/freescape.h
+++ b/engines/freescape/freescape.h
@@ -439,6 +439,18 @@ private:
 	void loadAssetsDemo();
 	void loadAssetsFullGame();
 
+	void loadAssetsAmigaFullGame();
+	void loadAssetsAmigaDemo();
+
+	void loadAssetsDOSFullGame();
+	void loadAssetsDOSDemo();
+
+	void loadAssetsZXFullGame();
+	void loadAssetsZXDemo();
+
+	void loadAssetsCPCFullGame();
+	void loadAssetsCPCDemo();
+
 	void drawDOSUI(Graphics::Surface *surface);
 	void drawZXUI(Graphics::Surface *surface);
 	void drawCPCUI(Graphics::Surface *surface);
diff --git a/engines/freescape/games/driller/amiga.cpp b/engines/freescape/games/driller/amiga.cpp
index 913c267c33b..f1a6e01b542 100644
--- a/engines/freescape/games/driller/amiga.cpp
+++ b/engines/freescape/games/driller/amiga.cpp
@@ -18,16 +18,122 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  *
  */
+#include "common/file.h"
 
 #include "freescape/freescape.h"
 #include "freescape/language/8bitDetokeniser.h"
 
+namespace Freescape {
+
+void DrillerEngine::loadAssetsAmigaFullGame() {
+	Common::File file;
+	if (_variant & GF_AMIGA_RETAIL) {
+		file.open("driller");
+
+		if (!file.isOpen())
+			error("Failed to open 'driller' executable for Amiga");
+
+		_border = loadAndConvertNeoImage(&file, 0x137f4);
+		byte *palette = (byte *)malloc(16 * 3);
+		for (int i = 0; i < 16; i++) { // gray scale palette
+			palette[i * 3 + 0] = i * (255 / 16);
+			palette[i * 3 + 1] = i * (255 / 16);
+			palette[i * 3 + 2] = i * (255 / 16);
+		}
+		_title = loadAndConvertNeoImage(&file, 0x10, palette);
+
+		loadFonts(&file, 0x8940);
+		loadMessagesFixedSize(&file, 0xc66e, 14, 20);
+		loadGlobalObjects(&file, 0xbd62);
+		load8bitBinary(&file, 0x29c16, 16);
+		loadPalettes(&file, 0x297d4);
+		loadSoundsFx(&file, 0x30e80, 25);
+	} else if (_variant & GF_AMIGA_BUDGET) {
+		file.open("lift.neo");
+		if (!file.isOpen())
+			error("Failed to open 'lift.neo' file");
+
+		_title = loadAndConvertNeoImage(&file, 0);
+
+		file.close();
+		file.open("console.neo");
+		if (!file.isOpen())
+			error("Failed to open 'console.neo' file");
+
+		_border = loadAndConvertNeoImage(&file, 0);
+
+		file.close();
+		file.open("driller");
+		if (!file.isOpen())
+			error("Failed to open 'driller' executable for Amiga");
+
+		loadFonts(&file, 0xa62);
+		loadMessagesFixedSize(&file, 0x499a, 14, 20);
+		loadGlobalObjects(&file, 0x4098);
+		load8bitBinary(&file, 0x21a3e, 16);
+		loadPalettes(&file, 0x215fc);
+
+		file.close();
+		file.open("soundfx");
+		if (!file.isOpen())
+			error("Failed to open 'soundfx' executable for Amiga");
+
+		loadSoundsFx(&file, 0, 25);
+	} else
+		error("Invalid or unknown Amiga release");
+}
+
+void DrillerEngine::loadAssetsAmigaDemo() {
+	Common::File file;
+	file.open("lift.neo");
+	if (!file.isOpen())
+		error("Failed to open 'lift.neo' file");
+
+	_title = loadAndConvertNeoImage(&file, 0);
+
+	file.close();
+	file.open("console.neo");
+	if (!file.isOpen())
+		error("Failed to open 'console.neo' file");
+
+	_border = loadAndConvertNeoImage(&file, 0);
+
+	file.close();
+	file.open("demo.cmd");
+	if (!file.isOpen())
+		error("Failed to open 'demo.cmd' file");
+
+	loadDemoData(&file, 0, 0x1000);
+
+	file.close();
+	file.open("data");
+	if (!file.isOpen())
+		error("Failed to open 'data' file");
+
+	load8bitBinary(&file, 0x442, 16);
+	loadPalettes(&file, 0x0);
+
+	file.close();
+	file.open("driller");
+	if (!file.isOpen())
+		error("Failed to open 'driller' file");
+
+	loadFonts(&file, 0xa30);
+	loadMessagesFixedSize(&file, 0x3960, 14, 20);
+	loadGlobalObjects(&file, 0x3716);
+
+	file.close();
+	file.open("soundfx");
+	if (!file.isOpen())
+		error("Failed to open 'soundfx' executable for Amiga");
+
+	loadSoundsFx(&file, 0, 25);
+}
+
 /*
-This file contains specific code for both Ammiga and AtariST implementations of Driller
+The following function contains specific UI code for both Amiga and AtariST
 */
 
-namespace Freescape {
-
 void DrillerEngine::drawAmigaAtariSTUI(Graphics::Surface *surface) {
 	uint32 white = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0xFF, 0xFF, 0xFF);
 	uint32 yellow = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0xFF, 0xFF, 0x55);
diff --git a/engines/freescape/games/driller/cpc.cpp b/engines/freescape/games/driller/cpc.cpp
index dce9d4a6110..8bf22b5df99 100644
--- a/engines/freescape/games/driller/cpc.cpp
+++ b/engines/freescape/games/driller/cpc.cpp
@@ -20,6 +20,7 @@
  */
 
 #include "common/file.h"
+#include "common/memstream.h"
 
 #include "freescape/freescape.h"
 #include "freescape/language/8bitDetokeniser.h"
@@ -122,6 +123,41 @@ void deobfuscateDrillerCPCVirtualWorlds(byte *memBuffer) {
 	}
 }
 
+void DrillerEngine::loadAssetsCPCFullGame() {
+	Common::File file;
+
+	loadBundledImages();
+	byte *memBuffer;
+	int memSize = 0;
+	if (_variant & GF_CPC_VIRTUALWORLDS) {
+		memBuffer = parseEDSK("virtualworlds.A.cpc.edsk", memSize);
+		deobfuscateDrillerCPCVirtualWorlds(memBuffer);
+	} else
+		memBuffer = parseEDSK("driller.cpc.edsk", memSize);
+	assert(memSize > 0);
+	Common::SeekableReadStream *stream = new Common::MemoryReadStream((const byte*)memBuffer, memSize);
+
+	if (_variant & GF_CPC_RETAIL) {
+		loadMessagesFixedSize(stream, 0xb0f7, 14, 20);
+		loadFonts(stream, 0xeb14);
+		load8bitBinary(stream, 0xec76, 4);
+		loadGlobalObjects(stream, 0xacb2);
+	} else if (_variant & GF_CPC_RETAIL2) {
+		loadMessagesFixedSize(stream, 0xb0f7 - 0x3fab, 14, 20);
+		loadFonts(stream, 0xeb14 - 0x3fab);
+		load8bitBinary(stream, 0xaccb, 4);
+		loadGlobalObjects(stream, 0xacb2 - 0x3fab);
+	} else if (_variant & _variant & GF_CPC_VIRTUALWORLDS) {
+		load8bitBinary(stream, 0x11acb, 4);
+	} else if (_variant & GF_CPC_BUDGET) {
+		loadMessagesFixedSize(stream, 0x9ef7, 14, 20);
+		loadFonts(stream, 0xd914);
+		load8bitBinary(stream, 0xda76, 4);
+		loadGlobalObjects(stream, 0x9ab2);
+	} else
+		error("Unknown Amstrad CPC variant");
+}
+
 void DrillerEngine::drawCPCUI(Graphics::Surface *surface) {
 	uint32 color = 1;
 	uint8 r, g, b;
diff --git a/engines/freescape/games/driller/dos.cpp b/engines/freescape/games/driller/dos.cpp
index ad61fa078d0..bb3f0b52d32 100644
--- a/engines/freescape/games/driller/dos.cpp
+++ b/engines/freescape/games/driller/dos.cpp
@@ -19,6 +19,8 @@
  *
  */
 
+#include "common/file.h"
+
 #include "freescape/freescape.h"
 #include "freescape/language/8bitDetokeniser.h"
 
@@ -178,6 +180,76 @@ Graphics::Surface *DrillerEngine::load8bitTitleImage(Common::SeekableReadStream
 	}
 	return surface;
 }
+void DrillerEngine::loadAssetsDOSFullGame() {
+	Common::File file;
+	if (_renderMode == Common::kRenderEGA) {
+		file.open("SCN1E.DAT");
+		if (file.isOpen()) {
+			_title = load8bitBinImage(&file, 0x0);
+		}
+		file.close();
+		file.open("EGATITLE.RL");
+		if (file.isOpen()) {
+			_title = load8bitTitleImage(&file, 0x1b3);
+		}
+		file.close();
+
+		file.open("DRILLE.EXE");
+
+		if (!file.isOpen())
+			error("Failed to open DRILLE.EXE");
+
+		loadMessagesFixedSize(&file, 0x4135, 14, 20);
+		loadFonts(&file, 0x99dd);
+		loadGlobalObjects(&file, 0x3b42);
+		load8bitBinary(&file, 0x9b40, 16);
+		_border = load8bitBinImage(&file, 0x210);
+	} else if (_renderMode == Common::kRenderCGA) {
+		file.open("SCN1C.DAT");
+		if (file.isOpen()) {
+			_title = load8bitBinImage(&file, 0x0);
+		}
+		file.close();
+		file.open("CGATITLE.RL");
+		if (file.isOpen()) {
+			_title = load8bitTitleImage(&file, 0x1b3);
+		}
+		file.close();
+		file.open("DRILLC.EXE");
+
+		if (!file.isOpen())
+			error("Failed to open DRILLC.EXE");
+
+		loadFonts(&file, 0x07a4a);
+		loadMessagesFixedSize(&file, 0x2585, 14, 20);
+		load8bitBinary(&file, 0x7bb0, 4);
+		loadGlobalObjects(&file, 0x1fa2);
+		_border = load8bitBinImage(&file, 0x210);
+	} else
+		error("Unsupported video mode for DOS");
+}
+
+void DrillerEngine::loadAssetsDOSDemo() {
+	Common::File file;
+	_renderMode = Common::kRenderCGA; // DOS demos is CGA only
+	_viewArea = Common::Rect(36, 16, 284, 117); // correct view area
+	_gfx->_renderMode = _renderMode;
+	loadBundledImages();
+	file.open("d2");
+	if (!file.isOpen())
+		error("Failed to open 'd2' file");
+
+	loadFonts(&file, 0x4eb0);
+	loadMessagesFixedSize(&file, 0x636, 14, 20);
+	load8bitBinary(&file, 0x55b0, 4);
+	loadGlobalObjects(&file, 0x8c);
+
+	// Fixed for a corrupted area names in the demo data
+	_areaMap[2]->_name = "LAPIS LAZULI";
+	_areaMap[3]->_name = "EMERALD";
+	_areaMap[8]->_name = "TOPAZ";
+	file.close();
+}
 
 void DrillerEngine::drawDOSUI(Graphics::Surface *surface) {
 	uint32 color = _renderMode == Common::kRenderCGA ? 1 : 14;
diff --git a/engines/freescape/games/driller/driller.cpp b/engines/freescape/games/driller/driller.cpp
index 73179d250e4..f1ea313ea11 100644
--- a/engines/freescape/games/driller/driller.cpp
+++ b/engines/freescape/games/driller/driller.cpp
@@ -22,7 +22,6 @@
 #include "common/config-manager.h"
 #include "common/events.h"
 #include "common/file.h"
-#include "common/memstream.h"
 #include "common/random.h"
 
 #include "freescape/freescape.h"
@@ -279,49 +278,7 @@ void DrillerEngine::loadAssets() {
 void DrillerEngine::loadAssetsDemo() {
 	Common::File file;
 	if (isAmiga()) {
-		file.open("lift.neo");
-		if (!file.isOpen())
-			error("Failed to open 'lift.neo' file");
-
-		_title = loadAndConvertNeoImage(&file, 0);
-
-		file.close();
-		file.open("console.neo");
-		if (!file.isOpen())
-			error("Failed to open 'console.neo' file");
-
-		_border = loadAndConvertNeoImage(&file, 0);
-
-		file.close();
-		file.open("demo.cmd");
-		if (!file.isOpen())
-			error("Failed to open 'demo.cmd' file");
-
-		loadDemoData(&file, 0, 0x1000);
-
-		file.close();
-		file.open("data");
-		if (!file.isOpen())
-			error("Failed to open 'data' file");
-
-		load8bitBinary(&file, 0x442, 16);
-		loadPalettes(&file, 0x0);
-
-		file.close();
-		file.open("driller");
-		if (!file.isOpen())
-			error("Failed to open 'driller' file");
-
-		loadFonts(&file, 0xa30);
-		loadMessagesFixedSize(&file, 0x3960, 14, 20);
-		loadGlobalObjects(&file, 0x3716);
-
-		file.close();
-		file.open("soundfx");
-		if (!file.isOpen())
-			error("Failed to open 'soundfx' executable for Amiga");
-
-		loadSoundsFx(&file, 0, 25);
+		loadAssetsAmigaDemo();
 	} else if (isAtariST()) {
 		file.open("lift.neo");
 		if (!file.isOpen())
@@ -368,24 +325,7 @@ void DrillerEngine::loadAssetsDemo() {
 
 		loadSoundsFx(&file, 0, 25);
 	} else if (isDOS()) {
-		_renderMode = Common::kRenderCGA; // DOS demos is CGA only
-		_viewArea = Common::Rect(36, 16, 284, 117); // correct view area
-		_gfx->_renderMode = _renderMode;
-		loadBundledImages();
-		file.open("d2");
-		if (!file.isOpen())
-			error("Failed to open 'd2' file");
-
-		loadFonts(&file, 0x4eb0);
-		loadMessagesFixedSize(&file, 0x636, 14, 20);
-		load8bitBinary(&file, 0x55b0, 4);
-		loadGlobalObjects(&file, 0x8c);
-
-		// Fixed for a corrupted area names in the demo data
-		_areaMap[2]->_name = "LAPIS LAZULI";
-		_areaMap[3]->_name = "EMERALD";
-		_areaMap[8]->_name = "TOPAZ";
-		file.close();
+		loadAssetsDOSDemo();
 	} else
 		error("Unsupported demo for Driller");
 
@@ -393,67 +333,10 @@ void DrillerEngine::loadAssetsDemo() {
 	_angleRotationIndex = 0;
 }
 
-extern byte *parseEDSK(const Common::String filename, int &size);
-extern void deobfuscateDrillerCPCVirtualWorlds(byte *memBuffer);
-
 void DrillerEngine::loadAssetsFullGame() {
 	Common::File file;
 	if (isAmiga()) {
-		if (_variant & GF_AMIGA_RETAIL) {
-			file.open("driller");
-
-			if (!file.isOpen())
-				error("Failed to open 'driller' executable for Amiga");
-
-			_border = loadAndConvertNeoImage(&file, 0x137f4);
-			byte *palette = (byte *)malloc(16 * 3);
-			for (int i = 0; i < 16; i++) { // gray scale palette
-				palette[i * 3 + 0] = i * (255 / 16);
-				palette[i * 3 + 1] = i * (255 / 16);
-				palette[i * 3 + 2] = i * (255 / 16);
-			}
-			_title = loadAndConvertNeoImage(&file, 0x10, palette);
-
-			loadFonts(&file, 0x8940);
-			loadMessagesFixedSize(&file, 0xc66e, 14, 20);
-			loadGlobalObjects(&file, 0xbd62);
-			load8bitBinary(&file, 0x29c16, 16);
-			loadPalettes(&file, 0x297d4);
-			loadSoundsFx(&file, 0x30e80, 25);
-		} else if (_variant & GF_AMIGA_BUDGET) {
-			file.open("lift.neo");
-			if (!file.isOpen())
-				error("Failed to open 'lift.neo' file");
-
-			_title = loadAndConvertNeoImage(&file, 0);
-
-			file.close();
-			file.open("console.neo");
-			if (!file.isOpen())
-				error("Failed to open 'console.neo' file");
-
-			_border = loadAndConvertNeoImage(&file, 0);
-
-			file.close();
-			file.open("driller");
-			if (!file.isOpen())
-				error("Failed to open 'driller' executable for Amiga");
-
-			loadFonts(&file, 0xa62);
-			loadMessagesFixedSize(&file, 0x499a, 14, 20);
-			loadGlobalObjects(&file, 0x4098);
-			load8bitBinary(&file, 0x21a3e, 16);
-			loadPalettes(&file, 0x215fc);
-
-			file.close();
-			file.open("soundfx");
-			if (!file.isOpen())
-				error("Failed to open 'soundfx' executable for Amiga");
-
-			loadSoundsFx(&file, 0, 25);
-		}
-		else
-			error("Invalid or unknown Amiga release");
+		loadAssetsAmigaFullGame();
 	} else if (isAtariST()) {
 		file.open("x.prg");
 
@@ -476,83 +359,9 @@ void DrillerEngine::loadAssetsFullGame() {
 		loadPalettes(&file, 0x296fa);
 		loadSoundsFx(&file, 0x30da6, 25);
 	} else if (isSpectrum()) {
-		file.open("driller.zx.title");
-		if (file.isOpen()) {
-			_title = loadAndCenterScrImage(&file);
-		} else
-			error("Unable to find driller.zx.title");
-
-		file.close();
-
-		file.open("driller.zx.border");
-		if (file.isOpen()) {
-			_border = loadAndCenterScrImage(&file);
-		} else
-			error("Unable to find driller.zx.border");
-		file.close();
-
-		file.open("driller.zx.data");
-
-		if (!file.isOpen())
-			error("Failed to open driller.zx.data");
-
-		if (_variant & GF_ZX_DISC)
-			loadMessagesFixedSize(&file, 0x2164, 14, 20);
-		else
-			loadMessagesFixedSize(&file, 0x20e4, 14, 20);
-
-		if (_variant & GF_ZX_RETAIL)
-			loadFonts(&file, 0x62ca);
-		else if (_variant & GF_ZX_BUDGET)
-			loadFonts(&file, 0x5aa8);
-		else if (_variant & GF_ZX_DISC)
-			loadFonts(&file, 0x63f0);
-
-		if (_variant & GF_ZX_DISC)
-			loadGlobalObjects(&file, 0x1d13);
-		else
-			loadGlobalObjects(&file, 0x1c93);
-
-		if (_variant & GF_ZX_RETAIL)
-			load8bitBinary(&file, 0x642c, 4);
-		else if (_variant & GF_ZX_BUDGET)
-			load8bitBinary(&file, 0x5c0a, 4);
-		else if (_variant & GF_ZX_DISC)
-			load8bitBinary(&file, 0x6552, 4);
-
-		else
-			error("Unknown ZX spectrum variant");
+		loadAssetsZXFullGame();
 	} else if (isCPC()) {
-		loadBundledImages();
-		byte *memBuffer;
-		int memSize = 0;
-		if (_variant & GF_CPC_VIRTUALWORLDS) {
-			memBuffer = parseEDSK("virtualworlds.A.cpc.edsk", memSize);
-			deobfuscateDrillerCPCVirtualWorlds(memBuffer);
-		} else
-			memBuffer = parseEDSK("driller.cpc.edsk", memSize);
-		assert(memSize > 0);
-		Common::SeekableReadStream *stream = new Common::MemoryReadStream((const byte*)memBuffer, memSize);
-
-		if (_variant & GF_CPC_RETAIL) {
-			loadMessagesFixedSize(stream, 0xb0f7, 14, 20);
-			loadFonts(stream, 0xeb14);
-			load8bitBinary(stream, 0xec76, 4);
-			loadGlobalObjects(stream, 0xacb2);
-		} else if (_variant & GF_CPC_RETAIL2) {
-			loadMessagesFixedSize(stream, 0xb0f7 - 0x3fab, 14, 20);
-			loadFonts(stream, 0xeb14 - 0x3fab);
-			load8bitBinary(stream, 0xaccb, 4);
-			loadGlobalObjects(stream, 0xacb2 - 0x3fab);
-		} else if (_variant & _variant & GF_CPC_VIRTUALWORLDS) {
-			load8bitBinary(stream, 0x11acb, 4);
-		} else if (_variant & GF_CPC_BUDGET) {
-			loadMessagesFixedSize(stream, 0x9ef7, 14, 20);
-			loadFonts(stream, 0xd914);
-			load8bitBinary(stream, 0xda76, 4);
-			loadGlobalObjects(stream, 0x9ab2);
-		} else
-			error("Unknown Amstrad CPC variant");
+		loadAssetsCPCFullGame();
 	} else if (isC64()) {
 		if (_targetName.hasPrefix("spacestationoblivion")) {
 			loadBundledImages();
@@ -568,49 +377,8 @@ void DrillerEngine::loadAssetsFullGame() {
 			load8bitBinary(&file, 0x8e02 - 0x400, 4);
 			loadGlobalObjects(&file, 0x1855 - 0x400);
 		}
-	} else if (_renderMode == Common::kRenderEGA) {
-		file.open("SCN1E.DAT");
-		if (file.isOpen()) {
-			_title = load8bitBinImage(&file, 0x0);
-		}
-		file.close();
-		file.open("EGATITLE.RL");
-		if (file.isOpen()) {
-			_title = load8bitTitleImage(&file, 0x1b3);
-		}
-		file.close();
-
-		file.open("DRILLE.EXE");
-
-		if (!file.isOpen())
-			error("Failed to open DRILLE.EXE");
-
-		loadMessagesFixedSize(&file, 0x4135, 14, 20);
-		loadFonts(&file, 0x99dd);
-		loadGlobalObjects(&file, 0x3b42);
-		load8bitBinary(&file, 0x9b40, 16);
-		_border = load8bitBinImage(&file, 0x210);
-	} else if (_renderMode == Common::kRenderCGA) {
-		file.open("SCN1C.DAT");
-		if (file.isOpen()) {
-			_title = load8bitBinImage(&file, 0x0);
-		}
-		file.close();
-		file.open("CGATITLE.RL");
-		if (file.isOpen()) {
-			_title = load8bitTitleImage(&file, 0x1b3);
-		}
-		file.close();
-		file.open("DRILLC.EXE");
-
-		if (!file.isOpen())
-			error("Failed to open DRILLC.EXE");
-
-		loadFonts(&file, 0x07a4a);
-		loadMessagesFixedSize(&file, 0x2585, 14, 20);
-		load8bitBinary(&file, 0x7bb0, 4);
-		loadGlobalObjects(&file, 0x1fa2);
-		_border = load8bitBinImage(&file, 0x210);
+	} else if (isDOS()) {
+		loadAssetsDOSFullGame();
 	} else
 		error("Invalid or unsupported render mode %s for Driller", Common::getRenderModeDescription(_renderMode));
 
diff --git a/engines/freescape/games/driller/zx.cpp b/engines/freescape/games/driller/zx.cpp
index 482bde642bc..a8f1a4658e3 100644
--- a/engines/freescape/games/driller/zx.cpp
+++ b/engines/freescape/games/driller/zx.cpp
@@ -18,12 +18,63 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  *
  */
+#include "common/file.h"
 
 #include "freescape/freescape.h"
 #include "freescape/language/8bitDetokeniser.h"
 
 namespace Freescape {
 
+void DrillerEngine::loadAssetsZXFullGame() {
+	Common::File file;
+	file.open("driller.zx.title");
+	if (file.isOpen()) {
+		_title = loadAndCenterScrImage(&file);
+	} else
+		error("Unable to find driller.zx.title");
+
+	file.close();
+
+	file.open("driller.zx.border");
+	if (file.isOpen()) {
+		_border = loadAndCenterScrImage(&file);
+	} else
+		error("Unable to find driller.zx.border");
+	file.close();
+
+	file.open("driller.zx.data");
+
+	if (!file.isOpen())
+		error("Failed to open driller.zx.data");
+
+	if (_variant & GF_ZX_DISC)
+		loadMessagesFixedSize(&file, 0x2164, 14, 20);
+	else
+		loadMessagesFixedSize(&file, 0x20e4, 14, 20);
+
+	if (_variant & GF_ZX_RETAIL)
+		loadFonts(&file, 0x62ca);
+	else if (_variant & GF_ZX_BUDGET)
+		loadFonts(&file, 0x5aa8);
+	else if (_variant & GF_ZX_DISC)
+		loadFonts(&file, 0x63f0);
+
+	if (_variant & GF_ZX_DISC)
+		loadGlobalObjects(&file, 0x1d13);
+	else
+		loadGlobalObjects(&file, 0x1c93);
+
+	if (_variant & GF_ZX_RETAIL)
+		load8bitBinary(&file, 0x642c, 4);
+	else if (_variant & GF_ZX_BUDGET)
+		load8bitBinary(&file, 0x5c0a, 4);
+	else if (_variant & GF_ZX_DISC)
+		load8bitBinary(&file, 0x6552, 4);
+
+	else
+		error("Unknown ZX spectrum variant");
+}
+
 void DrillerEngine::drawZXUI(Graphics::Surface *surface) {
 	uint32 color = 5;
 	uint8 r, g, b;


Commit: 5eda37b6d5bbabf1a35fe8bb905d0333cf708adb
    https://github.com/scummvm/scummvm/commit/5eda37b6d5bbabf1a35fe8bb905d0333cf708adb
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2023-02-24T16:05:34+01:00

Commit Message:
FREESCAPE: refactored/moved driller code specific for the atari release

Changed paths:
  A engines/freescape/games/driller/atari.cpp
    engines/freescape/freescape.h
    engines/freescape/games/driller/driller.cpp
    engines/freescape/module.mk


diff --git a/engines/freescape/freescape.h b/engines/freescape/freescape.h
index 8b05dd4291b..94521c68e43 100644
--- a/engines/freescape/freescape.h
+++ b/engines/freescape/freescape.h
@@ -439,6 +439,9 @@ private:
 	void loadAssetsDemo();
 	void loadAssetsFullGame();
 
+	void loadAssetsAtariFullGame();
+	void loadAssetsAtariDemo();
+
 	void loadAssetsAmigaFullGame();
 	void loadAssetsAmigaDemo();
 
diff --git a/engines/freescape/games/driller/atari.cpp b/engines/freescape/games/driller/atari.cpp
new file mode 100644
index 00000000000..6c2fe74a4ff
--- /dev/null
+++ b/engines/freescape/games/driller/atari.cpp
@@ -0,0 +1,100 @@
+/* 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/>.
+ *
+ */
+#include "common/file.h"
+
+#include "freescape/freescape.h"
+#include "freescape/language/8bitDetokeniser.h"
+
+namespace Freescape {
+
+void DrillerEngine::loadAssetsAtariFullGame() {
+	Common::File file;
+	file.open("x.prg");
+
+	if (!file.isOpen())
+		error("Failed to open 'x.prg' executable for AtariST");
+
+	_border = loadAndConvertNeoImage(&file, 0x1371a);
+	byte *palette = (byte *)malloc(16 * 3);
+	for (int i = 0; i < 16; i++) { // gray scale palette
+		palette[i * 3 + 0] = i * (255 / 16);
+		palette[i * 3 + 1] = i * (255 / 16);
+		palette[i * 3 + 2] = i * (255 / 16);
+	}
+	_title = loadAndConvertNeoImage(&file, 0x10, palette);
+
+	loadFonts(&file, 0x8a32);
+	loadMessagesFixedSize(&file, 0xc5d8, 14, 20);
+	loadGlobalObjects(&file, 0xbccc);
+	load8bitBinary(&file, 0x29b3c, 16);
+	loadPalettes(&file, 0x296fa);
+	loadSoundsFx(&file, 0x30da6, 25);
+}
+
+void DrillerEngine::loadAssetsAtariDemo() {
+	Common::File file;
+	file.open("lift.neo");
+	if (!file.isOpen())
+		error("Failed to open 'lift.neo' file");
+
+	_title = loadAndConvertNeoImage(&file, 0);
+
+	file.close();
+	file.open("console.neo");
+	if (!file.isOpen())
+		error("Failed to open 'console.neo' file");
+
+	_border = loadAndConvertNeoImage(&file, 0);
+
+	file.close();
+	file.open("demo.cmd");
+	if (!file.isOpen())
+		error("Failed to open 'demo.cmd' file");
+
+	loadDemoData(&file, 0, 0x1000);
+
+	file.close();
+	file.open("data");
+
+	if (!file.isOpen())
+		error("Failed to open 'data' file");
+
+	load8bitBinary(&file, 0x442, 16);
+	loadPalettes(&file, 0x0);
+
+	file.close();
+	file.open("x.prg");
+	if (!file.isOpen())
+		error("Failed to open 'x.prg' file");
+
+	loadFonts(&file, 0x7bc);
+	loadMessagesFixedSize(&file, 0x3b90, 14, 20);
+	loadGlobalObjects(&file, 0x3946);
+
+	file.close();
+	file.open("soundfx");
+	if (!file.isOpen())
+		error("Failed to open 'soundfx' executable for AtariST demo");
+
+	loadSoundsFx(&file, 0, 25);
+}
+
+} // End of namespace Freescape
\ No newline at end of file
diff --git a/engines/freescape/games/driller/driller.cpp b/engines/freescape/games/driller/driller.cpp
index f1ea313ea11..752eeed6d96 100644
--- a/engines/freescape/games/driller/driller.cpp
+++ b/engines/freescape/games/driller/driller.cpp
@@ -280,50 +280,7 @@ void DrillerEngine::loadAssetsDemo() {
 	if (isAmiga()) {
 		loadAssetsAmigaDemo();
 	} else if (isAtariST()) {
-		file.open("lift.neo");
-		if (!file.isOpen())
-			error("Failed to open 'lift.neo' file");
-
-		_title = loadAndConvertNeoImage(&file, 0);
-
-		file.close();
-		file.open("console.neo");
-		if (!file.isOpen())
-			error("Failed to open 'console.neo' file");
-
-		_border = loadAndConvertNeoImage(&file, 0);
-
-		file.close();
-		file.open("demo.cmd");
-		if (!file.isOpen())
-			error("Failed to open 'demo.cmd' file");
-
-		loadDemoData(&file, 0, 0x1000);
-
-		file.close();
-		file.open("data");
-
-		if (!file.isOpen())
-			error("Failed to open 'data' file");
-
-		load8bitBinary(&file, 0x442, 16);
-		loadPalettes(&file, 0x0);
-
-		file.close();
-		file.open("x.prg");
-		if (!file.isOpen())
-			error("Failed to open 'x.prg' file");
-
-		loadFonts(&file, 0x7bc);
-		loadMessagesFixedSize(&file, 0x3b90, 14, 20);
-		loadGlobalObjects(&file, 0x3946);
-
-		file.close();
-		file.open("soundfx");
-		if (!file.isOpen())
-			error("Failed to open 'soundfx' executable for AtariST demo");
-
-		loadSoundsFx(&file, 0, 25);
+		loadAssetsAtariDemo();
 	} else if (isDOS()) {
 		loadAssetsDOSDemo();
 	} else
@@ -338,26 +295,7 @@ void DrillerEngine::loadAssetsFullGame() {
 	if (isAmiga()) {
 		loadAssetsAmigaFullGame();
 	} else if (isAtariST()) {
-		file.open("x.prg");
-
-		if (!file.isOpen())
-			error("Failed to open 'x.prg' executable for AtariST");
-
-		_border = loadAndConvertNeoImage(&file, 0x1371a);
-		byte *palette = (byte *)malloc(16 * 3);
-		for (int i = 0; i < 16; i++) { // gray scale palette
-			palette[i * 3 + 0] = i * (255 / 16);
-			palette[i * 3 + 1] = i * (255 / 16);
-			palette[i * 3 + 2] = i * (255 / 16);
-		}
-		_title = loadAndConvertNeoImage(&file, 0x10, palette);
-
-		loadFonts(&file, 0x8a32);
-		loadMessagesFixedSize(&file, 0xc5d8, 14, 20);
-		loadGlobalObjects(&file, 0xbccc);
-		load8bitBinary(&file, 0x29b3c, 16);
-		loadPalettes(&file, 0x296fa);
-		loadSoundsFx(&file, 0x30da6, 25);
+		loadAssetsAtariFullGame();
 	} else if (isSpectrum()) {
 		loadAssetsZXFullGame();
 	} else if (isCPC()) {
diff --git a/engines/freescape/module.mk b/engines/freescape/module.mk
index b3baab38526..0d3c8b7d085 100644
--- a/engines/freescape/module.mk
+++ b/engines/freescape/module.mk
@@ -7,6 +7,7 @@ MODULE_OBJS := \
 	games/castle.o \
 	games/dark.o \
 	games/driller/amiga.o \
+	games/driller/atari.o \
 	games/driller/cpc.o \
 	games/driller/dos.o \
 	games/driller/driller.o \




More information about the Scummvm-git-logs mailing list