From 45d4cd52a8194f2ef9e0383cfb2e2a35634af6ff Mon Sep 17 00:00:00 2001 From: Olivier Galibert Date: Thu, 16 Jun 2022 12:47:52 +0200 Subject: full xtal conversion --- src/emu/save.h | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'src/emu/save.h') diff --git a/src/emu/save.h b/src/emu/save.h index 677f127853a..330533d07cd 100644 --- a/src/emu/save.h +++ b/src/emu/save.h @@ -285,6 +285,43 @@ public: save_item(device, module, tag, index, value, &attotime::m_seconds, tempstr.c_str(), count); } + // specializations for XTAL + template + std::enable_if_t::underlying_type, XTAL>::value> save_item(device_t *device, const char *module, const char *tag, int index, ItemType &value, const char *valname) + { + std::string tempstr; + tempstr.assign(valname).append(".base_clock"); + save_item(device, module, tag, index, value, &XTAL::m_base_clock, tempstr.c_str()); + tempstr.assign(valname).append(".current_clock"); + save_item(device, module, tag, index, value, &XTAL::m_current_clock, tempstr.c_str()); + tempstr.assign(valname).append(".disable_validation"); + save_item(device, module, tag, index, value, &XTAL::m_disable_validation, tempstr.c_str()); + } + + template + std::enable_if_t::underlying_type, XTAL>::value> save_pointer(device_t *device, const char *module, const char *tag, int index, ItemType *value, const char *valname, u32 count) + { + std::string tempstr; + tempstr.assign(valname).append(".base_clock"); + save_item(device, module, tag, index, value, &XTAL::m_base_clock, tempstr.c_str()); + tempstr.assign(valname).append(".current_clock"); + save_item(device, module, tag, index, value, &XTAL::m_current_clock, tempstr.c_str()); + tempstr.assign(valname).append(".disable_validation"); + save_item(device, module, tag, index, value, &XTAL::m_disable_validation, tempstr.c_str()); + } + + template + std::enable_if_t::underlying_type, XTAL>::value> save_pointer(device_t *device, const char *module, const char *tag, int index, const std::unique_ptr &value, const char *valname, u32 count) + { + std::string tempstr; + tempstr.assign(valname).append(".base_clock"); + save_item(device, module, tag, index, value, &XTAL::m_base_clock, tempstr.c_str()); + tempstr.assign(valname).append(".current_clock"); + save_item(device, module, tag, index, value, &XTAL::m_current_clock, tempstr.c_str()); + tempstr.assign(valname).append(".disable_validation"); + save_item(device, module, tag, index, value, &XTAL::m_disable_validation, tempstr.c_str()); + } + // global memory registration template void save_item(ItemType &value, const char *valname, int index = 0) -- cgit v1.2.3-70-g09d2