mirror of
https://github.com/holub/mame
synced 2025-04-22 08:22:15 +03:00
Revert "Memory region to use std::string (nw)"
This reverts commit 14d0bff4d0
.
This commit is contained in:
parent
2cc5e240f4
commit
684132719f
@ -149,7 +149,7 @@ void debug_view_memory::enumerate_sources()
|
||||
// then add all the memory regions
|
||||
for (memory_region *region = machine().memory().first_region(); region != nullptr; region = region->next())
|
||||
{
|
||||
strprintf(name, "Region '%s'", region->name().c_str());
|
||||
strprintf(name, "Region '%s'", region->name());
|
||||
m_source_list.append(*global_alloc(debug_view_memory_source(name.c_str(), *region)));
|
||||
}
|
||||
|
||||
|
@ -1599,13 +1599,13 @@ void memory_manager::dump(FILE *file)
|
||||
// region_alloc - allocates memory for a region
|
||||
//-------------------------------------------------
|
||||
|
||||
memory_region *memory_manager::region_alloc(std::string name, UINT32 length, UINT8 width, endianness_t endian)
|
||||
memory_region *memory_manager::region_alloc(const char *name, UINT32 length, UINT8 width, endianness_t endian)
|
||||
{
|
||||
osd_printf_verbose("Region '%s' created\n", name.c_str());
|
||||
osd_printf_verbose("Region '%s' created\n", name);
|
||||
// make sure we don't have a region of the same name; also find the end of the list
|
||||
memory_region *info = m_regionlist.find(name);
|
||||
if (info != nullptr)
|
||||
fatalerror("region_alloc called with duplicate region name \"%s\"\n", name.c_str());
|
||||
fatalerror("region_alloc called with duplicate region name \"%s\"\n", name);
|
||||
|
||||
// allocate the region
|
||||
return &m_regionlist.append(name, *global_alloc(memory_region(machine(), name, length, width, endian)));
|
||||
@ -1616,7 +1616,7 @@ memory_region *memory_manager::region_alloc(std::string name, UINT32 length, UIN
|
||||
// region_free - releases memory for a region
|
||||
//-------------------------------------------------
|
||||
|
||||
void memory_manager::region_free(std::string name)
|
||||
void memory_manager::region_free(const char *name)
|
||||
{
|
||||
m_regionlist.remove(name);
|
||||
}
|
||||
@ -4051,7 +4051,7 @@ void memory_bank::configure_entries(int startentry, int numentries, void *base,
|
||||
// memory_region - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
memory_region::memory_region(running_machine &machine, std::string name, UINT32 length, UINT8 width, endianness_t endian)
|
||||
memory_region::memory_region(running_machine &machine, const char *name, UINT32 length, UINT8 width, endianness_t endian)
|
||||
: m_machine(machine),
|
||||
m_next(nullptr),
|
||||
m_name(name),
|
||||
|
@ -676,7 +676,7 @@ class memory_region
|
||||
friend resource_pool_object<memory_region>::~resource_pool_object();
|
||||
|
||||
// construction/destruction
|
||||
memory_region(running_machine &machine, std::string name, UINT32 length, UINT8 width, endianness_t endian);
|
||||
memory_region(running_machine &machine, const char *name, UINT32 length, UINT8 width, endianness_t endian);
|
||||
|
||||
public:
|
||||
// getters
|
||||
@ -685,7 +685,7 @@ public:
|
||||
UINT8 *base() { return (this != nullptr) ? &m_buffer[0] : nullptr; }
|
||||
UINT8 *end() { return (this != nullptr) ? base() + m_buffer.size() : nullptr; }
|
||||
UINT32 bytes() const { return (this != nullptr) ? m_buffer.size() : 0; }
|
||||
std::string name() const { return m_name; }
|
||||
const char *name() const { return m_name.c_str(); }
|
||||
|
||||
// flag expansion
|
||||
endianness_t endianness() const { return m_endianness; }
|
||||
@ -738,8 +738,8 @@ public:
|
||||
UINT8 **bank_pointer_addr(UINT8 index) { return &m_bank_ptr[index]; }
|
||||
|
||||
// regions
|
||||
memory_region *region_alloc(std::string name, UINT32 length, UINT8 width, endianness_t endian);
|
||||
void region_free(std::string name);
|
||||
memory_region *region_alloc(const char *name, UINT32 length, UINT8 width, endianness_t endian);
|
||||
void region_free(const char *name);
|
||||
|
||||
private:
|
||||
// internal helpers
|
||||
|
@ -1329,7 +1329,7 @@ void rom_load_manager::load_software_part_region(device_t &device, software_list
|
||||
}
|
||||
|
||||
/* remember the base and length */
|
||||
m_region = machine().memory().region_alloc(regiontag, regionlength, width, endianness);
|
||||
m_region = machine().memory().region_alloc(regiontag.c_str(), regionlength, width, endianness);
|
||||
LOG(("Allocated %X bytes @ %p\n", m_region->bytes(), m_region->base()));
|
||||
|
||||
/* clear the region if it's requested */
|
||||
@ -1402,7 +1402,7 @@ void rom_load_manager::process_region_list()
|
||||
normalize_flags_for_device(machine(), regiontag.c_str(), width, endianness);
|
||||
|
||||
/* remember the base and length */
|
||||
m_region = machine().memory().region_alloc(regiontag, regionlength, width, endianness);
|
||||
m_region = machine().memory().region_alloc(regiontag.c_str(), regionlength, width, endianness);
|
||||
LOG(("Allocated %X bytes @ %p\n", m_region->bytes(), m_region->base()));
|
||||
|
||||
/* clear the region if it's requested */
|
||||
|
Loading…
Reference in New Issue
Block a user