[Scummvm-git-logs] scummvm master -> 54ae69f648ac90e958a6118213db2355fbd13ae1

neuromancer noreply at scummvm.org
Sat Jan 7 11:11:43 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:
66d89f3b73 FREESCAPE: improved parsing of Driller for C64
54ae69f648 FREESCAPE: fixed issue when adding the same type of game twice and regenerated freescape.dat file


Commit: 66d89f3b73618e437ff044bb81acc96ea181d77c
    https://github.com/scummvm/scummvm/commit/66d89f3b73618e437ff044bb81acc96ea181d77c
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2023-01-07T08:11:32-03:00

Commit Message:
FREESCAPE: improved parsing of Driller for C64

Changed paths:
    engines/freescape/freescape.cpp
    engines/freescape/freescape.h
    engines/freescape/games/driller.cpp
    engines/freescape/loaders/8bitBinaryLoader.cpp


diff --git a/engines/freescape/freescape.cpp b/engines/freescape/freescape.cpp
index 54c77270779..0ace1097bb5 100644
--- a/engines/freescape/freescape.cpp
+++ b/engines/freescape/freescape.cpp
@@ -682,7 +682,7 @@ void FreescapeEngine::drawStringInSurface(const Common::String &str, int x, int
 	Common::String ustr = str;
 	ustr.toUppercase();
 
-	if (isDOS() || isSpectrum() || isCPC()) {
+	if (isDOS() || isSpectrum() || isCPC() || isC64()) {
 		for (uint32 c = 0; c < ustr.size(); c++) {
 			assert(ustr[c] >= 32);
 			for (int j = 0; j < 6; j++) {
diff --git a/engines/freescape/freescape.h b/engines/freescape/freescape.h
index 3c9fbe997c6..8236dc708bb 100644
--- a/engines/freescape/freescape.h
+++ b/engines/freescape/freescape.h
@@ -396,6 +396,7 @@ private:
 	void drawDOSUI(Graphics::Surface *surface);
 	void drawZXUI(Graphics::Surface *surface);
 	void drawCPCUI(Graphics::Surface *surface);
+	void drawC64UI(Graphics::Surface *surface);
 	void drawAmigaAtariSTUI(Graphics::Surface *surface);
 };
 
diff --git a/engines/freescape/games/driller.cpp b/engines/freescape/games/driller.cpp
index 37feeff1249..dacfb2806bf 100644
--- a/engines/freescape/games/driller.cpp
+++ b/engines/freescape/games/driller.cpp
@@ -537,8 +537,10 @@ void DrillerEngine::loadAssetsFullGame() {
 		if (_targetName.hasPrefix("spacestationoblivion")) {
 			loadBundledImages();
 			file.open("spacestationoblivion.c64.extracted");
-			//load8bitBinary(&file, 0xeee, 4);
+			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");
 			load8bitBinary(&file, 0x63a6, 4);
@@ -652,6 +654,8 @@ void DrillerEngine::drawUI() {
 
 	if (isDOS())
 		drawDOSUI(surface);
+	else if (isC64())
+		drawC64UI(surface);
 	else if (isSpectrum())
 		drawZXUI(surface);
 	else if (isCPC())
@@ -818,6 +822,79 @@ void DrillerEngine::drawCPCUI(Graphics::Surface *surface) {
 	}
 }
 
+void DrillerEngine::drawC64UI(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), 240, 128, front, back, surface);
+
+	int hours = _countdown <= 0 ? 0 : _countdown / 3600;
+	drawStringInSurface(Common::String::format("%02d", hours), 209, 11, front, back, surface);
+	int minutes = _countdown <= 0 ? 0 : (_countdown - hours * 3600) / 60;
+	drawStringInSurface(Common::String::format("%02d", minutes), 232, 11, front, back, surface);
+	int seconds = _countdown <= 0 ? 0 : _countdown - hours * 3600 - minutes * 60;
+	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 (_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::drawZXUI(Graphics::Surface *surface) {
 	uint32 color = 5;
 	uint8 r, g, b;
diff --git a/engines/freescape/loaders/8bitBinaryLoader.cpp b/engines/freescape/loaders/8bitBinaryLoader.cpp
index a14397f033f..42db895a91e 100644
--- a/engines/freescape/loaders/8bitBinaryLoader.cpp
+++ b/engines/freescape/loaders/8bitBinaryLoader.cpp
@@ -602,7 +602,7 @@ void FreescapeEngine::loadFonts(Common::SeekableReadStream *file, int offset) {
 	file->seek(offset);
 	int charNumber = 60;
 	byte *font = nullptr;
-	if (isDOS() || isSpectrum() || isCPC()) {
+	if (isDOS() || isSpectrum() || isCPC() || isC64()) {
 		font = (byte *)malloc(6 * charNumber);
 		file->read(font, 6 * charNumber);
 


Commit: 54ae69f648ac90e958a6118213db2355fbd13ae1
    https://github.com/scummvm/scummvm/commit/54ae69f648ac90e958a6118213db2355fbd13ae1
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2023-01-07T08:11:32-03:00

Commit Message:
FREESCAPE: fixed issue when adding the same type of game twice and regenerated freescape.dat file

Changed paths:
  A devtools/create_freescape/driller_cpc.bmp
  A devtools/create_freescape/driller_zx.bmp
  A devtools/create_freescape/driller_zx_title.bmp
  A devtools/create_freescape/spacestationoblivion_c64.bmp
  R devtools/create_freescape/driller-cpc_Amstrad CPC.bmp
  R devtools/create_freescape/driller-zx_ZX Spectrum.bmp
  R devtools/create_freescape/driller-zx_ZX Spectrum_title.bmp
  R devtools/create_freescape/spacestationoblivion-c64_Commodore 64.bmp
    dists/engine-data/freescape.dat
    engines/freescape/loaders/8bitBinaryLoader.cpp


diff --git a/devtools/create_freescape/driller-cpc_Amstrad CPC.bmp b/devtools/create_freescape/driller_cpc.bmp
similarity index 100%
rename from devtools/create_freescape/driller-cpc_Amstrad CPC.bmp
rename to devtools/create_freescape/driller_cpc.bmp
diff --git a/devtools/create_freescape/driller-zx_ZX Spectrum.bmp b/devtools/create_freescape/driller_zx.bmp
similarity index 100%
rename from devtools/create_freescape/driller-zx_ZX Spectrum.bmp
rename to devtools/create_freescape/driller_zx.bmp
diff --git a/devtools/create_freescape/driller-zx_ZX Spectrum_title.bmp b/devtools/create_freescape/driller_zx_title.bmp
similarity index 100%
rename from devtools/create_freescape/driller-zx_ZX Spectrum_title.bmp
rename to devtools/create_freescape/driller_zx_title.bmp
diff --git a/devtools/create_freescape/spacestationoblivion-c64_Commodore 64.bmp b/devtools/create_freescape/spacestationoblivion_c64.bmp
similarity index 100%
rename from devtools/create_freescape/spacestationoblivion-c64_Commodore 64.bmp
rename to devtools/create_freescape/spacestationoblivion_c64.bmp
diff --git a/dists/engine-data/freescape.dat b/dists/engine-data/freescape.dat
index 7ae212617a1..ff5b23c68dd 100644
Binary files a/dists/engine-data/freescape.dat and b/dists/engine-data/freescape.dat differ
diff --git a/engines/freescape/loaders/8bitBinaryLoader.cpp b/engines/freescape/loaders/8bitBinaryLoader.cpp
index 42db895a91e..12b899a705a 100644
--- a/engines/freescape/loaders/8bitBinaryLoader.cpp
+++ b/engines/freescape/loaders/8bitBinaryLoader.cpp
@@ -574,11 +574,11 @@ void FreescapeEngine::load8bitBinary(Common::SeekableReadStream *file, int offse
 
 void FreescapeEngine::loadBundledImages() {
 	Image::BitmapDecoder decoder;
-	Common::String targetName = _targetName;
+	Common::String targetName = Common::String(_gameDescription->gameId);
 	if (isDOS() && isDemo())
 		Common::replace(targetName, "-demo", "");
 
-	Common::String borderFilename = targetName + "_" + Common::getRenderModeDescription(_renderMode) + ".bmp";
+	Common::String borderFilename = targetName + "_" + Common::getRenderModeCode(_renderMode) + ".bmp";
 	if (_dataBundle->hasFile(borderFilename)) {
 		Common::SeekableReadStream *borderFile = _dataBundle->createReadStreamForMember(borderFilename);
 		decoder.loadStream(*borderFile);




More information about the Scummvm-git-logs mailing list