summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/save.h
Commit message (Collapse)AuthorAgeFilesLines
* Fix compile error on Linux with NO_USE_XINPUT=0 Kiall Mac Innes2018-10-111-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | In file included from /usr/include/X11/extensions/XInput.h:53:0, from ../../../../../src/osd/modules/input/input_x11.cpp:18: ../../../../../src/emu/save.h:95:32: error: expected unqualified-id before numeric constant static constexpr std::size_t COUNT = 1U; ^ ../../../../../src/emu/save.h:102:32: error: expected unqualified-id before numeric constant static constexpr std::size_t COUNT = N * array_unwrap<T>::COUNT; ^ ../../../../../src/emu/save.h:109:32: error: expected unqualified-id before numeric constant static constexpr std::size_t COUNT = N * array_unwrap<T>::COUNT; ^ ../../../../../src/emu/save.h: In member function ‘void save_manager::save_item(device_t*, const char*, const char*, int, ItemType&, const char*)’: ../../../../../src/emu/save.h:154:142: error: expected unqualified-id before numeric constant save_memory(device, module, tag, index, valname, array_unwrap<ItemType>::ptr(value), array_unwrap<ItemType>::SIZE, array_unwrap<ItemType>::COUNT); ^ ../../../../../src/emu/save.h: In member function ‘void save_manager::save_pointer(device_t*, const char*, const char*, int, ItemType*, const char*, u32)’: ../../../../../src/emu/save.h:163:145: error: expected unqualified-id before numeric constant save_memory(device, module, tag, index, valname, array_unwrap<ItemType>::ptr(value[0]), array_unwrap<ItemType>::SIZE, array_unwrap<ItemType>::COUNT * count); ^ ../../../../../src/emu/save.h: In member function ‘void save_manager::save_pointer(device_t*, const char*, const char*, int, std::unique_ptr<_Tp []>&, const char*, u32)’: ../../../../../src/emu/save.h:172:145: error: expected unqualified-id before numeric constant save_memory(device, module, tag, index, valname, array_unwrap<ItemType>::ptr(value[0]), array_unwrap<ItemType>::SIZE, array_unwrap<ItemType>::COUNT * count);
* Better support for screen orientation/geometry: Vas Crabb2018-07-261-24/+37
| | | | | | | | | | | | | | | | | | | | | * Eliminates the need for the horizontal/vertical/LCD/SVG layout files * Screens can now have orientation and physical aspect ratio specified * RASTER/VECTOR defaults to 4:3, LCD/SVG defaults to square pixels at config time * System orientation is applied on top of screen orientation Automatically generated single-screen views and orientation flags in XML output now work correctly for systems with multiple screens in different geometries/orientations, e.g. housemnq, rocnms, stepstag, or netmerc. The "core rotation options" only interact with system orientation. Allowing multi-screen systems to work well with one monitor per emulated screen is a complex topic. System orientation also affects the GFX viewer while screen orientation doesn't. The orientation displayed in the system selection menu is from the system orientation. Let me know if I've broken any systems or use cases. Also, add save state support for std::array/C array nested to any depth.
* Allow passing std::unique_ptr<TYPE> directly to save_pointer and remove ↵ AJR2018-06-241-23/+31
| | | | now-superfluous .get() in many drivers/devices (nw)
* try this for size - emu.h no net change (nw) Vas Crabb2018-05-181-1/+0
|
* WARNING emu.h recompile! Curt Coder2018-05-181-0/+1
| | | | debugger: Show save state items in alphabetical order in the debugger view. [Curt Coder]
* rewind implementation fixes and improvements vadosnaprimer2017-12-221-18/+23
| | | | | | | | | | | | | - 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-5/+63
| | | | This reverts commit 54155441e9ba9941e85d80c4834a66376a11e791.
* Revert "Merge branch 'master' of https://github.com/mamedev/mame" Firehawke2017-12-131-63/+5
| | | | | This reverts commit f537428e5a40ba6dde8ca9bf0fe9ae6b1f189ac4, reversing changes made to 0d70d798107d4e4e8fb9f230410aeb1e888d65c5.
* Rewind feature and RAM savestates. vadosnaprimer2017-12-061-5/+63
| | | | | | | | | | | | | | 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().
* A round of spelling/typographical fixes to source comments (nw) Scott Stone2016-11-241-1/+1
|
* Introduce u8/u16/u32/u64/s8/s16/s32/s64 Vas Crabb2016-11-191-27/+27
| | | | | | | | | | | | * 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
* Do not use FUNC in delegate where applicable (nw) Miodrag Milanovic2016-11-061-1/+1
|
* NOTICE (TYPE NAME CONSOLIDATION) Miodrag Milanovic2016-10-221-18/+18
| | | | | 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
* simplified memory management for save states and states (nw) Miodrag Milanovic2016-07-011-13/+4
|
* Various cleanups suggested by static analyzer (nw) Miodrag Milanovic2016-04-241-1/+1
|
* reverting: Miodrag Milanovic2016-01-201-14/+14
| | | | | | | 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-16/+16
| | | | This reverts commit caba131d844ade3f2b30d6be24ea6cf46b2949d7.
* rest of device parameters to std::string (nw) Miodrag Milanovic2016-01-161-16/+16
|
* tags are now strings (nw) Miodrag Milanovic2016-01-161-14/+14
| | | | fix start project for custom builds in Visual Studio (nw)
* clang-modernize part 5 Miodrag Milanovic2015-12-041-1/+1
|
* clang-modernize part 1 (nw) Miodrag Milanovic2015-12-031-1/+1
|
* Added seconds() and attoseconds() to attotime and prefixed members with couriersud2015-08-151-2/+2
| | | | | | | m_. Rewrote code accessing members to use seconds() and attoseconds(). The changes were triggered by a test how gcc __int128_t would perform as the internal representation. This test revealed that the current implementation is still faster. (nw)
* some extremely low hanging pedantic fruit Cowering2015-07-081-15/+15
|
* Completed state_save_register_item* removal (nw) Ivan Vangelista2015-04-231-11/+0
|
* moved all to std::string (nw) Miodrag Milanovic2015-04-221-5/+5
|
* removed not used state_save_register_item_* calls (nw) Miodrag Milanovic2015-04-181-7/+0
|
* Replace dynamic_array with std::vector [O. Galibert] Olivier Galibert2015-04-141-3/+3
|
* updated astring constructors to have just one string param, to be more like ↵ Miodrag Milanovic2015-04-131-1/+1
| | | | std::string (nw)
* There is no implicit conversion to char* in std::string (nw) Miodrag Milanovic2015-04-121-2/+2
|
* save: Give the device when available to the state save subsystem [O. Galibert] Olivier Galibert2015-02-141-49/+53
|
* save: factor-out presave/postload dispatchers Luca Bruno2015-01-181-0/+4
| | | | Signed-off-by: Luca Bruno <lucab@debian.org>
* Enable saving dynamic_arrays of all fundamental types. Also fix emupal Aaron Giles2014-03-021-66/+22
| | | | | to save the indirection arrays properly when indirect color count is provided up front.
* Huge update, palette is now device (nw) Miodrag Milanovic2014-02-271-0/+12
| | | note: Aaron please give more descriptive text for release log I have no more strength :)
* Switched rgb_t to a class, replacing macros with methods. Mappings are Aaron Giles2014-02-191-0/+1
| | | | | | | | | | | | | | | | | | | as follows: MAKE_RGB(r,g,b) == rgb_t(r,g,b) MAKE_ARGB(a,r,g,b) == rgb_t(a,r,g,b) RGB_ALPHA(data) == data.a() RGB_RED(data) == data.r() RGB_GREEN(data) == data.g() RGB_BLUE(data) == data.b() RGB_BLACK == rgb_t::black RGB_WHITE == rgb_t::white Implicit conversions to/from UINT32 are built in as well as simple addition, subtraction, and scaling (with clamping). As a result of being a class, some stricter typing was needed in a few places but overall not too much.
* Bulk convert files that already had standard BSD license in my name Aaron Giles2013-10-161-31/+2
| | | | to new license tagged form.
* Split eeprom.c into a base class base_eeprom_device and a serial-specific Aaron Giles2013-07-271-0/+1
| | | | | | | | subclass serial_eeprom_device. Moved the latter into its own file eepromser.c and significantly cleaned up/simplified the code. The new code should be functionally the same as the previous code, but expect that to change soon. As a side-effect, the size and bus width of the EEPROM is now specified in the ADD macro rather than in the interface structure.
* Memory system: added endianness to the memory_share class. Aaron Giles2013-07-201-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tilemap system: numerous changes: * Moved remaining legacy macros and typedefs to tilelgcy.h. This revealed a few drivers mixing and matching modern & legcy, which have now been fixed. * Changed get info callback signature to no longer pass the user_data pointer, but instead pass a reference to the tilemap object itself. Updated those few drivers using user_data to pull it out of the tilemap object with the new user_data() getter method. * Changed get info and mapping callbacks to be device_delegates so that they can be described at config time. * Added tilemap_memory object that is used internally for reading/ writing to memory that backs a tilemap. This object is used to track a memory pointer that backs tilemap memory, and also is designed to transparently handle all bus width and endianness associated with reading and writing data in a tilemap. * Incorporated two tilemap_memory objects (basemem and extmem) into the tilemap object and added accessors to them, as well as read/write handlers for reading/writing to entries stored in the memory. This means that tilemap get info callbacks can now easily read data out of the tilemap in a generic way. * Rejiggered the initialization sequence for tilemap objects so that the tilemap_manager is not required to be present at instantiation. * Created a new tilemap_device, which can be used to declare a tilemap in the machine config, and which also is a tilemap object itself. The tilemap device will look for shared memory regions called "<tag>" and "<tag>_ext" and automatically plug them into the tilemap. The device also provides write handlers that can be used to write to the tilemap memory and mark tiles dirty, saving the need for each driver to write their own. Device system: moved required/optional device finders to a new header devfind.h. Atari drivers: removed all playfield and alpha memory and tilemap variables, apart from those needed by atarivc-using games (this will become a device in a future update). Updated all Atari 16-bit drivers to use the new tilemap_device instead, which provides all the needed functionality in a more generic way.
* save state cleanup, converted state_save_register_global* into ↵ Miodrag Milanovic2013-05-081-18/+0
| | | | save_item/save_pointer (nw)
* Cleanups and version bumpmame0148 Miodrag Milanovic2013-01-111-15/+15
|
* Clean-ups and version bump (yes, I know, it's too late)mame0145u4 Angelo Salese2012-03-111-1/+1
|
* Add save_item template specialization for dynamic_array. Aaron Giles2012-03-081-0/+31
|
* Major bitmap-related changes throughout the system. There are Aaron Giles2012-01-121-2/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | almost certainly some regressions lurking. Let me know if something seems busted. Bitmaps are now strongly typed based on format. bitmap_t still exists as an abstract base class, but it is almost never used. Instead, format-specific bitmap classes are provided: bitmap_ind8 == 8bpp indexed bitmap_ind16 == 16bpp indexed bitmap_ind32 == 32bpp indexed bitmap_ind64 == 64bpp indexed bitmap_rgb32 == 32bpp RGB bitmap_argb32 == 32bpp ARGB bitmap_yuy16 == 16bpp YUY For each format, a generic pix() method is provided which references pixels of the correct type. The old pix8/pix16/pix32/ pix64 methods still exist in the short term, but the only one available is the one that matches the bitmap's pixel size. Note also that the old RGB15 format bitmaps are no longer supported at all. Converted model1, megadriv, and stv drivers away from the RGB15 format bitmaps. New auto_bitmap_<type>_alloc() macros are provided for allocating the appropriate type of bitmap. Screen update functions now must specify the correct bitmap type as their input parameters. For static update functions the SCREEN_UPDATE macro is now replaced with SCREEN_UPDATE_RGB32 and SCREEN_UPDATE_IND16 macros. All existing drivers have been updated to use the correct macros. Screen update functions are now required for all screens; there is no longer any default behavior of copying a "default" bitmap to the screen (in fact the default bitmap has been deprecated). Use one of the following to specify your screen_update callback: MCFG_SCREEN_UPDATE_STATIC(name) - static functions MCFG_SCREEN_UPDATE_DRIVER(class, func) - driver members MCFG_SCREEN_UPDATE_DEVICE(tag, class, func) - device members Because the target bitmap format can now be deduced from the screen update function itself, the MCFG_SCREEN_FORMAT macro is no longer necessary, and has been removed. If you specify a screen update callback that takes a bitmap_ind16, then the screen will be configured to use a 16bpp indexed bitmap, and if you specify a callback that takes a bitmap_rgb32, then a 32bpp RGB bitmap will be provided. Extended the bitmap classes to support wrapping a subregion of another bitmap, and cleaner allocation/resetting. The preferred use of bitmaps now is to define them directly in drivers/devices and use allocate() or wrap() to set them up, rather than allocating them via auto_bitmap_*_alloc(). Several common devices needed overhauls or changes as a result of the above changes: * Reorganized the laserdisc base driver and all the laserdisc drivers as modern C++ devices, cleaning the code up considerably. Merged ldsound device into the laserdsc device since modern devices are flexible enough to handle it. * Reorganized the v9938 device as a modern C++ device. Removed v9938mod.c in favor of template functions in v9938.c directly. * Added independent ind16 and rgb32 callbacks for TMS340x0 devices. * All video devices are now hard-coded to either ind16 or rgb32 bitmaps. The most notable is the mc6845 which is rgb32, and required changes to a number of consumers. * Added screen_update methods to most video devices so they can be directly called via MCFG_SCREEN_UPDATE_DEVICE instead of creating tons of stub functions.
* Converted bitmap_t and rectangle into proper classes. Replaced BITMAP_ADDR* Aaron Giles2011-12-311-1/+1
| | | | | | | | macros with bitmap->pix* functions, and moved bitmap_fill() to bitmap->fill() among other similar changes. Bitmap fields now only available via accessors. Replaced sect_rect with &= and union_rect with |= operators for rectangle classes. Some general cleanup as a result of these changes. [Aaron Giles]
* Move per emulator constants info into separate class [Miodrag Milanovic] Miodrag Milanovic2011-11-171-2/+0
| | | | | out of log: This way it is possible to link two or more separated executables with different copyright/xml out/name/... in one compilation, just one step closer...
* Be consistent about template argument naming. Aaron Giles2011-04-301-19/+19
|
* Converted presave/postload functions to delegates. In a lot of Aaron Giles2011-04-301-26/+6
| | | | | | cases, we can get rid of the postload function entirely and just call directly to the target function. Drivers eventually should just override device_postload() instead of registering for callbacks.
* Rename state_manager -> save_manager since the term "state" is overloaded. Aaron Giles2011-04-201-0/+313