summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/emumem_het.cpp
diff options
context:
space:
mode:
author Olivier Galibert <galibert@pobox.com>2021-11-28 17:49:58 +0100
committer Olivier Galibert <galibert@pobox.com>2021-11-28 17:51:46 +0100
commit8027428e4d7ef0e1ebd9cb56dc058ef5c1b4257b (patch)
tree8f87ad1fc10a66c5070cac953cf0f720afa6dfe8 /src/emu/emumem_het.cpp
parentde1b03e4cd07d77c2946e5966630d0620180e9b0 (diff)
Fun with flags: Allows handlers to have user-defined flags set on
them, which can them be picked up on access with the {read,write}_*_flags variants of the accessors. Example use with the i960 and its burstable rom/ram.
Diffstat (limited to 'src/emu/emumem_het.cpp')
-rw-r--r--src/emu/emumem_het.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/emu/emumem_het.cpp b/src/emu/emumem_het.cpp
index c9363695cdc..1360badd99c 100644
--- a/src/emu/emumem_het.cpp
+++ b/src/emu/emumem_het.cpp
@@ -16,6 +16,17 @@ template<int Width, int AddrShift> typename emu::detail::handler_entry_size<Widt
return data;
}
+template<int Width, int AddrShift> std::pair<typename emu::detail::handler_entry_size<Width>::uX, u16> handler_entry_read_tap<Width, AddrShift>::read_flags(offs_t offset, uX mem_mask) const
+{
+ this->ref();
+
+ auto pack = this->m_next->read_flags(offset, mem_mask);
+ m_tap(offset, pack.first, mem_mask);
+
+ this->unref();
+ return pack;
+}
+
template<int Width, int AddrShift> std::string handler_entry_read_tap<Width, AddrShift>::name() const
{
return '(' + m_name + ") " + this->m_next->name();
@@ -37,6 +48,17 @@ template<int Width, int AddrShift> void handler_entry_write_tap<Width, AddrShift
this->unref();
}
+template<int Width, int AddrShift> u16 handler_entry_write_tap<Width, AddrShift>::write_flags(offs_t offset, uX data, uX mem_mask) const
+{
+ this->ref();
+
+ m_tap(offset, data, mem_mask);
+ u16 flags = this->m_next->write_flags(offset, data, mem_mask);
+
+ this->unref();
+ return flags;
+}
+
template<int Width, int AddrShift> std::string handler_entry_write_tap<Width, AddrShift>::name() const
{
return '(' + m_name + ") " + this->m_next->name();