From 1fe589ca1e65e94bc51a6dd694f21182ae4801cf Mon Sep 17 00:00:00 2001 From: AJR Date: Fri, 26 Aug 2016 22:21:47 -0400 Subject: Show color values in palette viewer - On the UI graphics viewer's palette screen, moving the mouse over a color rectangle will show the index of the entry and its RGB values in hexadecimal. - For indirect pens, the index of the corresponding color will also be shown. - For colors in normal RAM-based palettes, the raw (i.e. undecoded) value stored in memory will also be shown. This does not currently work with most buffered palettes (though the Seibu SPI driver has been updated for this purpose), and is totally incompatible with PROM-based or RAMDAC-based palettes. (nw) The changes made to the core while implementing this feature may look more substantial than they really are. A whole batch of read methods have been made const, and palette_device now has a generic read_entry function that is used both internally and externally. --- src/emu/memarray.cpp | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'src/emu/memarray.cpp') diff --git a/src/emu/memarray.cpp b/src/emu/memarray.cpp index 03161f000bf..98a5c7c33ef 100644 --- a/src/emu/memarray.cpp +++ b/src/emu/memarray.cpp @@ -125,22 +125,22 @@ void memory_array::set_endianness(endianness_t endianness) // heleprs for 1 byte-per-entry //------------------------------------------------- -UINT32 memory_array::read8_from_8(int index) { return reinterpret_cast(m_base)[index]; } +UINT32 memory_array::read8_from_8(int index) const { return reinterpret_cast(m_base)[index]; } void memory_array::write8_to_8(int index, UINT32 data) { reinterpret_cast(m_base)[index] = data; } -UINT32 memory_array::read8_from_16le(int index) { return reinterpret_cast(m_base)[BYTE_XOR_LE(index)]; } +UINT32 memory_array::read8_from_16le(int index) const { return reinterpret_cast(m_base)[BYTE_XOR_LE(index)]; } void memory_array::write8_to_16le(int index, UINT32 data) { reinterpret_cast(m_base)[BYTE_XOR_LE(index)] = data; } -UINT32 memory_array::read8_from_16be(int index) { return reinterpret_cast(m_base)[BYTE_XOR_BE(index)]; } +UINT32 memory_array::read8_from_16be(int index) const { return reinterpret_cast(m_base)[BYTE_XOR_BE(index)]; } void memory_array::write8_to_16be(int index, UINT32 data) { reinterpret_cast(m_base)[BYTE_XOR_BE(index)] = data; } -UINT32 memory_array::read8_from_32le(int index) { return reinterpret_cast(m_base)[BYTE4_XOR_LE(index)]; } +UINT32 memory_array::read8_from_32le(int index) const { return reinterpret_cast(m_base)[BYTE4_XOR_LE(index)]; } void memory_array::write8_to_32le(int index, UINT32 data) { reinterpret_cast(m_base)[BYTE4_XOR_LE(index)] = data; } -UINT32 memory_array::read8_from_32be(int index) { return reinterpret_cast(m_base)[BYTE4_XOR_BE(index)]; } +UINT32 memory_array::read8_from_32be(int index) const { return reinterpret_cast(m_base)[BYTE4_XOR_BE(index)]; } void memory_array::write8_to_32be(int index, UINT32 data) { reinterpret_cast(m_base)[BYTE4_XOR_BE(index)] = data; } -UINT32 memory_array::read8_from_64le(int index) { return reinterpret_cast(m_base)[BYTE8_XOR_BE(index)]; } +UINT32 memory_array::read8_from_64le(int index) const { return reinterpret_cast(m_base)[BYTE8_XOR_BE(index)]; } void memory_array::write8_to_64le(int index, UINT32 data) { reinterpret_cast(m_base)[BYTE8_XOR_BE(index)] = data; } -UINT32 memory_array::read8_from_64be(int index) { return reinterpret_cast(m_base)[BYTE8_XOR_BE(index)]; } +UINT32 memory_array::read8_from_64be(int index) const { return reinterpret_cast(m_base)[BYTE8_XOR_BE(index)]; } void memory_array::write8_to_64be(int index, UINT32 data) { reinterpret_cast(m_base)[BYTE8_XOR_BE(index)] = data; } @@ -149,22 +149,22 @@ void memory_array::write8_to_64be(int index, UINT32 data) { reinterpret_cast> 8); } -UINT32 memory_array::read16_from_8be(int index) { return (read8_from_8(index*2) << 8) | read8_from_8(index*2+1); } +UINT32 memory_array::read16_from_8be(int index) const { return (read8_from_8(index*2) << 8) | read8_from_8(index*2+1); } void memory_array::write16_to_8be(int index, UINT32 data) { write8_to_8(index*2, data >> 8); write8_to_8(index*2+1, data); } -UINT32 memory_array::read16_from_16(int index) { return reinterpret_cast(m_base)[index]; } +UINT32 memory_array::read16_from_16(int index) const { return reinterpret_cast(m_base)[index]; } void memory_array::write16_to_16(int index, UINT32 data) { reinterpret_cast(m_base)[index] = data; } -UINT32 memory_array::read16_from_32le(int index) { return reinterpret_cast(m_base)[BYTE_XOR_LE(index)]; } +UINT32 memory_array::read16_from_32le(int index) const { return reinterpret_cast(m_base)[BYTE_XOR_LE(index)]; } void memory_array::write16_to_32le(int index, UINT32 data) { reinterpret_cast(m_base)[BYTE_XOR_LE(index)] = data; } -UINT32 memory_array::read16_from_32be(int index) { return reinterpret_cast(m_base)[BYTE_XOR_BE(index)]; } +UINT32 memory_array::read16_from_32be(int index) const { return reinterpret_cast(m_base)[BYTE_XOR_BE(index)]; } void memory_array::write16_to_32be(int index, UINT32 data) { reinterpret_cast(m_base)[BYTE_XOR_BE(index)] = data; } -UINT32 memory_array::read16_from_64le(int index) { return reinterpret_cast(m_base)[BYTE4_XOR_LE(index)]; } +UINT32 memory_array::read16_from_64le(int index) const { return reinterpret_cast(m_base)[BYTE4_XOR_LE(index)]; } void memory_array::write16_to_64le(int index, UINT32 data) { reinterpret_cast(m_base)[BYTE4_XOR_LE(index)] = data; } -UINT32 memory_array::read16_from_64be(int index) { return reinterpret_cast(m_base)[BYTE4_XOR_BE(index)]; } +UINT32 memory_array::read16_from_64be(int index) const { return reinterpret_cast(m_base)[BYTE4_XOR_BE(index)]; } void memory_array::write16_to_64be(int index, UINT32 data) { reinterpret_cast(m_base)[BYTE4_XOR_BE(index)] = data; } @@ -173,20 +173,20 @@ void memory_array::write16_to_64be(int index, UINT32 data) { reinterpret_cast> 16); } -UINT32 memory_array::read32_from_8be(int index) { return (read16_from_8be(index*2) << 16) | read16_from_8be(index*2+1); } +UINT32 memory_array::read32_from_8be(int index) const { return (read16_from_8be(index*2) << 16) | read16_from_8be(index*2+1); } void memory_array::write32_to_8be(int index, UINT32 data) { write16_to_8be(index*2, data >> 16); write16_to_8be(index*2+1, data); } -UINT32 memory_array::read32_from_16le(int index) { return read16_from_16(index*2) | (read16_from_16(index*2+1) << 16); } +UINT32 memory_array::read32_from_16le(int index) const { return read16_from_16(index*2) | (read16_from_16(index*2+1) << 16); } void memory_array::write32_to_16le(int index, UINT32 data) { write16_to_16(index*2, data); write16_to_16(index*2+1, data >> 16); } -UINT32 memory_array::read32_from_16be(int index) { return (read16_from_16(index*2) << 16) | read16_from_16(index*2+1); } +UINT32 memory_array::read32_from_16be(int index) const { return (read16_from_16(index*2) << 16) | read16_from_16(index*2+1); } void memory_array::write32_to_16be(int index, UINT32 data) { write16_to_16(index*2, data >> 16); write16_to_16(index*2+1, data); } -UINT32 memory_array::read32_from_32(int index) { return reinterpret_cast(m_base)[index]; } +UINT32 memory_array::read32_from_32(int index) const { return reinterpret_cast(m_base)[index]; } void memory_array::write32_to_32(int index, UINT32 data) { reinterpret_cast(m_base)[index] = data; } -UINT32 memory_array::read32_from_64le(int index) { return reinterpret_cast(m_base)[BYTE_XOR_LE(index)]; } +UINT32 memory_array::read32_from_64le(int index) const { return reinterpret_cast(m_base)[BYTE_XOR_LE(index)]; } void memory_array::write32_to_64le(int index, UINT32 data) { reinterpret_cast(m_base)[BYTE_XOR_LE(index)] = data; } -UINT32 memory_array::read32_from_64be(int index) { return reinterpret_cast(m_base)[BYTE_XOR_BE(index)]; } +UINT32 memory_array::read32_from_64be(int index) const { return reinterpret_cast(m_base)[BYTE_XOR_BE(index)]; } void memory_array::write32_to_64be(int index, UINT32 data) { reinterpret_cast(m_base)[BYTE_XOR_BE(index)] = data; } -- cgit v1.2.3-70-g09d2