[Scummvm-git-logs] scummvm master -> 8645e88c0c88ccad3315fc12bd269a9ffdfe479d
mgerhardy
noreply at scummvm.org
Thu Sep 3 18:00:50 UTC 2026
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
8645e88c0c MACS2: don't read inventory icon indices from MCSEXEC.exe anymore
Commit: 8645e88c0c88ccad3315fc12bd269a9ffdfe479d
https://github.com/scummvm/scummvm/commit/8645e88c0c88ccad3315fc12bd269a9ffdfe479d
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2026-09-03T20:00:27+02:00
Commit Message:
MACS2: don't read inventory icon indices from MCSEXEC.exe anymore
we no longer need the exe file, only the mcs file (and others like music or speech)
Changed paths:
engines/macs2/macs2.cpp
engines/macs2/macs2.h
diff --git a/engines/macs2/macs2.cpp b/engines/macs2/macs2.cpp
index fe306dc2641..cfd34aa303a 100644
--- a/engines/macs2/macs2.cpp
+++ b/engines/macs2/macs2.cpp
@@ -611,41 +611,15 @@ void Macs2Engine::bootstrapMcsActorsObjectsAndScene() {
}
}
-void Macs2Engine::readExecutable() {
- inventoryIconIndices.resize(6);
- containerInventoryIconIndices.resize(6);
-
+void Macs2Engine::initInventoryIconIndices() {
if (isAmiga() || isV2()) {
- for (uint i = 0; i < 6; i++) {
- inventoryIconIndices[i] = (uint16)(i + 1);
- containerInventoryIconIndices[i] = (uint16)(i + 1);
- }
+ inventoryIconIndices = {1, 2, 3, 4, 5, 6};
+ containerInventoryIconIndices = {1, 2, 3, 4, 5, 6};
return;
}
- Common::ScopedPtr<Common::MemoryReadStream> exeFileStream;
- {
- // Extra scope in order to make sure no code tries to read from the file directly.
- Common::File file;
- if (!file.open("MCSEXEC.EXE"))
- error("readExecutable(): Error reading executable file");
-
- int64 size = file.size();
- byte *fileData = (byte *)malloc(size);
- file.read(fileData, size);
-
- exeFileStream.reset(new Common::MemoryReadStream(fileData, size, DisposeAfterUse::YES));
- }
-
- // Full MCSEXEC.EXE and demo MCSEXEC.EXE are different binaries (different MD5, ~12k differing bytes),
- // but the whole Data5 segment is identical (1020:0000...1020:3787)
- // TODO: if there are ever other games using different versions of MCSEXEC.EXE, we should check the checksum here
-
- exeFileStream->seek(0x0001B610, SEEK_SET);
- exeFileStream->read(inventoryIconIndices.data(), 12);
-
- exeFileStream->seek(0x0001B61C, SEEK_SET);
- exeFileStream->read(containerInventoryIconIndices.data(), 12);
+ inventoryIconIndices = {2, 3, 11, 12, 13, 9};
+ containerInventoryIconIndices = {2, 3, 11, 12, 18, 9};
}
void Macs2Engine::softRestart() {
@@ -3071,7 +3045,7 @@ void Macs2Engine::setGameSpeedMode(uint16 mode) {
Common::Error Macs2Engine::run() {
setGameSpeedMode(ConfMan.getInt(kGameSpeedModeConfigKey));
loadBootstrapResources();
- readExecutable();
+ initInventoryIconIndices();
// Load translation data if available
if (getFeatures() & GF_TRANSLATED) {
diff --git a/engines/macs2/macs2.h b/engines/macs2/macs2.h
index b94ae4fe37f..3947ddbad08 100644
--- a/engines/macs2/macs2.h
+++ b/engines/macs2/macs2.h
@@ -329,9 +329,7 @@ public:
*/
bool loadAmigaSceneBackground(uint32 sceneResourceId);
- // We also need some data from the executable, specifically embedded
- // Adlib data
- void readExecutable();
+ void initInventoryIconIndices();
// Assumes that the stream is at the location of the number of background animations
void readBackgroundAnimations(Common::SeekableReadStream *stream);
More information about the Scummvm-git-logs
mailing list