diff --git a/src/emu/emumem_het.cpp b/src/emu/emumem_het.cpp index 87f3d35dc10..571b8246eac 100644 --- a/src/emu/emumem_het.cpp +++ b/src/emu/emumem_het.cpp @@ -7,8 +7,12 @@ template typename emu::detail::handler_entry_size::uX handler_entry_read_tap::read(offs_t offset, uX mem_mask) { + this->ref(); + uX data = inh::m_next->read(offset, mem_mask); m_tap(offset, data, mem_mask); + + this->unref(); return data; } @@ -25,8 +29,12 @@ template handler_entry_read_tap void handler_entry_write_tap::write(offs_t offset, uX data, uX mem_mask) { + this->ref(); + m_tap(offset, data, mem_mask); inh::m_next->write(offset, data, mem_mask); + + this->unref(); } template std::string handler_entry_write_tap::name() const diff --git a/src/emu/emumem_heu.cpp b/src/emu/emumem_heu.cpp index 51a51a70d6d..7000f77dc25 100644 --- a/src/emu/emumem_heu.cpp +++ b/src/emu/emumem_heu.cpp @@ -62,7 +62,7 @@ template void handler_entry_read_units typename emu::detail::handler_entry_size::uX handler_entry_read_units::read(offs_t offset, uX mem_mask) { - ref(); + this->ref(); uX result = m_unmap; for (int index = 0; index < m_subunits; index++) { @@ -94,7 +94,7 @@ template typename emu::detail::handler_ent } } - unref(); + this->unref(); return result; } @@ -177,7 +177,7 @@ template void handler_entry_write_units void handler_entry_write_units::write(offs_t offset, uX data, uX mem_mask) { - ref(); + this->ref(); for (int index = 0; index < m_subunits; index++) { const subunit_info &si = m_subunit_infos[index]; @@ -208,7 +208,7 @@ template void handler_entry_write_unitsunref(); }