[Scummvm-git-logs] scummvm master -> b369d9aba0378cbe54f52d09daa31cf463be861c
athrxx
noreply at scummvm.org
Sat Aug 6 16:47:42 UTC 2022
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
cf318372e7 SCUMM: (v5/6/EGA) - improve post-load fix
b369d9aba0 SCUMM: (COMI) - fix encodings for savegame names
Commit: cf318372e7ff0e090565e3fafaf952100f9a9a16
https://github.com/scummvm/scummvm/commit/cf318372e7ff0e090565e3fafaf952100f9a9a16
Author: athrxx (athrxx at scummvm.org)
Date: 2022-08-06T18:46:48+02:00
Commit Message:
SCUMM: (v5/6/EGA) - improve post-load fix
MI1 CD, MI2 and DOTT make script-based color adjustments to the verb interface, depending on the videomode var...
MI1 VGA Floppy, LOOM VGA, INDY4 and SAMNMAX don't do that. It seems to me that it only applies to the games with the purple verbs interfaces. The fact alone that DOTT still checks the videomode for an EGA setting and sets colors accordingly (the same ones as in MI2) shows that these scripts most likely were just brought over from MI2 to MI1 CD and DOTT.
Changed paths:
engines/scumm/scumm.cpp
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index ab4611740da..db0d161ac8e 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -2827,18 +2827,33 @@ void ScummEngine_v5::scummLoop_handleSaveLoad() {
_roomPalette[i] = i;
// We want just the ENCD script...
int entryScript = VAR_ENTRY_SCRIPT;
- VAR_ENTRY_SCRIPT = 0xFF;
+ int entryScript2 = VAR_ENTRY_SCRIPT2;
+ VAR_ENTRY_SCRIPT = VAR_ENTRY_SCRIPT2 = 0xFF;
runEntryScript();
VAR_ENTRY_SCRIPT = entryScript;
+ VAR_ENTRY_SCRIPT2 = entryScript2;
} else if (_supportsEGADithering) {
// Reconstruct the screen palette. It might glitch a bit if the palette was modified with
// darkenPalette or similar. But we do give warning... and the alternative would be to
// completely process, save and load both the VGA and EGA palettes all the time (regardless
// of the current render mode).
setCurrentPalette(_curPalIndex);
+ // This is also needed to fix the verb interface colors for the games with the purple verbs
+ // interface. It looks like this came up first with MI2 and was then brought over to MI1 CD
+ // and even to DOTT. GID_MONKEY_VGA (with the green verbs) is not affected.
+ if ((_game.id == GID_MONKEY || _game.id == GID_MONKEY2) && VAR_ENTRY_SCRIPT2 != 0xFF && VAR(VAR_ENTRY_SCRIPT2))
+ runScript(VAR(VAR_ENTRY_SCRIPT2), 0, 0, nullptr);
}
}
-
+ bool redrawDistaff = (_game.id == GID_LOOM && _saveLoadFlag == 2 && VAR(150) == 2);
+ if (redrawDistaff) {
+ // Restore distaff and notes for LOOM VGA Talkie.
+ int args[NUM_SCRIPT_LOCAL];
+ memset(args, 0, sizeof(args));
+ args[0] = 2;
+ runScript(18, 0, 0, args);
+ //VAR(152) = VAR(153) = 0;
+ }
// update IQ points after loading
if (processIQPoints)
runScript(145, 0, 0, nullptr);
@@ -2866,6 +2881,12 @@ void ScummEngine_v6::scummLoop_handleSaveLoad() {
}
} else {
setDefaultCursor();
+ // For DOTT, this is also needed to fix the verb interface colors. Weirdly, it
+ // does check the videomode var for an EGA setting and makes color changes
+ // based on that. My guess is that this was brought over from MI2 (since the
+ // color adjustments are also the same).
+ if (VAR_ENTRY_SCRIPT2 != 0xFF && VAR(VAR_ENTRY_SCRIPT2))
+ runScript(VAR(VAR_ENTRY_SCRIPT2), 0, 0, nullptr);
}
}
}
Commit: b369d9aba0378cbe54f52d09daa31cf463be861c
https://github.com/scummvm/scummvm/commit/b369d9aba0378cbe54f52d09daa31cf463be861c
Author: athrxx (athrxx at scummvm.org)
Date: 2022-08-06T18:46:53+02:00
Commit Message:
SCUMM: (COMI) - fix encodings for savegame names
(for now, only for kISO8859_1)
Changed paths:
engines/scumm/saveload.cpp
diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp
index f5ffabaa345..b875c4e3805 100644
--- a/engines/scumm/saveload.cpp
+++ b/engines/scumm/saveload.cpp
@@ -228,7 +228,11 @@ void ScummEngine::copyHeapSaveGameToFile(int slot, const char *saveName) {
if (!saveFile) {
saveFailed = true;
} else {
- Common::strlcpy(hdr.name, saveName, sizeof(hdr.name));
+ // This will not work for Russian, Japanese, Chinese, Korean.
+ // But it has to be investigated if we can just insert the
+ // codePage returned by getDialogCodePage() here...
+ Common::String temp = Common::U32String(saveName, Common::kISO8859_1).encode(Common::kUtf8);
+ Common::strlcpy(hdr.name, temp.c_str(), sizeof(hdr.name));
saveSaveGameHeader(saveFile, hdr);
heapSaveFile->seek(sizeof(hdr), SEEK_SET);
@@ -944,6 +948,13 @@ bool ScummEngine::getSavegameName(int slot, Common::String &desc) {
result = Scumm::getSavegameName(in, desc, _game.heversion);
delete in;
}
+
+ Common::U32String temp(desc.c_str(), Common::kUtf8);
+ // This will not work for Russian, Japanese, Chinese, Korean.
+ // But it has to be investigated if we can just insert the
+ // codePage returned by getDialogCodePage() here...
+ desc = temp.encode(Common::kISO8859_1);
+
return result;
}
More information about the Scummvm-git-logs
mailing list