Some engines call setAutosave and some don't. isAutosave is used to
determine if a saved game is an autosave, but in fact, on most cases it
just falls back to comparing the name to "Autosave".
This is wrong for several reasons:
* Older versions of ScummVM used Autosave 0.
* The name "Autosave" is translated, so if you change the language, it
won't be detected.
Instead of relying on the name, use the well-known getAutosaveSlot() from
Engine/MetaEngine.
Fixes#12735.
This employs a "lazy" approach: the "format" for the credits stays
exactly as it was, i.e., perl code. Of course one may want to change
this to another format (e.g. YAML, JSON, XML; or also shell script or
AWK, like `configure.engine` uses). But I deliberately kept it simple,
to get a minimal change that is easy to verify. Any further changes to
e.g. the format can be layered atop this.
The filename `demo` was used to detect the Operation Stealth Amiga
demo. This would often produce false matches when the same filename
was present in data files for other engines, especially Mac Director.
We can use the filename `demo_os` instead. This is the file used for
the DOS demo (with a different md5).
For each engine:
- Make a new folder detection
- Move detection-related files inside the folder
- Add a new module "enginename/detection"
- Add DETECT_OBJS here
- Adjust the normal engine module to remove detect_objs
- Adjust every file for the new changes.
In Future Wars the command line was not always updated and thus failed
sometimes to be up to date (i.e. showing wrong text, e.g. "EXAMINE" only
when it should have read "EXAMINE scaffolding" because the mouse cursor
was on the scaffolding).
Now we just always update the command line for both Future Wars and
Operation Stealth which seems to fix the command line updating.
I think this probably was a regression caused by adding support for
Operation Stealth (i.e. pull request #2365) and the efforts made in it
to make the user interface responsive.
The Italian Amiga version of Future Wars tries to load music from file
"TELESONG.DAT" which does not exist. Previously after this starting to
play music might either try to play a null stream and crash or play an
old wrong music in memory. Fix that by setting the stream to null if
no music exists (Checked that the stream is destroyed i.e. the
destructor is run so it should be safe to set the _moduleStream variable
to nullptr directly).
Previously there was a fix for bug #2669415
("FW: half walking speed in a screen") which only addressed a single
scene in Amiga and Atari ST versions of Future Wars.
This fix fixes half walking speed in 8 more scenes in Amiga and Atari ST
versions of Future Wars. The scenes were identified by playing through
an Italian version of Amiga Future Wars.
3 more scenes were left over with half walking speed because they could
not be fixed as easily (i.e. using this fix on them broke the scenes in
some way, made them too fast or made the people walk into wrong
positions or something else). The scenes left over are the ones using
the following background files:
- "L10.PI1": The medieval castle's hall.
- "L18.PI1": The medieval castle's teleport room.
- "L45.PI1": Space station's computer room.
Total playtime is kept as milliseconds in the engine. It is saved as
seconds. Previously it was not converted to milliseconds on load but
seconds were took as milliseconds (i.e. 10s -> 10ms). Fix that by
converting total playtime on load from seconds to milliseconds.
Previously I encountered an std::bad_alloc with the code in manageEvents
pushing an empty Event into the event queue. It did not happen very
often but I got it to appear while debugging at least once or maybe
twice.
This is an attempt to fix this possible behaviour by not pushing empty
events into the event queue but making sure the current status is
checked without needing to push empty events into an empty event queue.
I played through Italian Amiga version of Future Wars with this change
and encountered no problems with it.
Previously the inventory could be summoned multiple times by pressing
F3 or F4. Fix that by keeping track when the inventory has been opened
and not allowing multiple use of it simultaneously.
After player has died it was hard to get the system menu to appear by
pressing the left and right mouse buttons simultaneously or the middle
mouse button. Fix that by using the maximum values of the mouse button
states for the polling period (Around 110ms at default play speed).
Make Amiga music loop until fade out when changing scene. This is
based on watching a video of Future Wars Amiga walkthrough, not on
playing the Amiga version or reading its disassembly. But it does seem
that the music loops instead of just playing once.
Previously frequency of zero samples crashed the debug version,
now they are simply discarded. Also the frequency calculation is done
differently in the Amiga version of Operation Stealth than in the
Future Wars. This fixes playing samples in Amiga versions of Operation
Stealth (Not crashing on frequency of zero samples and playing the
samples at their right pitch).
The .AMI files load better with loadSpl function than loadAni.
Using loadAni for some of the files resulted in garbled sound when
the input data was presumed to be 4-bit although it was 8-bit.
Fixes loading of some Amiga samples in Operation Stealth
(Not all samples were affected). Addresses bug #11676.
In Operation Stealth DOS and Atari ST versions, but not Amiga or
demo versions, sound effects are loaded in AUTO00.PRC using a
combination of o2_loadAbs and o2_playSample(1, ...) before
o1_freePartRange(0, 200). This is a better heuristic for ending the
script at the correct position than checking whether global variable
255 is compared to 0. In the original game AUTO00.PRC was run when
starting or restarting the game and one could not load a savegame
before passing the copy protection. Thus, we try to emulate that
behaviour by running at least part of AUTO00.PRC before loading a
savegame.
If the error messages can not be found (They are in the file
ERRMESS.DAT in Operation Stealth) then use the default values.
There are now the following default error messages included in ScummVM
for Operation Stealth:
- American English (Protagonist is James Bond)
- British English (Protagonist is John Glames)
- French
- German
For the Italian and Spanish releases of Operation Stealth the error
messages from Future Wars are used as fallback. This is incorrect
but better than nothing.
This makes the error message handling more lenient than before so that
not having an ERRMESS.DAT does not block the starting of the game
anymore.
Fixes bug #11649.
In French Amiga Future Wars from bug #10643 when walking left from the
scene with the open manhole cover a call to renderOverlay with a
type 0 (color sprite) overlay happens. The source mask for the overlay
is NULL and a memcpy using a NULL pointer as source is initiated.
This results in a memory access violation.
This fixes that memory access violation by simply setting the
destination mask to all zeroes when the source mask is NULL.
Seems to work fine at least in this case.
Fixes bug #10643.
This raises the maximum number of savegames from 20 to 100.
The original UI could only show 20 on a screen at once so an
intermediate selection menu for selecting the group of 20 savegames
to be accessed is added in this commit:
0-19
20-39
40-59
60-79
80-99
Those are the values that are shown when selecting
"Restore game" or "Save game".
After selecting the group of savegames to be accessed that particular
group is only shown as those 20 can fit on the screen using the
original save/load UI.
At least partially if not fully fixes bug #11625.