aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/savegame.h
AgeCommit message (Collapse)Author
2017-09-24SCI: Fix generation of save gamesColin Snover
2017-09-23SCI: Split save game metadata writing to separate functionColin Snover
RAMA has its own custom save game format that game scripts write, but we still want to be able to use these save game files from the ScummVM launcher, so the metadata has to be able to be written separately from the rest of the game saving.
2017-09-23SCI: Use reference instead of pointer for required out-data in metadata save ↵Colin Snover
function
2017-06-09SCI32: Implement kLock & kDoAudio(1) for SCI32Colin Snover
1. Unlocking all resources of a type using a resource ID of -1 is gone in SCI32; 2. Audio locks need to be serialized starting in GK2 for the game's modified kDoAudio(1) call; 3. Audio locks in SCI3 must work more like SSCI, since at least Lighthouse's `BackMusic::fade` method will attempt to unlock audio that was never locked by a script. In SSCI (and now in ScummVM too) this is a no-op; previously in ScummVM, it would remove Audio32's own lock on the audio resource, resulting in a use-after-free; 4. kDoAudio(1) starting in GK2 returns the number of active *not-in-memory* channels being played, not the total number of active channels. Fixes Trac#9675.
2017-04-23SCI32: Fix missing mustSetViewVisible data in cloned objectsColin Snover
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.
2017-04-23SCI32: Serialize Robots in SCI3Colin Snover
This is necessary for at least Lighthouse, which maintains the state of Robots across save games.
2017-04-23SCI: Convert Object to use Common::Array for SCI3Colin Snover
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.
2017-04-22SCI32: Make version 41 the first supported save game versionColin Snover
Save games created by earlier versions of ScummVM are prone to having subtle graphics problems or other corruption caused by incomplete save/load code.
2017-04-22SCI32: Add palette code for late SCI2.1mid+ gamesColin Snover
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.
2017-04-22SCI: Implement delayed restore for SCI32 and move implementations to ↵Colin Snover
GuestAdditions
2017-01-06SCI: Unconditionally save palvary stateWillem Jan Palenstijn
Additionally, add workaround to fix up old QfG3 saves with broken _palVaryPaused state. Fixes bug #9674.
2016-09-30SCI: Bump save game number to fix save game compatibilityColin Snover
Version 38 save games were added to the 1.9 release branch with only changes to SCI32 cursor support; shortly thereafter, changes to the general (SCI16+SCI32) save game metadata were committed to master -- without bumping the save game version number. This prevented SCI16 save games from loading correctly in 1.10pre, since the engine expected that version 38 games would have this extra metadata, but they don't.
2016-09-29SCI32: Fix warnings and incompatible save games when built without SCI32Colin Snover
2016-09-29SCI32: Emulate MGDX ego view metadataColin Snover
2016-09-29SCI32: Emulate Shivers 1 game score metadataColin Snover
2016-09-29SCI32: Rewrite kArray & kStringColin Snover
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.
2016-08-28SCI32: Fix incorrect/missing cursor after restoring a save gameColin Snover
2016-08-19SCI32: Implement SCI32 cursor supportColin Snover
2016-08-13SCI: Fix pointer invalidation caused by array storage movesColin Snover
When objects are added to a SegmentObjTable, it may cause the internal storage for the table to expand and move to a new region of memory. When this happens, all pointers to objects held by a SegmentObjTable of the same type would be invalidated, due to an implementation detail that should not be exposed. To prevent this, objects are now allocated separately on the heap, so even if the table's storage moves due to insertions, the objects owned by the table will not, so references remain valid for the lifetime of the object.
2016-08-01SCI32: Add bitmap segment and remove GC option from hunk segmentColin Snover
2016-06-26SCI32: Fix broken Remap implementationColin Snover
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-02-09SCI: Script patch for Mixed Up Mother Goose SCI1Martin Kiewitz
+ Mother Goose SCI1.1 Fixes graphic issues when restoring from GMM Also make the fix ups for Mixed Up Mother Goose, Jones + PQ2 get applied all the time (debugger command not included)
2016-01-14SCI: Use tick-based timing more consistentlyColin Snover
This means tick-based times are saved to save games, as in SCI32 engine, instead of seconds, which are not accurate enough. It also means places in SCI engine that need to access game ticks should do so through g_sci instead of g_system or g_engine.
2016-01-14SCI: Implement SCI32 kPalVary and kPalette setFadeColin Snover
This also fixes kPalCycle signatures to be more accurate.
2015-04-26SCI: implement delayed restore via ScummVM menuMartin Kiewitz
will delay restoring a saved game until the next kGetEvent or kWait also implement aborting playback for kPortrait and kShowMovie
2015-02-15SCI: Use sound resource priority by default for songsWillem Jan Palenstijn
SCI1 sound resources can have an embedded priority. We now use that by default, unless an explicit DoSound/SetPriority call overrides it. Thanks waltervn. This fixes relative priority of songs in at least PQ3 room 29. Also increase savegame version to 33.
2015-02-14SCI: Register and save playBed option to PlaySoundWillem Jan Palenstijn
The playBed option is not handled yet, only stored. This increases the savegame format version.
2014-02-18SCI: Make GPL headers consistent in themselves.Johannes Schickel
2013-09-21SCI: sfx/music priority int16 fixes bug #3615038m-kiewitz
it seems that sound system up till SCI0_LATE uses int16, afterwards it seems they changed to byte main music object (conMusic) in Laura Bow 1 uses -1 as priority. This was truncated to 255 till now, which resulted in many sound effects not getting played, because those used priority 0
2011-06-20ALL: Remove trailing whitespacesMax Horn
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]*$//'
2011-06-02ENGINES: Change 2nd param of Engine::saveGameState to Common::StringMax Horn
2011-05-12GIT: Clean up: Suppress SVN tags, now uselessstrangerke
2010-12-24SCI: Now saving/loading the list of synonyms (set by kSetSynonyms), like ↵Filippos Karapetis
SSCI did This is a more correct way of fixing bug #3037618 than in rev #55017. - Changed replaceant/replacement to be uint16's (they're very small positive values, usually smaller than 4096) - Changed SynonymList to an Array (so that it can be saved/loaded) - Removed the PQ2 script patch to Game::replay() - Added savegame history svn-id: r55032
2010-12-07SCI: Bumped up the save game version for rev #54805Filippos Karapetis
Initially, I thought that older ScummVM versions will work with these saved games. However, they will probably crash when trying to load saved games after rev #54805, as the heap is reset when loading, and the system strings segment is no longer initialized (thanks wjp). svn-id: r54809
2010-11-08SCI: Some changes regarding the string heap in saved gamesFilippos Karapetis
- Maintain the state of the string heap space in saved games - Merged SegManager::reconstructScripts() inside SegManager::saveLoadWithSerializer() - Disabled a now unnecessary script patch for the cipher puzzle in Castle of Dr. Brain, and performed some cleanup for another disabled patch - Removed direct access to the _baseObj variable of objects svn-id: r54133
2010-11-01SCI: fixing lfMartin Kiewitz
(stupid msvc) svn-id: r54014
2010-11-01SCI: saving/restoring script created windows nowMartin Kiewitz
fixes "GfxPorts::kernelSetActive" error based on code by [md5] svn-id: r54012
2010-10-31SCI: Play time related changesFilippos Karapetis
- Added support for savegame play time - Removed obsolete variables for calculating the play time (EngineState::gameStartTime and Console::_enterTime) - Renamed some variables to camelCase svn-id: r53974
2010-09-24SCI: save/restore intensity of sysPaletteMartin Kiewitz
fixes bug #3072868 should be save for backporting svn-id: r52875
2010-07-23SCI: Dropped support for the very old savegame versions 12 and 13 ↵Filippos Karapetis
(hopefully, the last ones to be dropped) svn-id: r51197
2010-07-23SCI: Now saving the kPalVary state inside savegamesFilippos Karapetis
svn-id: r51194
2010-07-07SCI: Dropped support for the very old saved game versions 9 - 11. Rationale: ↵Filippos Karapetis
a lot has changed since then, we're still not stable, and this helps clean up the code, thus we're still in a position to drop support for old saved games svn-id: r50738
2010-06-22Stop saving the buffer, script and heap sizes of each script in saved gamesFilippos Karapetis
svn-id: r50137
2010-06-15- Swapped the return value of gamestate_save (false = failed, true = succeeded)Filippos Karapetis
- Removed some duplicate code inside Console::cmdSaveGame() svn-id: r49688
2010-06-15Added a signature of the game itself inside saved games (the size of script ↵Filippos Karapetis
0, as well as the offset of the game object, which are unique for each game), to prevent users from loading saved games across different versions of the same game. In the cases where we can't load a saved game, throw a nice GUI dialog instead of a console warning svn-id: r49687
2010-06-13The offset of script local variables is now calculated when the script is ↵Filippos Karapetis
loaded, thus we no longer need to save it. Merged scriptInitialiseLocals() with scriptInitialiseLocalsZero() svn-id: r49640
2010-05-30SCI: Script exports and synonyms are now initialized when a script is ↵Filippos Karapetis
loaded. Removed a sanity check inside script_instantiate_sci0 for a bug which no longer exists svn-id: r49336
2010-05-19Updated the save game format for the changes in #49093Filippos Karapetis
svn-id: r49094
2010-01-31Removed duplicate code. Some cleanupFilippos Karapetis
svn-id: r47735
2010-01-30Add support for saving/loading Arrays/Strings in SCI32. It's possible to ↵Matthew Hoops
save a game in GK1 now via the console, but not load (yet). svn-id: r47696