diff options
author | 2016-10-22 13:13:17 +0200 | |
---|---|---|
committer | 2016-10-22 13:13:17 +0200 | |
commit | ddb290d5f615019c33c42b8d94e5a5254cabcf33 (patch) | |
tree | a70f688b0df3acd19da7b1151e5902e3c6af3fa5 /src/emu/memarray.h | |
parent | 333bff8de64dfaeb98134000412796b4fdef970b (diff) |
NOTICE (TYPE NAME CONSOLIDATION)
Use standard uint64_t, uint32_t, uint16_t or uint8_t instead of UINT64, UINT32, UINT16 or UINT8
also use standard int64_t, int32_t, int16_t or int8_t instead of INT64, INT32, INT16 or INT8
Diffstat (limited to 'src/emu/memarray.h')
-rw-r--r-- | src/emu/memarray.h | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/src/emu/memarray.h b/src/emu/memarray.h index 24e60c0d45d..fc6556b5389 100644 --- a/src/emu/memarray.h +++ b/src/emu/memarray.h @@ -44,16 +44,16 @@ class memory_array public: // construction/destruction memory_array(); - memory_array(void *base, UINT32 bytes, int membits, endianness_t endianness, int bpe) { set(base, bytes, membits, endianness, bpe); } + memory_array(void *base, uint32_t bytes, int membits, endianness_t endianness, int bpe) { set(base, bytes, membits, endianness, bpe); } template <typename _Type> memory_array(std::vector<_Type> &array, endianness_t endianness, int bpe) { set(array, endianness, bpe); } - memory_array(const address_space &space, void *base, UINT32 bytes, int bpe) { set(space, base, bytes, bpe); } + memory_array(const address_space &space, void *base, uint32_t bytes, int bpe) { set(space, base, bytes, bpe); } memory_array(const memory_share &share, int bpe) { set(share, bpe); } memory_array(const memory_array &array) { set(array); } // configuration - void set(void *base, UINT32 bytes, int membits, endianness_t endianness, int bpe); + void set(void *base, uint32_t bytes, int membits, endianness_t endianness, int bpe); template <typename _Type> void set(std::vector<_Type> &array, endianness_t endianness, int bpe) { set(&array[0], array.size(), 8*sizeof(_Type), endianness, bpe); } - void set(const address_space &space, void *base, UINT32 bytes, int bpe); + void set(const address_space &space, void *base, uint32_t bytes, int bpe); void set(const memory_share &share, int bpe); void set(const memory_array &array); @@ -63,61 +63,61 @@ public: // getters void *base() const { return m_base; } - UINT32 bytes() const { return m_bytes; } + uint32_t bytes() const { return m_bytes; } int membits() const { return m_membits; } endianness_t endianness() const { return m_endianness; } int bytes_per_entry() const { return m_bytes_per_entry; } // entry-level readers and writers - UINT32 read(int index) const { return (this->*m_read_entry)(index); } - void write(int index, UINT32 data) { (this->*m_write_entry)(index, data); } + uint32_t read(int index) const { return (this->*m_read_entry)(index); } + void write(int index, uint32_t data) { (this->*m_write_entry)(index, data); } // byte/word/dword-level readers and writers - UINT8 read8(offs_t offset) const { return reinterpret_cast<UINT8 *>(m_base)[offset]; } - UINT16 read16(offs_t offset) const { return reinterpret_cast<UINT16 *>(m_base)[offset]; } - UINT32 read32(offs_t offset) const { return reinterpret_cast<UINT32 *>(m_base)[offset]; } - UINT64 read64(offs_t offset) const { return reinterpret_cast<UINT64 *>(m_base)[offset]; } - void write8(offs_t offset, UINT8 data) { reinterpret_cast<UINT8 *>(m_base)[offset] = data; } - void write16(offs_t offset, UINT16 data, UINT16 mem_mask = 0xffff) { COMBINE_DATA(&reinterpret_cast<UINT16 *>(m_base)[offset]); } - void write32(offs_t offset, UINT32 data, UINT32 mem_mask = 0xffffffff) { COMBINE_DATA(&reinterpret_cast<UINT32 *>(m_base)[offset]); } - void write64(offs_t offset, UINT64 data, UINT64 mem_mask = U64(0xffffffffffffffff)) { COMBINE_DATA(&reinterpret_cast<UINT64 *>(m_base)[offset]); } + uint8_t read8(offs_t offset) const { return reinterpret_cast<uint8_t *>(m_base)[offset]; } + uint16_t read16(offs_t offset) const { return reinterpret_cast<uint16_t *>(m_base)[offset]; } + uint32_t read32(offs_t offset) const { return reinterpret_cast<uint32_t *>(m_base)[offset]; } + uint64_t read64(offs_t offset) const { return reinterpret_cast<uint64_t *>(m_base)[offset]; } + void write8(offs_t offset, uint8_t data) { reinterpret_cast<uint8_t *>(m_base)[offset] = data; } + void write16(offs_t offset, uint16_t data, uint16_t mem_mask = 0xffff) { COMBINE_DATA(&reinterpret_cast<uint16_t *>(m_base)[offset]); } + void write32(offs_t offset, uint32_t data, uint32_t mem_mask = 0xffffffff) { COMBINE_DATA(&reinterpret_cast<uint32_t *>(m_base)[offset]); } + void write64(offs_t offset, uint64_t data, uint64_t mem_mask = U64(0xffffffffffffffff)) { COMBINE_DATA(&reinterpret_cast<uint64_t *>(m_base)[offset]); } private: // internal read/write helpers for 1 byte entries - UINT32 read8_from_8(int index) const; void write8_to_8(int index, UINT32 data); - UINT32 read8_from_16le(int index) const; void write8_to_16le(int index, UINT32 data); - UINT32 read8_from_16be(int index) const; void write8_to_16be(int index, UINT32 data); - UINT32 read8_from_32le(int index) const; void write8_to_32le(int index, UINT32 data); - UINT32 read8_from_32be(int index) const; void write8_to_32be(int index, UINT32 data); - UINT32 read8_from_64le(int index) const; void write8_to_64le(int index, UINT32 data); - UINT32 read8_from_64be(int index) const; void write8_to_64be(int index, UINT32 data); + uint32_t read8_from_8(int index) const; void write8_to_8(int index, uint32_t data); + uint32_t read8_from_16le(int index) const; void write8_to_16le(int index, uint32_t data); + uint32_t read8_from_16be(int index) const; void write8_to_16be(int index, uint32_t data); + uint32_t read8_from_32le(int index) const; void write8_to_32le(int index, uint32_t data); + uint32_t read8_from_32be(int index) const; void write8_to_32be(int index, uint32_t data); + uint32_t read8_from_64le(int index) const; void write8_to_64le(int index, uint32_t data); + uint32_t read8_from_64be(int index) const; void write8_to_64be(int index, uint32_t data); // internal read/write helpers for 2 byte entries - UINT32 read16_from_8le(int index) const; void write16_to_8le(int index, UINT32 data); - UINT32 read16_from_8be(int index) const; void write16_to_8be(int index, UINT32 data); - UINT32 read16_from_16(int index) const; void write16_to_16(int index, UINT32 data); - UINT32 read16_from_32le(int index) const; void write16_to_32le(int index, UINT32 data); - UINT32 read16_from_32be(int index) const; void write16_to_32be(int index, UINT32 data); - UINT32 read16_from_64le(int index) const; void write16_to_64le(int index, UINT32 data); - UINT32 read16_from_64be(int index) const; void write16_to_64be(int index, UINT32 data); + uint32_t read16_from_8le(int index) const; void write16_to_8le(int index, uint32_t data); + uint32_t read16_from_8be(int index) const; void write16_to_8be(int index, uint32_t data); + uint32_t read16_from_16(int index) const; void write16_to_16(int index, uint32_t data); + uint32_t read16_from_32le(int index) const; void write16_to_32le(int index, uint32_t data); + uint32_t read16_from_32be(int index) const; void write16_to_32be(int index, uint32_t data); + uint32_t read16_from_64le(int index) const; void write16_to_64le(int index, uint32_t data); + uint32_t read16_from_64be(int index) const; void write16_to_64be(int index, uint32_t data); // internal read/write helpers for 4 byte entries - UINT32 read32_from_8le(int index) const; void write32_to_8le(int index, UINT32 data); - UINT32 read32_from_8be(int index) const; void write32_to_8be(int index, UINT32 data); - UINT32 read32_from_16le(int index) const; void write32_to_16le(int index, UINT32 data); - UINT32 read32_from_16be(int index) const; void write32_to_16be(int index, UINT32 data); - UINT32 read32_from_32(int index) const; void write32_to_32(int index, UINT32 data); - UINT32 read32_from_64le(int index) const; void write32_to_64le(int index, UINT32 data); - UINT32 read32_from_64be(int index) const; void write32_to_64be(int index, UINT32 data); + uint32_t read32_from_8le(int index) const; void write32_to_8le(int index, uint32_t data); + uint32_t read32_from_8be(int index) const; void write32_to_8be(int index, uint32_t data); + uint32_t read32_from_16le(int index) const; void write32_to_16le(int index, uint32_t data); + uint32_t read32_from_16be(int index) const; void write32_to_16be(int index, uint32_t data); + uint32_t read32_from_32(int index) const; void write32_to_32(int index, uint32_t data); + uint32_t read32_from_64le(int index) const; void write32_to_64le(int index, uint32_t data); + uint32_t read32_from_64be(int index) const; void write32_to_64be(int index, uint32_t data); // internal state void * m_base; - UINT32 m_bytes; + uint32_t m_bytes; int m_membits; endianness_t m_endianness; int m_bytes_per_entry; - UINT32 (memory_array::*m_read_entry)(int) const; - void (memory_array::*m_write_entry)(int, UINT32); + uint32_t (memory_array::*m_read_entry)(int) const; + void (memory_array::*m_write_entry)(int, uint32_t); }; |