Commit graph

277 commits

Author SHA1 Message Date
Donovan Watteau
ea163ea91e SCUMM: JANITORIAL: Update some comments regarding the "sign fixes" for MI1
Some stuff was moved with commit ad201e3b3e.
Update the comments referencing its previous location.
2025-04-02 15:40:20 +02:00
Torbjörn Andersson
3c6c15e1a9 SCUMM: Fix comment typo 2025-03-31 06:10:41 +02:00
Torbjörn Andersson
c27b22f113 SCUMM: Fix invisible conversation options in Sega CD MI1
This would happen when telling the Men of Low Moral Fiber about the
governor being kidnapped. Where the script was supposed to add 8 pixels
to the Y coordinate, it instead added 8 rows, forcing the text to be
completely outside the screen.

I have verified that this is an original bug by watching the scene in a
YouTube playthrough of the game.
2025-03-30 18:01:29 +02:00
Donovan Watteau
6eb94422cf SCUMM: LOOM: Add an enhancement fixing Hetchel flying with two heads in some releases
Some EGA releases of Loom have a bug where Hetchel may appear with two
heads for a few frames, when she's talking as she's flying, when she
appears at the forge to help Bobbin.

I can reproduce this problem in the original English EGA 1.0, EGA 1.1 and
Macintosh releases. It's been fixed by LucasArts in the French EGA 1.2
and in the Hebrew EGA releases (possibly others).

The TG16/PC-Engine release, and all later 256-color releases, appear to
be fixed by default.

So, for the earliest EGA releases, bring the script changes that LEC
made back then, i.e. some new `TalkAnimNr` options to some of the
`ActorOps()` calls of scripts 34-88 and 38-87.

Script 34-88:
 (11) animateCostume(11,245);
 (80) breakHere();
 (80) breakHere();
-(13) ActorOps(11,[WalkAnimNr(6),StandAnimNr(6)]);
+(13) ActorOps(11,[WalkAnimNr(6),StandAnimNr(6),TalkAnimNr(6,6)]);
...
-(13) ActorOps(11,[WalkAnimNr(2),StandAnimNr(3)]);
+(13) ActorOps(11,[WalkAnimNr(2),StandAnimNr(3),TalkAnimNr(4,5)]);
 (11) animateCostume(11,3);
 (AE) WaitForCamera();
 (80) breakHere();
...
 (11) animateCostume(11,245);
 (80) breakHere();
 (80) breakHere();
-(13) ActorOps(11,[WalkAnimNr(6),StandAnimNr(6)]);
+(13) ActorOps(11,[WalkAnimNr(6),StandAnimNr(6),TalkAnimNr(6,6)]);
 (11) animateCostume(11,9);

Script 38-87:
 (01) putActor(12,288,60);
 (1E) walkActorTo(12,96,60);
 (AE) WaitForActor(12);
-(13) ActorOps(12,[WalkSpeed(8,4),InitAnimNr(6),WalkAnimNr(6),StandAnimNr(6)]);
+(13) ActorOps(12,[WalkSpeed(8,4),InitAnimNr(6),WalkAnimNr(6),StandAnimNr(6),TalkAnimNr(6,6)]);
 (1E) walkActorTo(12,48,60);
...

I guess more official EGA 1.0 > 1.1 > 1.2 script fixes could be backported
as enhancements...
2025-03-08 22:38:18 +02:00
Filippos Karapetis
05cae5caf4 SCUMM: More cleanup and fixes for the MI1SE audio code 2025-01-07 03:38:03 +02:00
AndywinXp
bc8e3b5280 SCUMM: MI1SE: Implement speech playback
What is now missing is the delay time between phrases.
Some of the code will be refactored, since this was
hacked in for mantaining compatibility with stuff outside
of MI1:SE.
2024-12-29 22:05:02 +01:00
AndywinXp
07d9aafb02 SCUMM: MI1SE: Change speech.info parsing and script offset saving
This now matches the disasm but temporarily breaks our current
audio retrieval method. I will work on that separatedly.
2024-12-27 13:08:28 +01:00
Filippos Karapetis
e859f4118c SCUMM: More work on the MI1 and MI2 remastered speech
- Injected the audio code in the correct place (displayDialog), from
  disasm provided by @AndyWinXP (thanks!)
- Added support for multiple speech files for the same message
- Added game flag to MI1SE, for using remastered audio
2024-12-25 13:45:44 +02:00
Filippos Karapetis
510b973749 SCUMM: Initial work for injecting SE speech in classic MI1 and 2
TODOs:
- Correctly calculate the local script offset for all scripts
e.g. object scripts, such as Elaine's poster in the second screen)
- Handle multiple speech files for the same message
- Add handling for speech delay
2024-12-24 11:36:12 +02:00
Torbjörn Andersson
caacc8f3c8 SCUMM: Optionally restore boat wreck graphics at beginning of Mac MI2
It's possible that it was cut for performance reasons (it's also removed
from the Amiga version), since there's some simple parallax scrolling
going on here. But that's not a concern for ScummVM, of course.
2024-12-02 23:25:18 +02:00
Torbjörn Andersson
35e8e66d33 SCUMM: Remove inconsistent whitespace 2024-12-02 20:07:28 +01:00
AndywinXp
9f319cdd86 SCUMM: Add Mac screen implementation for remaining LEC games
This adds optional EPX scaling and 640x480 resolution for
LucasArts Macintosh games other than Indy3 and Loom.

This includes:
* Monkey Island 1
* Monkey Island 2
* Indy4
* Day of the Tentacle
* Sam&Max
* Full Throttle
* The Dig

In doing this, I reverted the ugly code which previously offset
the game screen 20 pixels below (to create an internal 320x240
buffer, instead of 320x200). Instead of just offsetting mouse
coordinates and the final screen texture, I used to offset the
in-engine graphics elements. Ew.

This ensures flawless savegame compatibility between old and
new, without touching anything.
2024-10-28 08:24:59 +01:00
AndywinXp
67b0440ad0 SCUMM: MI1 (Mac): Implement EPX scaling and a stub for the menu 2024-10-28 08:24:59 +01:00
Hubert Maier
370064f93f JANITORIAL: SCUMM: Fix typos 2024-09-16 01:55:26 +03:00
Donovan Watteau
30b46ce49e SCUMM: MONKEY1: Fix the "Important Notice" sign workaround for the Macintosh release
For some reason, the background color of the sign at the Governor's mansion
is already white in the Macintosh release (at least in the one I have here),
but the scripts still have the wrong color set. It looks like the Macintosh
interpreter may have fixed this on the fly...

So we still have to fix this, but for the Macintosh release the Enhancement
will always be enabled, since it matches the original behavior. Also, this
release only changed the background color, not the text color.

See my addition to the previous GH-4168 PR for a screenshot.

If someone has a Macintosh interpreter showing a different behavior, or
wants to analyze it to see whether the fix is indeed hardcoded into it,
I'd be curious to know that, of course :)
2024-09-07 02:03:03 +02:00
Donovan Watteau
88d0978a86 SCUMM: Mention that Monkey1-Amiga already has the fix for the map at Meathook's
Now, the workaround is written in a way as not to cause any problem if
the fix is already included in a release, and since several Amiga
releases may exist, it makes no sense to exclude this port from this
check.
2024-09-03 01:44:35 +02:00
Donovan Watteau
89404547d0 SCUMM: Add a new WORKAROUND for buggy map usage at Meathook's
In the SCUMMv4 releases of Monkey1 (with the older inventory), if one
tries to use/look at the map in Meathook's house or on Hook Isle
Shore, strange animation behaviors will happen, and a fatal script
error can also happen if one looks at the map instead of using one of
the verbs on the parrot.

This was fixed in the SCUMMv5 releases (an incomplete fix was also
added in the VGA SCUMMv4 releases), by making Guybrush say "I don't
need to look at a map right now." instead (as was already done for
some other rooms where this script causes too many issues). So we
just bring this fix to the earlier releases as well.

Reported by Mugg1991 in an amazing tcrf.net investgation, thanks!
2024-09-01 12:45:32 +02:00
Donovan Watteau
f039be35d9 SCUMM: Document Trac#346 workaround a bit more
One needs to wait a bit before reading the note or the map, for the
script sync issue to show up, and also the bug is also there in the
SCUMMv4 releases, but there it seems to only cause some strange
animation behavior, instead of an error (to be fixed with a new
enhancement at a later date...).
2024-08-31 13:07:58 +02:00
Donovan Watteau
d74b20aefe SCUMM: Make Trac#5709 enhancements optional
Reading the scripts and the (nicely detailed) original bug report,
it looks all good for being a `kEnhMinorBugFixes` enhancement.

The Macintosh and 256-color releases appear to be not affected, but
the workaround is done in a way where this doesn't matter.
2024-08-31 11:52:17 +02:00
Donovan Watteau
724ab1a3d0 SCUMM: Document the original interpreter behavior for Trac#346 and Trac#10571
Test done by AndywinXp, grazie mille!
2024-08-30 23:13:16 +02:00
Donovan Watteau
c7c4eafa49 SCUMM: Add TODO comments for some Enhancements / original interpreter behaviors to explore 2024-08-29 22:12:10 +02:00
Donovan Watteau
7cb47c31f8 SCUMM: Add/update some enhancementEnabled() calls for some workarounds
I reviewed what I was comfortable with; this change is not complete
(and I didn't review the HE workarounds at all), but it's still an
improvement.

I may need to update the Enhancement page on the wiki with these
changes...
2024-08-29 22:12:10 +02:00
Donovan Watteau
edc3d61cc2 SCUMM: JANITORIAL: Rename _enableEnhancements to enhancementEnabled in comments 2024-08-02 21:35:53 +02:00
athrxx
84a0bff281 SCUMM: fix Coverity warnings 2024-05-20 15:32:19 +02:00
athrxx
158614fce6 SCUMM: some Coverity fixes 2024-05-07 19:26:06 +02:00
athrxx
b868dab4c5 SCUMM: (V3/FM-Towns) - partial fix for bug no. 15027
(INDY3 (FMTowns): Map lines are drawn incorrectly)

This fix addresses the part concerning the line width of the travel
marker. Turns out that SCUMM3 FM-Towns draws all boxes one
pixel wider and higher on virtual screens other than 1. This also
allows removal of a hack in ScummEngine_v5::o5_drawBox().

I also fixed the old style pause/restart banners, since they incorrectly
used drawBox() for line drawing (which would be glitchy with the now
verdrawing drawBox(). The positive outcome is that we no have original
looking FM-Towns banners (only in Japanese, though, since - unlike the
original - we don't run the English version in 640x480).

The changed method of drawing and removing the banner also fixes
the removal of the black country borders on the map. But it will still
be removed below the pause banner and in the spots where the travel
marker passes the border. So that has to be addressed separately.
2024-04-30 23:29:53 +02:00
AndywinXp
14d1540e4b SCUMM: Fix #15018
Thanks eriktorbjorn for the nudge in the right direction ;-)
Confirmed by the disasm.
2024-03-23 10:45:38 +01:00
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