diff options
| author | 2010-08-25 15:33:14 +0000 | |
|---|---|---|
| committer | 2010-08-25 15:33:14 +0000 | |
| commit | be32426a9dfbeee732a61af735eca77d75c99a0d (patch) | |
| tree | 2daa9c7c35547750c15bc519d6e35e452975c9ba /src/emu/memory.c | |
| parent | 2d7e4565f02aa46e7f23134655fe00ed973cfb87 (diff) | |
Ok, I think the old logic did work, but I renamed the methods so that
it makes sense to me and updated the comment.
Diffstat (limited to 'src/emu/memory.c')
| -rw-r--r-- | src/emu/memory.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/emu/memory.c b/src/emu/memory.c index bdff3355ef4..1225c4b9958 100644 --- a/src/emu/memory.c +++ b/src/emu/memory.c @@ -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()); } } |
