Age | Commit message (Collapse) | Author |
|
|
|
This removes the unnecessary Buffer subclass and stops most places
where the output buffer was being interrogated about dimensions
instead of GfxFrameout.
|
|
* Rewrap comments to 80 columns
* Clarify comments where possible
|
|
* Rewrap doxygen comments to 80 columns
* Swap public/private sections so public APIs come first
* Clarify comments where easily possible
|
|
* Use containers where appropriate
* Re-wrap doxygen comments to 80 columns
* Clarify comments for parts of the engine that are understood now
but were not understood at the time of the initial
implementation
|
|
Fixes Trac#10251.
|
|
|
|
In SCI3, Sierra removed the ability of the main renderer to
automatically scale CelObjs with different source resolutions.
Instead, in SCI3, all CelObjs are treated as having the same
resolution as the screen (i.e. 640x480).
In all SCI3 games other than RAMA, keeping the code paths for
resolution-dependent scaling is not a problem because all the
assets and game code are correctly designed to use the same
640x480 resolution throughout. RAMA, on the other hand, was
written with the text subsystem set to a resolution of 630x450
(Phant1's screen resolution), and in SSCI, resolution-dependent
scaling code was not removed from the *text* subsystem. As a
result, RAMA's game scripts rely on the slightly larger scaled
dimensions coming out of the text system when determining the size
of screen items for rendering, and then also rely on the main
renderer ignoring the 630x450 resolution baked into the bitmaps
generated by the text subsystem when drawing them to the screen.
|
|
kCelLink exists in SSCI since 2.1mid, but it is only known to be
used in Lighthouse, during the weapon creation puzzle near the end
of the game.
|
|
It was using SCI16 calls to get the NowSeenRects.
This fixes #9855.
|
|
|
|
In SSCI, mouse events are received through a hardware interrupt
and the cursor is drawn directly to the graphics card by the
interrupt handler. This allows game scripts to omit calls to
kFrameOut without stopping the mouse cursor from being redrawn
in response to mouse movement.
ScummVM, in contrast, needs to poll for events and submit screen
updates explicitly from the main thread. Submitting screen updates
may block on vsync, which means that this call should really only
be made once per frame, just after the game has finished updating
its back buffer. The closest signal in SCI32 for having completed
drawing a frame is the kFrameOut call, so this is where the
update is submitted (by calling OSystem::updateScreen).
The problem with the approach in ScummVM is that, even though the
mouse position is being updated (by calls to kGetEvent) and drawn
to the backend's back buffer (by GfxCursor32::drawToHardware),
OSystem::updateScreen is never called during game loops that omit
calls to kFrameOut.
This commit introduces a workaround that looks at the number of
times kGetEvent is called between calls to kFrameOut. If the
number of kGetEvent calls is higher than usual (where "usual"
seems to be 0 or 1), we assume that the game is running one of
these tight event loops, and kGetEvent starts calling
OSystem::updateScreen until the next kFrameOut call. We also
then start throttling the calls to kGetEvent to keep CPU usage
down. This fixes at least two such known loops:
1. When interacting with the menu bar at the top of the screen
in LSL6hires;
2. When restoring a game in Phant2 and sitting on the "click mouse"
screen.
A similar workaround may also be needed for kGetTime, though loops
around kGetTime should preferably be replaced using a script patch
to call kWait instead.
|
|
Fixes Trac#9750.
|
|
Fixes text scaling gone mad in Phant2.
|
|
Sometime during SCI2.1mid, the palette manager was changed to
save and restore the source palette, and to add in-game gamma
correction. Previously, only the vary start and target palettes
were saved, and gamma correction was only configurable in SSCI by
editing RESOURCE.CFG.
|
|
|
|
Different subops have different call signature requirements.
|
|
|
|
In GK2, restoring a save game causes the segment manager to reset
in the middle of a kListFirstTrue call, which invalidates all
pointers and reg_ts to stored data. This means that when
kListFirstTrue tries to decrement the list recursion counter at
the end of iteration, it is writing to freed memory, potentially
resulting in heap corruption.
SCI3 added checks to prevent this from happening, but these checks
seem like they should have also been applied to some SCI2.1 games
as well (like GK2).
Since there should be no negative side-effect to this check, it
is applied universally to all SCI32 games.
|
|
Used by at least Phantasmagoria 2.
|
|
|
|
Game scripts pass an extra argument which is never used in SSCI.
This happens e.g. when warping from room 620 to room 860 in
LSL6hires.
Adding a signature for kPalVarySetVary for SCI2.1early games only
does not work because KQ7 1.51 is detected as SCI2.1early but the
interpreter includes kPalVary code that matches SCI2.1mid.
Fixes Trac#9611.
|
|
transparentColor -> skipColor
displace -> origin
scaledWidth -> xResolution
scaledHeight -> yResolution
|
|
|
|
|
|
Used by Torin room 40300 to perform pathfinding by bitmap.
|
|
This change invalidates earlier SCI32 save games, which separated
arrays and strings in an incompatible manner. Old save games
contain invalid references to a string segment which no longer
exists, and contain incompatible array structures that lack
critical type information.
|
|
SSCI explicitly ignored invalid references passed to this function.
Fixes GK1 room 410, when using the Rada Drum book on the drummer.
|
|
|
|
These were introduced in SCI3, and are used by RAMA. We don't preload
videos, so we don't really need kPlayVMDSetPreload, but
kPaletteSetGamma may need an implementation.
With these two stubs, the main menu of RAMA is working again
|
|
On at least DC platform, the ShowStyleType enum is fit to a 4-bit
data size, so the 16-bit input value needs to be checked for
validity *before* it is cast to a 4-bit ShowStyleType.
|
|
This may come back in the future to deduplicate some gfx code,
but SCI32 had two different inlined ways of doing coordinate
conversions with different rounding methods, so CoordAdjuster32
didn't get used when the graphics system was rewritten.
At the moment, SCI32 code uses the mulru/mulinc methods from
helper.h for scaling up/down coordinates.
|
|
KQ7 2.00b, PQ:SWAT, Phant1, GK2, and Torin are all verified as
using the 'ignore' variant; SQ6 and QFG4CD are verified as using
the 'fail' variant. MGDX and Shivers could not be checked as they
have only Phar Lap Win16 executables, so took a guess based on
their release dates.
|
|
|
|
|
|
|
|
|
|
This is used by Torin in room 50900.
|
|
This commit implements all of the known plane transitions from
SCI2 through SCI2.1mid games. Because kSetShowStyle is always
called indirectly via the Styler game script, it is difficult to
find all the places where transitions are used. As such,
transitions that appeared to never be used have been added as
stubs which will trigger a game crash with a message to report
what was being done, so any missed transition types can be
identified quickly and then implemented.
|
|
Bitmaps in ScrollWindow and Robot code are managed by the kernel
and not by game scripts, although they must be able to be
referenced through a reg_t. To prevent incorrect GC of bitmaps
that are in use but not referenced by any game script, explicit
memory management of hunk entries can be enabled.
|
|
|
|
|
|
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
|
|
|
|
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.
|
|
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.
|
|
These should be all the actually used subfunctions.
Co-authored-by: Colin Snover <github.com@zetafleet.com>
|
|
This line drawing code lives in a remodelled GfxPaint32 class
that is totally separate from GfxPaint16.
|
|
Most SCI32 games draw a "fred" object to the screen when the game
first starts to benchmark video performance. When framerate
throttling is enabled (which fixes many/most timing-related bugs
and reduces system load caused by unnecessary graphics updates),
the game's performance check will think that video card is slow,
causing some "high-performance" game features to be disabled.
To avoid this, we simply disable throttling during benchmarking by
detecting the "fred" object.
|
|
CID 1351617, 1351618, 1351619, 1351620, 1351621, 1351622, 1354791.
|