mirror of
https://github.com/holub/mame
synced 2025-04-23 00:39:36 +03:00
emumem: remove m_baseptr, may fix the save state issues [O. Galibert]
This commit is contained in:
parent
052419608d
commit
a9e6f19320
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user