diff options
author | Vas Crabb <vas@vastheman.com> | 2019-12-09 00:35:38 +1100 |
---|---|---|
committer | Vas Crabb <vas@vastheman.com> | 2019-12-09 00:35:38 +1100 |
commit | e6b4cdb3527bf7a799eb6b6b9f7df57aea8971ec (patch) | |
tree | 49f373544238a8e2458cc1de05039468a066a016 /src/emu/device.h | |
parent | d3a70dc3460ef0b9c97fe16efb70db83bf012848 (diff) |
Allow saving members of structures in n-dimensional arrays, even if the 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.
Diffstat (limited to 'src/emu/device.h')
-rw-r--r-- | src/emu/device.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/emu/device.h b/src/emu/device.h index 6e729402989..11798068259 100644 --- a/src/emu/device.h +++ b/src/emu/device.h @@ -610,9 +610,23 @@ public: // state saving interfaces template<typename ItemType> - void ATTR_COLD save_item(ItemType &&value, const char *valname, int index = 0) { assert(m_save != nullptr); m_save->save_item(this, name(), tag(), index, std::forward<ItemType>(value), valname); } + void ATTR_COLD save_item(ItemType &&value, const char *valname, int index = 0) + { + assert(m_save); + m_save->save_item(this, name(), tag(), index, std::forward<ItemType>(value), valname); + } + template<typename ItemType, typename ElementType> + void ATTR_COLD save_item(ItemType &&value, ElementType save_manager::array_unwrap<std::remove_reference_t<ItemType> >::underlying_type::*element, const char *valname, int index = 0) + { + assert(m_save); + m_save->save_item(this, name(), tag(), index, std::forward<ItemType>(value), element, valname); + } template<typename ItemType> - void ATTR_COLD save_pointer(ItemType &&value, const char *valname, u32 count, int index = 0) { assert(m_save != nullptr); m_save->save_pointer(this, name(), tag(), index, std::forward<ItemType>(value), valname, count); } + void ATTR_COLD save_pointer(ItemType &&value, const char *valname, u32 count, int index = 0) + { + assert(m_save); + m_save->save_pointer(this, name(), tag(), index, std::forward<ItemType>(value), valname, count); + } // debugging device_debug *debug() const { return m_debug.get(); } |