Commit Graph
250 Commits
Author SHA1 Message Date
athrxx 0baa6b593a SCUMM: coverity fixes 2024-01-30 00:35:45 +01:00
Torbjörn Andersson 6991ba08a1 SCUMM: Add workaround for MI2 glitch when diving to the Mad Monkey
Just before Guybrush sinks to the ocean floor, he is drawn at the wrong
position for a split second. This happens in the original too, though I
found it much easier to spot in ScummVM for some reason. We work around
this by setting Guybrush's elevation at the same time as he's put into
the room.
2024-01-20 23:36:15 +01:00
Torbjörn Andersson ffa7e807d5 SCUMM: Properly flag MI1 Smirk close-up enhancement
The part where the colors are remapped to get them right for Smirk's
cigar smoke was always run. Now it's only run when the enhancement is
enabled. This makes no visible difference, since those colors are only
used by the cigar smoke, and when the enhancement isn't enabled the
cigar smoke isn't drawn. But it's still the right thing to do.
2023-12-31 15:30:26 +01:00
AndywinXp bd22763cdc SCUMM: MACGUI: Implement correct video size for Mac v3 games
This commit brings games to 640x480 (from 640x400).
All old savegames are compatible and are brought up to date in
real time.
2023-12-03 21:03:59 +01:00
AndywinXp 8ddd8da773 SCUMM: GUI: Fix confirmation on exit behavior on script quit commands
We now quit without confirmation when the scripts tell the
interpreter to quit. Except in COMI main menu, when pressing
on the "Quit" option. In that case we must ALWAYS show the
confirmation dialog box.
2023-11-13 22:33:18 +01:00
AndywinXp 8461f25218 SCUMM: Rename enhancementClassActive to enhancementEnabled 2023-11-08 11:46:06 +01:00
AndywinXp e7f4f25881 SCUMM: Clean-up and explain enhancement classes 2023-11-08 11:46:06 +01:00
AndywinXp d5fa7aeb90 SCUMM: Mark all enhancements with their respective classes 2023-11-08 11:46:06 +01:00
Torbjörn Andersson 127c585362 SCUMM: More work on Indy 3 Mac GUI
It's now possible to travel all the way to Venice, though there is a
glitch on the travel map there.
2023-10-16 17:40:29 +02:00
Torbjörn Andersson 702ec52d96 SCUMM: Lots of Indy 3 Mac GUI rewriting 2023-10-16 17:40:29 +02:00
Torbjörn Andersson 716cd6e0e5 SCUMM: Remove Indy 3 Mac GUI mock-up. Begin work on proper GUI.
The goal is to make the interface as simple as possible, and to put as
much of the knowledge of what's going on into MacIndy3Gui itself.
2023-10-16 17:40:29 +02:00
Torbjörn Andersson 33b6ee6c05 SCUMM: Remove verb position adjustments for Indy 3 Mac 2023-10-16 17:40:29 +02:00
Torbjörn Andersson e74f6d5a59 SCUMM: Disable some Mac-specific Indy 3 stuff
Just as an experiment.
2023-10-16 17:40:29 +02:00
AndywinXp f4455e773e SCUMM: Relabel part of the general sound code
Albeit not 100% necessary for rewriting the HE sound engine,
I decided to make this change in order to:
- Give proper meaning to magic numbers and variables
  which were given temporary names 20 years ago;
- Avoid going insane when making comparison with HE code
  and ours, when rewriting the sound code.
2023-08-18 22:20:45 +02:00
AndywinXp eba3e39d9b SCUMM: Fix RNG debug message for v5 and below games 2023-04-05 13:21:21 +02:00
AndywinXp ae02bf6ab8 SCUMM: Make chosen random numbers visible via debug level 6 2023-04-02 18:24:28 +02:00
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:
https://github.com/scummvm/scummvm/commit/4248e22cbfc54c36dcc17f4d3912a5fb30a5dbc2#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