diff options
Diffstat (limited to 'src/mame/video/atarirle.cpp')
-rw-r--r-- | src/mame/video/atarirle.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/mame/video/atarirle.cpp b/src/mame/video/atarirle.cpp index 05a3fe4737d..897e300533a 100644 --- a/src/mame/video/atarirle.cpp +++ b/src/mame/video/atarirle.cpp @@ -68,7 +68,8 @@ inline int atari_rle_objects_device::round_to_powerof2(int value) atari_rle_objects_device::atari_rle_objects_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, ATARI_RLE_OBJECTS, "Atari RLE Motion Objects", tag, owner, clock, "atari_rle", __FILE__), - device_video_interface(mconfig, *this) + device_video_interface(mconfig, *this), + m_rombase(*this, DEVICE_SELF) { } @@ -218,8 +219,6 @@ void atari_rle_objects_device::device_start() m_bitmapymask = m_bitmapheight - 1; // set up the graphics ROM - m_rombase = reinterpret_cast<UINT16 *>(m_region->base()); - m_romlength = m_region->bytes(); m_objectcount = count_objects(); // set up a cliprect @@ -232,7 +231,7 @@ void atari_rle_objects_device::device_start() // compute the checksums memset(m_checksums, 0, sizeof(m_checksums)); - for (int sumchunk = 0; sumchunk < m_romlength / 0x20000; sumchunk++) + for (int sumchunk = 0; sumchunk < m_rombase.bytes() / 0x20000; sumchunk++) { const UINT16 *csbase = &m_rombase[0x10000 * sumchunk]; int cursum = 0; @@ -345,7 +344,7 @@ void atari_rle_objects_device::build_rle_tables() int atari_rle_objects_device::count_objects() { // first determine the lowest address of all objects - int lowest_address = m_romlength; + int lowest_address = m_rombase.length(); for (int objoffset = 0; objoffset < lowest_address; objoffset += 4) { int offset = ((m_rombase[objoffset + 2] & 0xff) << 16) | m_rombase[objoffset + 3]; @@ -370,7 +369,7 @@ void atari_rle_objects_device::prescan_rle(int which) // look up the offset UINT16 *base = (UINT16 *)&m_rombase[which * 4]; - const UINT16 *end = m_rombase + m_romlength / 2; + const UINT16 *end = &m_rombase[0] + m_rombase.length(); info.xoffs = (INT16)base[0]; info.yoffs = (INT16)base[1]; @@ -384,7 +383,7 @@ void atari_rle_objects_device::prescan_rle(int which) info.data = base = (UINT16 *)&m_rombase[offset]; // make sure it's valid - if (offset < which * 4 || offset >= m_romlength) + if (offset < which * 4 || offset >= m_rombase.length()) { info.data = nullptr; return; |