I noticed that the "I am Choas" typo in VGA Loom was no longer patched,
and I'm guessing the other workarounds may have been broken too. This
was a regression from when the missing Lemonhead lines in Monkey Island
1 were reinstated.
This was a regression that was apparently introduced when the animation
flag was cleared for the Mac cursor. The animation made the cursor show
up when loading older save games, but not new ones. That's why it went
unnoticed until now.
The autosave refactoring that was done in
7adad5aaf5 used g_engine for identifying the
autosave slot. This worked for in-game save/load, but doesn't fit when
called from the launcher.
Fix by passing MetaEngine to SaveStateDescriptor ctor and using it for this
query.
Amends 7adad5aaf5.
...because ScummVM will crash trying to do so.
This was discovered in bugs #13111 and #13113, where loading a HE
savegame does not load sound resource 1 but still tried to apply
workarounds to it. I don't know if this is the only case.
This is taken from pull request #3368 ("New Digital iMUSE Engine").
AndywinXp asked me to do it for him because it was less inconvenient for
me. It is only being applied to the 2.5 branch since his pull request
should take care of everything on the master branch later.
The credits script asks for white shadowed text, but the original (at
least when running in Basilisk II) uses light gray shadowed text. I have
no idea why, and the only workaround I can think of is to force the text
color this way.
It's possible for scripts to remap colors, of course, but that's not
what seems to be going on here.
For all the purists out there (I know there is at least one), the
default behavior is to try and emulate the original's slightly broken
font spacing. Even though I prefer correct spacing myself.
This is more guesswork, but seems to match the original for where I've
tried it. Next step is to implement an option to use the correct spacing
instead since it arguably looks better.
Measure the whole string before dividing the length by 2 to get the
low-res width of the string. Before, each character width was divided
which led to rounding errors. The result is better, but not pixel
perfect. I'm not sure what I'm still getting wrong.
The text positioning seemed to be correct in all cases I checked (which
admittedly weren't all of them). The original spaces characters
differently, but I would say that the original does it wrong. I typed
the same text in ResEdit, and it came out the way ScummVM draws it.
I see no reason for being that bug compatible with the original.
I didn't think anyone would notice that the lines of the Indy 3 text
boxes were spaced slightly differently in ScummVM than in the original.
I realized it wouldn't be as tricky as first thought to fix that, though
I may clean it up a bit later.
This fixes a tiny part of bug #12983.
(see https://bugs.scummvm.org/ticket/12499#comment:11)
In Actor::startWalkActor() we call adjustXYToBeInBox() twice, first with the dest coords, then again with the resulting coords from the first call. In the example from the bug ticket (clicking on Kenny the lemonade selling pirate) this will adjust the x position from 503 to 501 on the first pass and from 501 to 500 on the second pass.
The original SCUMM 5 and 6 (I checked MI2 and SAM) actually do it exactly like that, so it becomes kind of obvious where our code originates from.
However, for SCUMM 7 and 8 (I checked FT, DIG, COMI) the function has been simplified considerately. It makes the call to adjustXYToBeInBox() only once (and no call to checkXYInBoxBounds() either), so in our COMI example the x position will stay at 501.
I don't have this version of the game myself, so it's based on a YouTube
playthrough and walking through the process of extracting the necessary
data with timofonic. It has not been properly tested, though the
messages do look correct if I insert them into the English version.
Tested with Loom and The Dig. It seems to be consistent.
Sam&Max seems to have different mapping for Ctrl. The DOS version
has the following actions:
Ctrl-I: Rotates the current action
Ctrl-J: Switches to Joystick Mode
Ctrl-K: Shows memory stats
Ctrl-C: Prompts to quit
Ctrl-M: Switches to Mouse Mode
Anyway, since it doesn't break anything, I did not add an exclusion for it.
WORKAROUND bug #12420 (also occurs in original) Broken window and coat missing
This happens when you skip the cutscenes in the beginning, in particular
the one where Indy enters the office for the first time. If object 23 (National
Archeology) is in possession of Indy (owner == 1) then it's safe the force the
coat (object 24) and broken window (object 25) into the room to compensate for
the skipped code.
There are several Ctrl+Key combinations that are accepted by the engine.
Most famous one is Ctrl+W, which is Instant Win on monkey1 (monkey2 uses
Alt+W, and has a similar hack for passing it correctly).
This used to work with ScummVM 1.9.0/SDL1, but broke with SDL2, and was
later broken further even for SDL1 in f5ed14e93d.
Fixes#10644.
Just something I came across in the disasm while doing something else. I also ran the original CJK interpreter in VirtualBox to confirm this weirdness...
Some engines call setAutosave and some don't. isAutosave is used to
determine if a saved game is an autosave, but in fact, on most cases it
just falls back to comparing the name to "Autosave".
This is wrong for several reasons:
* Older versions of ScummVM used Autosave 0.
* The name "Autosave" is translated, so if you change the language, it
won't be detected.
Instead of relying on the name, use the well-known getAutosaveSlot() from
Engine/MetaEngine.
Fixes#12735.
Also occurs in original.
In script 204 room 25 (Cannibal Village) a crash can occur when you are
expected to give something to the cannibals, but instead look at certain
items like the compass or kidnap note. Those inventory items contain little
cutscenes and are abrubtly stopped by the cutscene in script 204 at 0x0060.
This workaround changes the result of isScriptRunning(164) to also wait for
any inventory scripts that are in a cutscene state, preventing the crash.
Script #204
[0000] (1A) Bit[354] = 1;
[0005] (1A) Var[249] = 0;
[000A] (5D) setClass(303,[32]);
[0011] (DD) setClass(VAR_EGO,[5]);
[0018] (2E) delay(1200);
[001C] (80) breakHere();
[001D] (68) VAR_RESULT = isScriptRunning(164);
[0021] (A8) if (VAR_RESULT) {
[0026] (18) goto 001C;
[0029] (**) }
[0029] (58) endOverride();
[002B] (91) animateCostume(VAR_EGO,3);
[002F] (5D) setClass(303,[160]);
[0036] (40) cutscene([]);
[0038] (AE) WaitForMessage();
[003A] (14) print(5,[Text("Obviously you have nothing for us.")]);
[0060] (C0) endCutscene();
[0061] (2A) startScript(105,[],F);
[0064] (A0) stopObjectCode();
END
- removed obsolete (and incorrectly implemented) COMI Chinese handling
- some preparations to make it easier if we would want to get rid of SmushFont::getStringWidth() in favour of this
This is just a small hack to address bug no. 12796 ("SCUMM: COMI: Object label line printed on the wrong spot"). It tries to apply the correct fix that we already have in SmushFont::drawStringWrap() to "normal" (non-Smush) blast strings.
The Mac CD versions that I have use the same GUI as the DOS CD version,
but don't have CD audio tracks for the music. (So there is no music for
the cannibal village.) The script to patch is identical to the DOS CD
version, but located four bytes earlier in the room resource.