mirror of
https://github.com/holub/mame
synced 2025-04-23 00:39:36 +03:00
views: Fix recursion on dup and lookup, reintroduce the correct tim100 view use, fix #7516
This commit is contained in:
parent
09cf3c635a
commit
3c01a99498
@ -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
|
||||
|
@ -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];
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user