Commit Graph
4076 Commits
Author SHA1 Message Date
Filippos Karapetis 01f3e6ccd2 SCI32: Fix a script bug when fighting revenants in QFG4 2018-08-25 13:53:13 +03:00
Filippos Karapetis 414d0277d0 SCI: Fix compilation 2018-08-25 12:57:01 +03:00
Filippos Karapetis 6fb19d1d01 SCI: Fix compilation when SCI32 is disabled 2018-08-25 12:44:13 +03:00
Filippos Karapetis d597fbc5e3 SCI32: Fix the walk region in Cazanoux's house in GK1
Fixes bug #9770
2018-08-25 12:39:14 +03:00
Filippos Karapetis a0bad913ae SCI32: Add a workaround for Shivers 2018-08-25 12:39:13 +03:00
Filippos Karapetis 0101ac6f71 SCI: Add a default case to the switch in toDebugString()
Silences a false positive in MSVC
2018-08-25 12:39:13 +03:00
Filippos Karapetis 941869c466 SCI32: Remove reg32_t and use reg_t in all cases
reg32_t was a transitive solution, before reg_t's were
adapted to use 32-bit addresses internally, and before
support for SCI3 was added. It was introduced as another
way to handle large script offsets in SCI3, and was only
used for the program counter (PC). It's no longer
needed, as we now support SCI3 script offsets using
reg_t's, so we can use make_reg32 in all cases where
we need to access offsets over 64KB
2018-08-25 12:39:12 +03:00
Filippos Karapetis 66cbaeefe2 SCI32: Adapt the pathfinding debug code to work woth SCI32 games 2018-08-25 12:39:12 +03:00
Filippos Karapetis 4dc9f0e66d SCI32: Fix attacking necrotaurs with the sword in QFG4
Fixes bug #10419
2018-08-23 01:59:26 +03:00
Filippos Karapetis 5e2db7a178 SCI32: Add workarounds for OOB reads for parameters
These are mostly used to silence known cases, for now. Some workarounds of this type have already been addded
2018-08-23 01:59:26 +03:00
Filippos Karapetis 37c0342b32 SCI32: Extend a script workaround to all screens in QFG4
Fixes bug #10420
2018-08-21 08:53:19 +03:00
Filippos Karapetis 8998d00bf2 SCI32: Extend a pathfinding workaround to all screens in QFG4
Fixes entry into the Gypsy camp - bug #10418
2018-08-21 08:47:18 +03:00
Filippos Karapetis 16aab5b281 SCI32: Add handling for config settings used in Hoyle 5 2018-08-21 03:36:06 +03:00
Filippos Karapetis 89785ea804 SCI32: Add stub for kWinDLL - used in Hoyle 5 2018-08-21 03:36:06 +03:00
Filippos Karapetis 5684273ee1 SCI: Add support for text loading in Hoyle 3 Amiga 2018-08-21 03:36:05 +03:00
Filippos Karapetis 2877c22097 SCI: Add workaround for buggy script in Hoyle 3 Amiga 2018-08-21 03:36:04 +03:00
Filippos Karapetis 06079340ac SCI32: Add several workarounds for uninitialized reads in Hoyle 5 2018-08-21 03:36:04 +03:00
Filippos Karapetis f18711f3c2 SCI: Update comment 2018-08-21 03:36:03 +03:00
Eugene Sandulenko ec08412925 SCI: Fix shadowing warning 2018-06-29 09:14:17 +02:00
David Fioramonti d52937cc7e SCI: Update rad2deg usage 2018-05-20 11:21:06 +01:00
Adrian Frühwirth 1967efc5cf JANITORIAL: Silence GCC 7 fallthrough warning
This wasn't explicitly marked as intentional but it very much looks it.
Committing separately in the unlikely case this needs to be reverted.
2018-03-23 18:38:37 +01:00
Willem Jan Palenstijn 0f98a60d35 SCI: Sabotage qfg1vga's speed test
This ensures the detected speed will end up at the highest level. This
improves the detail in Yorick's room (96), and slightly changes the
timing in other rooms.

Fixes bug #10296.
2018-02-01 20:08:20 +01:00
Colin Snover 2e061d95c5 COMMON: Move VER macro for serializer into common code 2018-01-31 17:58:01 +01:00
David Fioramonti 9518fd7210 SCI32: Fix PQ4 Barbie shoe points patch selector
The original script patch had the correct literal value but the
wrong selector name in the comment for the literal value, so when
it was converted to use a selector lookup in
c5dce17b1f, the patch broke because
the wrong selector name was used.

Fixes Trac#10392. Closes gh-1107.
2018-01-16 21:32:38 -06:00
Colin Snover f4bc714677 SCI32: Add uninitialized read workaround for LSL6hires
Fixes Trac#10361.
2017-12-19 23:49:07 -06:00
Colin Snover 57db3f7535 SCI: Partially clean up SCI16 video playback code 2017-12-01 18:48:35 -06:00
Colin Snover 673d25a9cd SCI32: Fix crash starting KQ7 demo
Fixes Trac#10343.
2017-11-28 16:47:37 -06:00
Colin Snover 37459bc6c1 SCI: Fix UB in SegManager memcpy/strcpy operations
Passing overlapping buffers to C standard library memcpy, strcpy,
and strncpy is undefined behavior. In SSCI these operations would
perform a forward copy, and most stdlib implementations do the
same, but at least newer Linux glibc on x86 copies bytes in
reverse, so just using the standard library on this platform
results in broken output.

Because SSCI used a blind forward copy instead of memmove for
overlapping copy operations, this patch implements an explicit
forward copy to ensure that overlapping copies continue to operate
the same as in SSCI.

This fixes the Island of Dr. Brain v1.1 flamingo puzzle
(script 185, flamingos::init, localCall 4c3) on platforms that do
not perform forward copy in memcpy/strcpy/strncpy.

Thanks to @moralrecordings for research on this bug and an initial
patch using memmove.

Closes gh-1034.
2017-10-29 13:18:37 -05:00
Willem Jan Palenstijn 9030b09ecc SCI: Allow lofsa string printing in disasm for all SCI versions 2017-10-21 19:13:38 +02:00
Willem Jan Palenstijn fab43f0f71 SCI: Fix offsets in disasm for multi-param opcodes
This code was assuming that retval points to the start of the next
instruction, which is only true if the current parameter is the last
one. This fixes op_call printing.
2017-10-21 18:55:40 +02:00
David Fioramonti ce052fbef4 SCI32: Fix cursor color when quitting for phant1
When quitting the game at the main menu and hitting no
or quitting the game while playing the cursor color
over the buttons will be tan the first time rather
than red. This fix makes it so it will be red.

This was done by removing a check in HotSpot::doit()
which checks the global193 value. Removing this check
fixes the problem.

Fixes Trac#9977.

Thanks snover and wjp for your help.
2017-10-16 19:37:36 -05:00
Colin Snover bb02d730b4 SCI32: Fix crash restoring save from endgame of RAMA
Fixes Trac#10263.
2017-10-08 19:25:54 -05:00
Martin Kiewitz bd94bbc3e3 SCI: Add QfG4 script patch to fix sliding down slope bug #9801
It's quite difficult to patch. I hope this finally solved it.
2017-10-09 01:58:16 +02:00
Martin Kiewitz 870cd80202 SCI: Crazy Nick's Larry workaround bug #10184
Added this already through last commit by accident
Was supposed to get added by this.
Workaround for reading uninitialized temp game bug.
2017-10-08 20:54:59 +02:00
Martin Kiewitz 656de5e360 SCI: Restrict some workarounds to certain temps
Also add a bit more documentation / Fix some documentation
2017-10-08 20:52:48 +02:00
Martin Kiewitz 60c2c2867c SCI: Change index inside workaround tables to an index range
So that one can specify an entire range of temp variables
by using just one single entry.
2017-10-07 22:11:25 +02:00
Colin Snover 7d037495be SCI: Use explicit indexes in castlebrain/islandbrain word search workarounds 2017-10-07 14:50:21 -05:00
Colin Snover 1b669d2489 SCI: Add workaround for uninitialized reads in Island of Dr Brain
Leaning on the enter key during a word search puzzle will trigger
this bug, just like in Castle of Dr Brain.
2017-10-07 14:46:01 -05:00
Colin Snover 432fd522d2 ENGINES: Remove default1x scaler flag
This flag is removed for a few reasons:

* Engines universally set this flag to true for widths > 320,
  which made it redundant everywhere;
* This flag functioned primarily as a "force 1x scaler" flag,
  since its behaviour was almost completely undocumented and users
  would need to figure out that they'd need an explicit non-default
  scaler set to get a scaler to operate at widths > 320;
* (Most importantly) engines should not be in the business of
  deciding how the backend may choose to render its virtual screen.
  The choice of rendering behaviour belongs to the user, and the
  backend, in that order.

A nearby future commit restores the default1x scaler behaviour in
the SDL backend code for the moment, but in the future it is my
hope that there will be a better configuration UI to allow users
to specify how they want scaling to work for high resolutions.
2017-10-07 12:30:29 -05:00
Martin Kiewitz 83436e685f SCI: Improve Larry 1 Spanish script patch
So that it also works even when the patch files are missing.
2017-10-07 19:06:16 +02:00
Martin Kiewitz eb1f9030a7 SCI: Add script patch for Larry 1 Spanish bug #10240
Fixes buying an apple from man wearing a barrel, who walks
around in front of the casino.
2017-10-07 18:56:29 +02:00
Martin Kiewitz 54cac32003 Revert "SCI: Add workaround for uninitialized reads in Island of Dr Brain"
This reverts commit ae8e4fa8e9.

This change is wrong in any case. It should be specific to temp
14+15 at the very least. I also did not get an answer on what
is actually happening internally. That's not how we should
add workarounds. My review was also still pending.
2017-10-07 11:25:12 +02:00
Colin Snover ae8e4fa8e9 SCI: Add workaround for uninitialized reads in Island of Dr Brain
Leaning on the enter key during a word search puzzle will trigger
this bug, just like in Castle of Dr Brain.
2017-10-07 00:56:00 -05:00
David Fioramonti ec1cfcbf47 SCI: Add workaround for uninit read during wordsearch in castlebrain
During the wordsearch puzzle (room 320 click left door) the
game will crash because of an uninitalized read of temp
variables in word::dispatchEvent (which gets called a lot),
if the player clicks the same letter or different letters
aggressively or holds down the enter key.

Fixes Trac#9783.
2017-10-07 00:56:00 -05:00
Colin Snover c7c5f28bdb SCI32: Clean up scriptWidth/scriptHeight/screenWidth/screenHeight
This removes the unnecessary Buffer subclass and stops most places
where the output buffer was being interrogated about dimensions
instead of GfxFrameout.
2017-10-06 22:56:26 -05:00
Colin Snover 8c9276e75a SCI32: Clean up script patch comments 2017-10-06 22:56:25 -05:00
Colin Snover b6c3f0f547 SCI32: Clean up CelObj
* Rewrap comments to 80 columns
* Clarify comments where possible
* Use smart pointers where appropriate
* Change view/pic flags detection to always use word-size
  (byte-size check for flag 0x80 was a compiler optimisation)
2017-10-06 22:56:24 -05:00
Colin Snover 31e1d0932c SCI32: Clean up Plane
* Rewrap comments to 80 columns
* Clarify comments where possible
2017-10-06 22:11:03 -05:00
Colin Snover 1b42146955 SCI32: Clean up GfxRemap32
* Rewrap comments to 80 columns
* Clarify comments where possible
2017-10-06 22:11:03 -05:00
Colin Snover 93c8044f69 SCI32: Clean up Audio32
* Rewrap comments to 80 columns
* Remove resolved TODOs
* Use containers and smart pointers where appropriate
2017-10-06 22:10:52 -05:00