Commit Graph

3888 Commits

Author SHA1 Message Date
Eugene Sandulenko
63870b65fa
AD: Properly seek to the tail of file for md5 computation 2021-10-19 21:09:15 +03:00
Eugene Sandulenko
841254e6f1
AD: Fix seeking for tail md5 2021-10-19 13:05:22 +03:00
Eugene Sandulenko
91b91c0cba
COMMON: Fix bug in Mac resfork data size calculation. This invalidates many detection entries 2021-10-17 20:48:02 +03:00
Eugene Sandulenko
4eea8524f7
COMMON: Add possibility to compute md5 for tail of resfork data 2021-10-17 20:48:01 +03:00
Thierry Crozat
32d4173fda COMMON: Remove unused and useless getCurrentCharset in TransMan
Now all translations use unicode.
2021-10-02 23:50:21 +01:00
Thierry Crozat
ebd8915009 GUI: Simplify builtin language check 2021-10-02 23:50:21 +01:00
Cameron Cawley
987c0eb76a COMMON: Add a signed version of uintptr 2021-09-19 11:21:41 +03:00
TehGelly
0992fa9c3b
COMMON: Change PRNG Function to Xorshift* (#3341)
The old RNG method had non-standard periods, ranging from some seeds looping on themselves (seed = 1184201285) to some seeds having periods as low as 11 or 48, as listed in https://github.com/scummvm/scummvm/pull/3340. This is a problem even for games that run the RNG once a frame, as the possibilities for random events is greatly reduced should the initial seed be in one of these sets of small periods.

Xorshift* is a standard, fast, non-cryptographic PRNG with academic backing that has period 2^32-1 (all seeds lead to another seed except 0, which is excluded from the initial seeds).  Many different flavors are possible, as listed in the paper, but the choice implemented in this pull request uses only a single 32-bit integer as a state, like the old PRNG.

Co-authored-by: Thierry Crozat <criezy@scummvm.org>
Co-authored-by: Filippos Karapetis <bluegr@gmail.com>
2021-09-09 21:46:08 +03:00
Scott Percival
666f241d29 EVENTRECORDER: Remove backwards compatibility 2021-09-09 19:32:02 +02:00
Scott Percival
fb421a0ca7 EVENTRECORDER: Change file format to big-endian
Previously the file format had all chunks, offsets and values stored in
little-endian format. The one exception was screenshots, which used the
existing THMB code in graphics/thumbnail.cpp, that is entirely
big-endian. Any tooling which attempts to parse the Event Recorder file
format must make a special exception for THMB chunks, and read the chunk
size and contents as big-endian.

In the interests of making the file format more consistant
to parse, and given that backwards compatibility is not required for
this iteration of Event Recorder, this patch changes everything to
big-endian.
2021-09-09 19:32:02 +02:00
Scott Percival
1040bd2862 EVENTRECORDER: Fixes based on feedback 2021-09-09 19:32:02 +02:00
Scott Percival
84707ec828 EVENTRECORDER: Prevent recursive call to warpMouse 2021-09-09 19:32:02 +02:00
Scott Percival
5cbcd98963 EVENTRECORDER: Add screen update tracking
Screen update boundaries are now used as sync points.
Screenshots are now processed on a screen update boundary.

This change increments the version of the Event Recorder
file format to 2; version 1 files will still play back as
before, without synchronising to screen updates.
2021-09-09 19:32:02 +02:00
Torbjörn Andersson
15916e02f1 COMMON: Fix Valgrind warning in PEResources
As with NEResources, _disposeFileHandle was never set.
2021-09-06 08:37:25 +02:00
Torbjörn Andersson
e14ffec25a COMMON: Fix _disposeFileHandle not being set
If there is a file handle, the clear() method checks if it should be
disposed of. However, the _disposeFileHandle variable was never set, so
it's unlikely that _exe was ever deleted. I found this out from a
Valgrind warning when quitting Buried in Time.

This seems like a very obvious fix to me, and as such it seems like a
good candidate for backporting to the release branch. On the other hand,
maybe there are cases where it worked by sheer, dumb luck? I'm not
familiar enough with where and how it is used.
2021-09-06 08:01:08 +02:00
Torbjörn Andersson
24ea36d3e9 COMMON: Don't decompress more bytes than the file specifies (bug 12900)
When running my CD version of Buried in Time, the loadFromCompresedEXE()
function would try to decompress beyond the allocated buffer, causing it
to crash. Up to that point, the decompressed data was identical to what
I would get if I let the original installer decompress the EXE and DLL
files.

So keep track of how many bytes have been decompressed, and terminate
when the upper limit is reached.
2021-09-05 21:26:49 +03:00
Matthew Duggan
2c4aae5294 COMMON: Use const references where possible in punycode
As suggested by coverity.
2021-09-04 23:15:23 +03:00
trembyle
05a27c3cfc COMMON: Add Macromedia/Adobe Shockwave as platform
These can be big- or little-endian. The development platform can be
autodetected based on RIFX/XFIR in header.

These games ran in Shockwave Player either as a standalone app or as
web browser plugins on Windows and Mac.

Shockwave game added as D6 detection entry as an example.
2021-08-31 11:44:44 +02:00
trembyle
8cea642962 COMMON: Add constants for new Director game languages
Catalan and Flemish use existing ISO/locale codes

Arabic uses generic ARB for country code. There is no clear country code
to apply here. We can take ARB to mean Arab League or Modern Standard
Arabic.

TODO: Consult Arabic speakers on country-level dialects
2021-08-31 11:44:44 +02:00
Die4Ever
b617364f45 COMMON: improve RandomSource initial seed
This improves the range of seeds compared to using only getMillis (which
is the number of milliseconds since program start) as the seed. This was
especially an issue if you started the game directly from command line,
Steam, or GOG instead of using the ScummVM interface. Previously the
initial seed was just the load time, which can have very small variance
on a fast computer.
2021-08-28 22:55:13 +02:00
sluicebox
386c5659ec BASE: Purge keyboard/mouse events before running Engine
Fixes GUI events leaking into engines at startup. This caused
Phantasmagoria 1 to skip its introduction if the game was started from
the ScummVM GUI with a keyboard (Enter) but not with a mouse because
the key-down event started the engine and the key-up event remained
in the queue.

This also purges and mouse events since we happen to already have a
purgeMouseEvents() method. We may want to also clear joystick inputs,
or possibly the entire event queue, but that can be done after the
upcoming release. For now, the known bug is fixed.
2021-08-23 15:46:33 -05:00
SupSuper
c9d67e48a9 BACKENDS: Use FSNode::getName in string operations 2021-08-23 21:22:27 +01:00
SupSuper
8c86319923 BACKENDS: Use U32String for FSNode::getDisplayName 2021-08-23 21:22:27 +01:00
Orgad Shaneh
a0c818bde6 COMMON: Introduce SaveFileManager::exists
Checks if a savefile with given name exists.

Implement on all backends.
2021-08-23 13:34:35 +02:00
djsrv
952dc3d3e1 COMMON: Fix punycoding strings with no ASCII chars 2021-08-22 14:42:33 -04:00
djsrv
ad6f533175 COMMON: Fix punycode encoder/decoder
These need to use Unicode code points, not raw bytes.
2021-08-22 13:11:26 -04:00
djsrv
7b71e617f6 COMMON: Fully remove old punycode path functions 2021-08-22 11:45:02 -04:00
Fiodar Stryzhniou
fe274d10ba COMMON: Fix c++ header usage. 2021-08-18 18:22:55 +03:00
Eugene Sandulenko
83fc4f7338
COMMON: Persist global debug channels between engine runs 2021-08-16 21:33:15 +02:00
Eugene Sandulenko
ed09f11eaa
COMMON: Keep only one instance of global debug flags 2021-08-16 20:43:16 +02:00
Thierry Crozat
abf782c670 COMMON: Remove kFeatureHiDPI from OSystem and use getHiDPIScreenFactor instead 2021-08-13 21:41:33 +01:00
Thierry Crozat
6d8462674f COMMON: Add getHiDPIScreenFactor to OSystem 2021-08-13 21:41:33 +01:00
Eugene Sandulenko
a197e7e795
COMMON: Added MacintoshII platform 2021-08-13 17:07:27 +02:00
djsrv
9c6fa32c82 COMMON: Create DisposablePtr::getDispose() 2021-08-12 13:18:27 -04:00
djsrv
b40233ffe7 COMMON: Create DisposablePtr::disownPtr() 2021-08-12 13:18:27 -04:00
Le Philousophe
6a82f704d4 COMMON: Fix build with old GCC 2021-08-11 12:01:40 +02:00
Eugene Sandulenko
b72d6d89b9
COMMON: Proper check for MacBinary presence. This fixes false positives for QT movies 2021-08-10 19:33:27 +02:00
Eugene Sandulenko
d44938f916
COMMON: Added common CRC implementation. Borrowed from Wintermute engine 2021-08-10 19:33:27 +02:00
djsrv
ba28d7fde6 ALL: Change listMatchingMembers pattern to a Path
This handles any potential differences in directory separators passed to
the function, as with the other Archive functions.
2021-08-09 17:47:30 -04:00
djsrv
2aa7e3e558 COMMON: Replace matchString pathMode with general wildcard exclusions
Different characters may need to be excluded for different path styles.
2021-08-09 17:43:12 -04:00
sluicebox
af7d05999e SCI: Add SQ1 option to enable bearded musicians
Adds a game option to enable the original graphics that Sierra
disabled for legal reasons but still included.

Trac #12773
2021-08-09 16:40:38 -05:00
sluicebox
49ce49aae6 COMMON: Update override keywords in OutSaveFile 2021-08-09 08:37:53 -05:00
Paul Gilbert
be06c4eb8a BACKENDS: Extend OutSaveFile to support SeekableWriteStream
The seek and size methods of SeekableWriteStream are only
supported when creating uncompressed save files.
2021-08-08 18:13:30 -07:00
Paul Gilbert
9db14ee109 BACKENDS: Update all the backends to support SeekableWriteStream 2021-08-08 18:13:30 -07:00
Eugene Sandulenko
4a5085b0f8
COMMON: Do not try to create "." directory in DumpFile 2021-08-08 17:44:14 +02:00
djsrv
d2b42b52d1 COMMON: Use Path functions in FSNode constructor
Path has an empty() function and equality operator. No need to convert
to a String first.
2021-08-07 10:44:37 +02:00
djsrv
763d2813a0 COMMON: Replace Path's += with append/join 2021-08-07 10:44:37 +02:00
djsrv
8c4ecf6cc5 COMMON: Add Doxygen comments to path.h 2021-08-07 10:44:37 +02:00
djsrv
2eca1126c5 VIDEO: Use Path type in VideoDecoder functions 2021-08-07 10:44:37 +02:00
djsrv
6020f24661 COMMON: Create punycode_encodepath 2021-08-07 10:44:37 +02:00