Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SCUMM: Work around lava flowing up in MONKEY1-FLOPPY-VGA (Trac#10854) #3958


Copy link

@dwatteau dwatteau commented Jun 3, 2022

See Trac #10854 for more context and savegames.

In the floppy VGA version of Monkey Island 1 (not the CD version, not the EGA floppy version), the lava in the cave under the Giant Monkey Head currently flows up instead of down, with ScummVM. This problem doesn't appear with the original interpreter.

This effect uses color-cycling in the VGA version (where it's enabled… the Amiga version just disabled the effect, for example).

initCycl() does a different color-cycling for the older GF_SMALL_HEADER games. I wonder if cycl->flags = 2; shouldn't just always be cycl->flags = 0; for these games instead. But I can't prove that. It looks like it's been this way in ScummVM since commit cec0239 (which was related to Trac#1016).

Diasm of the original floppy VGA interpreter could probably confirm or disprove this, but that's too much for me ;) The 2003 commit above says that LoomCD is another GF_SMALL_HEADER game which also used this effect, but not in a way which makes sense (I think I can trigger one in Loom CD by doing room 1 but epilepsy warning for this one).

So I suggest to just force the color-cycling effect to go in the opposite direction when we're in the MONKEY1-FLOPPY-VGA rooms where we know it's currently wrong.

How to test

  1. Start the floppy VGA version of Monkey Island 1 (which was only available for DOS, I believe)
  2. room 65 in the debugger, go to the right and look at the lava flowing from the wall. It should flow down, not up.
  3. This effect also appears in room 39 but you may need to try several tries since this room is randomy generated.

Another object using color-cycling in this game is Meathook's sign in room 48. But it looks like it just evenly alternates so I can't see any difference when changing the flags there.

In the floppy VGA version of Monkey Island 1 (and only this particular
version), the lava was flowing up instead of flowing down, in the cave
under the Giant Monkey Head.  This doesn't happen with the original
interpreter. ScummVM displays this effect correctly with the VGA CD

This is maybe because the game uses color-cycling for this effect in
VGA, and the floppy VGA version is still a GF_SMALL_HEADER game where
we decode this effect differently, notably by always setting its
flags to 2 (and it's been this way for a very long time).

Setting the flags to 0 instead fix this effect.  We should maybe
always use this 0 value, but it seems safer to only change this value
for the lava at the moment, until some disasm confirms or disproves
the current flags value for GF_SMALL_HEADER games.

(Also fix some incoherent indentation while there.)
Copy link

@bluegr bluegr commented Jun 5, 2022

Quite a straightforward bugfix with a very specific and targeted scope. The fix works just fine, thanks! Merging

@bluegr bluegr merged commit fe16115 into scummvm:master Jun 5, 2022
8 checks passed
@dwatteau dwatteau deleted the fix/workaround-monkey1-vga-floppy-lava-flowing-up-in-cave branch Jun 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
2 participants