[Scummvm-git-logs] scummvm master -> 6814bb3521c935225d46a3e0e2760da7a72656fe
neuromancer
noreply at scummvm.org
Sat Apr 26 11:10:19 UTC 2025
This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
210ec41e9d FREESCAPE: corrected color entries for c64 games
3c762925cb FREESCAPE: UI fixes for eclipse
b910bf9ee3 FREESCAPE: added disc variant for c64 dark
6814bb3521 FREESCAPE: allow to change rotation angle (except castle)
Commit: 210ec41e9de3066b84f6a5128a33140aefe0531d
https://github.com/scummvm/scummvm/commit/210ec41e9de3066b84f6a5128a33140aefe0531d
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2025-04-26T13:07:51+02:00
Commit Message:
FREESCAPE: corrected color entries for c64 games
Changed paths:
engines/freescape/games/dark/c64.cpp
engines/freescape/games/driller/c64.cpp
engines/freescape/games/eclipse/eclipse.cpp
engines/freescape/gfx.cpp
diff --git a/engines/freescape/games/dark/c64.cpp b/engines/freescape/games/dark/c64.cpp
index 4912396151e..88168390c0e 100644
--- a/engines/freescape/games/dark/c64.cpp
+++ b/engines/freescape/games/dark/c64.cpp
@@ -41,6 +41,83 @@ void DarkEngine::loadAssetsC64FullGame() {
loadGlobalObjects(&file, 0x20bd, 23);
load8bitBinary(&file, 0x9b3e, 16);
+ // The color map from the data is not correct,
+ // so we'll just hardcode the one that we found in the executable
+
+ for (int i = 0; i < 15; i++) {
+ _colorMap[i][0] = 0;
+ _colorMap[i][1] = 0;
+ _colorMap[i][2] = 0;
+ _colorMap[i][3] = 0;
+ }
+
+ _colorMap[1][0] = 0x55;
+ _colorMap[1][1] = 0x55;
+ _colorMap[1][2] = 0x55;
+ _colorMap[1][3] = 0x55;
+
+ _colorMap[2][0] = 0xaa;
+ _colorMap[2][1] = 0xaa;
+ _colorMap[2][2] = 0xaa;
+ _colorMap[2][3] = 0xaa;
+
+ _colorMap[3][0] = 0xff;
+ _colorMap[3][1] = 0xff;
+ _colorMap[3][2] = 0xff;
+ _colorMap[3][3] = 0xff;
+
+ _colorMap[4][0] = 0x44;
+ _colorMap[4][1] = 0x11;
+ _colorMap[4][2] = 0x44;
+ _colorMap[4][3] = 0x11;
+
+ _colorMap[5][0] = 0x88;
+ _colorMap[5][1] = 0x22;
+ _colorMap[5][2] = 0x88;
+ _colorMap[5][3] = 0x22;
+
+ _colorMap[6][0] = 0xcc;
+ _colorMap[6][1] = 0x33;
+ _colorMap[6][2] = 0xcc;
+ _colorMap[6][3] = 0x33;
+
+ _colorMap[7][0] = 0x66;
+ _colorMap[7][1] = 0x99;
+ _colorMap[7][2] = 0x66;
+ _colorMap[7][3] = 0x99;
+
+ _colorMap[8][0] = 0x77;
+ _colorMap[8][1] = 0xdd;
+ _colorMap[8][2] = 0x77;
+ _colorMap[8][3] = 0xdd;
+
+ _colorMap[9][0] = 0xbb;
+ _colorMap[9][1] = 0xee;
+ _colorMap[9][2] = 0xbb;
+ _colorMap[9][3] = 0xee;
+
+ _colorMap[10][0] = 0x5a;
+ _colorMap[10][1] = 0xa5;
+ _colorMap[10][2] = 0x5a;
+ _colorMap[10][3] = 0xa5;
+
+ // TODO
+ _colorMap[12][0] = 0x00;
+ _colorMap[12][1] = 0x00;
+ _colorMap[12][2] = 0x00;
+ _colorMap[12][3] = 0x00;
+
+ _colorMap[13][0] = 0x77;
+ _colorMap[13][1] = 0xdd;
+ _colorMap[13][2] = 0x77;
+ _colorMap[13][3] = 0xdd;
+
+ // TODO
+ _colorMap[14][0] = 0x00;
+ _colorMap[14][1] = 0x00;
+ _colorMap[14][2] = 0x00;
+ _colorMap[14][3] = 0x00;
+
Graphics::Surface *surf = loadBundledImage("dark_border");
surf->convertToInPlace(_gfx->_texturePixelFormat);
_border = new Graphics::ManagedSurface();
diff --git a/engines/freescape/games/driller/c64.cpp b/engines/freescape/games/driller/c64.cpp
index cf10eacb67e..d50fd1f47d4 100644
--- a/engines/freescape/games/driller/c64.cpp
+++ b/engines/freescape/games/driller/c64.cpp
@@ -59,9 +59,8 @@ void DrillerEngine::loadAssetsC64FullGame() {
assert(false);
}
-
- // The color map from the C64 version looks invalid
- // so we'll just hardcode the Dark Side one which works fine
+ // The color map from the data is not correct,
+ // so we'll just hardcode the one that we found in the executable
for (int i = 0; i < 15; i++) {
_colorMap[i][0] = 0;
@@ -70,77 +69,73 @@ void DrillerEngine::loadAssetsC64FullGame() {
_colorMap[i][3] = 0;
}
- _colorMap[1][0] = 0xf0;
- _colorMap[1][1] = 0xf0;
- _colorMap[1][2] = 0xf0;
- _colorMap[1][3] = 0xf0;
+ _colorMap[1][0] = 0x55;
+ _colorMap[1][1] = 0x55;
+ _colorMap[1][2] = 0x55;
+ _colorMap[1][3] = 0x55;
- _colorMap[2][0] = 0x0f;
- _colorMap[2][1] = 0x0f;
- _colorMap[2][2] = 0x0f;
- _colorMap[2][3] = 0x0f;
+ _colorMap[2][0] = 0xaa;
+ _colorMap[2][1] = 0xaa;
+ _colorMap[2][2] = 0xaa;
+ _colorMap[2][3] = 0xaa;
_colorMap[3][0] = 0xff;
_colorMap[3][1] = 0xff;
_colorMap[3][2] = 0xff;
_colorMap[3][3] = 0xff;
- _colorMap[4][0] = 0x05;
- _colorMap[4][1] = 0x0a;
- _colorMap[4][2] = 0x05;
- _colorMap[4][3] = 0x0a;
-
- _colorMap[5][0] = 0x50;
- _colorMap[5][1] = 0xa0;
- _colorMap[5][2] = 0x50;
- _colorMap[5][3] = 0xa0;
-
- _colorMap[6][0] = 0x55;
- _colorMap[6][1] = 0xaa;
- _colorMap[6][2] = 0x55;
- _colorMap[6][3] = 0xaa;
-
- _colorMap[7][0] = 0x5a;
- _colorMap[7][1] = 0xa5;
- _colorMap[7][2] = 0x5a;
- _colorMap[7][3] = 0xa5;
-
- _colorMap[8][0] = 0x5f;
- _colorMap[8][1] = 0xaf;
- _colorMap[8][2] = 0x5f;
- _colorMap[8][3] = 0xaf;
-
- _colorMap[9][0] = 0xf5;
- _colorMap[9][1] = 0xfa;
- _colorMap[9][2] = 0xf5;
- _colorMap[9][3] = 0xfa;
-
- _colorMap[10][0] = 0x0a;
- _colorMap[10][1] = 0x05;
- _colorMap[10][2] = 0x0a;
- _colorMap[10][3] = 0x05;
-
- _colorMap[11][0] = 0xa0;
- _colorMap[11][1] = 0x50;
- _colorMap[11][2] = 0xa0;
- _colorMap[11][3] = 0x50;
-
- _colorMap[12][0] = 0xa5;
- _colorMap[12][1] = 0x5a;
- _colorMap[12][2] = 0xa5;
- _colorMap[12][3] = 0x5a;
-
- _colorMap[13][0] = 0xaa;
- _colorMap[13][1] = 0x55;
- _colorMap[13][2] = 0xaa;
- _colorMap[13][3] = 0x55;
-
- _colorMap[14][0] = 0xdd;
+ _colorMap[4][0] = 0x44;
+ _colorMap[4][1] = 0x11;
+ _colorMap[4][2] = 0x44;
+ _colorMap[4][3] = 0x11;
+
+ _colorMap[5][0] = 0x88;
+ _colorMap[5][1] = 0x22;
+ _colorMap[5][2] = 0x88;
+ _colorMap[5][3] = 0x22;
+
+ _colorMap[6][0] = 0xcc;
+ _colorMap[6][1] = 0x33;
+ _colorMap[6][2] = 0xcc;
+ _colorMap[6][3] = 0x33;
+
+ _colorMap[7][0] = 0x66;
+ _colorMap[7][1] = 0x99;
+ _colorMap[7][2] = 0x66;
+ _colorMap[7][3] = 0x99;
+
+ _colorMap[8][0] = 0x77;
+ _colorMap[8][1] = 0xdd;
+ _colorMap[8][2] = 0x77;
+ _colorMap[8][3] = 0xdd;
+
+ _colorMap[9][0] = 0xbb;
+ _colorMap[9][1] = 0xee;
+ _colorMap[9][2] = 0xbb;
+ _colorMap[9][3] = 0xee;
+
+ _colorMap[10][0] = 0x5a;
+ _colorMap[10][1] = 0xa5;
+ _colorMap[10][2] = 0x5a;
+ _colorMap[10][3] = 0xa5;
+
+ // TODO
+ _colorMap[12][0] = 0xee;
+ _colorMap[12][1] = 0x77;
+ _colorMap[12][2] = 0x9e;
+ _colorMap[12][3] = 0xd5;
+
+ _colorMap[13][0] = 0xaf;
+ _colorMap[13][1] = 0xfa;
+ _colorMap[13][2] = 0xaf;
+ _colorMap[13][3] = 0xfa;
+
+ // TODO
+ _colorMap[14][0] = 0x77;
_colorMap[14][1] = 0xdd;
- _colorMap[14][2] = 0xdd;
+ _colorMap[14][2] = 0x77;
_colorMap[14][3] = 0xdd;
-
Graphics::Surface *surf = loadBundledImage("driller_border");
surf->convertToInPlace(_gfx->_texturePixelFormat);
_border = new Graphics::ManagedSurface();
diff --git a/engines/freescape/games/eclipse/eclipse.cpp b/engines/freescape/games/eclipse/eclipse.cpp
index ebb02609164..17008cd14e0 100644
--- a/engines/freescape/games/eclipse/eclipse.cpp
+++ b/engines/freescape/games/eclipse/eclipse.cpp
@@ -327,6 +327,9 @@ void EclipseEngine::drawBackground() {
if (isSpectrum() || isCPC()) {
color1 = 2;
color2 = 10;
+ } else if (isC64()) {
+ color1 = 1;
+ color2 = 5;
} else if (isAmiga() || isAtariST()) {
color1 = 8;
color2 = 14;
diff --git a/engines/freescape/gfx.cpp b/engines/freescape/gfx.cpp
index 4c31fbbf59a..fcfb8218d88 100644
--- a/engines/freescape/gfx.cpp
+++ b/engines/freescape/gfx.cpp
@@ -112,8 +112,16 @@ byte getCGAPixel(byte x, int index) {
}
byte getC64Pixel(byte x, int index) {
- // Unknown
- return 0;
+ if (index == 0)
+ return (x >> 0) & 0x3;
+ else if (index == 1)
+ return (x >> 2) & 0x3;
+ else if (index == 2)
+ return (x >> 4) & 0x3;
+ else if (index == 3)
+ return (x >> 6) & 0x3;
+ else
+ error("Invalid index %d requested", index);
}
byte getCGAStipple(byte x, int back, int fore) {
@@ -173,107 +181,40 @@ void Renderer::clearColorPairArray() {
_colorPair[i] = 0;
}
-int getC64Color(uint8 index, bool isBackground) {
- if (index < 4)
- return index;
-
- if (isBackground) {
- switch (index) {
- case 4:
- return 1;
- case 5: // OK
- return 2;
- case 6: // OK
- return 0;
- case 7: // OK
- return 1;
- case 8:
- return 1; // ??
- case 9: // OK
- return 3;
- case 10: // ??
- return 0;
- case 11:
- return 0;
- case 12:
- return 0;
- case 13: // OK
- return 3;
- case 14:
- return 0;
- default:
- error("invalid c64 color index %d", index);
- }
- }
-
- switch (index) {
- case 4:
- return 0;
- case 5: // OK
- return 0;
- case 6: // OK
- return 3;
- case 7: // OK
- return 2;
- case 8:
- return 3; // ??
- case 9: // OK
- return 2;
- case 10: // ??
- return 0;
- case 11:
- return 0;
- case 12:
- return 0;
- case 13:
- return 2;
- case 14:
- return 0;
- default:
- error("invalid c64 color index %d", index);
- }
-
- error("unreachable");
-}
-
void Renderer::fillColorPairArray() {
for (int i = 0; i < 15; i++) {
byte *entry = (*_colorMap)[i];
int c1 = -1;
int c2 = -1;
- if (_renderMode == Common::kRenderCGA)
+ if (_renderMode == Common::kRenderCGA || _renderMode == Common::kRenderC64)
c1 = getCGAPixel(entry[0], 0);
else if (_renderMode == Common::kRenderCPC)
c1 = getCPCPixel(entry[0], 0, true);
- else if (_renderMode == Common::kRenderC64) {
- c1 = getC64Color(i, false);
- c2 = getC64Color(i, true);
- } else
+ else
error("Not implemented");
- if (_renderMode != Common::kRenderC64) {
- for (int j = 0; j < 4 && c2 == -1; j++) {
- int k, c;
- for (k = 0; k < 4; k++) {
- if (_renderMode == Common::kRenderCGA)
- c = getCGAPixel(entry[j], k);
- else if (_renderMode == Common::kRenderCPC)
- c = getCPCPixel(entry[j], k, true);
- else
- error("Not implemented");
- if (c1 != c) {
- c2 = c;
- break;
- }
- }
- if (k != 4)
+
+ for (int j = 0; j < 4 && c2 == -1; j++) {
+ int k, c;
+ for (k = 0; k < 4; k++) {
+ if (_renderMode == Common::kRenderCGA || _renderMode == Common::kRenderC64)
+ c = getCGAPixel(entry[j], k);
+ else if (_renderMode == Common::kRenderCPC)
+ c = getCPCPixel(entry[j], k, true);
+ else
+ error("Not implemented");
+ if (c1 != c) {
+ c2 = c;
break;
+ }
}
- // The Castle Master CPC release needs the following workaround
- if (c2 < 0)
- c2 = c1;
-
+ if (k != 4)
+ break;
}
+ // The Castle Master CPC release needs the following workaround
+ if (c2 < 0)
+ c2 = c1;
+
assert((c1 < 16) & (c2 < 16));
_colorPair[i] = byte(c1) | (byte(c2) << 4);
}
Commit: 3c762925cb30cefebc736b8373d92fec851a0d66
https://github.com/scummvm/scummvm/commit/3c762925cb30cefebc736b8373d92fec851a0d66
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2025-04-26T13:07:51+02:00
Commit Message:
FREESCAPE: UI fixes for eclipse
Changed paths:
engines/freescape/games/eclipse/c64.cpp
engines/freescape/games/eclipse/cpc.cpp
engines/freescape/games/eclipse/dos.cpp
engines/freescape/games/eclipse/eclipse.cpp
engines/freescape/games/eclipse/eclipse.h
engines/freescape/games/eclipse/zx.cpp
diff --git a/engines/freescape/games/eclipse/c64.cpp b/engines/freescape/games/eclipse/c64.cpp
index 8a0b9a45717..478953bfb98 100644
--- a/engines/freescape/games/eclipse/c64.cpp
+++ b/engines/freescape/games/eclipse/c64.cpp
@@ -81,36 +81,41 @@ void EclipseEngine::drawC64UI(Graphics::Surface *surface) {
_gfx->readFromPalette(color, r, g, b);
uint32 back = _gfx->_texturePixelFormat.ARGBToColor(0xFF, r, g, b);
- _gfx->readFromPalette(7, r, g, b);
- uint32 gray = _gfx->_texturePixelFormat.ARGBToColor(0xFF, r, g, b);
+ _gfx->readFromPalette(13, r, g, b);
+ uint32 green = _gfx->_texturePixelFormat.ARGBToColor(0xFF, r, g, b);
- _gfx->readFromPalette(5, r, g, b);
+ _gfx->readFromPalette(3, r, g, b);
uint32 blue = _gfx->_texturePixelFormat.ARGBToColor(0xFF, r, g, b);
_gfx->readFromPalette(2, r, g, b);
uint32 red = _gfx->_texturePixelFormat.ARGBToColor(0xFF, r, g, b);
+ _gfx->readFromPalette(0, r, g, b);
+ uint32 black = _gfx->_texturePixelFormat.ARGBToColor(0xFF, r, g, b);
+
+ _gfx->readFromPalette(1, r, g, b);
+ uint32 white = _gfx->_texturePixelFormat.ARGBToColor(0xFF, r, g, b);
int score = _gameStateVars[k8bitVariableScore];
int shield = _gameStateVars[k8bitVariableShield] * 100 / _maxShield;
int energy = _gameStateVars[k8bitVariableEnergy];
shield = shield < 0 ? 0 : shield;
- uint32 yellow = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0xFF, 0xFF, 0);
+ _gfx->readFromPalette(7, r, g, b);
+ uint32 yellow = _gfx->_texturePixelFormat.ARGBToColor(0xFF, r, g, b);
Common::String message;
int deadline;
getLatestMessages(message, deadline);
if (deadline <= _countdown) {
- drawStringInSurface(message, 102, 141, back, yellow, surface);
+ drawStringInSurface(message, 104, 138, back, yellow, surface);
_temporaryMessages.push_back(message);
_temporaryMessageDeadlines.push_back(deadline);
} else if (!_currentAreaMessages.empty())
- drawStringInSurface(_currentArea->_name, 102, 141, back, yellow, surface);
+ drawStringInSurface(_currentArea->_name, 104, 138, back, yellow, surface);
- Common::String scoreStr = Common::String::format("%07d", score);
- Common::String encodedScoreStr = shiftStr(scoreStr, 'Z' - '0' + 1);
- drawStringInSurface(encodedScoreStr, 133, 11, back, gray, surface, 'Z' - '0' + 1);
+ Common::String encodedScoreStr = getScoreString(score);
+ drawStringInSurface(encodedScoreStr, 128, 7, black, white, surface);
Common::String shieldStr = Common::String::format("%d", shield);
@@ -125,13 +130,13 @@ void EclipseEngine::drawC64UI(Graphics::Surface *surface) {
drawStringInSurface(shieldStr, x, 161, back, red, surface);
- Common::Rect jarBackground(120, 162, 144, 192 - 4);
+ Common::Rect jarBackground(112, 170, 144, 196);
surface->fillRect(jarBackground, back);
- Common::Rect jarWater(120, 192 - energy - 4, 144, 192 - 4);
+ Common::Rect jarWater(112, 196 - energy, 144, 196);
surface->fillRect(jarWater, blue);
- drawStringInSurface(shiftStr("0", 'Z' - '$' + 1 - _angleRotationIndex), 79, 141, back, yellow, surface);
+ /*drawStringInSurface(shiftStr("0", 'Z' - '$' + 1 - _angleRotationIndex), 79, 141, back, yellow, surface);
drawStringInSurface(shiftStr("3", 'Z' - '$' + 1 - _playerStepIndex), 63, 141, back, yellow, surface);
drawStringInSurface(shiftStr("7", 'Z' - '$' + 1 - _playerHeightNumber), 240, 141, back, yellow, surface);
@@ -142,10 +147,10 @@ void EclipseEngine::drawC64UI(Graphics::Surface *surface) {
drawAnalogClock(surface, 89, 172, back, back, gray);
surface->fillRect(Common::Rect(227, 168, 235, 187), gray);
- drawCompass(surface, 231, 177, _yaw, 10, back);
+ drawCompass(surface, 231, 177, _yaw, 10, back);*/
//drawIndicator(surface, 65, 7, 8);
- drawEclipseIndicator(surface, 215, 3, front, gray);
+ drawEclipseIndicator(surface, 224, 0, front, green);
}
} // End of namespace Freescape
\ No newline at end of file
diff --git a/engines/freescape/games/eclipse/cpc.cpp b/engines/freescape/games/eclipse/cpc.cpp
index 3f9fa11b480..0e4b88d9f70 100644
--- a/engines/freescape/games/eclipse/cpc.cpp
+++ b/engines/freescape/games/eclipse/cpc.cpp
@@ -184,8 +184,7 @@ void EclipseEngine::drawCPCUI(Graphics::Surface *surface) {
} else if (!_currentAreaMessages.empty())
drawStringInSurface(_currentArea->_name, 102, 135, back, front, surface);
- Common::String scoreStr = Common::String::format("%07d", score);
- Common::String encodedScoreStr = shiftStr(scoreStr, 'Z' - '0' + 1);
+ Common::String encodedScoreStr = getScoreString(score);
drawStringInSurface(encodedScoreStr, 136, 6, back, other, surface);
int x = 171;
diff --git a/engines/freescape/games/eclipse/dos.cpp b/engines/freescape/games/eclipse/dos.cpp
index f75fdc6a3e4..b1d58391e2e 100644
--- a/engines/freescape/games/eclipse/dos.cpp
+++ b/engines/freescape/games/eclipse/dos.cpp
@@ -120,8 +120,7 @@ void EclipseEngine::drawDOSUI(Graphics::Surface *surface) {
} else if (!_currentAreaMessages.empty())
drawStringInSurface(_currentArea->_name, 102, 135, black, yellow, surface);
- Common::String scoreStr = Common::String::format("%07d", score);
- Common::String encodedScoreStr = shiftStr(scoreStr, 'Z' - '0' + 1);
+ Common::String encodedScoreStr = getScoreString(score);
drawStringInSurface(encodedScoreStr, 136, 6, black, white, surface);
int x = 171;
diff --git a/engines/freescape/games/eclipse/eclipse.cpp b/engines/freescape/games/eclipse/eclipse.cpp
index 17008cd14e0..ad92ca6c327 100644
--- a/engines/freescape/games/eclipse/eclipse.cpp
+++ b/engines/freescape/games/eclipse/eclipse.cpp
@@ -324,12 +324,9 @@ void EclipseEngine::drawBackground() {
uint8 color1 = 15;
uint8 color2 = 10;
- if (isSpectrum() || isCPC()) {
+ if (isSpectrum() || isCPC() || isC64()) {
color1 = 2;
color2 = 10;
- } else if (isC64()) {
- color1 = 1;
- color2 = 5;
} else if (isAmiga() || isAtariST()) {
color1 = 8;
color2 = 14;
@@ -699,6 +696,24 @@ void EclipseEngine::drawSensorShoot(Sensor *sensor) {
}
}
+Common::String EclipseEngine::getScoreString(int score) {
+ Common::String scoreStr = Common::String::format("%07d", score);
+
+ if (isDOS() || isCPC() || isSpectrum()) {
+ scoreStr = shiftStr(scoreStr, 'Z' - '0' + 1);
+ if (_renderMode == Common::RenderMode::kRenderEGA || isSpectrum())
+ return scoreStr;
+ }
+ Common::String encodedScoreStr;
+
+ for (int i = 0; i < int(scoreStr.size()); i++) {
+ encodedScoreStr.insertChar(scoreStr[int(scoreStr.size()) - i - 1], 0);
+ if ((i + 1) % 3 == 0 && i > 0)
+ encodedScoreStr.insertChar(',', 0);
+ }
+ return encodedScoreStr;
+}
+
void EclipseEngine::updateTimeVariables() {
if (isEclipse2() && _gameStateControl == kFreescapeGameStateStart) {
executeLocalGlobalConditions(false, true, false);
diff --git a/engines/freescape/games/eclipse/eclipse.h b/engines/freescape/games/eclipse/eclipse.h
index eb177c5fd13..b5bc09f429c 100644
--- a/engines/freescape/games/eclipse/eclipse.h
+++ b/engines/freescape/games/eclipse/eclipse.h
@@ -89,6 +89,7 @@ public:
void drawAnalogClockHand(Graphics::Surface *surface, int x, int y, double degrees, double magnitude, uint32 color);
void drawCompass(Graphics::Surface *surface, int x, int y, double degrees, double magnitude, uint32 color);
void drawEclipseIndicator(Graphics::Surface *surface, int x, int y, uint32 color1, uint32 color2);
+ Common::String getScoreString(int score);
soundFx *load1bPCM(Common::SeekableReadStream *file, int offset);
diff --git a/engines/freescape/games/eclipse/zx.cpp b/engines/freescape/games/eclipse/zx.cpp
index d7c1d3c3b3b..57b5e8b6674 100644
--- a/engines/freescape/games/eclipse/zx.cpp
+++ b/engines/freescape/games/eclipse/zx.cpp
@@ -199,9 +199,8 @@ void EclipseEngine::drawZXUI(Graphics::Surface *surface) {
} else if (!_currentAreaMessages.empty())
drawStringInSurface(_currentArea->_name, 102, 141, back, yellow, surface);
- Common::String scoreStr = Common::String::format("%07d", score);
- Common::String encodedScoreStr = shiftStr(scoreStr, 'Z' - '0' + 1);
- drawStringInSurface(encodedScoreStr, 133, 11, back, gray, surface, 'Z' - '0' + 1);
+ Common::String encodedScoreStr = getScoreString(score);
+ drawStringInSurface(encodedScoreStr, 135, 11, back, gray, surface);
Common::String shieldStr = Common::String::format("%d", shield);
Commit: b910bf9ee3c3f0958f14187d3332ec0fb4072e86
https://github.com/scummvm/scummvm/commit/b910bf9ee3c3f0958f14187d3332ec0fb4072e86
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2025-04-26T13:07:51+02:00
Commit Message:
FREESCAPE: added disc variant for c64 dark
Changed paths:
engines/freescape/detection.cpp
engines/freescape/doodle.cpp
engines/freescape/freescape.h
engines/freescape/games/dark/c64.cpp
engines/freescape/games/dark/dark.cpp
engines/freescape/games/dark/dark.h
engines/freescape/games/driller/c64.cpp
diff --git a/engines/freescape/detection.cpp b/engines/freescape/detection.cpp
index a350158326d..caed4d62ee7 100644
--- a/engines/freescape/detection.cpp
+++ b/engines/freescape/detection.cpp
@@ -101,7 +101,7 @@ static const ADGameDescription gameDescriptions[] = {
AD_ENTRY1s("DRILLER.C64.DATA", "055b261bf28f313041bc4c23ff03c8da", 54532),
Common::EN_ANY,
Common::kPlatformC64,
- ADGF_UNSTABLE | GF_C64_RETAIL,
+ ADGF_UNSTABLE | GF_C64_TAPE,
GUIO2(GUIO_NOMIDI, GAMEOPTION_AUTOMATIC_DRILLING)
},
{
@@ -110,7 +110,7 @@ static const ADGameDescription gameDescriptions[] = {
AD_ENTRY1s("DRILLER.C64.DATA", "4afec6eea3887343e7f91fb21a2f2948", 43278),
Common::EN_ANY,
Common::kPlatformC64,
- ADGF_UNSTABLE | GF_C64_BUDGET,
+ ADGF_UNSTABLE | GF_C64_TAPE,
GUIO2(GUIO_NOMIDI, GAMEOPTION_AUTOMATIC_DRILLING)
},
{
@@ -519,14 +519,25 @@ static const ADGameDescription gameDescriptions[] = {
GUIO2(GUIO_NOMIDI, GUIO_RENDERCPC)
},
{
- "darkside", // Tape relese
+ "darkside", // Tape release
"",
AD_ENTRY1s("DARKSIDE.C64.DATA", "c0d271d86cf4434ef7c3d823a32c0df5", 61290),
Common::EN_ANY,
Common::kPlatformC64,
- ADGF_UNSTABLE,
+ ADGF_UNSTABLE | GF_C64_TAPE,
GUIO2(GUIO_NOMIDI, GAMEOPTION_AUTOMATIC_DRILLING)
},
+
+ {
+ "darkside", // Disk release
+ "",
+ AD_ENTRY1s("DARKSIDE.C64.DATA", "1d8e42c71d6a9ae0e682396824dd12ba", 53780),
+ Common::EN_ANY,
+ Common::kPlatformC64,
+ ADGF_UNSTABLE | GF_C64_DISC,
+ GUIO2(GUIO_NOMIDI, GAMEOPTION_AUTOMATIC_DRILLING)
+ },
+
// Total Eclipse
{
"totaleclipse",
diff --git a/engines/freescape/doodle.cpp b/engines/freescape/doodle.cpp
index c7174f8c858..0d06cae6c5a 100644
--- a/engines/freescape/doodle.cpp
+++ b/engines/freescape/doodle.cpp
@@ -34,7 +34,7 @@ bool DoodleDecoder::loadStreams(Common::SeekableReadStream &highresStream,
destroy();
// Check stream sizes
- if (highresStream.size() < 8187) {
+ if (highresStream.size() < 8002) {
error("DoodleDecoder: Invalid high-resolution data size");
return false;
}
diff --git a/engines/freescape/freescape.h b/engines/freescape/freescape.h
index dccea31bfd0..464f68aeed6 100644
--- a/engines/freescape/freescape.h
+++ b/engines/freescape/freescape.h
@@ -606,8 +606,8 @@ enum GameReleaseFlags {
GF_CPC_VIRTUALWORLDS = (1 << 8),
GF_ATARI_RETAIL = (1 << 9),
GF_ATARI_BUDGET = (1 << 10),
- GF_C64_RETAIL = (1 << 11),
- GF_C64_BUDGET = (1 << 12),
+ GF_C64_TAPE = (1 << 11),
+ GF_C64_DISC = (1 << 12),
};
extern FreescapeEngine *g_freescape;
diff --git a/engines/freescape/games/dark/c64.cpp b/engines/freescape/games/dark/c64.cpp
index 88168390c0e..fec46d90c90 100644
--- a/engines/freescape/games/dark/c64.cpp
+++ b/engines/freescape/games/dark/c64.cpp
@@ -20,6 +20,7 @@
*/
#include "common/file.h"
+#include "common/memstream.h"
#include "freescape/freescape.h"
#include "freescape/games/dark/dark.h"
@@ -36,10 +37,28 @@ extern byte kC64Palette[16][3];
void DarkEngine::loadAssetsC64FullGame() {
Common::File file;
file.open("darkside.c64.data");
- loadMessagesFixedSize(&file, 0x1edf, 16, 27);
- loadFonts(&file, 0xc3e);
- loadGlobalObjects(&file, 0x20bd, 23);
- load8bitBinary(&file, 0x9b3e, 16);
+
+ if (_variant & GF_C64_TAPE) {
+ loadMessagesFixedSize(&file, 0x1edf, 16, 27);
+ loadFonts(&file, 0xc3e);
+ loadGlobalObjects(&file, 0x20bd, 23);
+ load8bitBinary(&file, 0x9b3e, 16);
+ } else if (_variant & GF_C64_DISC) {
+ loadMessagesFixedSize(&file, 0x16a3, 16, 27);
+ loadFonts(&file, 0x402);
+
+ // It is unclear why this C64 has this byte changed at 0x1881
+ // Once the game is loaded, it will be set to 0x66
+ // and the game will work
+ file.seek(0x1881);
+ _extraBuffer = (byte *)malloc(0x300 * sizeof(byte));
+ file.read(_extraBuffer, 0x300);
+ _extraBuffer[0] = 0x66;
+ Common::MemoryReadStream stream(_extraBuffer, 0x300, DisposeAfterUse::NO);
+ loadGlobalObjects(&stream, 0x0, 23);
+ load8bitBinary(&file, 0x8914, 16);
+ } else
+ error("Unknown C64 variant %x", _variant);
// The color map from the data is not correct,
// so we'll just hardcode the one that we found in the executable
diff --git a/engines/freescape/games/dark/dark.cpp b/engines/freescape/games/dark/dark.cpp
index 3609a2aa62a..9d1ba8cb990 100644
--- a/engines/freescape/games/dark/dark.cpp
+++ b/engines/freescape/games/dark/dark.cpp
@@ -84,6 +84,13 @@ DarkEngine::DarkEngine(OSystem *syst, const ADGameDescription *gd) : FreescapeEn
_initialShield = 15;
_jetFuelSeconds = _initialEnergy * 6;
+ _extraBuffer = nullptr;
+}
+
+DarkEngine::~DarkEngine() {
+ if (_extraBuffer)
+ free(_extraBuffer);
+ _extraBuffer = nullptr;
}
void DarkEngine::addECDs(Area *area) {
diff --git a/engines/freescape/games/dark/dark.h b/engines/freescape/games/dark/dark.h
index 27b5788d896..90e530a3d1e 100644
--- a/engines/freescape/games/dark/dark.h
+++ b/engines/freescape/games/dark/dark.h
@@ -48,6 +48,7 @@ enum DarkFontSize {
class DarkEngine : public FreescapeEngine {
public:
DarkEngine(OSystem *syst, const ADGameDescription *gd);
+ ~DarkEngine();
uint32 _initialEnergy;
uint32 _initialShield;
@@ -104,6 +105,8 @@ public:
int _soundIndexDestroyECD;
Audio::SoundHandle _soundFxHandleJetpack;
+ byte *_extraBuffer;
+
void drawString(const DarkFontSize size, const Common::String &str, int x, int y, uint32 primaryColor, uint32 secondaryColor, uint32 backColor, Graphics::Surface *surface);
void drawInfoMenu() override;
diff --git a/engines/freescape/games/driller/c64.cpp b/engines/freescape/games/driller/c64.cpp
index d50fd1f47d4..104f7a39f8f 100644
--- a/engines/freescape/games/driller/c64.cpp
+++ b/engines/freescape/games/driller/c64.cpp
@@ -44,20 +44,18 @@ void DrillerEngine::loadAssetsC64FullGame() {
} else if (_targetName.hasPrefix("driller")) {
file.open("driller.c64.data");
- if (_variant & GF_C64_RETAIL) {
+ if (_variant & GF_C64_TAPE) {
loadFonts(&file, 0x402);
load8bitBinary(&file, 0x8b04, 16);
loadMessagesFixedSize(&file, 0x167a, 14, 20);
loadGlobalObjects(&file, 0x1855, 8);
- } else if (_variant & GF_C64_BUDGET) {
+ /*} else if (_variant & GF_C64_BUDGET) {
//loadFonts(&file, 0x402);
load8bitBinary(&file, 0x7df7, 16);
loadMessagesFixedSize(&file, 0x1399, 14, 20);
- loadGlobalObjects(&file, 0x150a, 8);
- } else {
- //error("Unknown C64 release");
- assert(false);
- }
+ loadGlobalObjects(&file, 0x150a, 8);*/
+ } else
+ error("Unknown C64 variant %x", _variant);
// The color map from the data is not correct,
// so we'll just hardcode the one that we found in the executable
Commit: 6814bb3521c935225d46a3e0e2760da7a72656fe
https://github.com/scummvm/scummvm/commit/6814bb3521c935225d46a3e0e2760da7a72656fe
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2025-04-26T13:07:51+02:00
Commit Message:
FREESCAPE: allow to change rotation angle (except castle)
Changed paths:
engines/freescape/freescape.h
engines/freescape/games/dark/dark.cpp
engines/freescape/games/driller/driller.cpp
engines/freescape/games/eclipse/eclipse.cpp
engines/freescape/movement.cpp
diff --git a/engines/freescape/freescape.h b/engines/freescape/freescape.h
index 464f68aeed6..2633ca6d1c5 100644
--- a/engines/freescape/freescape.h
+++ b/engines/freescape/freescape.h
@@ -69,7 +69,8 @@ enum FreescapeAction {
kActionMoveLeft,
kActionMoveRight,
kActionShoot,
- kActionChangeAngle,
+ kActionIncreaseAngle,
+ kActionDecreaseAngle,
kActionChangeStepSize,
kActionToggleRiseLower,
kActionRiseOrFlyUp,
@@ -343,7 +344,7 @@ public:
void decreaseStepSize();
void changeStepSize();
- void changeAngle();
+ void changeAngle(int offset, bool wrapAround);
bool rise();
void lower();
bool checkFloor(Math::Vector3d currentPosition);
diff --git a/engines/freescape/games/dark/dark.cpp b/engines/freescape/games/dark/dark.cpp
index 9d1ba8cb990..ed29e196bfc 100644
--- a/engines/freescape/games/dark/dark.cpp
+++ b/engines/freescape/games/dark/dark.cpp
@@ -236,6 +236,17 @@ void DarkEngine::initKeymaps(Common::Keymap *engineKeyMap, Common::Keymap *infoS
act->addDefaultInputMapping("m");
engineKeyMap->addAction(act);
+ // I18N: Illustrates the angle at which you turn left or right.
+ act = new Common::Action("INCANGLE", _("Increase Turn Angle"));
+ act->setCustomEngineActionEvent(kActionIncreaseAngle);
+ act->addDefaultInputMapping("a");
+ engineKeyMap->addAction(act);
+
+ act = new Common::Action("DECANGLE", _("Decrease Turn Angle"));
+ act->setCustomEngineActionEvent(kActionDecreaseAngle);
+ act->addDefaultInputMapping("z");
+ engineKeyMap->addAction(act);
+
// I18N: STEP SIZE: Measures the size of one movement in the direction you are facing (1-250 standard distance units (SDUs))
act = new Common::Action("INCSTEPSIZE", _("Increase Step Size"));
act->setCustomEngineActionEvent(kActionIncreaseStepSize);
@@ -284,6 +295,10 @@ void DarkEngine::initGameState() {
getTimeFromCountdown(seconds, minutes, hours);
_lastMinute = minutes;
_lastTenSeconds = seconds / 10;
+
+ _angleRotationIndex = 0;
+ _playerStepIndex = 6;
+
// Start playing music, if any, in any supported format
playMusic("Dark Side Theme");
}
@@ -665,6 +680,10 @@ void DarkEngine::pressedKey(const int keycode) {
increaseStepSize();
} else if (keycode == kActionDecreaseStepSize) {
decreaseStepSize();
+ } else if (keycode == kActionIncreaseAngle) {
+ changeAngle(1, false);
+ } else if (keycode == kActionDecreaseAngle) {
+ changeAngle(-1, false);
} else if (keycode == kActionRollRight) {
rotate(0, 0, -_angleRotations[_angleRotationIndex]);
} else if (keycode == kActionRollLeft) {
diff --git a/engines/freescape/games/driller/driller.cpp b/engines/freescape/games/driller/driller.cpp
index 2298be71f21..11e92ba5b70 100644
--- a/engines/freescape/games/driller/driller.cpp
+++ b/engines/freescape/games/driller/driller.cpp
@@ -166,6 +166,17 @@ void DrillerEngine::initKeymaps(Common::Keymap *engineKeyMap, Common::Keymap *in
act->addDefaultInputMapping("w");
engineKeyMap->addAction(act);
+ // I18N: Illustrates the angle at which you turn left or right.
+ act = new Common::Action("INCANGLE", _("Increase Turn Angle"));
+ act->setCustomEngineActionEvent(kActionIncreaseAngle);
+ act->addDefaultInputMapping("a");
+ engineKeyMap->addAction(act);
+
+ act = new Common::Action("DECANGLE", _("Decrease Turn Angle"));
+ act->setCustomEngineActionEvent(kActionDecreaseAngle);
+ act->addDefaultInputMapping("z");
+ engineKeyMap->addAction(act);
+
// I18N: STEP SIZE: Measures the size of one movement in the direction you are facing (1-250 standard distance units (SDUs))
act = new Common::Action("INCSTEPSIZE", _("Increase Step Size"));
act->setCustomEngineActionEvent(kActionIncreaseStepSize);
@@ -510,6 +521,10 @@ void DrillerEngine::pressedKey(const int keycode) {
rise();
} else if (keycode == kActionLowerOrFlyDown) {
lower();
+ } else if (keycode == kActionIncreaseAngle) {
+ changeAngle(1, false);
+ } else if (keycode == kActionDecreaseAngle) {
+ changeAngle(-1, false);
} else if (keycode == kActionRollRight) {
rotate(0, 0, -_angleRotations[_angleRotationIndex]);
} else if (keycode == kActionRollLeft) {
@@ -875,6 +890,8 @@ void DrillerEngine::initGameState() {
_gameStateVars[k8bitVariableShieldDrillerJet] = _initialJetShield;
_playerHeightNumber = 1;
+ _angleRotationIndex = 0;
+ _playerStepIndex = 6;
_demoIndex = 0;
_demoEvents.clear();
diff --git a/engines/freescape/games/eclipse/eclipse.cpp b/engines/freescape/games/eclipse/eclipse.cpp
index ad92ca6c327..f804e067622 100644
--- a/engines/freescape/games/eclipse/eclipse.cpp
+++ b/engines/freescape/games/eclipse/eclipse.cpp
@@ -238,7 +238,7 @@ void EclipseEngine::initKeymaps(Common::Keymap *engineKeyMap, Common::Keymap *in
// I18N: Illustrates the angle at which you turn left or right.
act = new Common::Action("CHNGANGLE", _("Change Angle"));
- act->setCustomEngineActionEvent(kActionChangeAngle);
+ act->setCustomEngineActionEvent(kActionIncreaseAngle);
act->addDefaultInputMapping("a");
engineKeyMap->addAction(act);
@@ -460,8 +460,8 @@ void EclipseEngine::drawInfoMenu() {
}
void EclipseEngine::pressedKey(const int keycode) {
- if (keycode == kActionChangeAngle) {
- changeAngle();
+ if (keycode == kActionIncreaseAngle) {
+ changeAngle(1, true);
} else if (keycode == kActionChangeStepSize) {
changeStepSize();
} else if (keycode == kActionToggleRiseLower) {
diff --git a/engines/freescape/movement.cpp b/engines/freescape/movement.cpp
index c6d04196fdc..6936c395241 100644
--- a/engines/freescape/movement.cpp
+++ b/engines/freescape/movement.cpp
@@ -244,8 +244,21 @@ void FreescapeEngine::shoot() {
executeLocalGlobalConditions(true, false, false); // Only execute "on shot" room/global conditions
}
-void FreescapeEngine::changeAngle() {
- _angleRotationIndex++;
+void FreescapeEngine::changeAngle(int offset, bool wrapAround) {
+ _angleRotationIndex = _angleRotationIndex + offset;
+
+ if (_angleRotationIndex < 0) {
+ if (wrapAround)
+ _angleRotationIndex = int(_angleRotations.size()) - 1;
+ else
+ _angleRotationIndex = 0;
+ } else if (_angleRotationIndex >= int(_angleRotations.size())) {
+ if (wrapAround)
+ _angleRotationIndex = 0;
+ else
+ _angleRotationIndex = int(_angleRotations.size()) - 1;
+ }
+
_angleRotationIndex = _angleRotationIndex % int(_angleRotations.size());
}
More information about the Scummvm-git-logs
mailing list