73510 Commits

Author SHA1 Message Date
Colin Snover
0c799e1bd9 SCI32: Move matchColor to GfxRemap32 2016-07-01 00:18:32 +02:00
Colin Snover
0aed08681e SCI32: Separate remap types 2016-07-01 00:18:32 +02:00
Colin Snover
14e57ac867 SCI32: Add missing remap CelObj calls 2016-07-01 00:18:32 +02:00
Colin Snover
ed64d5b020 SCI32: Move GfxRemap32 to separate files 2016-07-01 00:18:32 +02:00
Colin Snover
5a3d8337a6 SCI32: Change kRemapColors naming for consistency 2016-07-01 00:18:32 +02:00
Willem Jan Palenstijn
c6c9593840 Revert "SCI32: Fix broken Remap implementation"
This reverts commit cfda8b9ecd8a6e3c003abe533ea2e2981d8ba984.

This is only to re-apply it immediately in a series of smaller commits.
2016-07-01 00:18:07 +02:00
Filippos Karapetis
a40e43f777 Merge pull request #770 from OmerMor/kgettime
SCI: Fixed KGetTime with SYSDATE subop in SCI0-LATE.
2016-07-01 00:54:44 +03:00
Colin Snover
28d97d0f55 SCI32: Specify default hardware rates
This normally happens in SSCI when the audio hardware is
initialised.

CID 1357048
2016-06-30 15:15:12 -05:00
Colin Snover
4ee1901706 SCI32: Add transparent pic plane type
It is not clear if this is ever actually used by game scripts,
though.
2016-06-30 14:04:57 -05:00
Colin Snover
e89bdf536d SCI32: Clean-up pass on rendering pipeline
This pass exposed two bugs, which have been fixed:

1. Checks of `_updated` and `_moved` were reversed in some areas,
   which lead to rendering bugs. In SQ6 the rendering bugs were
   subtle or non-existant, but in e.g. PQ:SWAT the Sierra logo and
   title screen animations were totally missing.

2. The renderer formerly kept reading from ScreenItemLists when
   new items were added in decrementScreenItemArrayCounts, but
   this was determined to be unnecessary.
2016-06-30 14:04:57 -05:00
Colin Snover
0310b4dc4d SCI32: Implement engine-accurate screen item list sorting
It seems highly probable that there are later SCI games that use
the "hi res" rendering path, so sorting and unsorting of
ScreenItemLists needs to be accurate.
2016-06-30 14:04:57 -05:00
Colin Snover
a785147d6c SCI32: Document & clean up extra rect argument for frameOut
This extra rect seems to probably only ever be used by VMD
playback in some SCI2.1 games.
2016-06-30 14:04:57 -05:00
Colin Snover
29f7a66af4 SCI32: Add low resolution constants
In a few places in the graphics system, fixed low-resolution values
are used instead of the game script resolution.
2016-06-30 14:04:56 -05:00
Willem Jan Palenstijn
d2f598cea6 CONFIGURE: Only open config.log after showing help
This prevents ./configure --help from clearing config.log.
2016-06-27 22:19:02 +02:00
Martin Kiewitz
9f789038b0 SCI: Add script patch for another Colonel's Bequest game bug
Command input stays disabled, when oiling the arm of the armor.
We fix this.
This script bug also happens, when using the original interpreter.

Fixes bug #7154
2016-06-27 21:42:18 +02:00
Omer Mor
36c7e7d252 SCI: Fixed KGetTime with SYSDATE subop in SCI0-LATE.
SSCI implementation of the SYSDATE subop of the GetTime kernel function was
changed between SCI0-LATE and SCI01: The base year used was changed from 1920 to
1980.
This subop is used in "Codename: Iceman" (Say "ask for date" to a passing girl
on the beach).

The Atari ST version of "Codename: Iceman" use the 1980 base year.
The Amiga version of "Codename: Iceman" appears to return the time instead of
date, with 0 for the YEAR part.
2016-06-27 08:16:58 +03:00
Colin Snover
1632bd50c8 SCI32: Fix benchmarking for QFG4 2016-06-26 12:44:36 -05:00
Colin Snover
60849a16cb SCI32: Change Color::operator!= to all operator== directly 2016-06-26 12:44:35 -05:00
Colin Snover
5e6f08d9fe SCI32: Enable aspect ratio correction on QFG4CD 2016-06-26 12:44:35 -05:00
Colin Snover
3ffde88b18 SCI32: Fix typo 2016-06-26 12:44:35 -05:00
Colin Snover
26e7d3d9e9 SCI32: Remove no-longer-relevant comment 2016-06-26 12:44:35 -05:00
Colin Snover
6feec9ed72 SCI32: Add more workarounds for SCI2.1early games
These games all share the same bad system script that always sends
NULL as a second argument to kDoSound(play).
2016-06-26 12:44:35 -05:00
Colin Snover
cfda8b9ecd SCI32: Fix broken Remap implementation
Remap would crash SCI2.1early games with 19 remap slots, and
did not actually work in most cases in SCI2.1mid+ games.

The SCI16 implementation was moved to its own separate file but
was otherwise touched as little as possible, so may still have
similar problems to the SCI32 code.

1. Split SCI16 and SCI32 code into separate files
2. Use -32 prefixes for SCI32 code and no prefix for SCI16 code,
   where possible, to match other existing code
3. Avoid accidental corruption of values from the VM that may be
   valid when signed or larger than 8 bits
4. Added documentation
5. Add missing remap CelObj calls
6. Inline where possible in performance-critical code paths
7. Fix bad `matchColor` function, and move it from GfxPalette to
   GfxRemap32 since it is only used by GfxRemap32
8. Fix bad capitalisation in getCycleMap
9. Remove unnecessary initialisation of SingleRemaps
10. Update architecture to more closely mirror how SSCI worked
11. Clarify the purpose of each type of remap type (and
    associated variable names)
12. Split large `apply` function into smaller units
13. Fix buffer overrun when loading a SCI2.1early game with remap
14. Remove use of `#define` constants
15. Warn instead of crashing with an error on invalid input (to
    match SSCI more closely)
16. Change the collision avoidance mechanism between the RemapType
    enum and remap kernel functions
17. Add save/load function
2016-06-26 12:42:58 -05:00
Colin Snover
c5914eb80d SCI32: Fix hang when playing auto-play audio channels 2016-06-26 10:56:36 -05:00
Colin Snover
6ec206ccee SCI32: Fix race condition when freeing audio resources
It's not possible to call any ResourceManager methods from any
thread other than the main thread because it is not thread-safe.
2016-06-26 10:53:45 -05:00
Bastien Bouclet
3391c726cf MOHAWK: Remap bitmaps not to use undefined colors
The Spanish version of Myst has bitmaps that use palette indices in the system
reserved range. Affected pixels previously used colors from the Windows system
palette instead of the bitmap's own palette, resulting in visual glitches.

Bitmaps are now remapped to the screen palette which is made of the Windows
reserved palette and part of the bitmap palette. The original engine used GDI's
StretchDIBits with DIB_RGB_COLORS to achieve the same result.

Fixes #7153.
2016-06-26 08:37:07 +02:00
Martin Kiewitz
cedcdbc48d SCI: Add getGameObjectName to fix compilation
Is needed for 80462b3 (Fix auto-saving in the fan-made Cascade Quest)
2016-06-25 23:59:46 +02:00
Martin Kiewitz
80462b3f87 SCI: Fix auto-saving in the fan-made Cascade Quest
Script patch to change the fixed slot 999 to fixed slot 99 in the
game scripts and additional code for kSaveGame, that checks for
Cascade Quest + slot 99 and will then use ScummVM slot 0, which
is our auto-save slot.

Fixes bug #7007

Also added the game name to the other fan-made script patch.
2016-06-25 23:59:01 +02:00
Filippos Karapetis
2e58e6d09f SCI32: Properly initialize pausedAtTick inside Audio32::play()
Fixes audio not playing in later SCI32 games that use Audio32
2016-06-25 17:42:19 +03:00
Filippos Karapetis
5ffafbb9b8 Revert "SCI32: Properly initialize AudioChannel inside Audio32::play()"
This reverts commit 5eaea05a2b6af0ddcf28fca1f0cd3fc0c54f4d07.
2016-06-25 17:37:43 +03:00
Eugene Sandulenko
d94f40e3ce TOLTECS: Fix typo 2016-06-25 16:21:00 +02:00
Eugene Sandulenko
95b8e23992 TOLTECS: Clear dead end rects count. 2016-06-25 16:18:59 +02:00
Martin Kiewitz
5385b4eda7 SCI: Script patch for critical Colonel's Bequest game bug
This patch is about an issue, when interacting with the
armor in room 37 (main house, downstairs).

This bug also happened, when using the original interpreter
and effectively froze the game depending on the coordinate
of Laura Bow, when the command was entered.

Fixes bug #7119

Versions affected: English PC/Atari ST/Amiga Floppy
2016-06-25 14:37:49 +02:00
Martin Kiewitz
09d314d3d7 SCI: Fix SQ1VGA script patch, fixes bug #7145
Script patch used "lsg" for one instruction, which should have
been "lag" instead.
Caused issues with the spider droid.
Added more details about this script patch in comments.

Also specified the method for a qfg3 script patch in comments.
2016-06-25 02:24:09 +02:00
Filippos Karapetis
5eaea05a2b SCI32: Properly initialize AudioChannel inside Audio32::play()
Fixes audio issues caused by uninitialized variables
2016-06-23 21:58:13 +03:00
Filippos Karapetis
17983508b3 SCI32: Fix usage of the C++11 override keyword with MSVC
MSVC does not allow the usage of the "override" keyword on function
definition, only on declaration
2016-06-23 21:17:16 +03:00
Filippos Karapetis
e80f1bb115 SCI32: Fix potentially uninitialized variable 2016-06-23 21:07:27 +03:00
Filippos Karapetis
97c50fcfb8 SCI32: Const correction in Audio32's readBuffer() implementation 2016-06-23 21:07:01 +03:00
Colin Snover
a9e2630d4e SCI: Assert on seeks past the end of audio resource bundles
This should never be allowed to happen, but currently does on
multi-CD games with different resource bundles on difference CDs
(Phant1, PQ:SWAT, GK2) because the resource manager does not yet
have the ability to handle this situation.
2016-06-22 13:05:18 -05:00
Kirben
87c5540c2a SCUMM HE: Update sound flags and queue, for new settings. 2016-06-22 11:45:44 +10:00
Kirben
6b07163600 SCUMM HE: Document sound opcodes. 2016-06-22 11:01:02 +10:00
Colin Snover
5b6114f4cc SCI32: Implement kBitmapDrawView 2016-06-21 16:12:33 -05:00
Colin Snover
d6d0e00dc5 SCI32: Expose a draw buffer on BitmapResource objects
Most of the time, we get a bitmap to draw on it. Exposing a buffer
avoids consumers having to create their own all the time, and
encourages use of common drawing code exposed by the buffer.
2016-06-21 16:11:43 -05:00
Eugene Sandulenko
521d2e299f GRAPHICS: Use better color for 1bpp BMPs 2016-06-21 21:26:40 +02:00
Colin Snover
848abbee06 AUDIO: Fix incorrect forward declaration 2016-06-21 08:33:50 -05:00
Colin Snover
4495ae3de0 SCI32: Remove unused dependencies from GfxFrameout 2016-06-21 08:17:28 -05:00
Colin Snover
a3055d3f49 SCI: Add an explanation about LRU removals when fetching resources
Several times I have run into this code and had to take a minute
to remind myself that the call to remove from the LRU on find is
not wrong, so it seemed to deserve a comment.
2016-06-21 08:17:28 -05:00
Colin Snover
820e6b8bd3 SCI32: Fixes to GfxText32
1. Inline borderSize constant in createFontBitmap for consistency
2. Fix "DrawTextBox GetLongest=0" warning to only appear in games
   that actually had this check (SQ6 and MGDX)
3. "Fix" implementation of getTextSize for SCI2.1early, which
   gave lines with word wrap disabled a height of 0
4. Add inlining hints to some methods in BitmapResource that were
   missing them for some reason
2016-06-21 08:17:28 -05:00
Colin Snover
52505dc57f SCI32: Implement basic kMessageBox
This kernel call seems only to be used by KQ7 1.51 (which was
Windows-only) to send warnings to the user.

It was easy enough to do a basic implementation in the ScummVM
GUI rather than just make it an empty call, so now it is a thing.
2016-06-21 08:14:12 -05:00
Willem Jan Palenstijn
ceee33ba2c SCI32: Add workaround for kScrollWindowAdd call in Phantasmagoria 2016-06-21 08:14:12 -05:00