Skip to content

Commit 92be6f5

Browse files
author
Adam
committed
- copy m_latched_map_control => m_map_control on every user access
1 parent b7d57e7 commit 92be6f5

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/mame/tektronix/tek440x.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -766,12 +766,11 @@ u16 tek440x_state::memory_r(offs_t offset, u16 mem_mask)
766766
{
767767
if ((m_maincpu->get_fc() & 4) == 0) // User mode access updates map_control from write latch
768768
{
769-
// NB need to apply once only as m_map_control gets modified
770-
if (m_latched_map_control && m_latched_map_control != m_map_control)
769+
if (m_latched_map_control != (m_map_control & 0x3f))
771770
{
772-
LOG("memory_r: m_map_control updated\n");
773-
m_map_control = m_latched_map_control;
774-
m_latched_map_control = 0;
771+
LOG("memory_r: m_map_control updated 0x%04x\n", m_latched_map_control);
772+
m_map_control &= ~0x3f;
773+
m_map_control |= m_latched_map_control;
775774
}
776775
}
777776

@@ -834,11 +833,11 @@ void tek440x_state::memory_w(offs_t offset, u16 data, u16 mem_mask)
834833
{
835834
if ((m_maincpu->get_fc() & 4) == 0) // User mode access updates map_control from write latch
836835
{
837-
if (m_latched_map_control && m_latched_map_control != m_map_control)
836+
if (m_latched_map_control != (m_map_control & 0x3f))
838837
{
839-
LOG("memory_w: m_map_control updated\n");
840-
m_map_control = m_latched_map_control;
841-
m_latched_map_control = 0;
838+
LOG("memory_w: m_map_control updated 0x%04x\n", m_latched_map_control);
839+
m_map_control &= ~0x3f;
840+
m_map_control |= m_latched_map_control;
842841
}
843842
}
844843

@@ -943,7 +942,8 @@ void tek440x_state::map_w(offs_t offset, u16 data, u16 mem_mask)
943942
m_maincpu->pc());
944943
}
945944

946-
if (BIT(m_map_control, MAP_SYS_WR_ENABLE))
945+
// NB page 2.1-52 shows WrMapEn coming from latch
946+
if (BIT(m_latched_map_control, MAP_SYS_WR_ENABLE))
947947
{
948948
COMBINE_DATA(&m_map[(offset >> 11) & 0x7ff]);
949949
}
@@ -979,7 +979,7 @@ void tek440x_state::mapcntl_w(u8 data)
979979
// copied on user mode read/write
980980
m_latched_map_control = data & 0x3f;
981981

982-
if (m_map_control != (data & 0x3f))
982+
if (m_map_control != m_latched_map_control)
983983
{
984984
LOGMASKED(LOG_MMU, "mapcntl_w(%02x) cpuWr(%d) BlockAccess(%d) SysWrEn(%d) PID(%d) pc(%08x)\n",m_latched_map_control,
985985
BIT(m_latched_map_control, MAP_CPU_WR) ? 1 : 0,

0 commit comments

Comments
 (0)