[Scummvm-git-logs] scummvm master -> 8a1f9c06af5c119c2a1156bd48df5800af6958f8
bluegr
noreply at scummvm.org
Wed Apr 20 04:23:26 UTC 2022
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:
8a1f9c06af SCUMM: Fix a-grave character in French Monkey1 904.LFL font
Commit: 8a1f9c06af5c119c2a1156bd48df5800af6958f8
https://github.com/scummvm/scummvm/commit/8a1f9c06af5c119c2a1156bd48df5800af6958f8
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2022-04-20T07:23:22+03:00
Commit Message:
SCUMM: Fix a-grave character in French Monkey1 904.LFL font
In the French floppy EGA/VGA versions of Monkey Island 1, the 904.LFL
font has a duplicate `ç` glyph where the `à ` letter is expected,
breaking some lines such as "Non! Ce n'est pas tout \x85 fait \x87a."
if one fails the very first copy protection screen.
Fortunately, the `Ã ` does exist in this font, but not at the right,
usual code point of CP850. So we can work around this by exchanging a
couple of glyphs while loading this particular font (while keeping the
same size as the original charset resource).
In order not to break anything else, and since we directly patch some
hardcoded offsets, this is only done when the faulty 904.LFL has been
detected and when playing a French version (some other glyphs are wrong
in this font, but it's the only one which matters for French).
The other fonts and the CD version of Monkey Island 1 are not affected.
Changed paths:
engines/scumm/resource_v4.cpp
diff --git a/engines/scumm/resource_v4.cpp b/engines/scumm/resource_v4.cpp
index 93d1bc29141..9d26d60184e 100644
--- a/engines/scumm/resource_v4.cpp
+++ b/engines/scumm/resource_v4.cpp
@@ -19,6 +19,8 @@
*
*/
+#include "common/md5.h"
+#include "common/memstream.h"
#include "scumm/scumm_v4.h"
#include "scumm/file.h"
@@ -159,6 +161,7 @@ void ScummEngine_v4::loadCharset(int no) {
Common::File file;
char buf[20];
+ byte *data;
sprintf(buf, "%03d.LFL", 900 + no);
file.open(buf);
@@ -168,7 +171,28 @@ void ScummEngine_v4::loadCharset(int no) {
}
size = file.readUint32LE() + 11;
- file.read(_res->createResource(rtCharset, no, size), size);
+ data = _res->createResource(rtCharset, no, size);
+ file.read(data, size);
+
+ // WORKAROUND: The French floppy EGA and VGA versions of Monkey Island 1
+ // don't properly follow CP850 for the \x85 character in the 904.LFL font.
+ // It should be the `à ` letter, but it will print the `ç` letter (which is
+ // already at \x87) instead, breaking at least the "Non! Ce n'est pas tout
+ // \x85 fait \x87a." line in the copy protection screen. The `Ã ` character
+ // does exist, but at the invalid \x86 position. So we replace \x85 with
+ // \x86 (and then \x86 with \x87 so that the whole charset resource keeps
+ // the same size), but only when detecting the faulty 904.LFL file.
+ if ((_game.id == GID_MONKEY_EGA || _game.id == GID_MONKEY_VGA) && no == 4 && size == 4857 && _language == Common::FR_FRA && _enableEnhancements) {
+ Common::MemoryReadStream stream(data, size);
+ Common::String md5 = Common::computeStreamMD5AsString(stream);
+
+ if (md5 == "f273c26bbcdfb9f87e42748c3e2729d8") {
+ warning("Fixing the invalid content of the 904.LFL a-grave character");
+ memmove(data + 4457, data + 4457 + 37, 40); // replace \x85 with \x86
+ memmove(data + 4457 + 40, data + 4457 + 37 + 40, 37); // replace \x86 with \x87
+ WRITE_LE_UINT32(data + 557, READ_LE_UINT32(data + 557) + (40 - 37)); // adjust \x86 start offset
+ }
+ }
}
void ScummEngine_v4::readMAXS(int blockSize) {
More information about the Scummvm-git-logs
mailing list