Age | Commit message (Collapse) | Author |
|
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
|
|
* Rewrap comments to 80 columns
* Clarify comments where possible
* Use smart pointers where appropriate
|
|
1. In SCI0/1, selectors and offsets in the method block are
stored contiguously (all selectors, then all offsets), with a
null separator between the two runs. All the later versions of
SCI instead interleave selectors & offsets. Since these values
are already being copied into a new array anyway, code for
reading method selectors/offsets is now simplified by
interleaving this data when it is written into _baseMethod
for SCI0/1, so the same equation for retrieving method
selectors/offsets can be used across all SCI versions.
2. In SCI1.1-2.1 branch, the method count was being copied into
the first entry of the array, which meant that SCI1.1-2.1 had
extra code for dealing with the fact that the first entry was
not an entry. This has been fixed, and the extra code removed.
3. Data was being overread into _baseMethod in all games SCI0-2.1.
(SCI0/1 had an extra magic value of 2, and SCI1.1-2.1 had an
extra magic value of 3). Reviewing history, it's not clear why
this happened, other than that it appears to have been
introduced at 7b0760f1bc5c28abcede041a6e3930f84ff3d319. My best
guess is that this was a confusion between byte count and record
count, where the intent was to read an extra 2 bytes for the
null separator in SCI0/1, but it actually read 2 records
instead. (I do not have a guess on why SCI1.1 ended up with a
3.) This overreading has been removed.
|
|
|
|
See code comment in Object::init for more details.
Fixes Trac#9780.
|
|
This groundwork enables an object to look up its static name
separately from the normal process that is used to populate
Object::_variables when an object is first constructed.
(The static name property needs to be able to be retrieved from
objects inside of earlier save games whose name properties may
have already been modified at runtime, so the code cannot simply
pluck the value out of Object::_variables when they are first
initialised and then persisted into the save game, as nice and
easy as that would have been.)
This commit also helps to clarify the situation with relocation
tables in SCI1 games that start with a zero entry.
Refs Trac#9780.
|
|
ObjMap owns Objects, so every time this map gets copied instead of
referenced, it creates a copy of every single object in the
associated script. This is expensive, and it breaks things like
the `Object::syncBaseObject` call in savegame.cpp, which hasn't
actually been doing anything since
58190c36b4cc84b3200239211d91b0291301db56 because it has been
operating on copies.
|
|
|
|
This information comes directly from script data and is not
modified at runtime, so it does not need to be persisted in save
games, but does need to be set when reconstructing clones.
|
|
In SCI2/2.1, variable indexes are used along with a range encoded
in the interpreter executable to determine whether an object
variable is a view-related variable. Operands to aTop, sTop, ipToa,
dpToa, ipTos, and dpTos are byte offsets into an object, which
are divided by two to get the varindex to check against the
interpreter range.
In SCI3, objects in game scripts contain groups of 32 selectors,
and each group has a flag that says whether or not the selectors
in that group are view-related. Operands to aTop, sTop, ipToa,
dpToa, ipTos, and dpTos are selectors.
|
|
|
|
There does not appear to be any reason to use a bit field instead
of a simple boolean for this one flag, since there are no other
flags that need to be set on Object like this.
|
|
|
|
In SCI3, index-to-selector tables no longer exist in compiled
object data (instead, the SCI3 VM uses selectors directly and
object data contains a bit map of valid selectors). In ScummVM,
the table is generated by Object::initSelectorsSci3 for
compatibility with the design of the ScummVM SCI VM. For
consistency, _baseVars is converted to use a standard container,
which works for all SCI versions.
The table for SCI3 property offsets is also changed to use a
standard container instead of manually managing the memory with
malloc/free.
|
|
|
|
This patch includes enhancements to the ScummVM integration with
SCI engine, with particular focus on SCI32 support.
1. Fixes audio volumes syncing erroneously to ScummVM in games
that modify the audio volume without user action (e.g. SCI1.1
talkies that reduce music volume during speech playback). Now,
volumes will only be synchronised when the user interacts with
the game's audio settings. This mechanism works by looking for
a known volume control object in the stack, and only syncing
when the control object is present. (Ports and planes were
researched and found unreliable.)
2. Fixes audio syncing in SCI32 games that do not set game
volumes through kDoSoundMasterVolume/kDoAudioVolume, like GK1,
GK2, Phant1, and Torin.
3. Fixes speech/subtitles syncing in SCI32 games that do not use
global 90, like LSL6hires.
4. Fixes in-game volume controls in SCI32 games reflecting
outdated audio volumes when a change is made during the game
from the ScummVM launcher.
5. Fixes SCI32 games that would restore volumes from save games
or reset volumes on startup, which caused game volumes to be
out-of-sync with ScummVM when started.
6. ScummVM integration code for audio sync has been abstracted
into a new GuestAdditions class. This keeps the ScummVM-
specific code all in one place, with only small hooks into the
engine code. ScummVM integrated save/load code should probably
also go here in the future.
Fixes Trac#9700.
|
|
|
|
|
|
|
|
|
|
- Detection works via signatures (couldn't find a better way)
- new kString subcalls were introduced SCI2.1 LATE
- kString now has signatures and is split via subcall table
- kString fix, so that KQ7 doesn't crash, when starting a chapter
- Sci2StringFunctionType removed, because no longer needed
|
|
|
|
No functionality change has been made with this commit. This avoids
setting and getting the reg_t members directly, and is the basis of any
future work on large SCI3 scripts (larger than 64KB)
|
|
These are needed for future handling of large SCI3 script files
|
|
This tries to make our code a bit more compliant with our code formatting
conventions. For future use, this is the command I used:
git ls-files "*.cpp" "*.h" | xargs sed -i -e 's/[ \t]*$//'
|
|
This may have to be undone if we ever want to start free'ing _baseVars again.
|
|
|
|
Some backends may break as I only compiled SDL
|
|
operations
have been commented out for now, as MSVC complains about heap corruption in SCI3 games
- Code formatting fixes
svn-id: r54991
|
|
the Object class, and it also plugs a leak.
svn-id: r54986
|
|
svn-id: r54362
|
|
svn-id: r54361
|