[Scummvm-git-logs] scummvm master -> 51b9f6f70536eda31144f0e67d83984dc6c01e6e
neuromancer
noreply at scummvm.org
Sun Jun 4 12:57:00 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:
0f2b44f07f FREESCAPE: better detection of driller releases for atari
4ed75d9c21 FREESCAPE: more precise timing of some fcl instructions
c9f9e897aa FREESCAPE: better code to transition between areas
2c40ad1b12 FREESCAPE: correctly scale mouse position in opengl renderers
51b9f6f705 FREESCAPE: fixes for driller demo
Commit: 0f2b44f07fd9da191b48a63554eb0ad71df5a0b9
https://github.com/scummvm/scummvm/commit/0f2b44f07fd9da191b48a63554eb0ad71df5a0b9
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2023-06-04T14:49:10+02:00
Commit Message:
FREESCAPE: better detection of driller releases for atari
Changed paths:
engines/freescape/detection.cpp
engines/freescape/freescape.h
engines/freescape/games/driller/atari.cpp
diff --git a/engines/freescape/detection.cpp b/engines/freescape/detection.cpp
index 6c70c1e1895..49e3c5f1c29 100644
--- a/engines/freescape/detection.cpp
+++ b/engines/freescape/detection.cpp
@@ -376,12 +376,12 @@ static const ADGameDescription gameDescriptions[] = {
"spacestationoblivion",
"",
{
- {"x.prg", 0, "10c556ee637bf03bcc1a051277542102", 293264},
+ {"x.prg", 0, "7fc6ef316be4819d88d8031738571a50", 293264},
AD_LISTEND
},
Common::EN_ANY,
Common::kPlatformAtariST,
- ADGF_UNSUPPORTED,
+ GF_ATARI_BUDGET,
GUIO2(GUIO_NOMIDI, GAMEOPTION_AUTOMATIC_DRILLING)
},
{
diff --git a/engines/freescape/freescape.h b/engines/freescape/freescape.h
index e011af256f7..90bbdf1f1b3 100644
--- a/engines/freescape/freescape.h
+++ b/engines/freescape/freescape.h
@@ -96,6 +96,7 @@ public:
// Game selection
uint32 _variant;
Common::Language _language;
+ bool isSpaceStationOblivion() { return _targetName.hasPrefix("spacestationoblivion"); }
bool isDriller() { return _targetName.hasPrefix("driller") || _targetName.hasPrefix("spacestationoblivion"); }
bool isDark() { return _targetName.hasPrefix("darkside"); }
bool isEclipse() { return _targetName.hasPrefix("totaleclipse"); }
diff --git a/engines/freescape/games/driller/atari.cpp b/engines/freescape/games/driller/atari.cpp
index df588dd62b6..5cf36467991 100644
--- a/engines/freescape/games/driller/atari.cpp
+++ b/engines/freescape/games/driller/atari.cpp
@@ -80,21 +80,39 @@ void DrillerEngine::loadAssetsAtariFullGame() {
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);
+ if (isSpaceStationOblivion()) {
+ _border = loadAndConvertNeoImage(&file, 0x13544);
+ 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 - 0x1d6);
+ loadMessagesFixedSize(&file, 0xc5d8 - 0x1da, 14, 20);
+ loadGlobalObjects(&file, 0xbccc - 0x1da, 8);
+ load8bitBinary(&file, 0x29b3c - 0x1d6, 16);
+ loadPalettes(&file, 0x296fa - 0x1d6);
+ loadSoundsFx(&file, 0x30da6 - 0x1d6, 25);
+ } else {
+ _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, 8);
+ load8bitBinary(&file, 0x29b3c, 16);
+ loadPalettes(&file, 0x296fa);
+ loadSoundsFx(&file, 0x30da6, 25);
}
- _title = loadAndConvertNeoImage(&file, 0x10, palette);
-
- loadFonts(&file, 0x8a32);
- loadMessagesFixedSize(&file, 0xc5d8, 14, 20);
- loadGlobalObjects(&file, 0xbccc, 8);
- load8bitBinary(&file, 0x29b3c, 16);
- loadPalettes(&file, 0x296fa);
- loadSoundsFx(&file, 0x30da6, 25);
}
}
Commit: 4ed75d9c21c6fe09d6edb0b81da7a495d587ebbe
https://github.com/scummvm/scummvm/commit/4ed75d9c21c6fe09d6edb0b81da7a495d587ebbe
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2023-06-04T14:49:10+02:00
Commit Message:
FREESCAPE: more precise timing of some fcl instructions
Changed paths:
engines/freescape/games/driller/driller.cpp
engines/freescape/language/instruction.cpp
engines/freescape/sound.cpp
diff --git a/engines/freescape/games/driller/driller.cpp b/engines/freescape/games/driller/driller.cpp
index 3d4d2075e07..d66a3a71b25 100644
--- a/engines/freescape/games/driller/driller.cpp
+++ b/engines/freescape/games/driller/driller.cpp
@@ -433,6 +433,7 @@ void DrillerEngine::pressedKey(const int keycode) {
_gameStateVars[32]++;
} else
_drillStatusByArea[_currentArea->getAreaID()] = kDrillerRigOutOfPlace;
+ executeMovementConditions();
} else if (keycode == Common::KEYCODE_c) {
if (isDOS() && isDemo()) // No support for drilling here yet
return;
@@ -473,6 +474,7 @@ void DrillerEngine::pressedKey(const int keycode) {
uint32 scoreToRemove = uint32(maxScore * success) / 100;
assert(scoreToRemove <= uint32(_gameStateVars[k8bitVariableScore]));
_gameStateVars[k8bitVariableScore] -= scoreToRemove;
+ executeMovementConditions();
}
}
diff --git a/engines/freescape/language/instruction.cpp b/engines/freescape/language/instruction.cpp
index e040fe6492c..17ebb83f044 100644
--- a/engines/freescape/language/instruction.cpp
+++ b/engines/freescape/language/instruction.cpp
@@ -93,6 +93,7 @@ void FreescapeEngine::executeObjectConditions(GeometricObject *obj, bool shot, b
assert(obj != nullptr);
if (!obj->_conditionSource.empty()) {
_firstSound = true;
+ _syncSound = false;
_objExecutingCodeSize = collided ? obj->getSize() : Math::Vector3d();
if (collided)
debugC(1, kFreescapeDebugCode, "Executing with collision flag: %s", obj->_conditionSource.c_str());
@@ -250,7 +251,15 @@ void FreescapeEngine::executeRedraw(FCLInstruction &instruction) {
_gfx->flipBuffer();
g_system->updateScreen();
g_system->delayMillis(10);
- waitForSounds();
+
+ drawFrame();
+ _gfx->flipBuffer();
+ g_system->updateScreen();
+ g_system->delayMillis(isCPC() ? 100 : 10);
+
+ if (_syncSound) {
+ waitForSounds();
+ }
}
void FreescapeEngine::executeExecute(FCLInstruction &instruction) {
diff --git a/engines/freescape/sound.cpp b/engines/freescape/sound.cpp
index 053d9668f72..016be2cb3fc 100644
--- a/engines/freescape/sound.cpp
+++ b/engines/freescape/sound.cpp
@@ -38,7 +38,8 @@ void FreescapeEngine::playSound(int index, bool sync) {
_syncSound = sync;
return;
}
- waitForSounds();
+ if (_syncSound)
+ waitForSounds();
switch (index) {
case 1:
if (_usePrerecordedSounds) {
@@ -267,8 +268,13 @@ void FreescapeEngine::stopAllSounds() {
}
void FreescapeEngine::waitForSounds() {
- while (!_speaker->endOfStream())
- g_system->delayMillis(10);
+ if (_usePrerecordedSounds || isAmiga() || isAtariST())
+ while (_mixer->isSoundIDActive(-1))
+ g_system->delayMillis(10);
+ else {
+ while (!_speaker->endOfStream())
+ g_system->delayMillis(10);
+ }
}
bool FreescapeEngine::isPlayingSound() {
Commit: c9f9e897aad7ea3c4376fa0ff4beaf2a72019210
https://github.com/scummvm/scummvm/commit/c9f9e897aad7ea3c4376fa0ff4beaf2a72019210
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2023-06-04T14:49:10+02:00
Commit Message:
FREESCAPE: better code to transition between areas
Changed paths:
engines/freescape/movement.cpp
diff --git a/engines/freescape/movement.cpp b/engines/freescape/movement.cpp
index ed0564cb815..3202e203824 100644
--- a/engines/freescape/movement.cpp
+++ b/engines/freescape/movement.cpp
@@ -57,7 +57,9 @@ void FreescapeEngine::traverseEntrance(uint16 entranceID) {
}
_pitch = rotation.x();
- if (_objExecutingCodeSize.length() == 0 || ABS(_objExecutingCodeSize.x()) > ABS(_objExecutingCodeSize.z()))
+ if (rotation.y() > 0 && rotation.y() <= 45)
+ _yaw = rotation.y();
+ else if (rotation.y() <= 0 || (rotation.y() >= 180 && rotation.y() < 270))
_yaw = rotation.y() + 90;
else
_yaw = rotation.y() - 90;
Commit: 2c40ad1b12f148d5de0cfc5fe889bbcd550a1f14
https://github.com/scummvm/scummvm/commit/2c40ad1b12f148d5de0cfc5fe889bbcd550a1f14
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2023-06-04T14:49:10+02:00
Commit Message:
FREESCAPE: correctly scale mouse position in opengl renderers
Changed paths:
engines/freescape/freescape.cpp
engines/freescape/gfx.h
engines/freescape/gfx_opengl.cpp
engines/freescape/gfx_opengl.h
engines/freescape/gfx_opengl_shaders.cpp
engines/freescape/gfx_opengl_shaders.h
diff --git a/engines/freescape/freescape.cpp b/engines/freescape/freescape.cpp
index f985adefcf8..73af6eb844b 100644
--- a/engines/freescape/freescape.cpp
+++ b/engines/freescape/freescape.cpp
@@ -468,22 +468,25 @@ void FreescapeEngine::processInput() {
if (_shootMode) {
{
bool shouldWarp = false;
- _crossairPosition = mousePos;
- if (mousePos.x < _viewArea.left) {
+ Common::Point resolution = _gfx->nativeResolution();
+ _crossairPosition.x = _screenW * mousePos.x / resolution.x;
+ _crossairPosition.y = _screenH * mousePos.y / resolution.y;
+
+ if (_crossairPosition.x < _viewArea.left) {
_crossairPosition.x = _viewArea.left + 1;
shouldWarp = true;
}
- if (mousePos.x > _viewArea.right) {
+ if (_crossairPosition.x > _viewArea.right) {
_crossairPosition.x = _viewArea.right - 1;
shouldWarp = true;
}
- if (mousePos.y < _viewArea.top) {
+ if (_crossairPosition.y < _viewArea.top) {
_crossairPosition.y = _viewArea.top + 1;
shouldWarp = true;
}
- if (mousePos.y > _viewArea.bottom) {
+ if (_crossairPosition.y > _viewArea.bottom) {
_crossairPosition.y = _viewArea.bottom - 1;
shouldWarp = true;
}
@@ -508,6 +511,9 @@ void FreescapeEngine::processInput() {
bool touchedScreenControls = false;
#if defined(__ANDROID__) || defined(IPHONE)
+ Common::Point resolution = _gfx->nativeResolution();
+ mousPos.x = _screenW * mousePos.x / resolution.x;
+ mousPos.y = _screenH * mousePos.y / resolution.y;
touchedScreenControls = onScreenControls(mousePos);
#endif
diff --git a/engines/freescape/gfx.h b/engines/freescape/gfx.h
index 7e38d4d7812..e269e45f486 100644
--- a/engines/freescape/gfx.h
+++ b/engines/freescape/gfx.h
@@ -96,6 +96,7 @@ public:
virtual void drawBackground(uint8 color);
Common::Rect viewport() const;
+ virtual Common::Point nativeResolution() { return Common::Point(_screenW, _screenH); }
// palette
void readFromPalette(uint8 index, uint8 &r, uint8 &g, uint8 &b);
diff --git a/engines/freescape/gfx_opengl.cpp b/engines/freescape/gfx_opengl.cpp
index 75c6408d35f..f00435c79fb 100644
--- a/engines/freescape/gfx_opengl.cpp
+++ b/engines/freescape/gfx_opengl.cpp
@@ -58,6 +58,12 @@ void OpenGLRenderer::freeTexture(Texture *texture) {
delete texture;
}
+Common::Point OpenGLRenderer::nativeResolution() {
+ GLint vect[4];
+ glGetIntegerv(GL_VIEWPORT, vect);
+ return Common::Point(vect[2], vect[3]);
+}
+
void OpenGLRenderer::init() {
computeScreenViewport();
diff --git a/engines/freescape/gfx_opengl.h b/engines/freescape/gfx_opengl.h
index 07536360988..1606bece443 100644
--- a/engines/freescape/gfx_opengl.h
+++ b/engines/freescape/gfx_opengl.h
@@ -84,6 +84,7 @@ public:
virtual void init() override;
virtual void clear(uint8 r, uint8 g, uint8 b) override;
virtual void setViewport(const Common::Rect &rect) override;
+ virtual Common::Point nativeResolution() override;
virtual void positionCamera(const Math::Vector3d &pos, const Math::Vector3d &interest) override;
virtual void updateProjectionMatrix(float fov, float nearClipPlane, float farClipPlane) override;
diff --git a/engines/freescape/gfx_opengl_shaders.cpp b/engines/freescape/gfx_opengl_shaders.cpp
index f46abb766fe..1055d4d2a96 100644
--- a/engines/freescape/gfx_opengl_shaders.cpp
+++ b/engines/freescape/gfx_opengl_shaders.cpp
@@ -73,6 +73,12 @@ void OpenGLShaderRenderer::freeTexture(Texture *texture) {
delete texture;
}
+Common::Point OpenGLShaderRenderer::nativeResolution() {
+ GLint vect[4];
+ glGetIntegerv(GL_VIEWPORT, vect);
+ return Common::Point(vect[2], vect[3]);
+}
+
void OpenGLShaderRenderer::init() {
computeScreenViewport();
diff --git a/engines/freescape/gfx_opengl_shaders.h b/engines/freescape/gfx_opengl_shaders.h
index ddcfe4a15b5..2ad2824b74e 100644
--- a/engines/freescape/gfx_opengl_shaders.h
+++ b/engines/freescape/gfx_opengl_shaders.h
@@ -67,6 +67,7 @@ public:
virtual void init() override;
virtual void clear(uint8 r, uint8 g, uint8 b) override;
virtual void setViewport(const Common::Rect &rect) override;
+ virtual Common::Point nativeResolution() override;
virtual void positionCamera(const Math::Vector3d &pos, const Math::Vector3d &interest) override;
virtual void updateProjectionMatrix(float fov, float nearClipPlane, float farClipPlane) override;
Commit: 51b9f6f70536eda31144f0e67d83984dc6c01e6e
https://github.com/scummvm/scummvm/commit/51b9f6f70536eda31144f0e67d83984dc6c01e6e
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2023-06-04T14:49:11+02:00
Commit Message:
FREESCAPE: fixes for driller demo
Changed paths:
engines/freescape/demo.cpp
engines/freescape/games/driller/driller.cpp
diff --git a/engines/freescape/demo.cpp b/engines/freescape/demo.cpp
index fc6cb1845eb..aa4227b1c59 100644
--- a/engines/freescape/demo.cpp
+++ b/engines/freescape/demo.cpp
@@ -40,12 +40,19 @@ void FreescapeEngine::generateDemoInput() {
if (_currentDemoInputCode >= 0x16 && _currentDemoInputCode <= 0x1a) {
event = decodeDOSMouseEvent(_currentDemoInputCode, _currentDemoInputRepetition);
+
+ Common::Point resolution = _gfx->nativeResolution();
+ event.mouse.x = resolution.x * event.mouse.x / _screenW;
+ event.mouse.y = resolution.y * event.mouse.y / _screenH ;
+
_demoEvents.push_back(event);
g_system->delayMillis(10);
_currentDemoInputRepetition = 0;
} else if (_currentDemoInputCode == 0x7f) {
// NOP
_currentDemoInputRepetition--;
+ } else if (_currentDemoInputCode == 0x0) {
+ _forceEndGame = true;
} else {
event = Common::Event();
event.type = Common::EVENT_KEYDOWN;
diff --git a/engines/freescape/games/driller/driller.cpp b/engines/freescape/games/driller/driller.cpp
index d66a3a71b25..4dfc8da6336 100644
--- a/engines/freescape/games/driller/driller.cpp
+++ b/engines/freescape/games/driller/driller.cpp
@@ -756,7 +756,8 @@ void DrillerEngine::initGameState() {
bool DrillerEngine::checkIfGameEnded() {
if (isDemo() && _demoMode)
- return (_demoData[_demoIndex + 1] == 0x5f);
+ if (_demoData[_demoIndex + 1] == 0x5f)
+ return true;
if (_countdown <= 0) {
insertTemporaryMessage(_messagesList[14], _countdown - 2);
@@ -800,12 +801,16 @@ bool DrillerEngine::checkIfGameEnded() {
if (_forceEndGame) {
_forceEndGame = false;
- insertTemporaryMessage(_messagesList[18], _countdown - 2);
- drawFrame();
- _gfx->flipBuffer();
- g_system->updateScreen();
- g_system->delayMillis(2000);
- gotoArea(127, 0);
+ if (isDemo())
+ return true;
+ else {
+ insertTemporaryMessage(_messagesList[18], _countdown - 2);
+ drawFrame();
+ _gfx->flipBuffer();
+ g_system->updateScreen();
+ g_system->delayMillis(2000);
+ gotoArea(127, 0);
+ }
}
if (_currentArea->getAreaID() == 127) {
More information about the Scummvm-git-logs
mailing list