diff options
Diffstat (limited to 'src/emu/divtlb.cpp')
-rw-r--r-- | src/emu/divtlb.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/emu/divtlb.cpp b/src/emu/divtlb.cpp index d6cc8b34e21..c227147cad9 100644 --- a/src/emu/divtlb.cpp +++ b/src/emu/divtlb.cpp @@ -179,10 +179,16 @@ bool device_vtlb_interface::vtlb_fill(offs_t address, int intention) { int liveindex = m_dynindex++ % m_dynamic; + // if an entry already exists at this index, free it - if (m_live[liveindex] != 0 && m_refcnt[m_live[liveindex] - 1] <= 1) - m_table[m_live[liveindex] - 1] = 0; - m_refcnt[m_live[liveindex] - 1]--; + if (m_live[liveindex] != 0) + { + if (m_refcnt[m_live[liveindex] - 1] <= 1) + m_table[m_live[liveindex] - 1] = 0; + else + m_refcnt[m_live[liveindex] - 1]--; + } + // claim this new entry m_live[liveindex] = tableindex + 1; |