Commit graph

216 commits

Author SHA1 Message Date
AndywinXp
1e9d51c28a SCUMM: COMI: Implement the original main menu
Every functionality has been implemented (audio options, text options, saving and loading).
The only thing currently missing from the menu is the thumbnail handling.
2022-08-06 13:33:56 +02:00
athrxx
85a191de2b SCUMM: (v6/EGA) - improved mouse cursor handling and some other fixes
The mouse cursors get dithered correctly now and due to earlier fixes SAMNMAX seems to be in as good a state as DOTT regarding EGA dithering mode, so I enable it. Also added a post-load fix for the palette and the mouse cursors.
2022-07-31 23:57:15 +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
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
21042c073f SCUMM: (v1) - fix minor glitch introduced in 97fbe86
(old savegames should only be upgraded for DOS)
2022-07-10 02:56:49 +02:00
athrxx
97fbe867cb SCUMM: (MMv1/ZAKv1) - add support for CGA, CGA Composite and Hercules modes
This does not improve anything about these modes for v2 and v3, except:
- brighter CGA colors
- v2 will also get the more accurate Hercules mouse cursor

I will do improve v2/v3 as separate tasks. v3 seems to be mostly fine, anyway, except for the actors (we dither them just like the backgrounds, but that looks different in DOSBox).
2022-07-10 01:04:38 +02:00
Torbjörn Andersson
6226efcf56 SCUMM: Fix mouse position after load for all rendering modes
Since the saved mouse position uses game coordinates, any rendering mode
that causes the graphics to be rescaled will have to convert them to
screen coordinates before warping the mouse there. (The rendering mode
scalers are separate from the backend scalers.)
2022-06-06 12:15:36 +02:00
athrxx
45cdc8ab07 SCUMM: (v1-3) - move load post processing to extra function 2022-06-05 23:17:28 +02:00
athrxx
dfe6082a12 SCUMM: (v1-3) - fix sound recovery when loading savegames
Prevent "stuttering" from starting the music multiple times (which may now happen due to the improved savegame loading for v1-3).

Also add some more tweaks to minimize stuttering, like setting volume to 0 during loading.

The result now seems to match what I get when using an emulator.
2022-06-05 23:17:28 +02:00
Andrea Boscarino
75b50b99b4 SCUMM: v7-8: Remove all blast texts before loading a savestate
This fixes an issue in COMI, in which bringing up the recipe book and then pulling it down
left the recipe texts on screen on the new room for several frames.
2022-06-03 17:51:56 +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
athrxx
acb665c109 SCUMM: (SCUMM7/8) - cleanup (text) verb drawing and Hebrew right-to-left drawing
(SCUMM7/8 only)
2022-04-08 19:53:44 +02:00
Torbjörn Andersson
c2b5a96f3c SCUMM: Fix regression in saving/loading Mac music
This applies to the Mac versions of Loom and The Secret of Monkey
Island. There was a regression some years ago that caused the channel
data to be saved twice, and the instrument data never.

Unfortunately, this does nothing to fix the savegames that were broken
by the regression.
2022-03-14 15:08:42 +01:00
Torbjörn Andersson
b5a93d9d67 SCUMM: Fix some more bugs with Loom replacement tracks
Don't try to update the _musicTimer in saveLoadWithSerializer(), because
we haven't yet loaded all of the savegame. Instead, do that in a new
restoreAfterLoad() method.

As an extra bonus, if an audio track was playing when the game was
saved, try to resume it from approximately that point.

Unfortunately, it turns out that _currentCDSound was not properly reset
when the song ended so loading a savegame made with an earlier version
of this feature may cause it to play music that it shouldn't. But that's
the kind of thing you should count on on the bleeding edge. Savegames
made after this change should be fine.
2022-03-08 11:19:39 +01:00
Torbjörn Andersson
db1fd7ddbb SCUMM: Fix missing cursor in Mac Indy 3 and Loom after loading
This was a regression that was apparently introduced when the animation
flag was cleared for the Mac cursor. The animation made the cursor show
up when loading older save games, but not new ones. That's why it went
unnoticed until now.
2022-01-24 16:08:48 +01:00
Eugene Sandulenko
abea37c9bb
ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Andrea Boscarino
f731cfd648
SCUMM: DiMUSE: New Digital iMUSE Engine (#3368)
SCUMM: DiMUSE: Add new implementation of the engine
2021-11-16 00:05:18 +01:00
Orgad Shaneh
ed5489929c SCUMM: Use nullptr
Using clang-tidy modernize-use-nullptr
2021-11-14 15:51:59 +02:00
athrxx
f8c9ae004a SCUMM: fix regression from 743343be
(thanks to criezy)
2021-09-09 01:39:05 +02:00
athrxx
743343be69 SCUMM: (FT) - fix bug no. 12903 ("Sometimes skipping videos occur")
Prevent autosave during smush playback. Thanks to AndywinXp for the tip.
2021-09-09 00:30:28 +02:00
Torbjörn Andersson
8b10066bda SCUMM: Fix compiling without SCUMM v7/8 2021-08-10 19:13:50 +02:00
Andrea Boscarino
886e6d83e6
SCUMM: COMI: Disable saving/loading during SMUSH videos (#3241) 2021-08-06 14:58:04 +03: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
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
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
Torbjörn Andersson
93cbb988a6 SCUMM: Some fixes that I'm not sure exactly what they do
I don't know what these fixes do exactly, but judging by the old code
they should be there.
2021-05-17 18:44:29 +02:00
Filippos Karapetis
cb6a107499 SCUMM: Limit x-range of selection workaround to Hebrew versions
Fixes bug #12552
2021-05-17 02:08:21 +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
athrxx
65f567d817 SCUMM: (FM-Towns) - array declaration cleanup
_cyclRects can have no more than 10 entries, but was declared as [16]. Someone put a TODO about it in saveload.cpp, so why not fix it...
2021-02-28 21:00:23 +01:00
Eugene Sandulenko
aa563f0c81 ALL: Remove PS2 port 2020-08-01 15:15:49 +02:00
Henrik "Henke37" Andersson
802c0ece7f SCUMM: PauseToken for saving 2020-05-10 23:39:31 +02:00
Paul Gilbert
a00e44ba6c ENGINES: Merge saveGameState virtual methods into a single one 2020-02-16 15:44:28 -08:00
sluicebox
b8390fa161 GRAPHICS: Add interface for horizontal shake 2019-11-19 00:20:40 +01:00
Robert Crossfield
71172add9c SCUMM: Original V0-V2 flashlight shape and size for MM/Zak (#10947, #10951) 2019-05-05 15:41:20 +03:00
Adrian Frühwirth
00e59a3122 ALL: Load savegame thumbnail only when necessary
This commit introduces the following changes:

1. Graphics::loadThumbnail()

   Now returns a boolean and takes a new argument skipThumbnail which
   defaults to false. In case of true, loadThumbnail() reads past the
   thumbnail data in the input stream instead of actually loading the
   thumbnail. This simplifies savegame handling where, up until now,
   many engines always read the whole savegame metadata (including
   the thumbnail) and then threw away the thumbnail when not needed
   (which is in almost all cases, the most common exception being
   MetaEngine::querySaveMetaInfos() which is responsible for loading
   savegame metadata for displaying it in the GUI launcher.

2. readSavegameHeader()

   Engines which already implement such a method (name varies) now take
   a new argument skipThumbnail (default: true) which is passed
   through to loadThumbnail(). This means that the default case for
   readSavegameHeader() is now _not_ loading the thumbnail from a
   savegame and just reading past it. In those cases, e.g.
   querySaveMetaInfos(), where we actually are interested in loading
   the thumbnail readSavegameHeader() needs to explicitely be called
   with skipThumbnail == false.

   Engines whose readSavegameHeader() (name varies) already takes an
   argument loadThumbnail have been adapted to have a similar
   prototype and semantics.
   I.e. readSaveHeader(in, loadThumbnail, header) now is
   readSaveHeader(in, header, skipThumbnail).

3. Error handling

   Engines which previously did not check the return value of
   readSavegameHeader() (name varies) now do so ensuring that possibly
   broken savegames (be it a broken thumbnail or something else) don't
   make it into the GUI launcher list in the first place.
2018-04-07 09:26:20 +02:00
Colin Snover
ffdb5a8ebc SCUMM: Fix compilation failure when DISABLE_TOWNS_DUAL_LAYER_MODE is defined 2018-01-31 21:24:09 -06:00
Colin Snover
08186aeec6 SCUMM: Rename iMUSE save/load function to avoid confusing function hiding 2018-01-31 21:24:09 -06:00
Colin Snover
4e6b60948d SCUMM: Remove variable shadowing 2018-01-31 12:24:32 -06:00
Colin Snover
2e061d95c5 COMMON: Move VER macro for serializer into common code 2018-01-31 17:58:01 +01:00
Colin Snover
9916b26383 SCUMM: Replace UB-triggering serialization code with Common::Serializer
Fixes Trac#10342.
2018-01-31 17:58:01 +01:00
Bastien Bouclet
3eb82462e7 ALL: Specify the DisposeAfterUse constructor argument for dynamic memory write streams 2017-09-22 07:06:21 +02:00
Ben Castricum
8957bf4d7f SCUMM: reset ShakePos on loading, fixes one part of bug #7141 2016-07-01 08:25:28 +02:00
Ori Avtalion
3564032330 JANITORIAL: Reduce audio header dependencies 2016-04-14 16:10:21 +03:00
Eugene Sandulenko
aa6ae7ac35 SCUMM: Fix warning 2016-02-14 17:51:30 +01:00
Torbjörn Andersson
f74ba29753 SCUMM: Enable Day of the Tentacle easter egg
Instead of returning to the launcher, a game may now specify a list
of "chained" games and optional save slots. The first game is popped
from the list and started. Quitting still quits the entire ScummVM.
It seemed like the sensible thing to do.
2014-12-30 03:45:14 +01:00
Filippos Karapetis
40b224fc74 SCUMM: Disallow saving while a room 'prequel' is shown in v0-v3 games
These are cases where the screen is completely blank, showing text.
In such cases, no room is set, thus no room resources are available.
An example is the screen shown after the credits in the Zak FM-TOWNS
intro ("The next day..."). Thanks to segrax for finding this case.
This commit is based off pull request 522, but completely disallows
saving in such scenes, instead of adding explicit checks for them
2014-10-29 11:23:59 +02:00
Filippos Karapetis
53d3ee07df SCUMM: Add support for CD audio tracks in the Steam versions of Loom
Many Thanks to Ben Castricum for the original patch
2014-07-04 23:33:43 +03:00
Max Horn
8638b29b89 SCUMM: Avoid potential issues casting invalid values to enum
A compiler could in principle decide that a ResType enum can
never equal 0xFF or 0xFFFF, and thus incorrectly optimize
the ScummEngine::saveOrLoad code. So check the value
*before* casting it.
2014-03-30 19:48:08 +02:00