Previous 199869 Revisions Next

r23651 Wednesday 12th June, 2013 at 16:40:31 UTC by O. Galibert
memory: Fix subunit reconfiguration [O. Galibert]

To hit this bug you need to have two subsized handlers on the same
address with a different starting address.  Something like, in a
64-bits address map:
 AM_RANGE(0x00, 0x1f) AM_READ32(r1_r, 0xffffffff00000000)
 AM_RANGE(0x10, 0x1f) AM_READ32(r2_r, 0x00000000ffffffff)

Then r2_r (last entry) was called with an incorrect offset.

To say that this configuration does not happen often is an
understatement.
[src/emu]memory.c

trunk/src/emu/memory.c
r23650r23651
304304   struct subunit_info
305305   {
306306      UINT32              m_mask;                 // mask (ff, ffff or ffffffff)
307      UINT32              m_offset;               // offset to add to the address
307      INT32               m_offset;               // offset to add to the address
308308      UINT32              m_multiplier;           // multiplier to the pre-split address
309309      UINT8               m_size;                 // size (8, 16 or 32)
310310      UINT8               m_shift;                // shift of the subunit
r23650r23651
43414341//-------------------------------------------------
43424342void handler_entry::reconfigure_subunits(offs_t bytestart)
43434343{
4344   offs_t delta = bytestart - m_bytestart;
4344   INT32 delta = bytestart - m_bytestart;
43454345   for (int i=0; i != m_subunits; i++)
4346      m_subunit_infos[i].m_offset -= delta;
4346      m_subunit_infos[i].m_offset += delta / (m_subunit_infos[i].m_size / 8);
43474347}
43484348
43494349

Previous 199869 Revisions Next


© 1997-2024 The MAME Team