summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/save.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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