Commit graph

223 commits

Author SHA1 Message Date
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
athrxx
4230a882b0 SCUMM: (V4/EGA/CGA) - improve post-load fixes
Also include room palette fixes for games that were saved with a different video mode. Unfortunately the scripts make changes to the room palette based on VAR_VIDEOMODE. The original interpreter does not fix that.
2022-07-23 23:17:46 +02:00
athrxx
3d27309624 SCUMM: (LOOM/CGA) - fix minor actor palette glitch
(original interpreter bug, reported by antoniou79)

The original interpreter has an actor palette fix for the CGA mode, but it isn't properly re-applied after the script makes changes to the actor palette)
2022-07-16 14:51:06 +02:00
Donovan Watteau
d945157f7c SCUMM: Fix verbs not being hidden during the biplane cutscene (FM-TOWNS)
Room 80 only contains a cutscene, where Indy and his father escape
from the zeppelin with the biplane. But it is started with
`cutscene()` instead of `cutscene([1])` which also disables the verb
interface.

The FM-TOWNS version doesn't like this and some verb leftovers were
mixed with the graphics. Adding the missing `[1]` parameter should fix
the issue.

Confirmed to also happen with the original interpreter under UNZ.
2022-07-02 12:38:40 +02:00
Donovan Watteau
34370de089 SCUMM: Fix wrong text color when Indy and his father escape from the zeppelin (FM-TOWNS)
Most lines in this cutscene miss their color parameter, which makes
both actors speak with the same color, which is confusing since one of
them suddenly appeared, and you can barely see them.

(For some reason, the PC VGA version also misses the color parameters,
but it works there, maybe because there's some palette-shifting going
on, which has been mostly removed in the FM-TOWNS version?).

We can fix this by always giving an explicit color to Indy's and his
father's lines. But the lines are not attached to any actor, and it's
hard to determine who's who, especially if we want to support
translations too. Henry Sr. is the only one using a wait() instruction
in his sentence, and he's the only one saying "Junior", so we try to
detect that.
2022-07-02 12:38:40 +02:00
Donovan Watteau
06edf3dd0c SCUMM: Fix Kerner's text not matching his voice in New York
The Talkie version of Indy4 changed Kerner's line when he uses the phone
booth in New York (reusing some words from the research lab scene), but
the text doesn't match with the voice in most releases: he says Ubermann
but the text mentions Fritz, in the English version.

The 1994 Talkie Macintosh release fixed this line, so we can replicate
this later, official fix as an enhancement for all the English talkie
releases.
2022-06-19 20:59:26 +03:00
Donovan Watteau
59cbd9003c SCUMM: Fix missing voice when selling back the hub cap and pirate hat
The Ultimate Talkie edition of Monkey Island 2 has a small script error
when you try to sell back your hub cap or your pirate hat to the antique
dealer.  It wasn't doing a comparison with the proper object number, and
so it would play a fallback line with no voice.
2022-06-18 21:52:59 +03:00
Donovan Watteau
6f8bd666b6 SCUMM: Restore the first frame of Indy's reaction drinking from the Grail
The original game always hides this first frame behind the second one,
probably so that this cutscene never starts with some previous frame
leftovers (since this animation will repeat as long as you pick up the
wrong Grail).

This is a bit unfortunate, especially since it also makes Indy appear
older if he drinks from the real Grail.  So, restore this first frame
and just reset any previously drawn object when starting this animation.
2022-06-16 02:57:39 +03:00
Donovan Watteau
74d4cb820a SCUMM: Fix the Nazis' uniforms in the corridors of Castle Brunwald (FM-TOWNS)
In Indy 3, some palette overrides were sometimes necessary to deal
with the 16-color limitation of EGA. When porting the game to the
FM-TOWNS, the palette overrides for the Nazis guards in the corridors
of Castle Brunwald weren't removed, and so their uniforms would be
gray there, although they were properly colored in green in all the
other rooms, including the zeppelin maze.

The PC VGA version doesn't have this problem, since they did remove
this palette override there.
2022-06-14 08:55:55 +03:00
AndywinXp
d5ad765ad7 SCUMM: MONKEY2: Mark workaround introduced in PR #1343 as enhancement 2022-06-14 00:20:29 +02:00
Donovan Watteau
e5601d34fe SCUMM: Fix Captain Dread's head when Guybrush says "It's me again."
When Guybrush interacts with Dread, Dread should turn and face him if
he's not already looking at him. But the original script forgot to do
this check on Bit[129] if Guybrush already met him, tries giving him
an object and then immediately talks to him.

Since Dread's movement is always done by 32 bytes of opcodes, we can
just skip that if its first drawObject() call was done although
Bit[129] was set.
2022-06-11 19:13:32 +03:00
Torbjörn Andersson
6a040e3ea2 SCUMM: Add adjustment sliders for VGA Loom (CD) and MI1 (CD)
When ripping the audio tracks from CD, you may not get quite what the
game expects, e.g. my copy of Loom has less silence at the start of the
track than the CDDA.SOU file from the Steam version. And the MI1 intro
appears to be timed with the assumption that there is no silence at all
at the start of that track.

This makes it possible to compensate for that without having to edit the
audio file. It may also be of some help with fan soundtrack replacements
for MI1, though I have little experience with that.
2022-06-03 21:03:58 +02:00