[Scummvm-git-logs] scummvm master -> 9e52dd076257791dbb1d96fbded096034d836e62

neuromancer noreply at scummvm.org
Sat Sep 7 06:09:19 UTC 2024


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

Summary:
54ab22a28d FREESCAPE: load more data from dos demo
89b5df90a6 FREESCAPE: load more data from amiga demo
0891565073 FREESCAPE: extend extra color handling for castle amiga
9e52dd0762 FREESCAPE: load border image from castle amiga demo


Commit: 54ab22a28d0707272f36ef269f87d1ee6a96d1db
    https://github.com/scummvm/scummvm/commit/54ab22a28d0707272f36ef269f87d1ee6a96d1db
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-09-07T08:06:40+02:00

Commit Message:
FREESCAPE: load more data from dos demo

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


diff --git a/engines/freescape/games/castle/dos.cpp b/engines/freescape/games/castle/dos.cpp
index 1e507f52a7f..7f381287120 100644
--- a/engines/freescape/games/castle/dos.cpp
+++ b/engines/freescape/games/castle/dos.cpp
@@ -257,7 +257,42 @@ void CastleEngine::loadAssetsDOSDemo() {
 		stream = unpackEXE(file);
 		if (stream) {
 			loadSpeakerFxDOS(stream, 0x636d + 0x200, 0x63ed + 0x200);
-			loadDOSFonts(stream, 0x29696);
+			loadDOSFonts(stream, 0x293f6);
+
+			stream->seek(0x1c700 - 0x2a0);
+			_background = loadFrameFromPlanes(stream, 252, 42);
+			_background->convertToInPlace(_gfx->_texturePixelFormat, (byte *)&kEGADefaultPalette, 16);
+
+			stream->seek(0x221ae - 0x2a0);
+			_menu = loadFrameFromPlanes(stream, 112, 114);
+			_menu->convertToInPlace(_gfx->_texturePixelFormat, (byte *)&kEGADefaultPalette, 16);
+
+			//debug("%lx", stream->pos());
+			// TODO: some space here from the menu image
+			/*stream->seek(0x25414);
+			_menuCrawlIndicator = loadFrameFromPlanes(stream, 16, 12, lightGray, lightGray, lightGray, darkGray);
+			_menuWalkIndicator = loadFrameFromPlanes(stream, 16, 12, lightGray, lightGray, lightGray, darkGray);
+			_menuRunIndicator = loadFrameFromPlanes(stream, 16, 12, lightGray, lightGray, lightGray, darkGray);
+			_menuFxOffIndicator = loadFrameFromPlanes(stream, 16, 12, lightGray, lightGray, lightGray, darkGray);
+			_menuFxOnIndicator = loadFrameFromPlanes(stream, 16, 12, lightGray, lightGray, lightGray, darkGray);*/
+
+			// This end in 0x257d4??
+			byte flagPalette[4][3] = {
+				{0x00, 0x00, 0x00},
+				{0x00, 0xaa, 0x00},
+				{0x55, 0xff, 0x55},
+				{0xff, 0xff, 0xff}
+			};
+
+			stream->seek(0x257cc - 0x2a0);
+			_flagFrames[0] = loadFrameFromPlanes(stream, 16, 11);
+			_flagFrames[0]->convertToInPlace(_gfx->_texturePixelFormat, (byte *)&flagPalette, 4);
+			_flagFrames[1] = loadFrameFromPlanes(stream, 16, 11);
+			_flagFrames[1]->convertToInPlace(_gfx->_texturePixelFormat, (byte *)&flagPalette, 4);
+			_flagFrames[2] = loadFrameFromPlanes(stream, 16, 11);
+			_flagFrames[2]->convertToInPlace(_gfx->_texturePixelFormat, (byte *)&flagPalette, 4);
+			_flagFrames[3] = loadFrameFromPlanes(stream, 16, 11);
+			_flagFrames[3]->convertToInPlace(_gfx->_texturePixelFormat, (byte *)&flagPalette, 4);
 		}
 
 		delete stream;


Commit: 89b5df90a63f49fcd6da572307479686ee095cef
    https://github.com/scummvm/scummvm/commit/89b5df90a63f49fcd6da572307479686ee095cef
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-09-07T08:06:40+02:00

Commit Message:
FREESCAPE: load more data from amiga demo

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


diff --git a/engines/freescape/games/castle/castle.cpp b/engines/freescape/games/castle/castle.cpp
index 1e24809e89e..dbe11998ffa 100644
--- a/engines/freescape/games/castle/castle.cpp
+++ b/engines/freescape/games/castle/castle.cpp
@@ -825,7 +825,10 @@ void CastleEngine::updateTimeVariables() {
 
 void CastleEngine::borderScreen() {
 	FreescapeEngine::borderScreen();
-	selectCharacterScreen();
+	if (isAmiga() && isDemo()) {
+		// Skip character selection
+	} else
+		selectCharacterScreen();
 }
 
 void CastleEngine::drawOption() {
diff --git a/engines/freescape/loaders/8bitBinaryLoader.cpp b/engines/freescape/loaders/8bitBinaryLoader.cpp
index c401193dd42..cfc00cd6442 100644
--- a/engines/freescape/loaders/8bitBinaryLoader.cpp
+++ b/engines/freescape/loaders/8bitBinaryLoader.cpp
@@ -623,6 +623,10 @@ Area *FreescapeEngine::load8bitArea(Common::SeekableReadStream *file, uint16 nco
 		}
 
 		if (isAmiga()) {
+			readField(file, 8);
+			readField(file, 8);
+			readField(file, 8);
+			readField(file, 8);
 			// TODO
 			groundColor = skyColor;
 			skyColor = 0;


Commit: 0891565073e633fc13a847401c99f6e3da5e11b0
    https://github.com/scummvm/scummvm/commit/0891565073e633fc13a847401c99f6e3da5e11b0
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-09-07T08:06:40+02:00

Commit Message:
FREESCAPE: extend extra color handling for castle amiga

Changed paths:
    engines/freescape/games/castle/castle.cpp
    engines/freescape/gfx.cpp


diff --git a/engines/freescape/games/castle/castle.cpp b/engines/freescape/games/castle/castle.cpp
index dbe11998ffa..c4fe1ae1e05 100644
--- a/engines/freescape/games/castle/castle.cpp
+++ b/engines/freescape/games/castle/castle.cpp
@@ -209,7 +209,7 @@ void CastleEngine::gotoArea(uint16 areaID, int entranceID) {
 	_gfx->_keyColor = 0;
 	_gfx->clearColorPairArray();
 
-	if (isDOS()) {
+	if (isDOS() || isAmiga()) {
 		_gfx->_colorPair[_currentArea->_underFireBackgroundColor] = _currentArea->_extraColor[0];
 		_gfx->_colorPair[_currentArea->_usualBackgroundColor] = _currentArea->_extraColor[1];
 		_gfx->_colorPair[_currentArea->_paperColor] = _currentArea->_extraColor[2];
diff --git a/engines/freescape/gfx.cpp b/engines/freescape/gfx.cpp
index 0c45df0580c..ae8d6f61899 100644
--- a/engines/freescape/gfx.cpp
+++ b/engines/freescape/gfx.cpp
@@ -485,7 +485,14 @@ bool Renderer::getRGBAt(uint8 index, uint8 ecolor, uint8 &r1, uint8 &g1, uint8 &
 	}
 
 	if (_renderMode == Common::kRenderAmiga || _renderMode == Common::kRenderAtariST) {
-		if (_colorRemaps && _colorRemaps->contains(index)) {
+		if (_colorPair[index] > 0) {
+			int color = 0;
+			color = _colorPair[index] & 0xf;
+			readFromPalette(color, r1, g1, b1);
+			color = _colorPair[index] >> 4;
+			readFromPalette(color, r2, g2, b2);
+			return true;
+		} else if (_colorRemaps && _colorRemaps->contains(index)) {
 			int color = (*_colorRemaps)[index];
 			_texturePixelFormat.colorToRGB(color, r1, g1, b1);
 		} else


Commit: 9e52dd076257791dbb1d96fbded096034d836e62
    https://github.com/scummvm/scummvm/commit/9e52dd076257791dbb1d96fbded096034d836e62
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-09-07T08:06:40+02:00

Commit Message:
FREESCAPE: load border image from castle amiga demo

Changed paths:
    engines/freescape/games/castle/amiga.cpp
    engines/freescape/games/castle/castle.h


diff --git a/engines/freescape/games/castle/amiga.cpp b/engines/freescape/games/castle/amiga.cpp
index b6209eb277f..af6f946b5b7 100644
--- a/engines/freescape/games/castle/amiga.cpp
+++ b/engines/freescape/games/castle/amiga.cpp
@@ -28,12 +28,45 @@
 
 namespace Freescape {
 
+Graphics::ManagedSurface *CastleEngine::loadFrameFromPlanesVertical(Common::SeekableReadStream *file, int widthInBytes, int height) {
+	Graphics::ManagedSurface *surface;
+	surface = new Graphics::ManagedSurface();
+	surface->create(widthInBytes * 8 / 4, height, Graphics::PixelFormat::createFormatCLUT8());
+	surface->fillRect(Common::Rect(0, 0, widthInBytes * 8 / 4, height), 0);
+	loadFrameFromPlanesInternalVertical(file, surface, widthInBytes / 4, height, 0);
+	loadFrameFromPlanesInternalVertical(file, surface, widthInBytes / 4, height, 1);
+	loadFrameFromPlanesInternalVertical(file, surface, widthInBytes / 4, height, 2);
+	loadFrameFromPlanesInternalVertical(file, surface, widthInBytes / 4, height, 3);
+	return surface;
+}
+
+Graphics::ManagedSurface *CastleEngine::loadFrameFromPlanesInternalVertical(Common::SeekableReadStream *file, Graphics::ManagedSurface *surface, int width, int height, int plane) {
+	byte *colors = (byte *)malloc(sizeof(byte) * height * width);
+	file->read(colors, height * width);
+
+	for (int i = 0; i < height * width; i++) {
+		byte color = colors[i];
+		for (int n = 0; n < 8; n++) {
+			int y = i / width;
+			int x = (i % width) * 8 + (7 - n);
+
+			int bit = ((color >> n) & 0x01) << plane;
+			int sample = surface->getPixel(x, y) | bit;
+			assert(sample < 16);
+			surface->setPixel(x, y, sample);
+		}
+	}
+	free(colors);
+	return surface;
+}
+
 void CastleEngine::loadAssetsAmigaDemo() {
 	Common::File file;
 	file.open("x");
 	if (!file.isOpen())
 		error("Failed to open 'x' file");
 
+	_viewArea = Common::Rect(37, 29, 277, 149);
 	loadMessagesVariableSize(&file, 0x8bb2, 178);
 	loadRiddles(&file, 0x96c8, 20);
 	load8bitBinary(&file, 0x162a6, 16);
@@ -41,6 +74,10 @@ void CastleEngine::loadAssetsAmigaDemo() {
 
 	file.seek(0x2be96); // Area 255
 	_areaMap[255] = load8bitArea(&file, 16);
+
+	file.seek(0x2cf26);
+	_border = loadFrameFromPlanesVertical(&file, 160, 200);
+	_border->convertToInPlace(_gfx->_texturePixelFormat, _paletteByArea[1], 16);
 	file.close();
 
 	_areaMap[2]->_groundColor = 1;
@@ -51,4 +88,7 @@ void CastleEngine::loadAssetsAmigaDemo() {
 	_areaMap[2]->addFloor();
 }
 
+void CastleEngine::drawAmigaAtariSTUI(Graphics::Surface *surface) {
+}
+
 } // End of namespace Freescape
\ No newline at end of file
diff --git a/engines/freescape/games/castle/castle.h b/engines/freescape/games/castle/castle.h
index 6da8f50c255..263d4e6207d 100644
--- a/engines/freescape/games/castle/castle.h
+++ b/engines/freescape/games/castle/castle.h
@@ -55,6 +55,7 @@ public:
 
 	void drawDOSUI(Graphics::Surface *surface) override;
 	void drawZXUI(Graphics::Surface *surface) override;
+	void drawAmigaAtariSTUI(Graphics::Surface *surface);
 	void drawEnergyMeter(Graphics::Surface *surface);
 	void pressedKey(const int keycode) override;
 	void checkSensors() override;
@@ -82,6 +83,9 @@ public:
 	Graphics::ManagedSurface *loadFrameFromPlanes(Common::SeekableReadStream *file, int widthInBytes, int height);
 	Graphics::ManagedSurface *loadFrameFromPlanesInternal(Common::SeekableReadStream *file, Graphics::ManagedSurface *surface, int width, int height);
 
+	Graphics::ManagedSurface *loadFrameFromPlanesVertical(Common::SeekableReadStream *file, int widthInBytes, int height);
+	Graphics::ManagedSurface *loadFrameFromPlanesInternalVertical(Common::SeekableReadStream *file, Graphics::ManagedSurface *surface, int width, int height, int plane);
+
 	Graphics::ManagedSurface *_keysFrame;
 	Graphics::ManagedSurface *_spiritsMeterIndicatorFrame;
 	Graphics::ManagedSurface *_strenghtBackgroundFrame;




More information about the Scummvm-git-logs mailing list