Commit Graph
137148 Commits
Author SHA1 Message Date
sluicebox 30fad94e9a SCI: Track correct location and size of temp variables
The VM has been treating the entire area between the frame pointer and
the stack pointer as temp variables for the current function. There are
two problems with this:

1. The VM hasn't been updating the frame pointer correctly when multiple
   methods are called within the same send/self/super instruction.
2. The VM has been recalculating the number of temp variables on every
   instruction as the difference between the two pointers.
   This is incorrect, as this changes with almost every instruction in
   ways have nothing to do with the number of temp variables allocated
   by the link instruction. Meanwhile, the VM has not been recording
   the number of variables allocated by the link instruction.

The first discrepancy caused scripts to behave differently than in SSCI
when reading parameters out of bounds in certain situations.
It also prevented our uninitialized variable detection from detecting
certain reads. The second made the temp-count used for out of bounds
detection too large, made debugger output such as `stack` incorrect,
and made stepping through the link instruction in the debugger appear
to do nothing until stepping through the following instruction.

When multiple methods are called by a send/self/super instruction, each
method's link instruction increases the stack pointer further.
Method B's variables appear after method A's. The VM has been setting
the stack pointer correctly but it kept using the previous frame
pointer, so method B would re-use method A's stack area instead of the
area the VM had just allocated for B. If a script correctly initializes
variables before using them and doesn't use out of bounds parameters or
temp variables then this discrepancy doesn't make a difference.
But a lot of scripts do these bad things and accidentally rely on the
undefined values they read.

Now we update the frame pointer correctly when "carrying over" to
subsequent method calls from the same send/self/super instruction.
This matches SSCI behavior. We also now record the number of temp
variables that have been allocated by the link instruction and use
that instead of incorrectly recalculating on every instruction.

Fixes the KQ6 black widow lockup, and other KQ6 music bugs, where
scripts call Sound:fade without the required fourth parameter.
Sound:fade expects a fourth parameter, so reads it out of bounds,
and passes it as the stop-after-completion boolean to kDoSoundFade.
Scripts that called Sound:fade as the only method in a send got the same
results as in SSCI, but scripts that called Sound:play first didn't.

Fixes bugs #5625 #5653 #6120 #6210 #6252 #13944
2022-11-30 23:13:00 +02:00
AndywinXp 82c6306443 SCUMM: Formatting 2022-11-30 21:40:13 +01:00
ScummVM-Translations 21ba409e68 I18N: Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: ScummVM/scummvm
Translate-URL: https://translations.scummvm.org/projects/scummvm/scummvm/
2022-11-30 11:36:42 +00:00
Vladimir Serbinenko 5220c16e40 COMMON: Fix delete[]/new[] mismatch in clickteam 2022-11-30 12:36:23 +01:00
ScummVM-Translations 44a7a4f9c2 I18N: Update translations templates 2022-11-30 11:36:03 +00:00
neuromancer a0e816370b FREESCAPE: relocated the code that process demo inputs 2022-11-30 12:36:49 +01:00
neuromancer 3f2fd5d703 FREESCAPE: reset player height when restart game in driller 2022-11-30 12:36:49 +01:00
neuromancer 4c969c7c47 FREESCAPE: basic implementation of code that restart the game in driller 2022-11-30 12:36:49 +01:00
neuromancer ae0620cbf4 FREESCAPE: make sure thumbnail image is always created from the screen 2022-11-30 12:36:49 +01:00
Roland van Laar 8b310f1271 DIRECTOR: Fix memory leak in sound
Delete the stream gotten from _macresman->getDataFork.

Made the stream copying more explicit by aligning the variables names
with the function logic.
2022-11-30 10:54:49 +01:00
Roland van Laar 9a6dea9466 DIRECTOR: Fix memory leaks in archive.cpp
The newly used Common::SeekableReadStreamEndianWrapper was leaking.
Setting the DisposeAfterUse to YES resolved the leaks.
2022-11-30 10:51:41 +01:00
sluicebox ea86295e3e SCI: Update QFG3 Woo dialog script patch
Simplifies the patch and updates the description
2022-11-29 18:35:45 -08:00
elasota 2982721aa7 MTROPOLIS: Fix missing return value. 2022-11-29 19:04:47 -05:00
elasota 19a3f6ade7 MTROPOLIS: Split off VISE archive handling. 2022-11-29 18:58:13 -05:00
elasota d8058f94f3 MTROPOLIS: VISE 3 archive improvements. 2022-11-29 18:58:13 -05:00
Donovan Watteau b365f97270 DOCS: Update for iOS 15 and iOS 16 new security settings 2022-11-30 00:44:12 +01:00
Eugene Sandulenko eddfa82896 DIRECTOR: Added comment 2022-11-30 00:40:34 +01:00
Eugene Sandulenko b114b95643 JANITORIAL: Fix code formatting 2022-11-30 00:35:59 +01:00
Vladimir Serbinenko aae70a0b11 COMMON: Fix new[]-free mismatch in unzip.cpp 2022-11-30 00:17:51 +01:00
Eugene Sandulenko e39051c7ff I18N: Update translation (Swedish)
Currently translated at 63.2% (1129 of 1786 strings)
2022-11-29 23:05:48 +00:00
Eugene Sandulenko 819100040d I18N: Update translation (Ukrainian)
Currently translated at 100.0% (1786 of 1786 strings)
2022-11-29 23:03:12 +00:00
Eugene Sandulenko 0e08fe11d9 I18N: Update translation (Russian)
Currently translated at 100.0% (1786 of 1786 strings)
2022-11-29 23:03:04 +00:00
Roland van Laar 78bd7e7fd5 DIRECTOR: Fix compilation deprecation warning
Remove uses of deprected `SeekableSubReadStreamEndian` in archive.cpp

The deprationwarning was:

    Use SeekableReadStreamEndianWrapper with SeekableSubReadStream instead
2022-11-29 22:11:02 +01:00
Vladimir Serbinenko e75f8784b0 HADESCH: Use readStream in memSubstream 2022-11-29 18:36:23 +01:00
Vladimir Serbinenko b8f3bc2732 COMMON: In getDataFork use SafeSeekableSubReadStream
It can be opened several times so re-seeking makes sense
2022-11-29 18:35:20 +01:00
Vladimir Serbinenko 3ed46d3484 COMMON: In openFileOrDataFork ensure to seek to the beginning 2022-11-29 18:35:12 +01:00
neuromancer ee3d1386be FREESCAPE: implemented spfx instruction for amiga/atari driller releases 2022-11-29 13:29:16 +01:00
Eugene Sandulenko d1e5b9a380 NEWS: Mention clickinstaller for AGS 2022-11-29 13:21:19 +01:00
BLooperZ 0c3c7a4b5c SCUMM: prevent possible issues when range is reversed 2022-11-29 12:48:27 +01:00
lb_ii cc08993822 WINTERMUTE: Fix crash on loaded games 2022-11-29 14:13:24 +03:00
Donovan Watteau 94ce25ac0c SKY: Fix AmigaOS and NDS builds 2022-11-29 11:19:20 +01:00
Purple T f54391b466 I18N: Update translation (French)
Currently translated at 100.0% (1786 of 1786 strings)
2022-11-29 06:11:22 +00:00
Vladimir Serbinenko e347b9957f MADS: Add Rex Nebular 5.25" floppy installer entry 2022-11-29 04:34:03 +01:00
Vladimir Serbinenko a08cc827ec MADS: Fix detection entry for Rex Nebular floppy installer
Looks like my copy was slightly corrupted. Since my disk died 2 days later
I can't check how exactly it was corrupted. Backup has a different checksum
Just change to a known good value. If current value turns out that there are 2
variants, then we can add a variant later
2022-11-29 04:33:36 +01:00
Vladimir Serbinenko bf95593580 MADS: Simplify name reading in mps_installer.cpp 2022-11-29 04:33:08 +01:00
Vladimir Serbinenko aaaf0a560d DREAMWEB: Add entry for international floppy release (compressed)
I don't have German, Italian or Spanish files to create entries for them.
2022-11-29 04:30:36 +01:00
Vladimir Serbinenko cf29e594e1 DREAMWEB: Support playing from compressed installer 2022-11-29 04:30:36 +01:00
Vladimir Serbinenko b66d3ec688 COMMON: Implement ConcatReadStream 2022-11-29 04:30:36 +01:00
Vladimir Serbinenko baf09ee417 DREAMWEB: Implement RNCA archive
It's used by floppy installer
2022-11-29 04:30:36 +01:00
Vladimir Serbinenko c5373134d2 COMMON: Uplift rnc decoder from toon to common
Toon has a RNC implementation with 2 differences from the one taken from SKY:

1. Protection against overread. Add it to common version and adjust callers
   in sky.
2. Lack of key parameter for obfuscation. We ignore it anyway and don't
   support obfuscation, so delete it in common version as well
2022-11-29 04:30:36 +01:00
Vladimir Serbinenko 074888e6b8 COMMON: Move RNC decoder from sky to common
RNC is a common packing algorithm used also in Toonstruck and installer of
Dreamweb floppy.
2022-11-29 04:30:36 +01:00
Vladimir Serbinenko c778a7a310 SKY: Make RNC_SIGNATURE from macro to const 2022-11-29 04:30:36 +01:00
Eugene Sandulenko ca37dccb5a SCUMM: Fix incorrect usage of Common::String internals
c_str() is constant for a reason, moreover, sizeof(String object)
is always bigger because it contains additional class variables.
2022-11-29 01:45:37 +01:00
Eugene Sandulenko e139c4ea68 FREESCAPE: Fix potentially uninitialized variable 2022-11-29 01:45:15 +01:00
Donovan Watteau 030f104c12 SCUMM: Fix MSVC C4309 enum sign warning 2022-11-29 01:37:55 +01:00
Donovan Watteau 25842987ef SCI: Fix MSVC C4309 enum sign warning 2022-11-29 01:37:55 +01:00
Donovan Watteau 93502a71ed PARALLACTION: Fix MSVC C4309 enum sign warning 2022-11-29 01:37:55 +01:00
Donovan Watteau 29004bee91 NEVERHOOD: Fix MSVC C4309 enum sign warning 2022-11-29 01:37:55 +01:00
Donovan Watteau cbea3840c1 MUTATIONOFJB: Fix MSVC C4309 enum sign warning 2022-11-29 01:37:55 +01:00
Donovan Watteau 513a54be04 MTROPOLIS: Fix MSVC C4309 enum sign warning 2022-11-29 01:37:55 +01:00