summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/save.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Better handling of null/missing items. More consistent error handling. ↵save-experiments Aaron Giles2021-04-201-118/+351
| | | | Reduced compression to default to speed up saves. Optimized simple binary saves as well. Device interfaces now have automatic containers. Fixed duplicate entry detection. Added logic to parse an item we're skipping. Added detection of missing/duplicate items from input JSON. Fixed timing for save/load.
* Keep link to parent item so that full names can be computed as needed. ↵ Aaron Giles2021-04-191-86/+105
| | | | Remove name accumulation logic from save/load step, along with unnecessary parameters.
* Differentiated raw arrays from vector arrays. Add warnings for raw arrays ↵ Aaron Giles2021-04-191-5/+96
| | | | that are not in containers.
* Detect array members that can't be replicated and manually register each ↵ Aaron Giles2021-04-191-160/+236
| | | | item instead. Remove old ALLOW_SAVE_TYPE now that enums are implicitly supported. Add stricter checking of endpoint offsets. Some other cleanups.
* More descriptive errors. Added compare mode and leveraged it to compare ↵ Aaron Giles2021-04-181-68/+110
| | | | saved data against current state.
* Moved CRC and size calculations into the streamers. Improved validation when ↵ Aaron Giles2021-04-181-343/+556
| | | | parsing.
* Checkpoint on JSON restore after successfully performing a JSON restore. ↵ Aaron Giles2021-04-171-454/+1199
| | | | Still needs cleanup.
* Implemented save_file. JSON and secondary files are now written to a ↵ Aaron Giles2021-04-161-36/+436
| | | | ZIP-formatted file.
* g update: Aaron Giles2021-04-151-845/+652
| | | | | | | | | | | | | | | | | | | * Removed old saving mechanism entirely, including internal lists of items. * Removed old logic saving to streams/buffers/files. * Removed old state item iterator; a new mechanism will need to be created for this. Stubbed out debugger and LUA calls to it for now. * Replaced the streams/buffers saves with the new binary save; these are presumed to be 100% internal, so there is no header checking or other associated logic. * Stubbed in incomplete file handling for JSON-based saves; large arrays are identified and referenced as external, though ZIP writing has not been done yet. * Redid JSON generation using an internal buffer and helpers for speed. * Added sorting and pruning of save items after registration. * Added detection of duplicate entries. * Fixed display of long names in save window. * Moved timers into their own container.
* Remove final cases where people directly registered state data with the core ↵ Aaron Giles2021-04-141-33/+0
| | | | manager. Fixed array stride calculations in registration. Removed old registration mechanism entirely.
* Added save state window to debugger. Centralized unique/vector/pointer ↵ Aaron Giles2021-04-121-53/+112
| | | | unwrapping.
* Add explicit unique_ptr/vector containers. Fix registration checks. Added ↵ Aaron Giles2021-04-091-8/+64
| | | | modern saving to namco and ymfm sound.
* Created new hierarchical save_registrar, which supports self-describing ↵ Aaron Giles2021-04-091-0/+336
| | | | structs and arrays. Converted several core files and structures over to using it. Currently just for testing.
* fix #7806 (#7841) feos2021-03-051-1/+1
|
* video/avgdvg.cpp: Modernised code somewhat. Vas Crabb2020-11-071-6/+9
| | | | bwidow is still broken, all other games seem to work.
* Fix a Olivier Galibert2020-11-031-2/+2
|
* emu/save.cpp: Fix bad SFINAE trick breaking segapcm.cpp, fix saving attotime ↵ Vas Crabb2020-09-141-3/+3
| | | | array on 32-bit Linux targets that align u64 on 32-bit boundaries
* emu: correct some file headers (nw) hap2020-06-191-1/+1
|
* template save/load code - the copy-pasta had become a liability (nw) Vas Crabb2020-04-081-180/+147
|
* luaengine: save state to/from binary string buffer (#6354) feos2020-02-241-0/+103
| | | | | | | | * luaengine: save state to/from binary string buffer * account for error * luaL_error makes it exit immediately, but explicit return is required by compiler. actual return is nil if it fails.
* Allow saving members of structures in n-dimensional arrays, even if the ↵ Vas Crabb2019-12-091-39/+54
| | | | members themselves are n-dimensional arrays - see qsoundhle.cpp for an example of loops disappearing. This can greatly reduce the number of save state registrations in some cases. Obviously I want to know if save states are broken in something by this.
* Make osd_printf_* use util/strformat semantics. Vas Crabb2019-09-261-1/+1
| | | | | | | | | | | | | | | | | (nw) This has been a long time coming but it's here at last. It should be easier now that logerror, popmessage and osd_printf_* behave like string_format and stream_format. Remember the differences from printf: * Any object with a stream out operator works with %s * %d, %i, %o, %x, %X, etc. work out the size by magic * No sign extending promotion to int for short/char * No widening/narrowing conversions for characters/strings * Same rules on all platforms, insulated from C runtime library * No format warnings from compiler * Assert in debug builds if number of arguments doesn't match format (nw) Also removed a pile of redundant c_str and string_format, and some workarounds for not being able to portably format 64-bit integers or long long.
* -save: Print all duplicate savestate entries found rather than bailing after ↵ MooglyGuy2019-06-241-1/+10
| | | | the first one, nw
* Renamed flipendian -> swapendian, as I spent minutes trying to find the ↵ mooglyguy2018-11-051-3/+3
| | | | functions to tell to another person who spent minutes trying to find the functions, and we refer to such functions as swapping just about everywhere else in the codebase, nw
* Optimise start up by delaying the state save sort and check for duplicates ↵ smf-2018-08-221-15/+9
| | | | until all the devices have been started. This has the most visible effect on vgmplay because it registers over thirty thousand state save entries. [smf]
* try this for size - emu.h no net change (nw) Vas Crabb2018-05-181-22/+0
|
* WARNING emu.h recompile! Curt Coder2018-05-181-0/+22
| | | | debugger: Show save state items in alphabetical order in the debugger view. [Curt Coder]
* srcclean and manual cleanups (nw) Vas Crabb2017-12-241-1/+1
| | | | | please people, remember to keep source UTF-8 and if you're committing on behalf of others, clean up indents to meet MAME conventions anyone can run srcclean over a submission and see what will get hit
* missing return vadosnaprimer2017-12-221-1/+1
|
* rewind implementation fixes and improvements vadosnaprimer2017-12-221-190/+220
| | | | | | | | | | | | | - reset scheduler savestate to what it was for years before rewind -- changing saved variables should be done after thorough testing. right now, adding some vars breaks some machines, adding other vars breaks others - switch to megabyte-wise capacity -- savestate size greatly differs between machines, relying on state count is unstable - switch to internal indexing -- no longer depends on inaccurate machine time - rewind accelerator key in debugger (Ctrl+F11) - report capacity hit (once), with some useful info - make error reports saner - mention rewind and rewind_capacity in the docs
* Revert "Revert "Merge branch 'master' of https://github.com/mamedev/mame"" Firehawke2017-12-131-18/+447
| | | | This reverts commit 54155441e9ba9941e85d80c4834a66376a11e791.
* Revert "Merge branch 'master' of https://github.com/mamedev/mame" Firehawke2017-12-131-447/+18
| | | | | This reverts commit f537428e5a40ba6dde8ca9bf0fe9ae6b1f189ac4, reversing changes made to 0d70d798107d4e4e8fb9f230410aeb1e888d65c5.
* Rewind feature and RAM savestates. vadosnaprimer2017-12-061-18/+447
| | | | | | | | | | | | | | This starts the work requested in #2398. How RAM states work. Implemented using util::vectorstream. Instead of dumping m_save.m_entry_list to file, it writes them as binary to vectorstream. Compression is not used, as it would slow down the process. The header is written as usual, also in binary. When a state is loaded, the savestate data gets binary-read from vectorstream. How rewind works. Rewind is optional, it can be turned off through MAME GUI while not running. Rewind capacity is available there too. Rewind step hotkey is available from the standard hotkey menu. In the debugger you have the "rewind" command ("rw" shortcut) that works the same as the hotkey. Every time you advance a frame (pause step), rewinder captures a RAM savestate of the frame you were at. It does the same when you do step into/over/out in the debugger. Every time it captures a new state (and when you unpause), it marks as invalid all its states that go after the current machine time, because input might change, so they are not relevant anymore. It keeps their buffers allocated though, for future use. When rewinder runs out of allowed amount of savestates it can have, it invalidates the first state in the list and tosses its unique_ptr to the end of the list, then it uses its buffer to capture a new state. When you hit the rewind step key, or use "rewind" command in the debugger, it loads a state that is immediately before the current machine time. Invalid states between valid ones are not allowed to appear, as that breaks rewinder integrity and causes problems. Rewinder keeps its own set of ram states as a vector of unique_ptr's. All rewinder operations and errors get reported using machine().popmessage().
* Move unemulated/imperfect flags from machines into devices. Vas Crabb2017-07-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Right now, flags for unemulated/imperfect features apply at system level. This falls over quickly with systems that have slot devices. For example you can plug in a broken sound card or keyboard on a PC or Amiga driver and get no warnings. There's also no way to propagate these flags from a device to all systems using it. This changeset addresses these issues. It's now possible to report unemulated/imperfect features on a device level with static unemulated_feeatures() and imperfect_features() member functions. So far the only thing using this is the votrax device. To support front-ends, this is exposed in -listxml output as a new "feature" element that can appear in system/device descriptions. It has a "type" attribute indicating which feature it is, potentially a "status" attribute if the device itself declares that the feature is unemulated/imperfect, and potentially an "overall" attribute if the device inherits a more severe indication from a subdevice. The embedded DTD describes possible values. Example: device/machine declares imperfect sound: <feature type="sound" status="imperfect"/> Example: device/machine declares unemulated keyboard: <feature type="keyboard" status="unemulated"/> Example: device declares imperfect controls but inherits unemulated controls from a subdevice: <feature type="controls" status="imperfect" overall="unemulated"/> Example: device doesn't declare imperfect LAN but inherits it from a subdevice: <feature type="lan" overall="imperfect"/> It's still possible to add these flags to machines in the GAME/COMP/CONS macro. If the state class declares them with static member functions, the two sources will be combined. If you subclass a device, you inherit its flags if you don't redefine the relevant static member functions (no override qualifier is necessary since they're static). The UI has been updated to display appropriate warnings for the overall machine configuration, including selected slot devices, at launch time. The menus don't display overall status, only status for the machine itself. We can make it scan subdevices if we decide that's desirable, it just needs caching to enure we don't take a huge performance hit.
* Introduce u8/u16/u32/u64/s8/s16/s32/s64 Vas Crabb2016-11-191-25/+25
| | | | | | | | | | | | * New abbreviated types are in osd and util namespaces, and also in global namespace for things that #include "emu.h" * Get rid of import of cstdint types to global namespace (C99 does this anyway) * Remove the cstdint types from everything in emu * Get rid of U64/S64 macros * Fix a bug in dps16 caused by incorrect use of macro * Fix debugcon not checking for "do " prefix case-insensitively * Fix a lot of messed up tabulation * More constexpr * Fix up many __names
* NOTICE (TYPE NAME CONSOLIDATION) Miodrag Milanovic2016-10-221-25/+25
| | | | | Use standard uint64_t, uint32_t, uint16_t or uint8_t instead of UINT64, UINT32, UINT16 or UINT8 also use standard int64_t, int32_t, int16_t or int8_t instead of INT64, INT32, INT16 or INT8
* made constexprs lower case and used constexpr for returning input value as ↵ Miodrag Milanovic2016-07-311-5/+5
| | | | well for rest of defines in osdcomm.h (nw)
* std::min and std:max instead of MIN and MAX, also some more macros converted ↵ Miodrag Milanovic2016-07-311-3/+3
| | | | to inline functions (nw)
* simplified memory management for save states and states (nw) Miodrag Milanovic2016-07-011-37/+35
|
* Iterate over core classes C++11 style AJR2016-03-311-27/+27
| | | | | | | | C++11 range-based for loops can now iterate over simple_list, tagged_list, core_options, device_t::subdevice_list, device_t::interface_list, render_primitive_list and all subclasses of the above, and much code has been refactored to use them. Most core classes that have these lists as members now have methods that return the lists themselves, replacing most of the methods that returned the object at an owned list's head. (A few have been retained due to their use in drivers or OSD.) device_t now manages subdevice and interface lists through subclasses, but has given up the work of adding and removing subdevices to machine_config. memory_manager has its tagged lists exposed, though the old rooted tag lookup methods have been removed (they were privatized already).
* Replace strformat, strprintf and strcatprintf with type-safe steam_format ↵ Vas Crabb2016-02-281-2/+2
| | | | | | | | | and string_format Update MAME to use new function Instantiate ODR-used static constant members Make some of the UI code more localisable Remove use of retired functions in tools
* Remove redundant defines, in order to make translation easier (nw) Miodrag Milanovic2016-02-201-2/+3
|
* reverting: Miodrag Milanovic2016-01-201-7/+7
| | | | | | | SHA-1: 1f90ceab075c4869298e963bf0a14a0aac2f1caa * tags are now strings (nw) fix start project for custom builds in Visual Studio (nw)
* Revert "rest of device parameters to std::string (nw)" Miodrag Milanovic2016-01-201-7/+7
| | | | This reverts commit caba131d844ade3f2b30d6be24ea6cf46b2949d7.
* rest of device parameters to std::string (nw) Miodrag Milanovic2016-01-161-7/+7
|
* tags are now strings (nw) Miodrag Milanovic2016-01-161-7/+7
| | | | fix start project for custom builds in Visual Studio (nw)
* clang-modernize part 1 (nw) Miodrag Milanovic2015-12-031-23/+23
|
* Some cleanups and init fixes with help of ReSharper C++ (nw) Miodrag Milanovic2015-11-111-1/+1
|
* Rename *.c -> *.cpp in our source (nw) Miodrag Milanovic2015-11-081-0/+468