diff options
author | Olivier Galibert <galibert@pobox.com> | 2018-12-20 20:25:33 +0100 |
---|---|---|
committer | Olivier Galibert <galibert@pobox.com> | 2018-12-20 20:25:33 +0100 |
commit | a9e6f19320a9f0c8489c6001b23a72ab232b23a0 (patch) | |
tree | cc1fbe6eeb0849da68ca56b51983b082a73d34de | |
parent | 052419608d389bd370a6d1215aa9938d30264bfe (diff) |
emumem: remove m_baseptr, may fix the save state issues [O. Galibert]
-rw-r--r-- | src/emu/emumem.cpp | 10 | ||||
-rw-r--r-- | src/emu/emumem.h | 3 |
2 files changed, 2 insertions, 11 deletions
diff --git a/src/emu/emumem.cpp b/src/emu/emumem.cpp index 3fde5702fd1..80aaaf32c42 100644 --- a/src/emu/emumem.cpp +++ b/src/emu/emumem.cpp @@ -2739,7 +2739,6 @@ memory_block::~memory_block() memory_bank::memory_bank(address_space &space, int index, offs_t addrstart, offs_t addrend, const char *tag) : m_machine(space.m_manager.machine()), - m_baseptr(nullptr), m_anonymous(tag == nullptr), m_addrstart(addrstart), m_addrend(addrend), @@ -2815,7 +2814,7 @@ void memory_bank::set_base(void *base) m_entries.resize(1); m_curentry = 0; } - m_baseptr = m_entries[m_curentry] = reinterpret_cast<u8 *>(base); + m_entries[m_curentry] = reinterpret_cast<u8 *>(base); for(auto cb : m_alloc_notifier) cb(base); m_alloc_notifier.clear(); @@ -2846,7 +2845,6 @@ void memory_bank::set_entry(int entrynum) throw emu_fatalerror("memory_bank::set_entry called for bank '%s' with invalid bank entry %d", m_tag.c_str(), entrynum); m_curentry = entrynum; - m_baseptr = m_entries[entrynum]; } @@ -2866,10 +2864,6 @@ void memory_bank::configure_entry(int entrynum, void *base) // set the entry m_entries[entrynum] = reinterpret_cast<u8 *>(base); - - // if the bank base is not configured, and we're the first entry, set us up - if (!m_baseptr && !entrynum) - m_baseptr = m_entries[0]; } @@ -2885,8 +2879,6 @@ void memory_bank::configure_entries(int startentry, int numentries, void *base, // fill in the requested bank entries for (int entrynum = 0; entrynum < numentries; entrynum ++) m_entries[entrynum + startentry] = reinterpret_cast<u8 *>(base) + entrynum * stride ; - if(!m_baseptr && !startentry) - m_baseptr = reinterpret_cast<u8 *>(base); } diff --git a/src/emu/emumem.h b/src/emu/emumem.h index 21c603e2225..74c0ae2a426 100644 --- a/src/emu/emumem.h +++ b/src/emu/emumem.h @@ -1657,7 +1657,7 @@ public: int entry() const { return m_curentry; } bool anonymous() const { return m_anonymous; } offs_t addrstart() const { return m_addrstart; } - void *base() const { return m_baseptr; } + void *base() const { return m_entries.empty() ? nullptr : m_entries[m_curentry]; } const char *tag() const { return m_tag.c_str(); } const char *name() const { return m_name.c_str(); } @@ -1683,7 +1683,6 @@ public: private: // internal state running_machine & m_machine; // need the machine to free our memory - u8 * m_baseptr; // pointer to our current base pointer std::vector<u8 *> m_entries; // the entries bool m_anonymous; // are we anonymous or explicit? offs_t m_addrstart; // start offset |