From 0abd03a7a7bd2400c52463ef8d58ba7750b86208 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Mon, 4 Jan 2021 15:15:16 +1100 Subject: [PATCH] emumem: more idiomatic way to access members inherited from argument-dependent base templates (may or may not work around GCC11 bug causing #7616) --- src/emu/emumem_hedp.cpp | 20 ++++++++++---------- src/emu/emumem_hedp.h | 10 ++++++---- src/emu/emumem_hedr.h | 9 +++++++-- src/emu/emumem_hedr.ipp | 21 +++++++++++++-------- src/emu/emumem_hedw.h | 9 +++++++-- src/emu/emumem_hedw.ipp | 21 +++++++++++++-------- src/emu/emumem_hem.cpp | 28 ++++++++++++++-------------- src/emu/emumem_hem.h | 10 ++++++---- src/emu/emumem_het.cpp | 12 ++++++------ src/emu/emumem_het.h | 8 ++++++-- src/emu/emumem_heu.cpp | 14 +++++++------- src/emu/emumem_heu.h | 7 +++++-- src/emu/emumem_heun.cpp | 20 ++++++++++---------- src/emu/emumem_heun.h | 10 ++++++---- 14 files changed, 116 insertions(+), 83 deletions(-) diff --git a/src/emu/emumem_hedp.cpp b/src/emu/emumem_hedp.cpp index 13938e07413..9f77b8b3517 100644 --- a/src/emu/emumem_hedp.cpp +++ b/src/emu/emumem_hedp.cpp @@ -12,7 +12,7 @@ template template< std::is_same::value, typename emu::detail::handler_entry_size::uX> handler_entry_read_delegate::read_impl(offs_t offset, uX mem_mask) const { - return m_delegate(*inh::m_space, ((offset - inh::m_address_base) & inh::m_address_mask) >> (Width + AddrShift), mem_mask); + return m_delegate(*this->m_space, ((offset - this->m_address_base) & this->m_address_mask) >> (Width + AddrShift), mem_mask); } template template @@ -22,7 +22,7 @@ template template< std::is_same::value, typename emu::detail::handler_entry_size::uX> handler_entry_read_delegate::read_impl(offs_t offset, uX mem_mask) const { - return m_delegate(*inh::m_space, ((offset - inh::m_address_base) & inh::m_address_mask) >> (Width + AddrShift)); + return m_delegate(*this->m_space, ((offset - this->m_address_base) & this->m_address_mask) >> (Width + AddrShift)); } template template @@ -32,7 +32,7 @@ template template< std::is_same::value, typename emu::detail::handler_entry_size::uX> handler_entry_read_delegate::read_impl(offs_t offset, uX mem_mask) const { - return m_delegate(((offset - inh::m_address_base) & inh::m_address_mask) >> (Width + AddrShift), mem_mask); + return m_delegate(((offset - this->m_address_base) & this->m_address_mask) >> (Width + AddrShift), mem_mask); } template template @@ -42,7 +42,7 @@ template template< std::is_same::value, typename emu::detail::handler_entry_size::uX> handler_entry_read_delegate::read_impl(offs_t offset, uX mem_mask) const { - return m_delegate(((offset - inh::m_address_base) & inh::m_address_mask) >> (Width + AddrShift)); + return m_delegate(((offset - this->m_address_base) & this->m_address_mask) >> (Width + AddrShift)); } template template @@ -52,7 +52,7 @@ template template< std::is_same::value, typename emu::detail::handler_entry_size::uX> handler_entry_read_delegate::read_impl(offs_t offset, uX mem_mask) const { - return m_delegate(*inh::m_space); + return m_delegate(*this->m_space); } template template @@ -82,7 +82,7 @@ template template std::is_same::value, void> handler_entry_write_delegate::write_impl(offs_t offset, uX data, uX mem_mask) const { - m_delegate(*inh::m_space, ((offset - inh::m_address_base) & inh::m_address_mask) >> (Width + AddrShift), data, mem_mask); + m_delegate(*this->m_space, ((offset - this->m_address_base) & this->m_address_mask) >> (Width + AddrShift), data, mem_mask); } template template @@ -92,7 +92,7 @@ template template std::is_same::value, void> handler_entry_write_delegate::write_impl(offs_t offset, uX data, uX mem_mask) const { - m_delegate(*inh::m_space, ((offset - inh::m_address_base) & inh::m_address_mask) >> (Width + AddrShift), data); + m_delegate(*this->m_space, ((offset - this->m_address_base) & this->m_address_mask) >> (Width + AddrShift), data); } template template @@ -102,7 +102,7 @@ template template std::is_same::value, void> handler_entry_write_delegate::write_impl(offs_t offset, uX data, uX mem_mask) const { - m_delegate(((offset - inh::m_address_base) & inh::m_address_mask) >> (Width + AddrShift), data, mem_mask); + m_delegate(((offset - this->m_address_base) & this->m_address_mask) >> (Width + AddrShift), data, mem_mask); } template template @@ -112,7 +112,7 @@ template template std::is_same::value, void> handler_entry_write_delegate::write_impl(offs_t offset, uX data, uX mem_mask) const { - m_delegate(((offset - inh::m_address_base) & inh::m_address_mask) >> (Width + AddrShift), data); + m_delegate(((offset - this->m_address_base) & this->m_address_mask) >> (Width + AddrShift), data); } template template @@ -122,7 +122,7 @@ template template std::is_same::value, void> handler_entry_write_delegate::write_impl(offs_t offset, uX data, uX mem_mask) const { - m_delegate(*inh::m_space, data); + m_delegate(*this->m_space, data); } template template diff --git a/src/emu/emumem_hedp.h b/src/emu/emumem_hedp.h index 3cd1c646f17..f55f583c768 100644 --- a/src/emu/emumem_hedp.h +++ b/src/emu/emumem_hedp.h @@ -1,5 +1,9 @@ // license:BSD-3-Clause // copyright-holders:Olivier Galibert +#ifndef MAME_EMU_EMUMEM_HEDP_H +#define MAME_EMU_EMUMEM_HEDP_H + +#pragma once // handler_entry_read_delegate/handler_entry_write_delegate @@ -9,7 +13,6 @@ template class han { public: using uX = typename emu::detail::handler_entry_size::uX; - using inh = handler_entry_read_address; handler_entry_read_delegate(address_space *space, const READ &delegate) : handler_entry_read_address(space, 0), m_delegate(delegate) {} ~handler_entry_read_delegate() = default; @@ -68,7 +71,6 @@ template class ha { public: using uX = typename emu::detail::handler_entry_size::uX; - using inh = handler_entry_write_address; handler_entry_write_delegate(address_space *space, const WRITE &delegate) : handler_entry_write_address(space, 0), m_delegate(delegate) {} ~handler_entry_write_delegate() = default; @@ -132,7 +134,6 @@ template class handler_entry_read { public: using uX = typename emu::detail::handler_entry_size::uX; - using inh = handler_entry_read; handler_entry_read_ioport(address_space *space, ioport_port *port) : handler_entry_read(space, 0), m_port(port) {} ~handler_entry_read_ioport() = default; @@ -149,7 +150,6 @@ template class handler_entry_writ { public: using uX = typename emu::detail::handler_entry_size::uX; - using inh = handler_entry_write; handler_entry_write_ioport(address_space *space, ioport_port *port) : handler_entry_write(space, 0), m_port(port) {} ~handler_entry_write_ioport() = default; @@ -161,3 +161,5 @@ public: private: ioport_port *m_port; }; + +#endif // MAME_EMU_EMUMEM_HEDP_H diff --git a/src/emu/emumem_hedr.h b/src/emu/emumem_hedr.h index 0756c91795c..e2278e5132b 100644 --- a/src/emu/emumem_hedr.h +++ b/src/emu/emumem_hedr.h @@ -1,5 +1,9 @@ // license:BSD-3-Clause // copyright-holders:Olivier Galibert +#ifndef MAME_EMU_EMUMEM_HEDR_H +#define MAME_EMU_EMUMEM_HEDR_H + +#pragma once // handler_entry_read_dispatch @@ -10,8 +14,7 @@ template class hand { public: using uX = typename emu::detail::handler_entry_size::uX; - using inh = handler_entry_read; - using mapping = typename inh::mapping; + using mapping = typename handler_entry_read::mapping; handler_entry_read_dispatch(address_space *space, const handler_entry::range &init, handler_entry_read *handler); handler_entry_read_dispatch(address_space *space, memory_view &view); @@ -96,3 +99,5 @@ private: void populate_passthrough_mirror_subdispatch(offs_t entry, offs_t start, offs_t end, offs_t ostart, offs_t oend, offs_t mirror, handler_entry_read_passthrough *handler, std::vector &mappings); void passthrough_patch(handler_entry_read_passthrough *handler, std::vector &mappings, handler_entry_read *&target); }; + +#endif // MAME_EMU_EMUMEM_HEDR_H diff --git a/src/emu/emumem_hedr.ipp b/src/emu/emumem_hedr.ipp index 7c2818dc7c6..21085d9c7f2 100644 --- a/src/emu/emumem_hedr.ipp +++ b/src/emu/emumem_hedr.ipp @@ -1,7 +1,10 @@ // license:BSD-3-Clause // copyright-holders:Olivier Galibert +#ifndef MAME_EMU_EMUMEM_HEDR_IPP +#define MAME_EMU_EMUMEM_HEDR_IPP + +#pragma once -#include "emu.h" #include "emumem_mud.h" #include "emumem_hea.h" #include "emumem_heu.h" @@ -166,7 +169,7 @@ template void handl if(cur->is_dispatch()) cur->populate_nomirror(start, end, ostart, oend, handler); else { - auto subdispatch = new handler_entry_read_dispatch(handler_entry::m_space, m_u_ranges[entry], cur); + auto subdispatch = new handler_entry_read_dispatch(this->m_space, m_u_ranges[entry], cur); cur->unref(); m_u_dispatch[entry] = subdispatch; subdispatch->populate_nomirror(start, end, ostart, oend, handler); @@ -232,7 +235,7 @@ template void handl if(cur->is_dispatch()) cur->populate_mirror(start, end, ostart, oend, mirror, handler); else { - auto subdispatch = new handler_entry_read_dispatch(handler_entry::m_space, m_u_ranges[entry], cur); + auto subdispatch = new handler_entry_read_dispatch(this->m_space, m_u_ranges[entry], cur); cur->unref(); m_u_dispatch[entry] = subdispatch; subdispatch->populate_mirror(start, end, ostart, oend, mirror, handler); @@ -285,7 +288,7 @@ template void handl if(original) replacement = new handler_entry_read_units(descriptor, ukey, static_cast *>(original)); else - replacement = new handler_entry_read_units(descriptor, ukey, inh::m_space); + replacement = new handler_entry_read_units(descriptor, ukey, this->m_space); mappings.emplace_back(mapping{ original, replacement, ukey }); } else @@ -300,7 +303,7 @@ template void handl if(cur->is_dispatch()) cur->populate_mismatched_nomirror(start, end, ostart, oend, descriptor, rkey, mappings); else { - auto subdispatch = new handler_entry_read_dispatch(handler_entry::m_space, m_u_ranges[entry], cur); + auto subdispatch = new handler_entry_read_dispatch(this->m_space, m_u_ranges[entry], cur); cur->unref(); m_u_dispatch[entry] = subdispatch; subdispatch->populate_mismatched_nomirror(start, end, ostart, oend, descriptor, rkey, mappings); @@ -372,7 +375,7 @@ template void handl if(cur->is_dispatch()) cur->populate_mismatched_mirror(start, end, ostart, oend, mirror, descriptor, mappings); else { - auto subdispatch = new handler_entry_read_dispatch(handler_entry::m_space, m_u_ranges[entry], cur); + auto subdispatch = new handler_entry_read_dispatch(this->m_space, m_u_ranges[entry], cur); cur->unref(); m_u_dispatch[entry] = subdispatch; subdispatch->populate_mismatched_mirror(start, end, ostart, oend, mirror, descriptor, mappings); @@ -431,7 +434,7 @@ template void handl if(cur->is_dispatch()) cur->populate_passthrough_nomirror(start, end, ostart, oend, handler, mappings); else { - auto subdispatch = new handler_entry_read_dispatch(handler_entry::m_space, m_u_ranges[entry], cur); + auto subdispatch = new handler_entry_read_dispatch(this->m_space, m_u_ranges[entry], cur); cur->unref(); m_u_dispatch[entry] = subdispatch; subdispatch->populate_passthrough_nomirror(start, end, ostart, oend, handler, mappings); @@ -487,7 +490,7 @@ template void handl if(cur->is_dispatch()) cur->populate_passthrough_mirror(start, end, ostart, oend, mirror, handler, mappings); else { - auto subdispatch = new handler_entry_read_dispatch(handler_entry::m_space, m_u_ranges[entry], cur); + auto subdispatch = new handler_entry_read_dispatch(this->m_space, m_u_ranges[entry], cur); cur->unref(); m_u_dispatch[entry] = subdispatch; subdispatch->populate_passthrough_mirror(start, end, ostart, oend, mirror, handler, mappings); @@ -629,3 +632,5 @@ template handler_en return new handler_entry_read_dispatch(this); } + +#endif // MAME_EMU_EMUMEM_HEDR_IPP diff --git a/src/emu/emumem_hedw.h b/src/emu/emumem_hedw.h index 3d8973181f6..e0ed2c33d81 100644 --- a/src/emu/emumem_hedw.h +++ b/src/emu/emumem_hedw.h @@ -1,5 +1,9 @@ // license:BSD-3-Clause // copyright-holders:Olivier Galibert +#ifndef MAME_EMU_EMUMEM_HEDW_H +#define MAME_EMU_EMUMEM_HEDW_H + +#pragma once // handler_entry_write_dispatch @@ -10,8 +14,7 @@ template class hand { public: using uX = typename emu::detail::handler_entry_size::uX; - using inh = handler_entry_write; - using mapping = typename inh::mapping; + using mapping = typename handler_entry_write::mapping; handler_entry_write_dispatch(address_space *space, const handler_entry::range &init, handler_entry_write *handler); handler_entry_write_dispatch(address_space *space, memory_view &view); @@ -96,3 +99,5 @@ private: void populate_passthrough_mirror_subdispatch(offs_t entry, offs_t start, offs_t end, offs_t ostart, offs_t oend, offs_t mirror, handler_entry_write_passthrough *handler, std::vector &mappings); void passthrough_patch(handler_entry_write_passthrough *handler, std::vector &mappings, handler_entry_write *&target); }; + +#endif // MAME_EMU_EMUMEM_HEDW_H diff --git a/src/emu/emumem_hedw.ipp b/src/emu/emumem_hedw.ipp index fba9ae3e210..dcd506d4f33 100644 --- a/src/emu/emumem_hedw.ipp +++ b/src/emu/emumem_hedw.ipp @@ -1,7 +1,10 @@ // license:BSD-3-Clause // copyright-holders:Olivier Galibert +#ifndef MAME_EMU_EMUMEM_HEDW_IPP +#define MAME_EMU_EMUMEM_HEDW_IPP + +#pragma once -#include "emu.h" #include "emumem_mud.h" #include "emumem_hea.h" #include "emumem_heu.h" @@ -168,7 +171,7 @@ template void handl if(cur->is_dispatch()) cur->populate_nomirror(start, end, ostart, oend, handler); else { - auto subdispatch = new handler_entry_write_dispatch(handler_entry::m_space, m_u_ranges[entry], cur); + auto subdispatch = new handler_entry_write_dispatch(this->m_space, m_u_ranges[entry], cur); cur->unref(); m_u_dispatch[entry] = subdispatch; subdispatch->populate_nomirror(start, end, ostart, oend, handler); @@ -235,7 +238,7 @@ template void handl if(cur->is_dispatch()) cur->populate_mirror(start, end, ostart, oend, mirror, handler); else { - auto subdispatch = new handler_entry_write_dispatch(handler_entry::m_space, m_u_ranges[entry], cur); + auto subdispatch = new handler_entry_write_dispatch(this->m_space, m_u_ranges[entry], cur); cur->unref(); m_u_dispatch[entry] = subdispatch; subdispatch->populate_mirror(start, end, ostart, oend, mirror, handler); @@ -287,7 +290,7 @@ template void handl if(original) replacement = new handler_entry_write_units(descriptor, ukey, static_cast *>(original)); else - replacement = new handler_entry_write_units(descriptor, ukey, inh::m_space); + replacement = new handler_entry_write_units(descriptor, ukey, this->m_space); mappings.emplace_back(mapping{ original, replacement, ukey }); } else @@ -302,7 +305,7 @@ template void handl if(cur->is_dispatch()) cur->populate_mismatched_nomirror(start, end, ostart, oend, descriptor, rkey, mappings); else { - auto subdispatch = new handler_entry_write_dispatch(handler_entry::m_space, m_u_ranges[entry], cur); + auto subdispatch = new handler_entry_write_dispatch(this->m_space, m_u_ranges[entry], cur); cur->unref(); m_u_dispatch[entry] = subdispatch; subdispatch->populate_mismatched_nomirror(start, end, ostart, oend, descriptor, rkey, mappings); @@ -374,7 +377,7 @@ template void handl if(cur->is_dispatch()) cur->populate_mismatched_mirror(start, end, ostart, oend, mirror, descriptor, mappings); else { - auto subdispatch = new handler_entry_write_dispatch(handler_entry::m_space, m_u_ranges[entry], cur); + auto subdispatch = new handler_entry_write_dispatch(this->m_space, m_u_ranges[entry], cur); cur->unref(); m_u_dispatch[entry] = subdispatch; subdispatch->populate_mismatched_mirror(start, end, ostart, oend, mirror, descriptor, mappings); @@ -433,7 +436,7 @@ template void handl if(cur->is_dispatch()) cur->populate_passthrough_nomirror(start, end, ostart, oend, handler, mappings); else { - auto subdispatch = new handler_entry_write_dispatch(handler_entry::m_space, m_u_ranges[entry], cur); + auto subdispatch = new handler_entry_write_dispatch(this->m_space, m_u_ranges[entry], cur); cur->unref(); m_u_dispatch[entry] = subdispatch; subdispatch->populate_passthrough_nomirror(start, end, ostart, oend, handler, mappings); @@ -493,7 +496,7 @@ template void handl if(cur->is_dispatch()) cur->populate_passthrough_mirror(start, end, ostart, oend, mirror, handler, mappings); else { - auto subdispatch = new handler_entry_write_dispatch(handler_entry::m_space, m_u_ranges[entry], cur); + auto subdispatch = new handler_entry_write_dispatch(this->m_space, m_u_ranges[entry], cur); cur->unref(); m_u_dispatch[entry] = subdispatch; subdispatch->populate_passthrough_mirror(start, end, ostart, oend, mirror, handler, mappings); @@ -635,3 +638,5 @@ template handler_en return new handler_entry_write_dispatch(this); } + +#endif // MAME_EMU_EMUMEM_HEDW_IPP diff --git a/src/emu/emumem_hem.cpp b/src/emu/emumem_hem.cpp index 4ed00acfa3a..f8cba179d20 100644 --- a/src/emu/emumem_hem.cpp +++ b/src/emu/emumem_hem.cpp @@ -7,44 +7,44 @@ template typename emu::detail::handler_entry_size::uX handler_entry_read_memory::read(offs_t offset, uX mem_mask) const { - return m_base[((offset - inh::m_address_base) & inh::m_address_mask) >> (Width + AddrShift)]; + return m_base[((offset - this->m_address_base) & this->m_address_mask) >> (Width + AddrShift)]; } template void *handler_entry_read_memory::get_ptr(offs_t offset) const { - return m_base + (((offset - inh::m_address_base) & inh::m_address_mask) >> (Width + AddrShift)); + return m_base + (((offset - this->m_address_base) & this->m_address_mask) >> (Width + AddrShift)); } template std::string handler_entry_read_memory::name() const { - return util::string_format("memory@%x", inh::m_address_base); + return util::string_format("memory@%x", this->m_address_base); } template void handler_entry_write_memory::write(offs_t offset, uX data, uX mem_mask) const { - offs_t off = ((offset - inh::m_address_base) & inh::m_address_mask) >> (Width + AddrShift); + offs_t off = ((offset - this->m_address_base) & this->m_address_mask) >> (Width + AddrShift); m_base[off] = (m_base[off] & ~mem_mask) | (data & mem_mask); } template<> void handler_entry_write_memory<0, 0, ENDIANNESS_LITTLE>::write(offs_t offset, u8 data, u8 mem_mask) const { - m_base[(offset - inh::m_address_base) & inh::m_address_mask] = data; + m_base[(offset - this->m_address_base) & this->m_address_mask] = data; } template<> void handler_entry_write_memory<0, 0, ENDIANNESS_BIG>::write(offs_t offset, u8 data, u8 mem_mask) const { - m_base[(offset - inh::m_address_base) & inh::m_address_mask] = data; + m_base[(offset - this->m_address_base) & this->m_address_mask] = data; } template void *handler_entry_write_memory::get_ptr(offs_t offset) const { - return m_base + (((offset - inh::m_address_base) & inh::m_address_mask) >> (Width + AddrShift)); + return m_base + (((offset - this->m_address_base) & this->m_address_mask) >> (Width + AddrShift)); } template std::string handler_entry_write_memory::name() const { - return util::string_format("memory@%x", inh::m_address_base); + return util::string_format("memory@%x", this->m_address_base); } @@ -53,12 +53,12 @@ template std::string handler_entr template typename emu::detail::handler_entry_size::uX handler_entry_read_memory_bank::read(offs_t offset, uX mem_mask) const { - return static_cast(m_bank.base())[((offset - inh::m_address_base) & inh::m_address_mask) >> (Width + AddrShift)]; + return static_cast(m_bank.base())[((offset - this->m_address_base) & this->m_address_mask) >> (Width + AddrShift)]; } template void *handler_entry_read_memory_bank::get_ptr(offs_t offset) const { - return static_cast(m_bank.base()) + (((offset - inh::m_address_base) & inh::m_address_mask) >> (Width + AddrShift)); + return static_cast(m_bank.base()) + (((offset - this->m_address_base) & this->m_address_mask) >> (Width + AddrShift)); } template std::string handler_entry_read_memory_bank::name() const @@ -69,23 +69,23 @@ template std::string handler_entr template void handler_entry_write_memory_bank::write(offs_t offset, uX data, uX mem_mask) const { - offs_t off = ((offset - inh::m_address_base) & inh::m_address_mask) >> (Width + AddrShift); + offs_t off = ((offset - this->m_address_base) & this->m_address_mask) >> (Width + AddrShift); static_cast(m_bank.base())[off] = (static_cast(m_bank.base())[off] & ~mem_mask) | (data & mem_mask); } template<> void handler_entry_write_memory_bank<0, 0, ENDIANNESS_LITTLE>::write(offs_t offset, u8 data, u8 mem_mask) const { - static_cast(m_bank.base())[(offset - inh::m_address_base) & inh::m_address_mask] = data; + static_cast(m_bank.base())[(offset - this->m_address_base) & this->m_address_mask] = data; } template<> void handler_entry_write_memory_bank<0, 0, ENDIANNESS_BIG>::write(offs_t offset, u8 data, u8 mem_mask) const { - static_cast(m_bank.base())[(offset - inh::m_address_base) & inh::m_address_mask] = data; + static_cast(m_bank.base())[(offset - this->m_address_base) & this->m_address_mask] = data; } template void *handler_entry_write_memory_bank::get_ptr(offs_t offset) const { - return static_cast(m_bank.base()) + (((offset - inh::m_address_base) & inh::m_address_mask) >> (Width + AddrShift)); + return static_cast(m_bank.base()) + (((offset - this->m_address_base) & this->m_address_mask) >> (Width + AddrShift)); } template std::string handler_entry_write_memory_bank::name() const diff --git a/src/emu/emumem_hem.h b/src/emu/emumem_hem.h index f3650328854..7b1379b7f9e 100644 --- a/src/emu/emumem_hem.h +++ b/src/emu/emumem_hem.h @@ -1,5 +1,9 @@ // license:BSD-3-Clause // copyright-holders:Olivier Galibert +#ifndef MAME_EMU_EMUMEM_HEM_H +#define MAME_EMU_EMUMEM_HEM_H + +#pragma once // handler_entry_read_memory/handler_entry_write_memory @@ -9,7 +13,6 @@ template class handler_entry_read { public: using uX = typename emu::detail::handler_entry_size::uX; - using inh = handler_entry_read_address; handler_entry_read_memory(address_space *space, void *base) : handler_entry_read_address(space, 0), m_base(reinterpret_cast(base)) {} ~handler_entry_read_memory() = default; @@ -27,7 +30,6 @@ template class handler_entry_writ { public: using uX = typename emu::detail::handler_entry_size::uX; - using inh = handler_entry_write_address; handler_entry_write_memory(address_space *space, void *base) : handler_entry_write_address(space, 0), m_base(reinterpret_cast(base)) {} ~handler_entry_write_memory() = default; @@ -50,7 +52,6 @@ template class handler_entry_read { public: using uX = typename emu::detail::handler_entry_size::uX; - using inh = handler_entry_read_address; handler_entry_read_memory_bank(address_space *space, memory_bank &bank) : handler_entry_read_address(space, 0), m_bank(bank) {} ~handler_entry_read_memory_bank() = default; @@ -68,7 +69,6 @@ template class handler_entry_writ { public: using uX = typename emu::detail::handler_entry_size::uX; - using inh = handler_entry_write_address; handler_entry_write_memory_bank(address_space *space, memory_bank &bank) : handler_entry_write_address(space, 0), m_bank(bank) {} ~handler_entry_write_memory_bank() = default; @@ -81,3 +81,5 @@ public: private: memory_bank &m_bank; }; + +#endif // MAME_EMU_EMUMEM_HEM_H diff --git a/src/emu/emumem_het.cpp b/src/emu/emumem_het.cpp index 0bf8a2e3077..dd49492c85b 100644 --- a/src/emu/emumem_het.cpp +++ b/src/emu/emumem_het.cpp @@ -9,7 +9,7 @@ template typename emu::detail::ha { this->ref(); - uX data = inh::m_next->read(offset, mem_mask); + uX data = this->m_next->read(offset, mem_mask); m_tap(offset, data, mem_mask); this->unref(); @@ -18,12 +18,12 @@ template typename emu::detail::ha template std::string handler_entry_read_tap::name() const { - return '(' + m_name + ") " + inh::m_next->name(); + return '(' + m_name + ") " + this->m_next->name(); } template handler_entry_read_tap *handler_entry_read_tap::instantiate(handler_entry_read *next) const { - return new handler_entry_read_tap(inh::m_space, inh::m_mph, next, m_name, m_tap); + return new handler_entry_read_tap(this->m_space, this->m_mph, next, m_name, m_tap); } @@ -32,20 +32,20 @@ template void handler_entry_write this->ref(); m_tap(offset, data, mem_mask); - inh::m_next->write(offset, data, mem_mask); + this->m_next->write(offset, data, mem_mask); this->unref(); } template std::string handler_entry_write_tap::name() const { - return '(' + m_name + ") " + inh::m_next->name(); + return '(' + m_name + ") " + this->m_next->name(); } template handler_entry_write_tap *handler_entry_write_tap::instantiate(handler_entry_write *next) const { - return new handler_entry_write_tap(inh::m_space, inh::m_mph, next, m_name, m_tap); + return new handler_entry_write_tap(this->m_space, this->m_mph, next, m_name, m_tap); } diff --git a/src/emu/emumem_het.h b/src/emu/emumem_het.h index 2e788108896..1c7ca565485 100644 --- a/src/emu/emumem_het.h +++ b/src/emu/emumem_het.h @@ -1,5 +1,9 @@ // license:BSD-3-Clause // copyright-holders:Olivier Galibert +#ifndef MAME_EMU_EMUMEM_HET_H +#define MAME_EMU_EMUMEM_HET_H + +#pragma once // handler_entry_read_tap/handler_entry_write_tap @@ -9,7 +13,6 @@ template class handler_entry_read { public: using uX = typename emu::detail::handler_entry_size::uX; - using inh = handler_entry_read_passthrough; handler_entry_read_tap(address_space *space, memory_passthrough_handler &mph, std::string name, std::function tap) : handler_entry_read_passthrough(space, mph), m_name(name), m_tap(std::move(tap)) {} ~handler_entry_read_tap() = default; @@ -31,7 +34,6 @@ template class handler_entry_writ { public: using uX = typename emu::detail::handler_entry_size::uX; - using inh = handler_entry_write_passthrough; handler_entry_write_tap(address_space *space, memory_passthrough_handler &mph, std::string name, std::function tap) : handler_entry_write_passthrough(space, mph), m_name(name), m_tap(std::move(tap)) {} ~handler_entry_write_tap() = default; @@ -48,3 +50,5 @@ protected: handler_entry_write_tap(address_space *space, memory_passthrough_handler &mph, handler_entry_write *next, std::string name, std::function tap) : handler_entry_write_passthrough(space, mph, next), m_name(name), m_tap(tap) {} }; + +#endif // MAME_EMU_EMUMEM_HET_H diff --git a/src/emu/emumem_heu.cpp b/src/emu/emumem_heu.cpp index aba5a28f9c2..ac61986650b 100644 --- a/src/emu/emumem_heu.cpp +++ b/src/emu/emumem_heu.cpp @@ -8,7 +8,7 @@ template handler_entry_read_units::handler_entry_read_units(const memory_units_descriptor &descriptor, u8 ukey, address_space *space) : - handler_entry_read(space, inh::F_UNITS), + handler_entry_read(space, handler_entry_read_units::F_UNITS), m_subunits(0) { const auto &entries = descriptor.get_entries_for_key(ukey); @@ -17,7 +17,7 @@ template handler_entry_read_units } template handler_entry_read_units::handler_entry_read_units(const memory_units_descriptor &descriptor, u8 ukey, const handler_entry_read_units *src) : - handler_entry_read(src->m_space, inh::F_UNITS), + handler_entry_read(src->m_space, handler_entry_read_units::F_UNITS), m_subunits(0) { uX fullmask = 0; @@ -37,7 +37,7 @@ template handler_entry_read_units } template handler_entry_read_units::handler_entry_read_units(const handler_entry_read_units *src) : - handler_entry_read(src->m_space, inh::F_UNITS), + handler_entry_read(src->m_space, handler_entry_read_units::F_UNITS), m_subunits(src->m_subunits) { for(u32 i=0; i != src->m_subunits; i++) { @@ -69,7 +69,7 @@ template void handler_entry_read_ handler->ref(entries.size()); for(const auto &e : entries) m_subunit_infos[m_subunits++] = subunit_info{ handler, e.m_amask, e.m_dmask, e.m_ashift, e.m_offset, e.m_dshift, descriptor.get_subunit_width(), descriptor.get_subunit_endian() }; - m_unmap = inh::m_space->unmap(); + m_unmap = this->m_space->unmap(); for(int i = 0; i < m_subunits; i++) m_unmap &= ~m_subunit_infos[i].m_dmask; } @@ -142,7 +142,7 @@ template std::string handler_entr template handler_entry_write_units::handler_entry_write_units(const memory_units_descriptor &descriptor, u8 ukey, address_space *space) : - handler_entry_write(space, inh::F_UNITS), + handler_entry_write(space, handler_entry_write_units::F_UNITS), m_subunits(0) { const auto &entries = descriptor.get_entries_for_key(ukey); @@ -151,7 +151,7 @@ template handler_entry_write_unit } template handler_entry_write_units::handler_entry_write_units(const memory_units_descriptor &descriptor, u8 ukey, const handler_entry_write_units *src) : - handler_entry_write(src->m_space, inh::F_UNITS), + handler_entry_write(src->m_space, handler_entry_write_units::F_UNITS), m_subunits(0) { uX fullmask = 0; @@ -171,7 +171,7 @@ template handler_entry_write_unit } template handler_entry_write_units::handler_entry_write_units(const handler_entry_write_units *src) : - handler_entry_write(src->m_space, inh::F_UNITS), + handler_entry_write(src->m_space, handler_entry_write_units::F_UNITS), m_subunits(src->m_subunits) { for(u32 i=0; i != src->m_subunits; i++) { diff --git a/src/emu/emumem_heu.h b/src/emu/emumem_heu.h index 670d489d00a..8814f4119a1 100644 --- a/src/emu/emumem_heu.h +++ b/src/emu/emumem_heu.h @@ -1,5 +1,9 @@ // license:BSD-3-Clause // copyright-holders:Olivier Galibert +#ifndef MAME_EMU_EMUMEM_HEU_H +#define MAME_EMU_EMUMEM_HEU_H + +#pragma once // handler_entry_read_units/handler_entry_write_units @@ -9,7 +13,6 @@ template class handler_entry_read { public: using uX = typename emu::detail::handler_entry_size::uX; - using inh = handler_entry_read; handler_entry_read_units(const memory_units_descriptor &descriptor, u8 ukey, address_space *space); handler_entry_read_units(const memory_units_descriptor &descriptor, u8 ukey, const handler_entry_read_units *src); @@ -52,7 +55,6 @@ template class handler_entry_writ { public: using uX = typename emu::detail::handler_entry_size::uX; - using inh = handler_entry_write; handler_entry_write_units(const memory_units_descriptor &descriptor, u8 ukey, address_space *space); handler_entry_write_units(const memory_units_descriptor &descriptor, u8 ukey, const handler_entry_write_units *src); @@ -90,3 +92,4 @@ private: static std::string m2r(uX mask); }; +#endif // MAME_EMU_EMUMEM_HEU_H diff --git a/src/emu/emumem_heun.cpp b/src/emu/emumem_heun.cpp index 0248f0f5a98..2fcbdebfa1b 100644 --- a/src/emu/emumem_heun.cpp +++ b/src/emu/emumem_heun.cpp @@ -7,14 +7,14 @@ template typename emu::detail::handler_entry_size::uX handler_entry_read_unmapped::read(offs_t offset, uX mem_mask) const { - if (inh::m_space->log_unmap() && !inh::m_space->m_manager.machine().side_effects_disabled()) - inh::m_space->device().logerror(inh::m_space->is_octal() + if (this->m_space->log_unmap() && !this->m_space->m_manager.machine().side_effects_disabled()) + this->m_space->device().logerror(this->m_space->is_octal() ? "%s: unmapped %s memory read from %0*o & %0*o\n" : "%s: unmapped %s memory read from %0*X & %0*X\n", - inh::m_space->m_manager.machine().describe_context(), inh::m_space->name(), - inh::m_space->addrchars(), offset, + this->m_space->m_manager.machine().describe_context(), this->m_space->name(), + this->m_space->addrchars(), offset, 2 << Width, mem_mask); - return inh::m_space->unmap(); + return this->m_space->unmap(); } template std::string handler_entry_read_unmapped::name() const @@ -25,12 +25,12 @@ template std::string handler_entr template void handler_entry_write_unmapped::write(offs_t offset, uX data, uX mem_mask)const { - if (inh::m_space->log_unmap() && !inh::m_space->m_manager.machine().side_effects_disabled()) - inh::m_space->device().logerror(inh::m_space->is_octal() + if (this->m_space->log_unmap() && !this->m_space->m_manager.machine().side_effects_disabled()) + this->m_space->device().logerror(this->m_space->is_octal() ? "%s: unmapped %s memory write to %0*o = %0*o & %0*o\n" : "%s: unmapped %s memory write to %0*X = %0*X & %0*X\n", - inh::m_space->m_manager.machine().describe_context(), inh::m_space->name(), - inh::m_space->addrchars(), offset, + this->m_space->m_manager.machine().describe_context(), this->m_space->name(), + this->m_space->addrchars(), offset, 2 << Width, data, 2 << Width, mem_mask); } @@ -45,7 +45,7 @@ template std::string handler_entr template typename emu::detail::handler_entry_size::uX handler_entry_read_nop::read(offs_t offset, uX mem_mask) const { - return inh::m_space->unmap(); + return this->m_space->unmap(); } template std::string handler_entry_read_nop::name() const diff --git a/src/emu/emumem_heun.h b/src/emu/emumem_heun.h index 4e76e4cb531..1e1d0fb4ab3 100644 --- a/src/emu/emumem_heun.h +++ b/src/emu/emumem_heun.h @@ -1,5 +1,9 @@ // license:BSD-3-Clause // copyright-holders:Olivier Galibert +#ifndef MAME_EMU_EMUMEM_HEUN_H +#define MAME_EMU_EMUMEM_HEUN_H + +#pragma once // handler_entry_read_unmapped/handler_entry_write_unmapped @@ -9,7 +13,6 @@ template class handler_entry_read { public: using uX = typename emu::detail::handler_entry_size::uX; - using inh = handler_entry_read; handler_entry_read_unmapped(address_space *space) : handler_entry_read(space, 0) {} ~handler_entry_read_unmapped() = default; @@ -23,7 +26,6 @@ template class handler_entry_writ { public: using uX = typename emu::detail::handler_entry_size::uX; - using inh = handler_entry_write; handler_entry_write_unmapped(address_space *space) : handler_entry_write(space, 0) {} ~handler_entry_write_unmapped() = default; @@ -43,7 +45,6 @@ template class handler_entry_read { public: using uX = typename emu::detail::handler_entry_size::uX; - using inh = handler_entry_read; handler_entry_read_nop(address_space *space) : handler_entry_read(space, 0) {} ~handler_entry_read_nop() = default; @@ -57,7 +58,6 @@ template class handler_entry_writ { public: using uX = typename emu::detail::handler_entry_size::uX; - using inh = handler_entry_write; handler_entry_write_nop(address_space *space) : handler_entry_write(space, 0) {} ~handler_entry_write_nop() = default; @@ -66,3 +66,5 @@ public: std::string name() const override; }; + +#endif // MAME_EMU_EMUMEM_HEUN_H