[Scummvm-git-logs] scummvm master -> 0dd017f6044b4b4f2464531f70e10f86c6af75fc
neuromancer
noreply at scummvm.org
Tue Nov 5 13:44:13 UTC 2024
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:
54a8515f4a FREESCAPE: improved detection tables
b5008a4a91 FREESCAPE: fixes for parsing amiga data
0dd017f604 FREESCAPE: use correct palette for amiga castle data
Commit: 54a8515f4afeb84b213635c6453ead01dec41214
https://github.com/scummvm/scummvm/commit/54a8515f4afeb84b213635c6453ead01dec41214
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-11-05T14:45:07+01:00
Commit Message:
FREESCAPE: improved detection tables
Changed paths:
engines/freescape/detection.cpp
diff --git a/engines/freescape/detection.cpp b/engines/freescape/detection.cpp
index b39dfdd30c1..8d6f91373e0 100644
--- a/engines/freescape/detection.cpp
+++ b/engines/freescape/detection.cpp
@@ -761,7 +761,7 @@ static const ADGameDescription gameDescriptions[] = {
},
Common::UNK_LANG,
Common::kPlatformDOS,
- ADGF_UNSTABLE,
+ ADGF_PIRATED,
GUIO4(GUIO_NOMIDI, GAMEOPTION_TRAVEL_ROCK, GUIO_RENDEREGA, GUIO_RENDERCGA)
},
{
Commit: b5008a4a918eac93ec098cac58e1afbdd61a926e
https://github.com/scummvm/scummvm/commit/b5008a4a918eac93ec098cac58e1afbdd61a926e
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-11-05T14:45:07+01:00
Commit Message:
FREESCAPE: fixes for parsing amiga data
Changed paths:
engines/freescape/games/castle/amiga.cpp
engines/freescape/games/castle/castle.cpp
engines/freescape/games/palettes.cpp
engines/freescape/loaders/8bitBinaryLoader.cpp
diff --git a/engines/freescape/games/castle/amiga.cpp b/engines/freescape/games/castle/amiga.cpp
index 2f7de6a37bc..fbdb6f6ae4e 100644
--- a/engines/freescape/games/castle/amiga.cpp
+++ b/engines/freescape/games/castle/amiga.cpp
@@ -86,10 +86,25 @@ void CastleEngine::loadAssetsAmigaDemo() {
//charsRiddle.push_back(imgRiddle);
//charsRiddle[i]->convertToInPlace(_gfx->_texturePixelFormat, (byte *)&kEGARiddleFontPalette, 16);
}
+ // 0x1356c
+
_font = Font(chars);
_font.setCharWidth(9);
load8bitBinary(&file, 0x162a6, 16);
+ for (int i = 0; i < 3; i++) {
+ debugC(1, kFreescapeDebugParser, "Continue to parse area index %d at offset %x", _areaMap.size() + i + 1, (int)file.pos());
+ Area *newArea = load8bitArea(&file, 16);
+ if (newArea) {
+ if (!_areaMap.contains(newArea->getAreaID()))
+ _areaMap[newArea->getAreaID()] = newArea;
+ else
+ error("Repeated area ID: %d", newArea->getAreaID());
+ } else {
+ error("Invalid area %d?", i);
+ }
+ }
+
loadPalettes(&file, 0x151a6);
file.seek(0x2be96); // Area 255
diff --git a/engines/freescape/games/castle/castle.cpp b/engines/freescape/games/castle/castle.cpp
index 416241c4cbd..1346f26b7db 100644
--- a/engines/freescape/games/castle/castle.cpp
+++ b/engines/freescape/games/castle/castle.cpp
@@ -351,14 +351,33 @@ void CastleEngine::gotoArea(uint16 areaID, int entranceID) {
_gfx->_keyColor = 0;
_gfx->clearColorPairArray();
- if (isDOS() || isAmiga()) {
+ swapPalette(areaID);
+ if (isDOS()) {
_gfx->_colorPair[_currentArea->_underFireBackgroundColor] = _currentArea->_extraColor[0];
_gfx->_colorPair[_currentArea->_usualBackgroundColor] = _currentArea->_extraColor[1];
_gfx->_colorPair[_currentArea->_paperColor] = _currentArea->_extraColor[2];
_gfx->_colorPair[_currentArea->_inkColor] = _currentArea->_extraColor[3];
+ } else if (isAmiga()) {
+ // Unclear why these colors are always overwritten
+ byte (*palette)[16][3] = (byte (*)[16][3])_gfx->_palette;
+
+ (*palette)[1][0] = 0x44;
+ (*palette)[1][1] = 0x44;
+ (*palette)[1][2] = 0x44;
+
+ (*palette)[2][0] = 0x66;
+ (*palette)[2][1] = 0x66;
+ (*palette)[2][2] = 0x66;
+
+ (*palette)[3][0] = 0x88;
+ (*palette)[3][1] = 0x88;
+ (*palette)[3][2] = 0x88;
+
+ (*palette)[5][0] = 0xcc;
+ (*palette)[5][1] = 0xcc;
+ (*palette)[5][2] = 0xcc;
}
- swapPalette(areaID);
if (isSpectrum() || isCPC())
_gfx->_paperColor = 0;
resetInput();
diff --git a/engines/freescape/games/palettes.cpp b/engines/freescape/games/palettes.cpp
index 5f9961a54d3..c25e6fa6d2d 100644
--- a/engines/freescape/games/palettes.cpp
+++ b/engines/freescape/games/palettes.cpp
@@ -164,6 +164,8 @@ void FreescapeEngine::loadPalettes(Common::SeekableReadStream *file, int offset)
numberOfAreas += 2;
else if (isDark())
numberOfAreas += 5;
+ else if (isCastle())
+ numberOfAreas += 10;
for (uint i = 0; i < numberOfAreas; i++) {
int label = readField(file, 8);
@@ -182,6 +184,7 @@ void FreescapeEngine::loadPalettes(Common::SeekableReadStream *file, int offset)
b = v & 0xf;
b = b << 4 | b;
palette[c][2] = b & 0xff;
+ debugC(1, kFreescapeDebugParser, "Color %d: %02x %02x %02x", c, palette[c][0], palette[c][1], palette[c][2]);
}
assert(!_paletteByArea.contains(label));
diff --git a/engines/freescape/loaders/8bitBinaryLoader.cpp b/engines/freescape/loaders/8bitBinaryLoader.cpp
index 6238d4c12aa..37efc0e412a 100644
--- a/engines/freescape/loaders/8bitBinaryLoader.cpp
+++ b/engines/freescape/loaders/8bitBinaryLoader.cpp
@@ -700,16 +700,18 @@ Area *FreescapeEngine::load8bitArea(Common::SeekableReadStream *file, uint16 nco
extraColor[1] = readField(file, 8);
extraColor[2] = readField(file, 8);
extraColor[3] = readField(file, 8);
+ debugC(1, kFreescapeDebugParser, "Extra colors: %x %x %x %x", extraColor[0], extraColor[1], extraColor[2], extraColor[3]);
}
if (isAmiga()) {
- readField(file, 8);
- readField(file, 8);
- readField(file, 8);
- readField(file, 8);
+ extraColor[0] = readField(file, 8);
+ extraColor[1] = readField(file, 8);
+ extraColor[2] = readField(file, 8);
+ extraColor[3] = readField(file, 8);
// TODO
groundColor = skyColor;
skyColor = 0;
+ debugC(1, kFreescapeDebugParser, "Extra colors: %x %x %x %x", extraColor[0], extraColor[1], extraColor[2], extraColor[3]);
}
}
debugC(1, kFreescapeDebugParser, "Area name: %s", name.c_str());
Commit: 0dd017f6044b4b4f2464531f70e10f86c6af75fc
https://github.com/scummvm/scummvm/commit/0dd017f6044b4b4f2464531f70e10f86c6af75fc
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-11-05T14:45:07+01:00
Commit Message:
FREESCAPE: use correct palette for amiga castle data
Changed paths:
engines/freescape/games/castle/amiga.cpp
engines/freescape/games/palettes.cpp
diff --git a/engines/freescape/games/castle/amiga.cpp b/engines/freescape/games/castle/amiga.cpp
index fbdb6f6ae4e..7f9d589d590 100644
--- a/engines/freescape/games/castle/amiga.cpp
+++ b/engines/freescape/games/castle/amiga.cpp
@@ -28,6 +28,25 @@
namespace Freescape {
+byte kAmigaCastlePalette[16][3] = {
+ {0x00, 0x00, 0x00},
+ {0x44, 0x44, 0x44},
+ {0x66, 0x66, 0x66},
+ {0x88, 0x88, 0x88},
+ {0xaa, 0xaa, 0xaa},
+ {0xcc, 0xcc, 0xcc},
+ {0x00, 0x00, 0x88},
+ {0x66, 0xaa, 0x00},
+ {0x88, 0xcc, 0x00},
+ {0xcc, 0xee, 0x00},
+ {0xee, 0xee, 0x66},
+ {0x44, 0x88, 0x00},
+ {0xee, 0xaa, 0x00},
+ {0xcc, 0x44, 0x00},
+ {0x88, 0x44, 0x00},
+ {0xee, 0xee, 0xee},
+};
+
Graphics::ManagedSurface *CastleEngine::loadFrameFromPlanesVertical(Common::SeekableReadStream *file, int widthInBytes, int height) {
Graphics::ManagedSurface *surface;
surface = new Graphics::ManagedSurface();
@@ -70,9 +89,6 @@ void CastleEngine::loadAssetsAmigaDemo() {
loadMessagesVariableSize(&file, 0x8bb2, 178);
loadRiddles(&file, 0x96c8 - 2 - 19 * 2, 19);
- file.seek(0x3c6d0);
- byte *borderPalete = loadPalette(&file);
-
file.seek(0x11eec);
Common::Array<Graphics::ManagedSurface *> chars;
for (int i = 0; i < 90; i++) {
@@ -81,7 +97,7 @@ void CastleEngine::loadAssetsAmigaDemo() {
//imgRiddle->copyFrom(*img);
chars.push_back(img);
- chars[i]->convertToInPlace(_gfx->_texturePixelFormat, borderPalete, 16);
+ chars[i]->convertToInPlace(_gfx->_texturePixelFormat, (byte *)kAmigaCastlePalette, 16);
//charsRiddle.push_back(imgRiddle);
//charsRiddle[i]->convertToInPlace(_gfx->_texturePixelFormat, (byte *)&kEGARiddleFontPalette, 16);
@@ -112,8 +128,7 @@ void CastleEngine::loadAssetsAmigaDemo() {
file.seek(0x2cf28 + 0x28 - 0x2 + 0x28);
_border = loadFrameFromPlanesVertical(&file, 160, 200);
- _border->convertToInPlace(_gfx->_texturePixelFormat, borderPalete, 16);
- delete[] borderPalete;
+ _border->convertToInPlace(_gfx->_texturePixelFormat, (byte *)kAmigaCastlePalette, 16);
file.close();
_areaMap[2]->_groundColor = 1;
diff --git a/engines/freescape/games/palettes.cpp b/engines/freescape/games/palettes.cpp
index c25e6fa6d2d..b6ed3c111a2 100644
--- a/engines/freescape/games/palettes.cpp
+++ b/engines/freescape/games/palettes.cpp
@@ -148,6 +148,7 @@ byte *FreescapeEngine::loadPalette(Common::SeekableReadStream *file) {
b = v & 0xf;
b = b << 4 | b;
palette[c][2] = b & 0xff;
+ debugC(1, kFreescapeDebugParser, "Color %d: (%04x) %02x %02x %02x", c, v, palette[c][0], palette[c][1], palette[c][2]);
}
return (byte *)palette;
}
@@ -165,7 +166,7 @@ void FreescapeEngine::loadPalettes(Common::SeekableReadStream *file, int offset)
else if (isDark())
numberOfAreas += 5;
else if (isCastle())
- numberOfAreas += 10;
+ numberOfAreas += 20;
for (uint i = 0; i < numberOfAreas; i++) {
int label = readField(file, 8);
@@ -184,9 +185,8 @@ void FreescapeEngine::loadPalettes(Common::SeekableReadStream *file, int offset)
b = v & 0xf;
b = b << 4 | b;
palette[c][2] = b & 0xff;
- debugC(1, kFreescapeDebugParser, "Color %d: %02x %02x %02x", c, palette[c][0], palette[c][1], palette[c][2]);
+ debugC(1, kFreescapeDebugParser, "Color %d: (%04x) %02x %02x %02x", c, v, palette[c][0], palette[c][1], palette[c][2]);
}
-
assert(!_paletteByArea.contains(label));
_paletteByArea[label] = (byte *)palette;
}
More information about the Scummvm-git-logs
mailing list