| 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 |
| r23650 | r23651 | |
|---|---|---|
| 304 | 304 | struct subunit_info |
| 305 | 305 | { |
| 306 | 306 | UINT32 m_mask; // mask (ff, ffff or ffffffff) |
| 307 | | |
| 307 | INT32 m_offset; // offset to add to the address | |
| 308 | 308 | UINT32 m_multiplier; // multiplier to the pre-split address |
| 309 | 309 | UINT8 m_size; // size (8, 16 or 32) |
| 310 | 310 | UINT8 m_shift; // shift of the subunit |
| r23650 | r23651 | |
| 4341 | 4341 | //------------------------------------------------- |
| 4342 | 4342 | void handler_entry::reconfigure_subunits(offs_t bytestart) |
| 4343 | 4343 | { |
| 4344 | | |
| 4344 | INT32 delta = bytestart - m_bytestart; | |
| 4345 | 4345 | for (int i=0; i != m_subunits; i++) |
| 4346 | m_subunit_infos[i].m_offset | |
| 4346 | m_subunit_infos[i].m_offset += delta / (m_subunit_infos[i].m_size / 8); | |
| 4347 | 4347 | } |
| 4348 | 4348 | |
| 4349 | 4349 |
| Previous | 199869 Revisions | Next |