diff options
author | 2021-09-15 11:06:58 -0700 | |
---|---|---|
committer | 2021-09-15 11:06:58 -0700 | |
commit | de28f087ffe26ece88ef416ca7080f8d10d08398 (patch) | |
tree | b031f70d3ca93e81c818b587fb71dead4568420b /src/osd/sdl/sdlsync_sdl.c | |
parent | da6f1fd6fc9643902dea9e9737c70847fb380599 (diff) |
Enable flexible structure saving.
This change introduces the ability to save arbitrary structures. To
make a structure eligible for saving, it must implement a new method
register_save(save_registrar &). Structs can then save their members
directly via the provided save_registrar. Nested structs and arrays of
structs are supported in this manner.
Note that state registration is not done via a virtual method or mix-in
interface because doing so would convert lightweight structures away
from being POD, and lightweight structures are one of the most common
situations where this system can be leveraged in MAME.
As a first example, the attotime struct has been changed to support
this mechanism for saving, allowing us to remove the special cases for
attotimes currently in save_manager.
(It would be tempting to do the same for bitmap_t, but bitmaps are
defined in lib/util and can't take a dependency on save.h so those
special cases will remain.)
This is a prologue to full hierarchical save state support, which I am
working on in another branch. The save_registrar class name and reg()
signatures match current work on that branch, so any changes made to
existing code to leverage struct saving in this way will port over
cleanly.
Diffstat (limited to 'src/osd/sdl/sdlsync_sdl.c')
0 files changed, 0 insertions, 0 deletions