Commit graph

234 commits

Author SHA1 Message Date
AndywinXp
2a91e8ef70 SCUMM: LOOM (Towns): Fix save slot boxes being smaller than they look on the original 2022-11-28 23:21:45 +01:00
AndywinXp
9102a2f0ec SCUMM: DIG: Fix palette artifacts on cursor change
Interestingly, but unsurprisingly, this was caused by 20 years old code which now produces no effects
at all, other than causing the bug that this commit fixes :-P I have checked the disasm of every version
of SCUMM, and there is no sign of updatePalette() ever being called at the end of the fadeOut() function.
Removing it fixes the issue. I have tested every game I have for this change, but I'm sure that whatever
that updatePalette() call was trying to fix 20 years ago, it has probably been fixed properly now, so there's
no need for it.

Also, removed _fullRedraw toggles in o_LoadRoom for DIG and COMI, which, judging by the disasm, don't
force the redraw after changing the scene.
2022-11-28 21:28:32 +01:00
Torbjörn Andersson
32a6f94cfe SCUMM: Fix comment typo 2022-11-28 07:16:08 +01:00
Torbjörn Andersson
41984b7153 SCUMM: Use new GF_ULTIMATE_TALKIE flag instead of strcmp()
This workaround was added after I submitted the recently merged pull
request, so it didn't get included in those changes.
2022-11-08 06:48:19 +01:00
Torbjörn Andersson
1ffa644d20 SCUMM: Add feature flag for the "Ultimate Talkie" version of MI1/MI2
There are so many workarounds where we either want to make sure it's not
the "Ultimate Talkie" version or that it is, that it's much nicer to
have a feature flag than having to strcmp() the variant.
2022-11-07 22:07:28 +02:00
Donovan Watteau
e80a33eb74 SCUMM: Prevent Indy from being stuck in Crete (WORKAROUND)
In the "elevator" room in Crete (where you can pick up the gold box),
one can get stuck in the room, if quickly clicking on the right side of
the room, although that part shouldn't be accessible yet at that point.

This is because the original entry script for this room initializes
the walkbox matrix too late, so it's possible to move to the other side
of the room before the walkbox restrictions kick in.  This workaround
just copies the original setBoxFlags() and createBoxMatrix() calls, but
triggers them at an earlier stage.

This enhancement is always enforced, since you can get completely stuck,
and some players can be totally confused by this problem.

Also happens with the original interpreter; I remember hitting this
issue twenty years ago...
2022-11-01 00:17:19 +02:00
AndywinXp
ade8ebd097 SCUMM: INDY4: Replace old actor workaround with proper fix 2022-10-17 21:24:41 +02:00
Donovan Watteau
ea0f0cc9ee SCUMM: Remove old getDist() MI2 workaround for Trac#420
This one was added more than 20 years ago, but I can't reproduce the
issue anymore with the DOS, Macintosh, or Amiga versions, and it
appears that it was already OK back in 2008.

I couldn't reproduce any lock-up with the original DOS version in
DOSBox either.
2022-10-17 17:28:57 +02:00
Donovan Watteau
4ff9960ac9 SCUMM: Remove old getDist() MI1 workaround for Trac#1194
We are probably closer to the behavior of the original interpreters
now, because I can't reproduce this ScummVM problem anymore with any
demo, Passport to Adventure, EGA or Amiga version.

Bisecting a bit with the Amiga demo, this has effectively been fixed
by commit d719e83783.
2022-10-17 16:56:59 +02:00
AndywinXp
6572d3c3df SCUMM: Remove an unneeded 20 years old LOOM CD workaround
20 years ago this was needed because it was assumed that actor 0 was an invalid actor, but that
simply isn't true. In the original this particular call failed because actor 0 wasn't in the current room,
and this is exactly what happens now on our end, when removing this workaround.
2022-10-17 16:01:10 +02:00
AndywinXp
3bd3fe6b04 SCUMM: INDY4: Properly fix #1265 2022-10-17 00:49:38 +02:00
Donovan Watteau
14f12c3d6c SCUMM: Fix the storekeeper closing the door in MI1CD (WORKAROUND)
In the v5 releases of Monkey Island 1, the storekeeper on Mêlée Island
closes the door *after* going to the counter, which looks very strange
since he's far away from it, at this point. In the v4 releases, he just
closes it *before* walking away from it, which is much more natural.

AFAIK the storekeeper isn't meant to have the same Jedi powers as the
troll on the bridge, so that's probably yet another scripting oversight
from the SCUMM v4 to v5 update.

Fix this by calling the related script a bit earlier. This was already
fixed in the SegaCD release and in the Ultimate Talkie edition.
2022-10-12 22:53:31 +03:00
Donovan Watteau
468575ed06 SCUMM: Only apply Trac#2215 subtitle workaround when Indy uses the gold box
This subtitle bug only happens if Indy has the gold box and is about to
use it, right after finding the beads in Crete. Document this, and don't
apply the workaround if we're not in this case, since this pauses Indy's
animation for no reason.

See the difference in behavior with the two old savegames included
in Trac#2215 issue.

Also make this an enhancement, while there.

Tested with the Floppy/French, DOS/Talkie/English and
Macintosh/Talkie/English releases. Original issue also in DREAMM.
2022-10-12 13:03:36 +02:00
Torbjörn Andersson
15572c408b SCUMM: Exclude SEGA CD and FM Towns versions from dog sign workaround
The SEGA CD version already uses the old colors, and the FM Towns
version makes the text more readable by giving it a black outline.
2022-10-09 11:23:19 +03:00
Torbjörn Andersson
b01d7d4d57 SCUMM: Exclude "Ultimate Talkie" MI1 from dog sign color workaround
The unofficial talkie version already uses the floppy version colors.
Applying our fix to it, while it doesn't seem to do any harm, is
unnecessary.
2022-10-09 11:23:19 +03:00
Torbjörn Andersson
effb129776 SCUMM: Make the dog sign colors in MI1 VGA CD closer to MI1 VGA floppy
The colors in the sign that tells you that the dogs are only sleeping
are much harder to read in the VGA CD version than in the VGA floppy
version. I assume these were not picked deliberately, but rather a
consequence of the palette being different. So this works around that by
temporarily remapping the palette for the sign object, and adjusting one
of the text colors to something close to the floppy version.
2022-10-09 11:23:19 +03:00
Donovan Watteau
f7bdce7671 SCUMM: Adjust subtitle color workarounds for MI1 FM-TOWNS
In the FM-TOWNS version of Monkey Island 1, the inventory is limited to
16 colors, and it looks like the subtitles have a similar constraint, so
adjust the subtitle color workarounds for the priest and the head of the
navigator for this case, otherwise they would just be printed in white.
2022-10-07 13:34:59 +02:00
AndywinXp
59c0b4fa7d SCUMM: Extend workaround for #832 to all games using this code 2022-09-30 21:16:36 +02:00
Donovan Watteau
e16c30d023 SCUMM: Fix the navigator head text color in MI1 CD (WORKAROUND)
When the navigator head speaks, the v5 release forgot to adjust the
`Color(6)` parameter for the v5 palette changes, meaning that the text
wasn't displayed with the intended brown color, as in all other versions
(this was fixed in the v5 SegaCD release, though).
2022-09-25 11:49:34 +03:00
Donovan Watteau
d488212f7d SCUMM: Fix an original palette issue at Stan's in MONKEY1-CD (WORKAROUND)
In the versions of Monkey Island 1 with the full 256-color inventory,
going at Stan's (when he's not there) will mess up the color of some
objects, such as the "striking yellow color" of the flower from the
forest suddenly being greenish in this room.  The VGA floppy release
doesn't appear to have this issue, so this is probably another oversight
from the v5 release.

The setPalColor() calls are taken from the Ultimate Talkie Edition.

This fix is not applied to the FM-TOWNS and Sega CD releases, since they
use a smaller palette (and I don't have them).
2022-09-17 17:10:48 +03:00
Donovan Watteau
468a79aee6 SCUMM: Make the Monkey1 FM-TOWNS verb rendering fix an enhancement (Trac#13735)
The original FM-TOWNS interpreter had a bug which made the verb font
much thinner than in the other releases (it was missing its "3D"
effect).

Some people may prefer seeing the original behavior, others prefer
having original game bugs fixed, so `_enableEnhancements` solves the
personal taste matter.

Was discussed here:
4248e22cbf (commitcomment-80191288)
2022-09-15 09:58:39 +02:00
Donovan Watteau
2c1d8ae13f SCUMM: Simplify the shepherd workaround for Loom
ScummEngine::actorTalk() doesn't crash anymore when the actor number
is 0. ScummVM behaves like the original nowadays, in that the invalid
line is just silently skipped, and so restoring the missing line is
just simpler than I thought during my previous change.

We still have to deal with actor 3 which is in a buggy status in some
releases, but again it was possible to deal with this in a simpler way
(especially since my usage of `return;` was wrong, here).
2022-09-14 23:51:36 +02:00
Donovan Watteau
b4caf16b69 SCUMM: Fix a staircase glitch in room 32 for early Loom EGA (WORKAROUND)
The earliest 16-color releases of Loom have a bug when Bobbin exits
room 32 (in the dragon's cave) with the staircase on the right: he will
walk *through* them instead of just walking *on* them, if he entered the
room via the other stairs in the ground.

This has been fixed in some 1.2 and later releases, but the original
16-color English releases appear to always have this bug (even with the
original interpreters).  The 1.2 release fixed this with more changes
(incl. checking Bobbin's coordinates), but this smaller fix appears to
be enough.

With some help from eientei on Discord, who also found that the
scripts were different in this room between the EGA releases.
2022-09-11 20:38:20 +03:00
Donovan Watteau
1823f6efbd SCUMM: Make Trac#2961 workaround an enhancement and describe it more (Indy4)
Fixing original typos is usually an enhancement now, and most of the
SCUMM workarounds describe what's going on.

Still OK with the English talkie release from GOG (with boot param 4964).
I'm not sure this workaround works with the floppy releases though (the
length and offsets look talkie-only) but I don't have any English floppy
release of this title.
2022-09-11 17:20:01 +02:00
Donovan Watteau
699550a6cd SCUMM: Fix the inconsistent text color for the priest in Monkey1-CD
In all v5 releases (except for the SegaCD one), the priest's lines will
switch between 3 colors in a row, when Guybrush meets LeChuck in the
church of Mêlée Island.  The original EGA and VGA floppy releases don't
have this weird behavior.

This forces the same color for all his lines (while making sure not to
match Elaine's offscreen line), choosing the gloomy green color from the
Ultimate Talkie edition, since the original EGA/VGA releases also used
that.
2022-08-28 17:21:54 +03:00
Donovan Watteau
5351232c72 SCUMM: Split the SO_TEXTSTRING part of ScummEngine_v5::decodeParseString()
There's now a lot of stuff in this part (thanks to workarounds) and it
really becomes quite narrow.
2022-08-28 17:21:54 +03:00
athrxx
3d39d206ee SCUMM: replace strcpy calls with Common::strlcpy
This replaces every single strcpy call in the engine with
Common::strlcpy.

Some of these might cases seem a bit pointless, but it is
supposed to discourage future use of strcpy. If people don't
see a single occasion of it they might think twice before they
use it...
2022-08-27 13:08:38 +03:00
Donovan Watteau
255f87dffa SCUMM: Apply the Jolly Roger workaround to MONKEY1-VGA too
It looks like my French floppy VGA release doesn't have that fix,
although the English floppy VGA release from the LRG Anthology has it!

So it just feels safer to enable this workaround for all Monkey 1
releases (except for the Ultimate Talkie Edition). If the same fix is
already in this script, it shouldn't hurt.
2022-08-27 01:24:31 +03:00
Donovan Watteau
659df7bc01 SCUMM: Bring the Jolly Roger fix from Monkey1 VGA to the other releases
In Part 2, the Jolly Roger should only be visible in the first cutscene
showing the Sea Monkey in the middle of the sea. For the next two
cutscenes showing the full ship, it shouldn't be there anymore, since
Guybrush must have picked it for these scenes to happen.

The VGA releases fixed this small oversight from the original game, but
then this fix appears to have been lost for the v5 releases.
2022-08-27 01:24:31 +03:00
Donovan Watteau
8e3c344cb5 SCUMM: Work around some silent lines in the spitting contest of MI2 Talkie
The crowd has some reaction lines while Guybrush plays the spitting
contest on Booty Island, but some of them are missing an audio sample
in the current version of the Monkey Island 2 Ultimate Talkie builder.
Neither the script nor the MONSTER.SOU file appear to have it,
although the voiced clips are there in the original 000001e1,
00000661, 00000caf, 000001e8, 0000066c and 00000cba.wav files.
The crowd would then remain silent for these particular lines.

Let's just drop them if we detect them without any associated audio
resource, since the crowd has already a lot of other reaction lines
which play fine.  This is written with as much care as possible for any
future update or fan-made translation which would change this.

If you've muted the speech or if you're playing in keep-original-text
mode we can keep them as-is, though.
2022-08-20 00:03:37 +03:00
Donovan Watteau
27f2307b8a SCUMM: Work around a small glitch with Largo's door in Monkey2
If one closes the door just before using the pins with the voodoo doll
in front of Largo, the middle of the door will glitch when Largo opens
it again to escape from his room.

It looks like script 13-200 forgot to clean the part of the door which
deals with the (invisible) laundry claim ticket, in this case. But
script 13-213 triggers the same action without any problem, since this
one properly updates the class and state of this object; so let's just
reuse its `setState(111,2)` and `setClass(111,[160])` calls.
2022-08-17 23:15:04 +03:00
eientei
d47127aa90 SCUMM: Simplify bug #4556 workaround; comment fixes 2022-08-17 21:47:29 +02:00
Donovan Watteau
484c0589f7 SCUMM: Add more inline details about the Trac#1266 workaround
Details taken from the Trac issue itself; I don't have this version.
2022-08-17 14:54:27 +02:00
Orgad Shaneh
b3d0813300 SCUMM: Fix indentation
Amends commit 4451101b80.
2022-08-11 22:58:54 +03:00
Donovan Watteau
1e44fd3fdf SCUMM: Restrict the "I am Choas." Loom workaround to the English talkie 2022-08-11 22:25:10 +03:00
Donovan Watteau
9c78d324a6 SCUMM: Add a bit more comments about Trac#832 workaround
Most of the workarounds in SCUMM explain a bit what's going on, even
when referring to a Trac issue, but this one didn't say much.

I tested that this problem still occurs today (boot param 5234 is
perfect for this), while the original interpreter within DREAMM
doesn't mind this script.
2022-08-11 14:00:51 +02:00
Donovan Watteau
5538830bda SCUMM: Don't try to apply the Captain Dread glitch workaround on the Ultimate Talkie
This bug was already fixed in the Ultimate Talkie edition, but a good
part of this script has been rewritten in this version, so I'd rather
avoid triggering any _scriptPointer change there. The Bit[129] check
was probably enough to prevent this, but I'd rather be safe.

Adding the check is also a way of documenting that this version fixed
this.
2022-08-11 11:26:47 +02:00
athrxx
319e50fc35 SCUMM: (LOOM/VGA Talkie) - improve verb handling
- get rid of weird hackery in o5_verbOps
- make sure the verbs are properly restored after loading a savegame
2022-08-10 15:27:23 +02:00
Donovan Watteau
7a4f09504a SCUMM: Quote Aric Wilmunder as to why the cliff puzzle was disabled in Monkey2 Towns
It appears that this was disabled on FM-TOWNS because of a vertical scrolling
limitation, but it appears to work fine, nonetheless. This is also what they
observed while doing the QA for the original PC version, and so they enabled
it again there.

Sources (with also some words from Dave and Tami!):

https://twitter.com/AWilmunder/status/1553827430699192320
https://www.timeextension.com/features/how-we-helped-solve-a-30-year-old-mystery-in-monkey-island-2-lechucks-revenge
2022-08-08 12:15:19 +02:00
Torbjörn Andersson
4451101b80 SCUMM: Restrict PC-Engine Loom loading screen delay to English version
The Japanese version shows only a blank screen, so it seems silly to
delay for that.
2022-08-08 11:53:59 +02:00
Torbjörn Andersson
d51c9336b9 SCUMM: Add delay to "Turbo Technologies" PC Engine Loom loading screen
The original gets its delay - about 10 seconds, judging by the emulator
I tried - by loading resources. ScummVM does that in the blink of an
eye. Of course, we don't want the full delay. Just a tasteful one.
2022-08-08 11:53:59 +02:00
Donovan Watteau
4ec06a2bf6 SCUMM: Unify WORKAROUND usage and complete/tweak some of them 2022-08-07 17:24:27 +02:00
Donovan Watteau
63a5010e3e SCUMM: Fix Sophia speaking with Indy's voice when looking at him
When playing as Sophia in some scenes (such as in the Azores), using the
`Look at` verb on Indy would make her speak with Indy's voice, because
the script triggering this sentence for this verb didn't check or
include a line for the case when VAR_EGO is Sophia.

Fortunately, a different script does have this exact same line dubbed
for Sophia, so we can reuse it, as long as the audio offsets have the
values that we expect (and I'm only aware of a single MONSTER.SOU file
for this title, always in English and identical on all ports).
2022-08-04 23:57:12 +03:00
athrxx
61eae101ed SCUMM: properly initilize array (follow-up to 4248e22)
(the array is now 7 bytes larger than before, so it doesn't get reset completely in getWordVararg())
2022-08-03 21:43:06 +02:00
athrxx
4248e22cbf SCUMM: (MI1/FM-TOWNS) - fix bug no. 13735
("Inaccurate verb rendering in Monkey 1 FM-TOWNS)"

Actually, this is rather an emulation of an original bug than a fix...

I have also included a fix in the charset renderer that I noticed, but I don't think that one actually matters anywhere.

I haven't added a fix for exisiting saves. It would require another version bump and it is really not important enough.
2022-08-03 17:03:25 +02:00
Donovan Watteau
6be4040b0b SCUMM: Document that the Trac#812 script bug also exists in Indy3 EGA
Checked against my EGA/DOS French copy: script 33 appears to have the
same Local[5] error as in the VGA release. It also looks like Local[1]
and Local[3] are uninitialized in the EGA version too, but this doesn't
seem to cause any issue.

Actually, if I completely disable this workaround, I can't reproduce the
original crash anymore, so maybe we handle uninitialized local values
the same way the original interpreter did, now?
2022-07-31 10:02:34 +02:00
Donovan Watteau
27f9a460b5 JANITORIAL: Fix "the the" and similar typos 2022-07-29 19:36:40 +03:00
Donovan Watteau
691d1dffdb SCUMM: Improve the antiques dealer map piece workaround (Monkey2)
The Ultimate Talkie Edition fixes this at the source, by setting
Bit[70] as intended when you buy the map piece.

But it makes more sense to fix it at a later stage for us, so that
it will also apply for previous saves (if one enables the Enhancement
option), and so that one can also disable this enhancement just before
meeting Captain Dread at this point, if they prefer to restore the
original behavior of the game.

Again, we're not modding the game here, just restoring an intended
behavior which was hidden by a script error, but people may prefer
playing the game with the original behavior they've known for years
and years.
2022-07-27 10:58:21 +03:00
Donovan Watteau
abe00b44c9 SCUMM: Restore Captain's Dread reaction when you have the four map pieces
This actually comes from the Ultimate Talkie Edition, so we're just
borrowing their fix for this.

The original scripts check if you have the whole map of Big Whoop; if
that's the case and you go to Captain Dread's ship, he should tell you
that he must go back to Scabb Island, and he'll leave you there and
never appear again. This forces the player to focus on Scabb Island
again, so that you know where to solve the map puzzle.

If you don't remember this, it's because the scripts forget to update
the status of the map piece from the antiques dealer, when you buy it.
So this is what this commit fixes, and this makes the Captain Dread
script trigger as intended.

Note: this REQUIRES the model lighthouse lens fix I've committed just
before, otherwise this would add a dead-end to the game (because of
another original script oversight; see that commit and
o5_notEqualZero() for more information).

We are restoring something which was part of the original intent of
the writers (it has even been dubbed in the Special Edition), but
it's maybe controversial since people never saw this in the original
because of a script bug.  That's why this is just an enhancement that
you can disable.

Kudos to the Ultimate Talkie Edition authors for this very nice
finding!
2022-07-27 10:58:21 +03:00
Donovan Watteau
e30f9e2c35 SCUMM: Fix a possible dead-end in Monkey Island 2 (Ultimate Edition)
When playing the Regular mode of the Ultimate Talkie Edition of Monkey
Island 2, you can get stuck if you picked up the four map pieces, but
haven't picked up the model lighthouse lens yet. Captain Dread will
force you to go back to Scabb Island and disappear (so you can't go
back to Phatt Island), but Wally won't be able to read the map without
his monocle and without the lens replacement. Nobody wants a dead-end
in a Monkey Island game :)

This commit just short-circuits the checks for the four map pieces if
the lens is still on the model lighthouse, and so you're still free
to navigate between the 3 islands until you pick it up.

This doesn't happen in any other version (yet), because the Ultimate
Edition is the only one which fixed setting the Bit[70] flag when
buying the map piece from the antiques dealer, restoring the reaction
from Captain Dread but unveiling this other, more fatal script
oversight.  But we'll need this fix for the other versions anyway,
since I'm going to add the same enhancement in a new commit.
2022-07-27 10:58:21 +03:00