Commit Graph
231 Commits
Author SHA1 Message Date
Donovan Watteau ee26cf4d18 SCUMM: Get the workaround for bug #1025 closer to the original behavior
In most (if not all) versions of Loom before the Talkie v4 release, one
of the shepherds should trigger a "We are the masters of stealth" line
if Bobbin tries to use the stealth draft on them, but no proper value for
the actor number is ever given.  In the original interpreters, the invalid
line would be skipped.  The Talkie release changes the lines a bit and
makes the third shepherd (act. 4) say something similar, instead.

Until now, ScummVM would work around this by forcing the leftmost (act. 2)
shepherd to say this line.  But, looking at the original script, it seems
that the original intent may have been to let any of the four shepherds
say this line, since script 232 expects a parameter which could be given
by any of the associated 422--425 (act. 2--5) actor objects.

So, moving this check from actorTalk() to o5_startScript() lets us
implement a more comprehensive workaround (with a bit more safety checks,
since there are so many Loom versions), but it also exposes another bug
in some EGA versions and derivatives (e.g. the French EGA version has it,
but the English EGA 1.1 version doesn't): if Bobbin uses the stealth draft
on the second shepherd (act. 3), then some line(s) will be completely
missing, potentially because this actor has been removed from the scene
in the earliest versions, although he's still in use.

Having zero reaction from the shepherds when you try their draft upon
them can be extremely confusing, so we need to work around this, too.

Forcing this actor to "stay" doesn't fix the issue for now (and the
symptoms are a bit different between ScummVM and the original
interpreters), so at the moment we force this workaround even if
`_enableEnhancements` is not enabled, when we detect this strange
actor behavior.
2022-05-21 17:30:34 +03:00
athrxx b63bc6bfd6 SCUMM: (ZAK/FM-TOWNS) - fix bug no. 13399
(Counter door remains in closed status even though the Caponian just opened it)
2022-04-24 23:39:09 +02:00
athrxx b5571cc089 SCUMM: fix another regression from 2adc35e
The direction parameter used in setDirection can be > 360, so it may not be passed to newDirToOldDir() directly.
Also, fix the converting routine for old saves.
2022-04-22 00:08:50 +02:00
athrxx 17f4113f20 SCUMM: fix accidental line removal
(experimental code that I forgot to restore)
2022-04-21 21:23:27 +02:00
athrxx 5f87731465 SCUMM: (MM/V2) - fix regression from 2adc35e 2022-04-21 21:13:09 +02:00
athrxx 2adc35e261 SCUMM: fix minor (and rare) costume rendering glitch
(DOTT bug mentioned here: https://github.com/scummvm/scummvm/pull/3795/)

I found this in all versions from 1 to 6, so I applied the fix to all non-AKOS and non-v0 costumes.
2022-04-20 19:48:22 +02:00
Andrea Boscarino bd21f18d0c SCUMM: DIG (demo): Improve text accuracy
This is done just by adapting everything FT does to DIG demo, since they share the same exact code
2022-04-08 19:53:44 +02:00
Torbjörn Andersson cb561f462e SCUMM: Read the "enable_enhancements" setting only once
I can't change during gameplay, it's shorter to type, and we won't
accidentally involve the config manater in some tight loop.
2022-03-23 15:23:10 +01:00
Torbjörn Andersson 52549c1678 SCUMM: Make correcting position of green tank in Sam & Max optional 2022-03-23 15:23:10 +01:00
Torbjörn Andersson b221812eda SCUMM: Fix indentation 2022-02-25 07:17:20 +01:00
athrxx 1ce1554157 SCUMM: fix bug 13306 (SCUMM: LOOM (not VGA): Bobbin walks in front of the sheep for a split second) 2022-02-20 19:09:57 +01:00
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Orgad Shaneh ed5489929c SCUMM: Use nullptr
Using clang-tidy modernize-use-nullptr
2021-11-14 15:51:59 +02:00
athrxx f3729de274 SCUMM: (SCUMM7/8) - fix minor walking code glitch
(see https://bugs.scummvm.org/ticket/12499#comment:11)

In Actor::startWalkActor() we call adjustXYToBeInBox() twice, first with the dest coords, then again with the resulting coords from the first call. In the example from the bug ticket (clicking on Kenny the lemonade selling pirate) this will adjust the x position from 503 to 501 on the first pass and from 501 to 500 on the second pass.

The original SCUMM 5 and 6 (I checked MI2 and SAM) actually do it exactly like that, so it becomes kind of obvious where our code originates from.

However, for SCUMM 7 and 8 (I checked FT, DIG, COMI) the function has been simplified considerately. It makes the call to adjustXYToBeInBox() only once (and no call to checkXYInBoxBounds() either), so in our COMI example the x position will stay at 501.
2021-09-23 23:07:06 +02:00
athrxx a70206f56f SCUMM: (SCUMM 3) - avoid possible division by 0
(I haven't encountered a case where it actually happened, but it looks like it could...)
2021-09-04 18:28:27 +02:00
athrxx c19a3f1cc1 SCUMM: (COMI/CJK) - add actor text color hack
Just something I came across in the disasm while doing something else. I also ran the original CJK interpreter in VirtualBox to confirm this weirdness...
2021-08-28 14:10:00 +02:00
athrxx 033084505c SCUMM: (COMI) - fix bug no. 4424 ("Guybrush walks in place when examining certain objects")
Minor walking code fix from disasm. I have verified that the changes have to be applied to all SCUMM7/8 games, but not to the lower versions.
2021-08-23 15:48:10 +02:00
athrxx e3775f1f15 SCUMM: (SCUMM4) - extend DOTT walk code fix to another target
(verified from disasm)
2021-08-10 19:48:40 +02:00
athrxx b5171e3567 SCUMM: (FT) - fix actor facing in calcMovementFactor
(verified from disasm that FT uses the same method as DIG and COMI)
2021-08-10 19:46:37 +02:00
athrxx 21b2411490 SCUMM: (SCUMM5/6) - extend DOTT walk code fix to more targets
I have verified this for all SCUMM5/6 games.
2021-08-10 19:46:16 +02:00
athrxx 78252d9c2a SCUMM: (DOTT) - fix bug no. 11445 ("George Washington faces Left instead of Forward, after chopping down the Cherry Tree")
I have limited this to DOTT for now, since I haven't checked anything else...
2021-08-10 19:45:10 +02:00
athrxx ecd02afeda SCUMM: minor v1-3 walk code cleanup 2021-08-06 16:13:07 +02:00
athrxx 3c69292a66 SCUMM: fix Actor_v2 initActor regession 2021-08-06 15:25:31 +02:00
athrxx 3218092187 SCUMM: some walking code cleanup
(move more code from Actor to Actor_v3 and generally try to cleanup the mess I created over time)
2021-08-06 15:22:33 +02:00
athrxx c4678c993f SCUMM: split Actor::calcMovementFactor() into separate functions for SCUMM1-3 and SCUMM4+.
(The code has diverged so much, it makes sense to make use of the already existing sub class here)
2021-08-06 01:00:57 +02:00
athrxx 5a94f51eab SCUMM: (v1/2) - fix actor move flags
(final fix for ticket no. 3215 ("SCUMM: Zak McKracken - intro behavior + movement")

The ticket has been closed a couple weeks ago, since a user claimed that the intro was fully fixed. And it mostly was. Except one little thing about the movement of the floating hat which, after chasing Zak, would return to the left of the screen one step to early.

Turns out that o2_waitForActor() got triggered one step to early, because we didn't set the final MF_TURN flag...
2021-08-06 01:00:15 +02:00
athrxx 9bcfc91ce2 SCUMM: (v1/2) - fix walking steps calculations
After my recent effort to do this for SCUMM3 I now try to achieve the same thing for v1/2. (Unsurprisingly) the step calculations actually have more in common with SCUMM3 than with the later versions upon which the code was based. However, I find the  v1/2 code somewhat more difficult to fix than v3, since it is quite heavily twisted and refactored to fit into our common code. So all testing and bug reporting is welcome...
2021-08-06 00:58:40 +02:00
Andrea Boscarino 7032f742ff SCUMM: COMI: Fix bug #12029 2021-07-29 22:54:04 +02:00
Andrea Boscarino 8b78da3723 SCUMM: FT: Fix softlock on negative walk destination 2021-07-29 22:46:22 +02:00
athrxx e0db30fb8f SCUMM: (SCUMM3) - add new walking code vars to save/load function
(also recalculate these vars when loading old savegames)
2021-07-16 01:07:13 +02:00
athrxx 4aa78f28b3 SCUMM: remove leftover debug message
(this was left over from my private testing and not meant for upstream)
2021-07-10 22:41:05 +02:00
athrxx 61d163ac98 SCUMM: silence two MSVC warnings 2021-07-10 01:10:04 +02:00
Paul Gilbert 0136043f09 COMMON: Revert Change Rect and Point to have int32 fields
This reverts commit 1c3e7fb4e9.
2021-07-06 20:35:42 -07:00
Paul Gilbert 1c3e7fb4e9 COMMON: Change Rect and Point to have int32 fields 2021-07-04 18:24:26 -07:00
athrxx 1bf264d5f6 SCUMM: (SCUMM3) - fix bug/typo in walk code 2021-07-04 21:23:24 +02:00
athrxx f039bdb083 SCUMM: (SCUMM3) - pixel-perfect walking
This is a follow-up commit to 8cbcde0c (bug
https://bugs.scummvm.org/ticket/12666). While that commit improved the situation, in particular the behavior described in the bug ticket, it still wasn't anything like pixel-perfect.
The agents would walk in a weird half circle due to being showered with walkActorToActor calls from the script.

I have now implemented the original walk code and also compared the first part of the INDY3 scene described in the ticket frame by frame with the DOSBox debugger to check whether it is truly pixel-perfect.
2021-07-04 18:47:54 +02:00
Torbjörn Andersson b5cfd4d5e3 SCUMM: Remove mac_restoreCharsetBg()
The differences between the two weren't as great as I had first thought.
2021-06-30 14:59:55 +02:00
Torbjörn Andersson 9d2d6b60c8 SCUMM: Some more work on the Indy 3 Mac text box.
I'm starting to reconsider the exact way I'm doing this, so this is a
good place to commit what's there, before tearing it up.
2021-06-30 14:59:55 +02:00
Torbjörn Andersson 319492e83a SCUMM: Add function for drawing Indy 3 Mac text box
Well, the border and title at least. I still need to get the text to be
drawn inside, and remove the box once it's done.
2021-06-30 14:59:55 +02:00
athrxx 8cbcde0c57 SCUMM: fix bug 12666 ("Dodgy path finding in Indy 3")
The particular scene with Indy and Donovan's men had all sorts of pathfinding issues compared to DOSBox:
- Indy's initial facing was downwards instead of to the right when walking from the window to the "meeting point" and the path he walked wasn't exactly correct.
- One of Donovan's men was facing down instead of left.
- Indy would take several weird up and down walks at the walk box transition from box 1 to box 3
- Indy would walk over the grass instead of on the road.

All fixes are from disasm. Some code I have removed (or rather commented out) seems to have been meant as a fix for bug no. 1778. So maybe that one has to be fixed again (correctly), but I don't know that yet.

The scene is not 100% fixed yet. Donovan's men walk a bit too much upwards in the beginning. But I can do that separately...

It will really be necessary to do some testing (and possibly more fixing) in the catacombs, in castle brunwald and in the zeppelin maze.
2021-06-29 23:19:29 +02:00
athrxx 89152dc2c4 SCUMM: fix regression from ef0d76a2
(reported by erictorbjorn)
https://github.com/scummvm/scummvm/commit/ef0d76a2c7c3a061f4322fa29b879b4bdef606ad
2021-06-28 16:31:27 +02:00
athrxx 3a4e3879f4 SCUMM: partial revert of c57243ae (limit to SCUMM3)
This is only supposed to apply to SCUMM3. It is a bit difficult to recognize this from SCUMM1/2 disasm, since things happen in a different order there. But it actually causes glitches in SCUMM1/2 (actors are slowed down sometimes) and it isn't required for bugs like no. 12278 (which has been fixed for SCUMM1/2 by one of my other recent commits).
2021-06-13 01:28: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
athrxx ef0d76a2c7 SCUMM: (INDY3) - properly fix bug no. 1052
(minor SCUMM 3 walk code fix)

This fixes it according to disasm, without relying on a hack.
2021-06-07 23:51:32 +02:00
athrxx 1f7c52a942 SCUMM: whitespace 2021-06-06 17:06:33 +02:00
athrxx fa48015bbd SCUMM: (ZAK/TOWNS) - fix bug no. 4594 and 4601
4594: "Zak keeps walk animation without moving"

4601: "SCUMM: Zak McKracken (FM-Towns) - shopkeeper keeps walking"

Bug 4594 also happens with the original ZAK FM-TOWNS interpreter (unlike SCUMM1/2). I have added a workaround similiar to PR #2991.

Bug 4601 does not happen with the original, although it seems to have the exaxct same cause and is also fixed by this workaround. So I have stopped exploring this one for now.

I have limited the workaround to ZAK, since the bug reports are all from that game. To me, it looks like an oversight when converting the original SCUMM1/2 scripts to SCUMM3.
2021-06-06 16:02:00 +02:00
athrxx a408f44c1b SCUMM: (SCUMM1/2) - fix bug no. 4594 ("Zak keeps walk animation without moving")
This is only the fix for SCUMM1/2. It fixes at least the bug described in the ticket (clicking on the shop manager after buying a lotto ticket). Unlike later versions V1/2 adds and removes the MF_TURN flag on the actor without touching the other bits. I have verified this from disasm and dosbox debugging.
2021-06-06 16:01:50 +02:00
athrxx f5ed4d54d3 SCUMM: (SCUMM1-3) - fix actor facing for diagonal walks
While testing fixes for bug no. 12278 I also noticed that the actor facing when walking diagonally did not match the original behavior when I had the ZAK intros running in ScummVM and UNZ (for Zak-Towns) and ScummVM and DosBox (for Zak-DOS-V1 and V2).

This is about the decision whether a character that walks diagonally should face up/down or left/right. I implemented the original method to determine the facing.
2021-06-06 16:01:19 +02:00
athrxx 74ed6d94c8 SCUMM: (SCUMM1-3) - (very minor) fix for walk dir interpolation
Our current interpolation does not always turn characters in the same direction as the original, e. g. when walking straight up or down the original will always turn the character counter-clockwise. I implemented the interpolation table used by the original interpreters for more faithful display. Verified visually for v1-v3, and from disasm for v3 and v1.
2021-06-06 16:01:10 +02:00
athrxx c57243ae85 SCUMM: (ZAK) - fix bug #12278 ("Zak's positioning in the intro")
(added 2 lines of code from disasm)
2021-06-06 16:00:51 +02:00