Fix debugger memory view editing for address-shifted spaces

This commit is contained in:
AJR 2018-09-24 14:39:16 -04:00
parent 3e94624a08
commit dd0b82a670

View File

@ -464,14 +464,16 @@ void debug_view_memory::view_char(int chval)
if (hexchar == nullptr)
break;
const debug_view_memory_source &source = downcast<const debug_view_memory_source &>(*m_source);
offs_t address = (source.m_space != nullptr) ? source.m_space->byte_to_address(pos.m_address) : pos.m_address;
u64 data;
bool ismapped = read(m_bytes_per_chunk, pos.m_address, data);
bool ismapped = read(m_bytes_per_chunk, address, data);
if (!ismapped)
break;
data &= ~(u64(0x0f) << pos.m_shift);
data |= u64(hexchar - hexvals) << pos.m_shift;
write(m_bytes_per_chunk, pos.m_address, data);
write(m_bytes_per_chunk, address, data);
// fall through to the right-arrow press
}