[Scummvm-git-logs] scummvm master -> 70b6da92111986f9b4d7a751c44d1dfc4f3ff969
AndywinXp
noreply at scummvm.org
Sun Oct 1 07:33:42 UTC 2023
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
70b6da9211 SWORD1: Apply script patch found in executable and source
Commit: 70b6da92111986f9b4d7a751c44d1dfc4f3ff969
https://github.com/scummvm/scummvm/commit/70b6da92111986f9b4d7a751c44d1dfc4f3ff969
Author: AndywinXp (andywinxp at gmail.com)
Date: 2023-10-01T09:33:33+02:00
Commit Message:
SWORD1: Apply script patch found in executable and source
This patch is available in every executable after the
original UK one. Its purpose is to turn off scripts which
were causing issues by continuing running past their scope.
The patch, as descripted within the the original source
code, checks if the game is past the Syria section,
and if so it checks if the Market Stall section is still
alive, and if so it closes both the section (45) and
the Mega object for Duane (134), effectively terminating
their scripts.
Changed paths:
engines/sword1/objectman.cpp
engines/sword1/objectman.h
engines/sword1/sword1.cpp
diff --git a/engines/sword1/objectman.cpp b/engines/sword1/objectman.cpp
index 2637fcf50d2..02509334f4c 100644
--- a/engines/sword1/objectman.cpp
+++ b/engines/sword1/objectman.cpp
@@ -231,6 +231,28 @@ void ObjectMan::loadLiveList(uint16 *src) {
}
}
+void ObjectMan::mainLoopPatch() {
+ // This patch is available in every executable after the
+ // original UK one. Its purpose is to turn off scripts which
+ // were causing issues by continuing running past their scope.
+ // The patch, as descripted within the the original source
+ // code, checks if the game is past the Syria section,
+ // and if so it checks if the Market Stall section is still
+ // alive, and if so it closes both the section (45) and
+ // the Mega object for Duane (134), effectively terminating
+ // their scripts.
+
+ if (_liveList[45] > 0) {
+ _liveList[45] = 0; // Turn off the Syria Market Stall
+ _resMan->resClose(_objectList[45]);
+
+ if (_liveList[134] > 0) {
+ _liveList[134] = 0; // Turn off Duane
+ _resMan->resClose(_objectList[134]);
+ }
+ }
+}
+
void ObjectMan::saveLiveList(uint16 *dest) {
memcpy(dest, _liveList, TOTAL_SECTIONS * sizeof(uint16));
}
diff --git a/engines/sword1/objectman.h b/engines/sword1/objectman.h
index 36e8adb5580..72970a37814 100644
--- a/engines/sword1/objectman.h
+++ b/engines/sword1/objectman.h
@@ -51,6 +51,9 @@ public:
void saveLiveList(uint16 *dest); // for loading/saving
void loadLiveList(uint16 *src);
+
+ void mainLoopPatch();
+
private:
char *lockText(uint32 textId, uint8 language);
void unlockText(uint32 textId, uint8 language);
diff --git a/engines/sword1/sword1.cpp b/engines/sword1/sword1.cpp
index 2807ad6f4dc..063b1de5301 100644
--- a/engines/sword1/sword1.cpp
+++ b/engines/sword1/sword1.cpp
@@ -1018,7 +1018,9 @@ uint8 SwordEngine::mainLoop() {
if (shouldQuit())
break;
- // do we need the section45-hack from sword.c here?
+ if (Logic::_scriptVars[NEW_SCREEN] > 50)
+ _objectMan->mainLoopPatch();
+
checkCd();
_screen->newScreen(Logic::_scriptVars[NEW_SCREEN]);
More information about the Scummvm-git-logs
mailing list