Ok, I think the old logic did work, but I renamed the methods so that

it makes sense to me and updated the comment.
This commit is contained in:
Aaron Giles 2010-08-25 15:33:14 +00:00
parent 2d7e4565f0
commit be32426a9d

View File

@ -352,8 +352,9 @@ public:
// compare a range against our range
bool matches_exactly(offs_t bytestart, offs_t byteend) const { return (m_bytestart == bytestart && m_byteend == byteend); }
bool fully_covers(offs_t bytestart, offs_t byteend) const { return (m_bytestart >= bytestart && m_byteend <= byteend); }
bool partially_covers(offs_t bytestart, offs_t byteend) const { return (m_bytestart <= byteend && m_byteend >= bytestart); }
bool fully_covers(offs_t bytestart, offs_t byteend) const { return (m_bytestart <= bytestart && m_byteend >= byteend); }
bool is_covered_by(offs_t bytestart, offs_t byteend) const { return (m_bytestart >= bytestart && m_byteend <= byteend); }
bool straddles(offs_t bytestart, offs_t byteend) const { return (m_bytestart < byteend && m_byteend > bytestart); }
// track and verify address space references to this bank
bool references_space(address_space &space, read_or_write readorwrite) const;
@ -2237,8 +2238,8 @@ void address_space::set_decrypted_region(offs_t addrstart, offs_t addrend, void
// consider this bank if it is used for reading and matches the address space
if (bank->references_space(*this, ROW_READ))
{
// verify that the region fully covers the decrypted range
if (bank->fully_covers(bytestart, byteend))
// verify that the provided range fully covers this bank
if (bank->is_covered_by(bytestart, byteend))
{
// set the decrypted pointer for the corresponding memory bank
bank->set_base_decrypted(reinterpret_cast<UINT8 *>(base) + bank->bytestart() - bytestart);
@ -2246,7 +2247,7 @@ void address_space::set_decrypted_region(offs_t addrstart, offs_t addrend, void
}
// fatal error if the decrypted region straddles the bank
else if (bank->partially_covers(bytestart, byteend))
else if (bank->straddles(bytestart, byteend))
throw emu_fatalerror("memory_set_decrypted_region found straddled region %08X-%08X for device '%s'", bytestart, byteend, m_device.tag());
}
}