Commit Graph
238 Commits
Author SHA1 Message Date
AndywinXp 5475281c09 SCUMM: Clean up boolean assignment in c108dc2
...whoops. Thanks athrxx for the heads up.
2022-07-27 17:12:55 +02:00
AndywinXp c108dc2646 SCUMM: Fix o5_faceActor() implementation for v4 and below
Fixes #5312.
Verified from the disasms of MANIAC v2, INDY3 v3 and LOOM v4.
2022-07-27 15:03:36 +02: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 660512ac4d SCUMM: (V3/4 - CGA) - fix CGA mode for MI1EGA + cleanup
In the end, once fully understood, the CGA rendering is very similar for all versions. So I did manage to clean out some code. Hercules mode for MI1EGA is broken here, I will have another commit for that, once I understand how it works.
2022-07-23 23:17:45 +02:00
athrxx bf45eb3daa SCUMM (v3/CGA) - improved rendermode post-load fix
Fix actor palettes for savegames saved with a different rendering mode. This works for Loom and Indy3...
2022-07-16 23:13:45 +02:00
athrxx 2fd8bf67db SCUMM: fix videomode var handling (LOOM CGA actor palette glitch)
(original bug)

In LOOM, the scripts actually read the videomode var and make actor palette adjustments based on that. Which means for games saved in EGA mode, with the wrong videomode var value,  there will be glitches.

This concerns not only Bobbin, but the script does things for various actors and costumes in various situations.

We just set the videomode var to the actual config after loading.

For Bobbin in normal costume, I also include a post-load fix for savegames that will not have the actor palettes fixed by the scripts (savegames that we allow in situations where the original would prevent them).
2022-07-16 14:51:11 +02:00
athrxx 53cff7c239 SCUMM: (MM/V1) - fix walk code bug
(in the bathroom with the mummy in the tub, applies to v1 only)
2022-07-10 20:21:35 +02:00
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