Commit graph

147 commits

Author SHA1 Message Date
Torbjörn Andersson
bd2bf31c5f SCUMM: Fix regression in ScummEngine_v5::decodeParseString()
Some checks failed
CI / Windows (push) Has been cancelled
CI / Xcode (push) Has been cancelled
CI / Ubuntu (push) Has been cancelled
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.
2022-02-23 11:47:37 +01:00
Torbjörn Andersson
d1f8e3a0ea SCUMM: Hack Indy 3 Mac credits to use correct text color
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.
2021-10-19 19:28:18 +02:00
Torbjörn Andersson
327e183eab
SCUMM: Add Spanish version of the MI1 Lemonhead patch
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.
2021-09-02 13:15:06 +02:00
Filippos Karapetis
ccee4a18c6
SCUMM: Fix comment 2021-08-31 10:15:30 +02:00
Ben Castricum
da4175c46f
SCUMM: Indy4 - Put coat/window in office, fixes bug #12420
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.
2021-08-31 10:15:26 +02:00
Ben Castricum
9f44c5522a SCUMM: MONKEY-VGA fix bug #10571, Object stopped with active cutscene
Also occurs in original

Script 68 contains the code for handling the mugs. The issue occurs when a mug
changes state. It will call setObjectName for the new state which in its turn
restarts objects in inventory. Some objects (kidnap note) can be in a cutscene state
what causes a crash if the object gets restarted. This workaroud waits for cutscenes
to end, preventing the crash.

Script #68
[0000] (DD) setClass(Local[0],[146]);
[0007] (28) if (!Bit[421]) {
[000C] (1A)   Bit[421] = 1;
[0011] (62)   stopScript(201);
[0013] (62)   stopScript(188);
[0015] (80)   breakHere();
[0016] (D8)   printEgo([Text(sound(0x612F889, 0xA) + "This stuff is eating right through the mug!")]);
[0054] (80)   breakHere();
[0055] (0A)   startScript(201,[]);
[0058] (**) }
[0058] (2E) delay(300);
[005C] (DD) setClass(Local[0],[147]);
[0063] (D4) setObjectName(Local[0],"melting mug");
[0072] (1A) Var[233] = 500;
[0077] (48) if (VAR_ROOM == 33) {
[007E] (3A)   Var[233] -= 2;
[0083] (48) } else if (VAR_ROOM == 35) {
[008D] (3A)   Var[233] -= 3;
[0092] (48) } else if (VAR_ROOM == 34) {
[009C] (3A)   Var[233] -= 5;
[00A1] (18) } else {
[00A4] (3A)   Var[233] -= 1;
[00A9] (**) }
[00A9] (80) breakHere();
[00AA] (78) unless (Var[233] < 1) goto 0077;
[00B1] (DD) setClass(Local[0],[134]);
[00B8] (D4) setObjectName(Local[0],"mug near death");
[00CA] (2E) delay(300);
[00CE] (DD) setClass(Local[0],[12]);
[00D5] (D4) setObjectName(Local[0],"pewter wad");
[00E3] (9A) Local[1] = VAR_ROOM;
[00E8] (80) breakHere();
[00E9] (C8) if (Local[1] == VAR_ROOM) {
[00F0] (18)   goto 00E8;
[00F3] (**) }
[00F3] (A9) setOwnerOf(Local[0],0);
[00F7] (A9) setOwnerOf(Local[0],15);
[00FB] (0A) startScript(11,[]);
[00FE] (0A) startScript(12,[]);
[0101] (DD) setClass(Local[0],[19,6,140]);
[010E] (0C) Resource.unlockScript(69);
[0111] (A0) stopObjectCode();
END
2021-08-23 00:08:08 +03:00
Ben Castricum
ccc7412c57 SCUMM: MONKEY-VGA fix bug #346, Object stopped with active cutscene
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
2021-08-23 00:08:08 +03:00
Jan Sperling
f12fe5e9b5 SCUMM: Add German MI1 Lemonhead lines 2021-08-15 22:07:38 +03:00
Andrea Boscarino
b5e56e9230
SCUMM: Add italian translation for MI1 Cannibal script patch 2021-08-10 22:39:11 +03:00
Torbjörn Andersson
c193fa74bf SCUMM: Restore old clock tower behavior to the CD version of MI1
In the floppy VGA version (and presumably the EGA version as well), the
clock tower only gets a new description ("e.g. "Hmm.  Still ten
o'clock.") if you leave the room after examining it. In the CD version,
someone has "fixed" the behavior so that the description changes
immediately when the clock tower is examined.

Since it also changes on exiting the room after examining the clock
tower, that means you're much less likely to ever see the second
description. (There are only three, with a random variation on the
last one.) It doesn't completely ruin the joke, but...

To restore the original behavior, we don't allow the clock tower script
to increment the variable that changes its description.
2021-08-10 12:47:03 +03:00
Torbjörn Andersson
400e40da8e SCUMM: MI1: Use correct colors for Smirk's cigar smoke in CD version
We recently enabled the smoke animation that was present in the EGA and
VGA floppy versions of MI1, but removed in the CD version. However, for
a couple of reasons the colors were not correct.

For one thing, the animation doesn't use the same color indexes as in
the floppy version. But it still tries to remap the floppy version's
color indexes to other colors.

For another, one of the colors it tries to remap to gets overwritten,
probably to ensure that the GUI uses consistent colors. If that's the
only reason, we can safely ignore that for this room since it has no
visible GUI.

The voodoo lady's smoke is still using different colors than the floppy
version. I have no good ideas for how to fix that. Those colors will get
overwritten, and this time there is a visible GUI. But perhaps that
shouldn't be fixed since the special edition, for better or for worse,
pretty much made those colors canonical.
2021-08-10 12:41:48 +03:00
Torbjörn Andersson
0209d79652 SCUMM: Simplify Indy 3 Mac workarounds
I was confused when writing them. There shouldn't be any need to check
if the script is global when that's already implied by the script
number.
2021-08-09 10:06:26 +02:00
Torbjörn Andersson
4bcfd4aa3b SCUMM: Prepare for translated versions of the MI1 cannibal patch 2021-08-07 11:57:48 +03:00
Torbjörn Andersson
30ce02e9e3 SCUMM: Simplify MI1 cannibal patch
There's enough space to just change the first message and insert the
WaitForMessage(). No need to mess with the second message, since that
one's already correct.
2021-08-07 11:57:48 +03:00
Torbjörn Andersson
8e8e3225da SCUMM: Add missing Lemonhead lines in English CD Monkey Island 1
Apparently these were lost when the game was converted from floppy to CD
version. Not just in the English version, but that's all I have. We
should come up with a way to make it easy to add other languages,
though.
2021-08-07 11:57:48 +03:00
Torbjörn Andersson
a5d7d9fdd2 SCUMM: Limit Loom CD Choas/Chaos workaround to the appropriate script 2021-08-03 21:05:24 +02:00
Torbjörn Andersson
c6b8b1b9ac SCUMM: Remove stray "the" from recent captain Smirk workaround comment
And I forgot to mention in the previous commits that they were for
Monkey Island 1. Oops. Too late to do anything about that now.
2021-08-02 18:54:36 +02:00
Torbjörn Andersson
8b29bf5271 SCUMM: Restore missing cigar smoke to captain Smirk's close-up
In the EGA and VGA floppy versions, the close-up of captain Smirk has
animated cigar smoke. I don't have the EGA version, but in the VGA
version it apparently depends on whether you're running the game from
floppy or hard disk. If you run it from floppy, there is no smoke,
probably to cut down on disk access.

This is implemented in the entry script for room 76, where it either
sets costume 76 or 0 on actor 12.

In the VGA CD version, it always sets costume 0. Setting it to 76
restores the smoke, but the position is a bit off. Using the positions
from the floppy verion's script 57 fixes that. I have no idea why they
were changed in the CD version when they seem to use the same animation.
Only the colors are a bit different.

The "Ultimate Talkie" version already fixes this, but this fix should
not interfer with that. It uses slightly different positions for the
smoke, but the difference is never more than a single pixel so I'm not
touching those.
2021-08-02 16:21:20 +02:00
Torbjörn Andersson
e2544841df SCUMM: Handle shadow palette in Macintosh b/w mode
In Macintosh b/w mode, there really is no such thing as palette
manipulation. Any color changes have to be handled by the renderer.
Instead of marking the palette as dirty, changes to the shadow palette
trigger a full redraw of the screen.

At the time of writing, I'm only aware of two things that use this: The
lightning flashes at Castle Brunwald in Indiana Jones and the Last
Crusade, and the scene where the dragon finds Rusty in Loom. I have
verified that both of these seem to work correctly.
2021-07-13 09:53:36 +02:00
Torbjörn Andersson
3b730ecc55 SCUMM: Extended old workaround for overlapping MI2 music
While testing the Mac version of MI2, I noticed that the game would
resume the Woodtick music while Largo's theme was still playing after
the scene with the bartender. We already have a workaround for a similar
problem when he's talking to Mad Marty, and the cause seems to be the
same both times: Optimistic scripting. So delay that music transition as
well.

I've excluded the Amiga version from this workaround, because that one
cuts much of the music so it shouldn't be needed there. But if I'm
wrong, please let me know.
2021-07-09 12:50:09 +02:00
athrxx
e452349eea SCUMM: remove obsolete workaround
(obsolete due to f039bdb0)
2021-07-04 21:15:32 +02:00
Torbjörn Andersson
985463cfd0 SCUMM: Make the Indy 3 Mac fix a bit more specific
I don't know if there can ever be any confusion, but check that it's a
global script that's called, just to be safe.
2021-06-30 14:59:55 +02:00
Torbjörn Andersson
671a169153 SCUMM: Fix inventory problem when offering items to other characters.
If you offered an object to someone, e.g. one of the guards at Castle
Brunwald, then clicked "Never mind" instead, the next time you tried you
would only see one inventory object. This seems to be because unlike the
DOS version (at least the 256-color version), script 12 only enables
verb 101, not the whole inventory.

Perhaps the Mac version treated the inventory as a single verb?
2021-06-30 14:59:55 +02:00
sluicebox
674ed112aa JANITORIAL: Update more old bug tracker numbers
I missed the six digit ones and a few others in:
93eeffc84d
2021-06-09 14:28:52 -06:00
Orgad Shaneh
8047607908 SCUMM: Fix unclickable centered verbs
Fixes #12552
2021-05-17 22:16:56 +03:00
Orgad Shaneh
c8fc484c37 SCUMM: Fix X-range of selection for Hebrew on scumm<7
curRect.left is assigned in the script, and it is not modified. right is
assigned with the screen width - original left.

This results in bad highlighting of the verbs all over the line width,
instead of being limited to the actual string.

Due to that, sometimes the selection range of the up/down arrows overlaps
with some of the verbs, and then these verbs cannot be selected.

Solve by storing the original left value, and using it as initial x
position for the string (the actual right-to-left manipulation is done in
drawString()), and modify the value of curRect.left to match the string
that was actually drawn.

This bug is similar to the one that was fixed in 58e921eb87, but the
solution that was done there for v7 and v8 cannot work here, because the
string logic is much more complicated.
2021-04-26 21:26:41 +03:00
Zvika Haramaty
a1f440c073 SCUMM: FM-TOWNS: Add optional trimming to 200 pixels height
Trimming the screen to 200 pixels allows using aspect ratio correction.
2021-04-20 23:56:39 +02:00
sluicebox
93eeffc84d JANITORIAL: Update old bug tracker numbers 2021-03-03 02:15:05 +02:00
D G Turner
59b639ed4d SCUMM: Fix Missing Default Switch Cases
These are flagged by GCC if -Wswitch-default is enabled.
2019-12-23 11:56:16 +00:00
Ben Castricum
9b56d7c6bc SCUMM: MONKEY2: Skip extra code on FMTOWNS, fixes bug #2223 2018-10-02 19:32:32 +01:00
Eugene Sandulenko
e0b3001218 SCUMM: Add missing return statement 2017-08-11 20:20:25 +02:00
Robert Crossfield
4b1b9ec66f SCUMM: Maniac V0: Remove workaround for bug #2971126 (this issue no longer occurs as walking is handled the same as the original) 2014-12-02 16:40:46 +11:00
Torbjörn Andersson
fd40cb2224 SCUMM: Fix potential crash in o5_setClass()
If 'obj' was exactly equal to _numActors, derefActor() would have
complained about it being an invalid actor. I haven't seen any bug
reports about this, so presumably it never actually happened.
2014-07-12 10:44:37 +02:00
Johannes Schickel
3847465163 SCUMM: Make GPL headers consistent in themselves. 2014-02-18 02:39:38 +01:00
Filippos Karapetis
4f807ee53e SCUMM: More renaming for players
Rename "player" directory to "players", and reintroduce the "player_"
file prefix. This has been done after sev's request.
"players/player_foo.*" is more descriptive, and avoids potential name
clashes in libraries
2013-11-01 19:26:51 +02:00
Filippos Karapetis
651bf89939 SCUMM: Move all players to a separate "player" directory
There are 34 player .cpp/.h player files, so they have been placed in
their own directory, to logically separate them from the rest of the
engine
2013-11-01 06:57:53 +02:00
Matthew Hoops
0031c41db8 COMMON: Change kPlatformPC to kPlatformDOS
"PC" was very ambiguous and now it matches what we show in the GUI.

This also corrects sword2's platform to Windows.
2013-05-02 18:43:10 -04:00
Torbjörn Andersson
ce79ff4f2e SCUMM: Change NUM_SCRIPT_LOCALS to NUM_SCRIPT_LOCAL
For consistency with NUM_SCRIPT_SLOT.
2013-05-01 07:47:56 +02:00
Torbjörn Andersson
2284aba719 SCUMM: Use correct array size when calling initializeLocals()
The initializeLocals() function assumes that it can copy 25
elements when being provided an array of values. But this array
was frequently a lot smaller than that. I've introduced a constant
for the number of locals (though VirtualMachineState has one more
for some reason), and fixed the array sizes in a number of places.

CID 1003951, 1003952, 1003953, 1003955, 1003956, 1003959, 1003960,
1003961, 1003963, 100394, 1003965
2013-04-30 22:26:51 +02:00
Johannes Schickel
89abab97e3 JANITORIAL: Remove trailing whitespaces.
Powered by:
git ls-files "*.cpp" "*.h" "*.m" "*.mm" | xargs sed -i -e 's/[ \t]*$//'
2012-09-26 04:17:55 +02:00
Tobias Gunkel
96f8fc6ca9 SCUMM: Fix actor ID handling in v0
Some object functions allow actor IDs and object IDs as parameters. They are easily distinguishable in engines > 0 as actor IDs are < _numActors and object IDs are bigger. In v0 this is not the case as there are objects with IDs like 3 and 5 (e.g. the hamster). So object ID handling was unified for v0 and the other engines by introducing objIsActor(), objToActor() and ActorToObj().
2012-02-11 08:29:13 +01:00
Tobias Gunkel
621017ce65 SCUMM: remove some NOTEs/TODOs
- o5_breakHere() seems to be still needed. For example edna does not manage to walk up the ladder if this is not enabled.
- numLocalObjects seems to be big enough so that < instead of <= can be used. The original interpreter only uses the local ids 0 .. 44 whereas scummvm has _numLocalObjects set to 200.
2012-02-11 08:28:40 +01:00
Tobias Gunkel
de0b5f7674 SCUMM: use command stack and SentenceTab in mm c64
- MM C64 uses command stack (SentenceTab, doSentence()) now
- _cmdObject... added for current SentenceTab. The _active... variables are only used to build a sentence in the inventory but never by a script.
-> many routines are not needed anymore and are removed
2012-02-11 08:28:22 +01:00
Tarek Soliman
71f3c54365 SCUMM: Apply modified patch from #3076698
This adds support for the Ultimate Talkie Edition fanpatch

This is authored by the original UTE author LogicDeLuxe and Fingolfin.

Modification:
Removed detection entries
2011-10-04 23:44:05 -05:00
Eugene Sandulenko
10536e285c SCUMM: Fix bug #3306145: INDY3: EGA version script bugs
Based on a patch presented in the bugreport. Fixes several bugs
connected with calcualting IQ points in Amiga versions of Indy3.
2011-07-13 12:33:51 +01:00
Max Horn
88913c0139 ALL: Remove trailing whitespaces
This tries to make our code a bit more compliant with our code formatting
conventions. For future use, this is the command I used:
  git ls-files "*.cpp" "*.h" | xargs sed -i -e 's/[ \t]*$//'
2011-06-20 00:59:48 +02:00
Matthew Hoops
eea482fa43 ALL: behaviour -> behavior 2011-05-25 10:50:46 -04:00
Max Horn
649f8e0a84 SCUMM: Rename ResTypes->ResType, introduce ResId typedef, change code to use both 2011-05-13 14:02:53 +02:00
Max Horn
b37463fe59 SCUMM: Move class ResourceManager to its own header 2011-05-13 11:47:08 +02:00
strangerke
69b1485a22 GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00