Use a tagged_list for memory_banks.

This commit is contained in:
Aaron Giles 2012-04-24 04:47:27 +00:00
parent 3066fcc635
commit 9afad3fd75
2 changed files with 7 additions and 9 deletions

View File

@ -2930,13 +2930,12 @@ memory_bank &address_space::bank_find_or_allocate(const char *tag, offs_t addrst
throw emu_fatalerror("Unable to allocate bank for RAM/ROM area %X-%X\n", bytestart, byteend);
}
// allocate the bank
// if no tag, create a unique one
membank = global_alloc(memory_bank(*this, banknum, bytestart, byteend, tag));
manager().m_banklist.append(*membank);
// for named banks, add to the map and register for save states
if (tag != NULL)
manager().m_bankmap.add_unique_hash(tag, membank, false);
astring temptag;
if (tag == NULL)
tag = temptag.format("anon_%p", membank);
manager().m_banklist.append(tag, *membank);
}
// add a reference for this space

View File

@ -829,7 +829,7 @@ public:
private:
// internal helpers
memory_bank *first_bank() const { return m_banklist.first(); }
memory_bank *bank(const char *tag) const { return m_bankmap.find(tag); }
memory_bank *bank(const char *tag) const { return m_banklist.find(tag); }
memory_region *region(const char *tag) { return m_regionlist.find(tag); }
memory_share *shared(const char *tag) { return m_sharelist.find(tag); }
void bank_reattach();
@ -844,8 +844,7 @@ private:
simple_list<address_space> m_spacelist; // list of address spaces
simple_list<memory_block> m_blocklist; // head of the list of memory blocks
simple_list<memory_bank> m_banklist; // data gathered for each bank
tagmap_t<memory_bank *> m_bankmap; // map for fast bank lookups
tagged_list<memory_bank> m_banklist; // data gathered for each bank
UINT8 m_banknext; // next bank to allocate
tagged_list<memory_share> m_sharelist; // map for share lookups