From 8113e27292af16a28c00cbee7a712730f06aa301 Mon Sep 17 00:00:00 2001 From: ajrhacker Date: Thu, 12 Oct 2017 14:39:51 -0400 Subject: device_state_interface: Polymorphism and std::function for entries (nw) (#2690) * device_state_interface: Polymorphism and std::function for entries (nw) - Create a templated subclass of device_state_entry to provide separate read/write interfaces for registers of varying widths. The efficiency impact of this should be minimal, given that this eliminates the need to make each byte width a subcase for reads and writes. - Create similarly templated "pseudo-register" versions of device_state_entry that provides custom read/write interfaces through std::function. The intent of this is to eventually replace the dummy register + state_export interface hitherto necessary to provide debugger access to bankswitched or computed state registers. - State registers can now be made read-only, and this is automatically done now when state_add is called with a std::function read handler but no write handler. This property is honored by MAME debug expressions. * Add override keyword (nw) * Remove explicit instantiations that were causing linking errors in tools build (nw) --- src/emu/debug/debugcpu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/emu/debug/debugcpu.cpp') diff --git a/src/emu/debug/debugcpu.cpp b/src/emu/debug/debugcpu.cpp index 46ad9e04683..5b41d0f8241 100644 --- a/src/emu/debug/debugcpu.cpp +++ b/src/emu/debug/debugcpu.cpp @@ -1560,7 +1560,7 @@ device_debug::device_debug(device_t &device) for (const auto &entry : m_state->state_entries()) { strmakelower(tempstr.assign(entry->symbol())); - m_symtable.add(tempstr.c_str(), (void *)(uintptr_t)entry->index(), get_state, set_state, entry->format_string()); + m_symtable.add(tempstr.c_str(), (void *)(uintptr_t)entry->index(), get_state, entry->writeable() ? set_state : nullptr, entry->format_string()); } } -- cgit v1.2.3