diff options
author | Olivier Galibert <galibert@pobox.com> | 2020-11-26 11:54:51 +0100 |
---|---|---|
committer | Olivier Galibert <galibert@pobox.com> | 2020-11-26 11:55:00 +0100 |
commit | 3c01a994980484965664e6c3015a6abe6fa763da (patch) | |
tree | 08054796324f893431d8004afe8b11e220435fa3 | |
parent | 09cf3c635aa05decca5453514723682a389785fc (diff) |
views: Fix recursion on dup and lookup, reintroduce the correct tim100 view use, fix #7516
-rw-r--r-- | src/emu/emumem_aspace.cpp | 2 | ||||
-rw-r--r-- | src/emu/emumem_hedr.ipp | 2 | ||||
-rw-r--r-- | src/emu/emumem_hedw.ipp | 6 | ||||
-rw-r--r-- | src/mame/drivers/tim100.cpp | 10 |
4 files changed, 7 insertions, 13 deletions
diff --git a/src/emu/emumem_aspace.cpp b/src/emu/emumem_aspace.cpp index f9029b9422f..8140d7cc560 100644 --- a/src/emu/emumem_aspace.cpp +++ b/src/emu/emumem_aspace.cpp @@ -42,7 +42,7 @@ template <typename Format, typename... Params> static void VPRINTF(Format &&fmt, template <typename Format, typename... Params> static void VPRINTF(Format &&, Params &&...) {} #endif -#define VALIDATE_REFCOUNTS 0 +#define VALIDATE_REFCOUNTS 1 //************************************************************************** // CONSTANTS diff --git a/src/emu/emumem_hedr.ipp b/src/emu/emumem_hedr.ipp index bdb1f971703..7c2818dc7c6 100644 --- a/src/emu/emumem_hedr.ipp +++ b/src/emu/emumem_hedr.ipp @@ -46,7 +46,7 @@ template<int HighBits, int Width, int AddrShift, endianness_t Endian> handler_en m_u_dispatch = m_dispatch_array[0].data(); for(unsigned int i=0; i != COUNT; i++) { - m_u_dispatch[i] = src->m_u_dispatch[i]; + m_u_dispatch[i] = src->m_u_dispatch[i]->dup(); m_u_ranges[i] = src->m_u_ranges[i]; } } diff --git a/src/emu/emumem_hedw.ipp b/src/emu/emumem_hedw.ipp index b59a17b8f79..fba9ae3e210 100644 --- a/src/emu/emumem_hedw.ipp +++ b/src/emu/emumem_hedw.ipp @@ -48,7 +48,7 @@ template<int HighBits, int Width, int AddrShift, endianness_t Endian> handler_en m_u_dispatch = m_dispatch_array[0].data(); for(unsigned int i=0; i != COUNT; i++) { - m_u_dispatch[i] = src->m_u_dispatch[i]; + m_u_dispatch[i] = src->m_u_dispatch[i]->dup(); m_u_ranges[i] = src->m_u_ranges[i]; } } @@ -120,14 +120,14 @@ template<int HighBits, int Width, int AddrShift, endianness_t Endian> void *hand template<int HighBits, int Width, int AddrShift, endianness_t Endian> std::string handler_entry_write_dispatch<HighBits, Width, AddrShift, Endian>::name() const { - return m_view ? "view" :"dispatch"; + return m_view ? "view" :"dispatch"; } template<int HighBits, int Width, int AddrShift, endianness_t Endian> void handler_entry_write_dispatch<HighBits, Width, AddrShift, Endian>::lookup(offs_t address, offs_t &start, offs_t &end, handler_entry_write<Width, AddrShift, Endian> *&handler) const { offs_t slot = (address >> LowBits) & BITMASK; auto h = m_a_dispatch[slot]; - if(h->is_dispatch()) + if(h->is_dispatch() || h->is_view()) h->lookup(address, start, end, handler); else { start = m_a_ranges[slot].start; diff --git a/src/mame/drivers/tim100.cpp b/src/mame/drivers/tim100.cpp index 198a7085537..c51441df698 100644 --- a/src/mame/drivers/tim100.cpp +++ b/src/mame/drivers/tim100.cpp @@ -80,16 +80,10 @@ void tim100_state::mem_map(address_map &map) void tim100_state::mem_xfer_map(address_map &map) { - // FIXME: this should be a single-entry view layered over mem_map map.unmap_value_high(); + mem_map(map); map(0x0000, 0xffff).view(m_dma_view); m_dma_view[0](0x0000, 0xffff).r(FUNC(tim100_state::dma_r)); - m_dma_view[1](0x0000, 0x1fff).rom().region("maincpu", 0); // 2764 at U16 - m_dma_view[1](0x2000, 0x27ff).ram().share("videoram"); // 2KB static ram CDM6116A at U15 - m_dma_view[1](0x6000, 0x6001).rw("uart_u17", FUNC(i8251_device::read), FUNC(i8251_device::write)); - m_dma_view[1](0x8000, 0x8001).rw("uart_u18", FUNC(i8251_device::read), FUNC(i8251_device::write)); - m_dma_view[1](0xa000, 0xa000).nopw(); // continuously writes 00 here - m_dma_view[1](0xc000, 0xc001).rw(m_crtc, FUNC(i8276_device::read), FUNC(i8276_device::write)); // i8276 } @@ -172,7 +166,7 @@ WRITE_LINE_MEMBER( tim100_state::sod_w ) if (state) m_dma_view.select(0); else - m_dma_view.select(1); + m_dma_view.disable(); } |