From 27d1b900e2715d67ea2633d6b64f2efbb8c5b7f5 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Sat, 20 Aug 2022 03:39:36 +1000 Subject: [PATCH] bus: Get rid of some dubious tag manipulation. The implementation details of how the cartridges allocate storage for memory really shouldn't be part of the interface. Having tags in the headers encourages people to depend on these implementation details. This gets rid of it in most of the headers. A few particularly leaky abstractions (bbc/rom, electron/cart, gba, generic, jakks_gamekey, m5) depend on this, so it can't be removed in those cases without further refactoring to encapsulate the slot devices better. This doesn't change behaviour, it just mechanically removes stuff from the headers and uses device_t::subtag rather than string manipulation on tags. Most of the cartridge devices shouldn't have rom_alloc member functions at all - the region created by the software list loader can be used directly when loading from the software list, and the slot can allocate a region with the same tag when loading loose software. This avoids creating an extra region and copying the data when loading from the software list. See vboy for an example that doesn't allocate a superfluous region. --- src/devices/bus/a7800/a78_slot.cpp | 14 ++++++------- src/devices/bus/a7800/a78_slot.h | 4 +--- src/devices/bus/a800/a800_slot.cpp | 8 ++++---- src/devices/bus/a800/a800_slot.h | 4 +--- src/devices/bus/apf/slot.cpp | 6 +++--- src/devices/bus/apf/slot.h | 10 +--------- src/devices/bus/aquarius/slot.cpp | 6 +++--- src/devices/bus/aquarius/slot.h | 4 +--- src/devices/bus/arcadia/slot.cpp | 6 +++--- src/devices/bus/arcadia/slot.h | 3 +-- src/devices/bus/astrocde/slot.cpp | 6 +++--- src/devices/bus/astrocde/slot.h | 6 ++---- src/devices/bus/bbc/rom/slot.cpp | 2 +- src/devices/bus/chanf/slot.cpp | 6 +++--- src/devices/bus/chanf/slot.h | 9 +-------- src/devices/bus/crvision/slot.cpp | 6 +++--- src/devices/bus/crvision/slot.h | 4 +--- src/devices/bus/ekara/slot.cpp | 6 +++--- src/devices/bus/ekara/slot.h | 4 +--- src/devices/bus/electron/cart/slot.cpp | 4 ++-- src/devices/bus/gamate/slot.cpp | 6 +++--- src/devices/bus/gamate/slot.h | 4 +--- src/devices/bus/gameboy/gb_slot.cpp | 8 ++++---- src/devices/bus/gameboy/gb_slot.h | 4 +--- src/devices/bus/gba/gba_slot.cpp | 6 +++--- src/devices/bus/generic/slot.cpp | 2 +- src/devices/bus/intv/slot.cpp | 10 +++++----- src/devices/bus/intv/slot.h | 4 +--- src/devices/bus/jakks_gamekey/slot.cpp | 2 +- src/devices/bus/m5/slot.cpp | 2 +- src/devices/bus/mc10/mc10_cart.cpp | 2 +- src/devices/bus/megadrive/md_slot.cpp | 14 ++++++------- src/devices/bus/megadrive/md_slot.h | 9 +-------- src/devices/bus/mtx/exp.cpp | 2 +- src/devices/bus/nes/nes_ines.hxx | 4 ++-- src/devices/bus/nes/nes_pcb.hxx | 6 +++--- src/devices/bus/nes/nes_slot.cpp | 16 ++++++--------- src/devices/bus/nes/nes_slot.h | 15 +++----------- src/devices/bus/nes/nes_unif.hxx | 6 +++--- src/devices/bus/pce/pce_slot.cpp | 6 +++--- src/devices/bus/pce/pce_slot.h | 9 +-------- src/devices/bus/saturn/sat_slot.cpp | 6 +++--- src/devices/bus/saturn/sat_slot.h | 9 +-------- src/devices/bus/scv/slot.cpp | 6 +++--- src/devices/bus/scv/slot.h | 9 +-------- src/devices/bus/sega8/sega8_slot.cpp | 6 +++--- src/devices/bus/sega8/sega8_slot.h | 8 +------- src/devices/bus/snes/snes_slot.cpp | 20 +++++++++---------- src/devices/bus/snes/snes_slot.h | 10 +--------- src/devices/bus/vboy/slot.cpp | 2 +- src/devices/bus/vc4000/slot.cpp | 6 +++--- src/devices/bus/vc4000/slot.h | 4 +--- src/devices/bus/vcs/vcs_slot.cpp | 2 +- src/devices/bus/vectrex/slot.cpp | 6 +++--- src/devices/bus/vectrex/slot.h | 9 +-------- src/devices/bus/vsmile/vsmile_slot.cpp | 6 +++--- src/devices/bus/vsmile/vsmile_slot.h | 4 +--- src/devices/bus/wswan/slot.cpp | 6 +++--- src/devices/bus/wswan/slot.h | 9 +-------- .../{interpro => intergraph}/interpro.cpp | 0 .../interpro_arbga.cpp | 0 .../{interpro => intergraph}/interpro_arbga.h | 0 .../interpro_ioga.cpp | 0 .../{interpro => intergraph}/interpro_ioga.h | 0 .../interpro_mcga.cpp | 0 .../{interpro => intergraph}/interpro_mcga.h | 0 .../{interpro => intergraph}/interpro_sga.cpp | 0 .../{interpro => intergraph}/interpro_sga.h | 0 68 files changed, 138 insertions(+), 245 deletions(-) rename src/mame/{interpro => intergraph}/interpro.cpp (100%) rename src/mame/{interpro => intergraph}/interpro_arbga.cpp (100%) rename src/mame/{interpro => intergraph}/interpro_arbga.h (100%) rename src/mame/{interpro => intergraph}/interpro_ioga.cpp (100%) rename src/mame/{interpro => intergraph}/interpro_ioga.h (100%) rename src/mame/{interpro => intergraph}/interpro_mcga.cpp (100%) rename src/mame/{interpro => intergraph}/interpro_mcga.h (100%) rename src/mame/{interpro => intergraph}/interpro_sga.cpp (100%) rename src/mame/{interpro => intergraph}/interpro_sga.h (100%) diff --git a/src/devices/bus/a7800/a78_slot.cpp b/src/devices/bus/a7800/a78_slot.cpp index 14127b69759..cee7d3bd99f 100644 --- a/src/devices/bus/a7800/a78_slot.cpp +++ b/src/devices/bus/a7800/a78_slot.cpp @@ -61,11 +61,11 @@ device_a78_cart_interface::~device_a78_cart_interface () // rom_alloc - alloc the space for the cart //------------------------------------------------- -void device_a78_cart_interface::rom_alloc(uint32_t size, const char *tag) +void device_a78_cart_interface::rom_alloc(uint32_t size) { if (m_rom == nullptr) { - m_rom = device().machine().memory().region_alloc(std::string(tag).append(A78SLOT_ROM_REGION_TAG).c_str(), size, 1, ENDIANNESS_LITTLE)->base(); + m_rom = device().machine().memory().region_alloc(device().subtag("^cart:rom"), size, 1, ENDIANNESS_LITTLE)->base(); m_rom_size = size; // setup other helpers @@ -345,7 +345,7 @@ image_init_result a78_cart_slot_device::call_load() bool has_nvram = get_software_region("nvram") ? true : false; len = get_software_region_length("rom"); - m_cart->rom_alloc(len, tag()); + m_cart->rom_alloc(len); memcpy(m_cart->get_rom_base(), get_software_region("rom"), len); if ((pcb_name = get_feature("slot")) != nullptr) @@ -445,7 +445,7 @@ image_init_result a78_cart_slot_device::call_load() internal_header_logging((uint8_t *)head, length()); - m_cart->rom_alloc(len, tag()); + m_cart->rom_alloc(len); fread(m_cart->get_rom_base(), len); if (m_type == A78_TYPE6 || m_type == A78_TYPE8) @@ -792,7 +792,7 @@ void a78_cart_slot_device::internal_header_logging(uint8_t *header, uint32_t len logerror( "==============\n\n" ); logerror( "\tTitle: %.32s\n", head_title); logerror( "\tLength: 0x%X [real 0x%X]\n", head_length, len); - logerror( "\tMapper: %s [0x%X]\n", cart_mapper.c_str(), head_mapper); + logerror( "\tMapper: %s [0x%X]\n", cart_mapper, head_mapper); logerror( "\t\tPOKEY: %s\n", BIT(head_mapper, 0) ? "Yes" : "No"); logerror( "\t\tSC Bankswitch: %s\n", BIT(head_mapper, 1) ? "Yes" : "No"); logerror( "\t\tRAM at $4000: %s\n", BIT(head_mapper, 2) ? "Yes" : "No"); @@ -809,7 +809,7 @@ void a78_cart_slot_device::internal_header_logging(uint8_t *header, uint32_t len } else logerror( "\n"); - logerror( "\tController 1: 0x%.2X [%s]\n", head_ctrl1, ctrl1.c_str()); - logerror( "\tController 2: 0x%.2X [%s]\n", head_ctrl2, ctrl2.c_str()); + logerror( "\tController 1: 0x%.2X [%s]\n", head_ctrl1, ctrl1); + logerror( "\tController 2: 0x%.2X [%s]\n", head_ctrl2, ctrl2); logerror( "\tVideo: %s\n", (head_ispal) ? "PAL" : "NTSC"); } diff --git a/src/devices/bus/a7800/a78_slot.h b/src/devices/bus/a7800/a78_slot.h index 678de644f0d..d27a175e3d1 100644 --- a/src/devices/bus/a7800/a78_slot.h +++ b/src/devices/bus/a7800/a78_slot.h @@ -12,8 +12,6 @@ TYPE DEFINITIONS ***************************************************************************/ -#define A78SLOT_ROM_REGION_TAG ":cart:rom" - /* PCB */ enum { @@ -58,7 +56,7 @@ public: virtual void write_30xx(offs_t offset, uint8_t data) {} virtual void write_40xx(offs_t offset, uint8_t data) {} - void rom_alloc(uint32_t size, const char *tag); + void rom_alloc(uint32_t size); void ram_alloc(uint32_t size); void nvram_alloc(uint32_t size); uint8_t* get_rom_base() { return m_rom; } diff --git a/src/devices/bus/a800/a800_slot.cpp b/src/devices/bus/a800/a800_slot.cpp index 1e9013bb602..a34f64eeb6f 100644 --- a/src/devices/bus/a800/a800_slot.cpp +++ b/src/devices/bus/a800/a800_slot.cpp @@ -60,11 +60,11 @@ device_a800_cart_interface::~device_a800_cart_interface () // rom_alloc - alloc the space for the cart //------------------------------------------------- -void device_a800_cart_interface::rom_alloc(uint32_t size, const char *tag) +void device_a800_cart_interface::rom_alloc(uint32_t size) { if (m_rom == nullptr) { - m_rom = device().machine().memory().region_alloc(std::string(tag).append(A800SLOT_ROM_REGION_TAG).c_str(), size, 1, ENDIANNESS_LITTLE)->base(); + m_rom = device().machine().memory().region_alloc(device().subtag("^cart:rom"), size, 1, ENDIANNESS_LITTLE)->base(); m_rom_size = size; // setup other helpers @@ -235,7 +235,7 @@ image_init_result a800_cart_slot_device::call_load() const char *pcb_name; len = get_software_region_length("rom"); - m_cart->rom_alloc(len, tag()); + m_cart->rom_alloc(len); memcpy(m_cart->get_rom_base(), get_software_region("rom"), len); if ((pcb_name = get_feature("slot")) != nullptr) @@ -271,7 +271,7 @@ image_init_result a800_cart_slot_device::call_load() m_type = A5200_16K_2CHIPS; } - m_cart->rom_alloc(len, tag()); + m_cart->rom_alloc(len); fread(m_cart->get_rom_base(), len); } if (m_type == A800_TELELINK2) diff --git a/src/devices/bus/a800/a800_slot.h b/src/devices/bus/a800/a800_slot.h index 233fa922583..e615058960e 100644 --- a/src/devices/bus/a800/a800_slot.h +++ b/src/devices/bus/a800/a800_slot.h @@ -12,8 +12,6 @@ TYPE DEFINITIONS ***************************************************************************/ -#define A800SLOT_ROM_REGION_TAG ":cart:rom" - /* PCB */ enum { @@ -60,7 +58,7 @@ public: virtual void write_80xx(offs_t offset, uint8_t data) {} virtual void write_d5xx(offs_t offset, uint8_t data) {} - void rom_alloc(uint32_t size, const char *tag); + void rom_alloc(uint32_t size); void ram_alloc(uint32_t size); void nvram_alloc(uint32_t size); uint8_t* get_rom_base() { return m_rom; } diff --git a/src/devices/bus/apf/slot.cpp b/src/devices/bus/apf/slot.cpp index 32efe21adf3..62c8c7c02e9 100644 --- a/src/devices/bus/apf/slot.cpp +++ b/src/devices/bus/apf/slot.cpp @@ -44,11 +44,11 @@ device_apf_cart_interface::~device_apf_cart_interface() // rom_alloc - alloc the space for the cart //------------------------------------------------- -void device_apf_cart_interface::rom_alloc(uint32_t size, const char *tag) +void device_apf_cart_interface::rom_alloc(uint32_t size) { if (m_rom == nullptr) { - m_rom = device().machine().memory().region_alloc(std::string(tag).append(APFSLOT_ROM_REGION_TAG).c_str(), size, 1, ENDIANNESS_LITTLE)->base(); + m_rom = device().machine().memory().region_alloc(device().subtag("^cart:rom"), size, 1, ENDIANNESS_LITTLE)->base(); m_rom_size = size; } } @@ -156,7 +156,7 @@ image_init_result apf_cart_slot_device::call_load() return image_init_result::FAIL; } - m_cart->rom_alloc(size, tag()); + m_cart->rom_alloc(size); if (!loaded_through_softlist()) fread(m_cart->get_rom_base(), size); diff --git a/src/devices/bus/apf/slot.h b/src/devices/bus/apf/slot.h index b85715ae0e1..886135cb62b 100644 --- a/src/devices/bus/apf/slot.h +++ b/src/devices/bus/apf/slot.h @@ -34,7 +34,7 @@ public: virtual uint8_t read_ram(offs_t offset) { return 0xff; } virtual void write_ram(offs_t offset, uint8_t data) {} - void rom_alloc(uint32_t size, const char *tag); + void rom_alloc(uint32_t size); void ram_alloc(uint32_t size); uint8_t* get_rom_base() { return m_rom; } uint8_t* get_ram_base() { return &m_ram[0]; } @@ -102,15 +102,7 @@ protected: }; - // device type definition DECLARE_DEVICE_TYPE(APF_CART_SLOT, apf_cart_slot_device) - -/*************************************************************************** - DEVICE CONFIGURATION MACROS - ***************************************************************************/ - -#define APFSLOT_ROM_REGION_TAG ":cart:rom" - #endif // MAME_BUS_APF_SLOT_H diff --git a/src/devices/bus/aquarius/slot.cpp b/src/devices/bus/aquarius/slot.cpp index ab2966afe61..2deb6149e12 100644 --- a/src/devices/bus/aquarius/slot.cpp +++ b/src/devices/bus/aquarius/slot.cpp @@ -38,11 +38,11 @@ device_aquarius_cartridge_interface::device_aquarius_cartridge_interface(const m // rom_alloc - alloc the space for the ROM //------------------------------------------------- -void device_aquarius_cartridge_interface::rom_alloc(uint32_t size, const char *tag) +void device_aquarius_cartridge_interface::rom_alloc(uint32_t size) { if (m_rom == nullptr) { - m_rom = device().machine().memory().region_alloc(std::string(tag).append(AQUARIUS_CART_ROM_REGION_TAG).c_str(), size, 1, ENDIANNESS_LITTLE)->base(); + m_rom = device().machine().memory().region_alloc(device().subtag("^cart:rom"), size, 1, ENDIANNESS_LITTLE)->base(); m_rom_size = size; } } @@ -95,7 +95,7 @@ image_init_result aquarius_cartridge_slot_device::call_load() return image_init_result::FAIL; } - m_cart->rom_alloc(size, tag()); + m_cart->rom_alloc(size); if (!loaded_through_softlist()) fread(m_cart->get_rom_base(), size); diff --git a/src/devices/bus/aquarius/slot.h b/src/devices/bus/aquarius/slot.h index f165c146708..9ee7aaf6d2b 100644 --- a/src/devices/bus/aquarius/slot.h +++ b/src/devices/bus/aquarius/slot.h @@ -14,8 +14,6 @@ #include "imagedev/cartrom.h" -#define AQUARIUS_CART_ROM_REGION_TAG ":cart:rom" - //************************************************************************** // TYPE DEFINITIONS //************************************************************************** @@ -92,7 +90,7 @@ public: virtual uint8_t iorq_r(offs_t offset) { return 0xff; } virtual void iorq_w(offs_t offset, uint8_t data) { } - void rom_alloc(uint32_t size, const char *tag); + void rom_alloc(uint32_t size); uint8_t* get_rom_base() { return m_rom; } uint32_t get_rom_size() { return m_rom_size; } diff --git a/src/devices/bus/arcadia/slot.cpp b/src/devices/bus/arcadia/slot.cpp index 7fc145ccc64..1eaada68544 100644 --- a/src/devices/bus/arcadia/slot.cpp +++ b/src/devices/bus/arcadia/slot.cpp @@ -44,11 +44,11 @@ device_arcadia_cart_interface::~device_arcadia_cart_interface() // rom_alloc - alloc the space for the cart //------------------------------------------------- -void device_arcadia_cart_interface::rom_alloc(uint32_t size, const char *tag) +void device_arcadia_cart_interface::rom_alloc(uint32_t size) { if (m_rom == nullptr) { - m_rom = device().machine().memory().region_alloc(std::string(tag).append(EA2001SLOT_ROM_REGION_TAG).c_str(), size, 1, ENDIANNESS_LITTLE)->base(); + m_rom = device().machine().memory().region_alloc(device().subtag("^cart:rom"), size, 1, ENDIANNESS_LITTLE)->base(); m_rom_size = size; } } @@ -139,7 +139,7 @@ image_init_result arcadia_cart_slot_device::call_load() { uint32_t len = !loaded_through_softlist() ? length() : get_software_region_length("rom"); - m_cart->rom_alloc(len, tag()); + m_cart->rom_alloc(len); if (!loaded_through_softlist()) fread(m_cart->get_rom_base(), len); diff --git a/src/devices/bus/arcadia/slot.h b/src/devices/bus/arcadia/slot.h index f0f8eefb902..e9a3ed8415e 100644 --- a/src/devices/bus/arcadia/slot.h +++ b/src/devices/bus/arcadia/slot.h @@ -5,7 +5,6 @@ #include "imagedev/cartrom.h" -#define EA2001SLOT_ROM_REGION_TAG ":cart:rom" /*************************************************************************** TYPE DEFINITIONS @@ -31,7 +30,7 @@ public: virtual uint8_t read_rom(offs_t offset) { return 0xff; } virtual uint8_t extra_rom(offs_t offset) { return 0xff; } - void rom_alloc(uint32_t size, const char *tag); + void rom_alloc(uint32_t size); uint8_t* get_rom_base() { return m_rom; } uint32_t get_rom_size() { return m_rom_size; } diff --git a/src/devices/bus/astrocde/slot.cpp b/src/devices/bus/astrocde/slot.cpp index 6fcc2015160..6581dee5d01 100644 --- a/src/devices/bus/astrocde/slot.cpp +++ b/src/devices/bus/astrocde/slot.cpp @@ -44,11 +44,11 @@ device_astrocade_cart_interface::~device_astrocade_cart_interface() // rom_alloc - alloc the space for the cart //------------------------------------------------- -void device_astrocade_cart_interface::rom_alloc(uint32_t size, const char *tag) +void device_astrocade_cart_interface::rom_alloc(uint32_t size) { if (m_rom == nullptr) { - m_rom = device().machine().memory().region_alloc(std::string(tag).append(ASTROCADESLOT_ROM_REGION_TAG).c_str(), size, 1, ENDIANNESS_LITTLE)->base(); + m_rom = device().machine().memory().region_alloc(device().subtag("^cart:rom"), size, 1, ENDIANNESS_LITTLE)->base(); m_rom_size = size; } } @@ -139,7 +139,7 @@ image_init_result astrocade_cart_slot_device::call_load() if (m_cart) { uint32_t size = !loaded_through_softlist() ? length() : get_software_region_length("rom"); - m_cart->rom_alloc(size, tag()); + m_cart->rom_alloc(size); if (!loaded_through_softlist()) fread(m_cart->get_rom_base(), size); diff --git a/src/devices/bus/astrocde/slot.h b/src/devices/bus/astrocde/slot.h index a366b9dc518..49242f2c31d 100644 --- a/src/devices/bus/astrocde/slot.h +++ b/src/devices/bus/astrocde/slot.h @@ -12,8 +12,6 @@ TYPE DEFINITIONS ***************************************************************************/ -#define ASTROCADESLOT_ROM_REGION_TAG ":cart:rom" - /* PCB */ enum { @@ -35,8 +33,8 @@ public: // reading and writing virtual uint8_t read_rom(offs_t offset) { return 0xff; } - void rom_alloc(uint32_t size, const char *tag); - uint8_t* get_rom_base() { return m_rom; } + void rom_alloc(uint32_t size); + uint8_t *get_rom_base() { return m_rom; } uint32_t get_rom_size() { return m_rom_size; } protected: diff --git a/src/devices/bus/bbc/rom/slot.cpp b/src/devices/bus/bbc/rom/slot.cpp index 4c19a767dfe..b7ea541bbc2 100644 --- a/src/devices/bus/bbc/rom/slot.cpp +++ b/src/devices/bus/bbc/rom/slot.cpp @@ -50,7 +50,7 @@ void device_bbc_rom_interface::rom_alloc(uint32_t size, const char *tag) { if (m_rom == nullptr) { - m_rom = device().machine().memory().region_alloc(std::string(tag).append(BBC_ROM_REGION_TAG).c_str(), size, 1, ENDIANNESS_LITTLE)->base(); + m_rom = device().machine().memory().region_alloc(std::string(tag).append(BBC_ROM_REGION_TAG), size, 1, ENDIANNESS_LITTLE)->base(); m_rom_size = size; } } diff --git a/src/devices/bus/chanf/slot.cpp b/src/devices/bus/chanf/slot.cpp index 9a49d62ca82..e13dd1d0d82 100644 --- a/src/devices/bus/chanf/slot.cpp +++ b/src/devices/bus/chanf/slot.cpp @@ -44,11 +44,11 @@ device_channelf_cart_interface::~device_channelf_cart_interface() // rom_alloc - alloc the space for the cart //------------------------------------------------- -void device_channelf_cart_interface::rom_alloc(uint32_t size, const char *tag) +void device_channelf_cart_interface::rom_alloc(uint32_t size) { if (m_rom == nullptr) { - m_rom = device().machine().memory().region_alloc(std::string(tag).append(CHANFSLOT_ROM_REGION_TAG).c_str(), size, 1, ENDIANNESS_LITTLE)->base(); + m_rom = device().machine().memory().region_alloc(device().subtag("^cart:rom"), size, 1, ENDIANNESS_LITTLE)->base(); m_rom_size = size; } } @@ -151,7 +151,7 @@ image_init_result channelf_cart_slot_device::call_load() if (m_cart) { uint32_t len = !loaded_through_softlist() ? length() : get_software_region_length("rom"); - m_cart->rom_alloc(len, tag()); + m_cart->rom_alloc(len); if (!loaded_through_softlist()) fread(m_cart->get_rom_base(), len); diff --git a/src/devices/bus/chanf/slot.h b/src/devices/bus/chanf/slot.h index eaf8a787857..afad1a76065 100644 --- a/src/devices/bus/chanf/slot.h +++ b/src/devices/bus/chanf/slot.h @@ -37,7 +37,7 @@ public: virtual void write_ram(offs_t offset, uint8_t data) { } virtual void write_bank(uint8_t data) { } - void rom_alloc(uint32_t size, const char *tag); + void rom_alloc(uint32_t size); void ram_alloc(uint32_t size); uint8_t* get_rom_base() { return m_rom; } uint8_t* get_ram_base() { return &m_ram[0]; } @@ -111,11 +111,4 @@ protected: // device type definition DECLARE_DEVICE_TYPE(CHANF_CART_SLOT, channelf_cart_slot_device) - -/*************************************************************************** - DEVICE CONFIGURATION MACROS - ***************************************************************************/ - -#define CHANFSLOT_ROM_REGION_TAG ":cart:rom" - #endif // MAME_BUS_CHANF_SLOT_H diff --git a/src/devices/bus/crvision/slot.cpp b/src/devices/bus/crvision/slot.cpp index e0776bec33b..616ad6173b4 100644 --- a/src/devices/bus/crvision/slot.cpp +++ b/src/devices/bus/crvision/slot.cpp @@ -44,11 +44,11 @@ device_crvision_cart_interface::~device_crvision_cart_interface() // rom_alloc - alloc the space for the cart //------------------------------------------------- -void device_crvision_cart_interface::rom_alloc(uint32_t size, const char *tag) +void device_crvision_cart_interface::rom_alloc(uint32_t size) { if (m_rom == nullptr) { - m_rom = device().machine().memory().region_alloc(std::string(tag).append(CRVSLOT_ROM_REGION_TAG).c_str(), size, 1, ENDIANNESS_LITTLE)->base(); + m_rom = device().machine().memory().region_alloc(device().subtag("^cart:rom"), size, 1, ENDIANNESS_LITTLE)->base(); m_rom_size = size; } } @@ -149,7 +149,7 @@ image_init_result crvision_cart_slot_device::call_load() return image_init_result::FAIL; } - m_cart->rom_alloc(size, tag()); + m_cart->rom_alloc(size); if (!loaded_through_softlist()) fread(m_cart->get_rom_base(), size); diff --git a/src/devices/bus/crvision/slot.h b/src/devices/bus/crvision/slot.h index ec0a626f994..41f86b117ae 100644 --- a/src/devices/bus/crvision/slot.h +++ b/src/devices/bus/crvision/slot.h @@ -12,8 +12,6 @@ TYPE DEFINITIONS ***************************************************************************/ -#define CRVSLOT_ROM_REGION_TAG ":cart:rom" - /* PCB */ enum { @@ -39,7 +37,7 @@ public: virtual uint8_t read_rom40(offs_t offset) { return 0xff; } virtual uint8_t read_rom80(offs_t offset) { return 0xff; } - void rom_alloc(uint32_t size, const char *tag); + void rom_alloc(uint32_t size); uint8_t* get_rom_base() { return m_rom; } uint32_t get_rom_size() { return m_rom_size; } diff --git a/src/devices/bus/ekara/slot.cpp b/src/devices/bus/ekara/slot.cpp index 198d6c35519..2cd33594edb 100644 --- a/src/devices/bus/ekara/slot.cpp +++ b/src/devices/bus/ekara/slot.cpp @@ -38,11 +38,11 @@ device_ekara_cart_interface::~device_ekara_cart_interface() // rom_alloc - alloc the space for the cart //------------------------------------------------- -void device_ekara_cart_interface::rom_alloc(uint32_t size, const char *tag) +void device_ekara_cart_interface::rom_alloc(uint32_t size) { if (m_rom == nullptr) { - m_rom = device().machine().memory().region_alloc(std::string(tag).append(EKARASLOT_ROM_REGION_TAG).c_str(), size, 1, ENDIANNESS_BIG)->base(); + m_rom = device().machine().memory().region_alloc(device().subtag("^cart:rom"), size, 1, ENDIANNESS_BIG)->base(); m_rom_size = size; } } @@ -134,7 +134,7 @@ image_init_result ekara_cart_slot_device::call_load() uint8_t *ROM; uint32_t len = !loaded_through_softlist() ? length() : get_software_region_length("rom"); - m_cart->rom_alloc(len, tag()); + m_cart->rom_alloc(len); ROM = m_cart->get_rom_base(); diff --git a/src/devices/bus/ekara/slot.h b/src/devices/bus/ekara/slot.h index 6efbd5962e7..29cdc7f81de 100644 --- a/src/devices/bus/ekara/slot.h +++ b/src/devices/bus/ekara/slot.h @@ -46,7 +46,7 @@ public: virtual bool is_read_access_not_rom(void) { return false; } virtual bool is_write_access_not_rom(void) { return false; } - void rom_alloc(uint32_t size, const char *tag); + void rom_alloc(uint32_t size); uint8_t* get_rom_base() { return m_rom; } uint32_t get_rom_size() { return m_rom_size; } @@ -128,8 +128,6 @@ DECLARE_DEVICE_TYPE(EKARA_CART_SLOT, ekara_cart_slot_device) DEVICE CONFIGURATION MACROS ***************************************************************************/ -#define EKARASLOT_ROM_REGION_TAG ":cart:rom" - void ekara_cart(device_slot_interface &device); #endif // MAME_BUS_EKARA_SLOT_H diff --git a/src/devices/bus/electron/cart/slot.cpp b/src/devices/bus/electron/cart/slot.cpp index 6502fb7d4ac..bcdff13233d 100644 --- a/src/devices/bus/electron/cart/slot.cpp +++ b/src/devices/bus/electron/cart/slot.cpp @@ -52,12 +52,12 @@ void device_electron_cart_interface::rom_alloc(uint32_t size, const char *tag) { if (size <= 0x8000) { - m_rom = device().machine().memory().region_alloc(std::string(tag).append(ELECTRON_CART_ROM_REGION_TAG).c_str(), 0x8000, 1, ENDIANNESS_LITTLE)->base(); + m_rom = device().machine().memory().region_alloc(std::string(tag).append(ELECTRON_CART_ROM_REGION_TAG), 0x8000, 1, ENDIANNESS_LITTLE)->base(); m_rom_size = 0x8000; } else { - m_rom = device().machine().memory().region_alloc(std::string(tag).append(ELECTRON_CART_ROM_REGION_TAG).c_str(), size, 1, ENDIANNESS_LITTLE)->base(); + m_rom = device().machine().memory().region_alloc(std::string(tag).append(ELECTRON_CART_ROM_REGION_TAG), size, 1, ENDIANNESS_LITTLE)->base(); m_rom_size = size; } } diff --git a/src/devices/bus/gamate/slot.cpp b/src/devices/bus/gamate/slot.cpp index cf75898e768..d46ed1d0a65 100644 --- a/src/devices/bus/gamate/slot.cpp +++ b/src/devices/bus/gamate/slot.cpp @@ -38,11 +38,11 @@ device_gamate_cart_interface::~device_gamate_cart_interface() // rom_alloc - alloc the space for the cart //------------------------------------------------- -void device_gamate_cart_interface::rom_alloc(uint32_t size, const char *tag) +void device_gamate_cart_interface::rom_alloc(uint32_t size) { if (m_rom == nullptr) { - m_rom = device().machine().memory().region_alloc(std::string(tag).append(GAMATESLOT_ROM_REGION_TAG).c_str(), size, 1, ENDIANNESS_BIG)->base(); + m_rom = device().machine().memory().region_alloc(device().subtag("^cart:rom"), size, 1, ENDIANNESS_BIG)->base(); m_rom_size = size; } } @@ -138,7 +138,7 @@ image_init_result gamate_cart_slot_device::call_load() return image_init_result::FAIL; } - m_cart->rom_alloc(len, tag()); + m_cart->rom_alloc(len); ROM = m_cart->get_rom_base(); diff --git a/src/devices/bus/gamate/slot.h b/src/devices/bus/gamate/slot.h index 333fd404e4a..b78fa012705 100644 --- a/src/devices/bus/gamate/slot.h +++ b/src/devices/bus/gamate/slot.h @@ -31,7 +31,7 @@ public: virtual uint8_t read_cart(offs_t offset) { return 0xff; } virtual void write_cart(offs_t offset, uint8_t data) { } - void rom_alloc(uint32_t size, const char *tag); + void rom_alloc(uint32_t size); uint8_t* get_rom_base() { return m_rom; } uint32_t get_rom_size() { return m_rom_size; } @@ -97,8 +97,6 @@ DECLARE_DEVICE_TYPE(GAMATE_CART_SLOT, gamate_cart_slot_device) DEVICE CONFIGURATION MACROS ***************************************************************************/ -#define GAMATESLOT_ROM_REGION_TAG ":cart:rom" - void gamate_cart(device_slot_interface &device); #endif // MAME_BUS_GAMATE_SLOT_H diff --git a/src/devices/bus/gameboy/gb_slot.cpp b/src/devices/bus/gameboy/gb_slot.cpp index 3bf19202635..cda1283254b 100644 --- a/src/devices/bus/gameboy/gb_slot.cpp +++ b/src/devices/bus/gameboy/gb_slot.cpp @@ -58,11 +58,11 @@ device_gb_cart_interface::~device_gb_cart_interface() // rom_alloc - alloc the space for the cart //------------------------------------------------- -void device_gb_cart_interface::rom_alloc(uint32_t size, const char *tag) +void device_gb_cart_interface::rom_alloc(uint32_t size) { if (m_rom == nullptr) { - m_rom = device().machine().memory().region_alloc(std::string(tag).append(GBSLOT_ROM_REGION_TAG).c_str(), size, 1, ENDIANNESS_LITTLE)->base(); + m_rom = device().machine().memory().region_alloc(device().subtag("^cart:rom"), size, 1, ENDIANNESS_LITTLE)->base(); m_rom_size = size; } } @@ -272,7 +272,7 @@ image_init_result gb_cart_slot_device_base::call_load() } } - m_cart->rom_alloc(len, tag()); + m_cart->rom_alloc(len); ROM = m_cart->get_rom_base(); if (!loaded_through_softlist()) @@ -396,7 +396,7 @@ image_init_result megaduck_cart_slot_device::call_load() { uint32_t len = !loaded_through_softlist() ? length() : get_software_region_length("rom"); - m_cart->rom_alloc(len, tag()); + m_cart->rom_alloc(len); if (!loaded_through_softlist()) fread(m_cart->get_rom_base(), len); diff --git a/src/devices/bus/gameboy/gb_slot.h b/src/devices/bus/gameboy/gb_slot.h index 04432ba90a3..3f330a4d959 100644 --- a/src/devices/bus/gameboy/gb_slot.h +++ b/src/devices/bus/gameboy/gb_slot.h @@ -63,7 +63,7 @@ public: virtual uint8_t read_ram(offs_t offset) { return 0xff; } virtual void write_ram(offs_t offset, uint8_t data) {} - void rom_alloc(uint32_t size, const char *tag); + void rom_alloc(uint32_t size); void ram_alloc(uint32_t size); uint8_t* get_rom_base() { return m_rom; } uint8_t* get_ram_base() { return &m_ram[0]; } @@ -204,6 +204,4 @@ public: DECLARE_DEVICE_TYPE(GB_CART_SLOT, gb_cart_slot_device) DECLARE_DEVICE_TYPE(MEGADUCK_CART_SLOT, megaduck_cart_slot_device) -#define GBSLOT_ROM_REGION_TAG ":cart:rom" - #endif // MAME_BUS_GAMEBOY_GB_SLOT_H diff --git a/src/devices/bus/gba/gba_slot.cpp b/src/devices/bus/gba/gba_slot.cpp index d4630c9c325..bb5ad11048e 100644 --- a/src/devices/bus/gba/gba_slot.cpp +++ b/src/devices/bus/gba/gba_slot.cpp @@ -504,11 +504,11 @@ void device_gba_cart_interface::rom_alloc(uint32_t size, const char *tag) { if (size < 0x4000000) // we always alloc 32MB of rom region! - m_rom = (uint32_t *)device().machine().memory().region_alloc(std::string(tag).append(GBASLOT_ROM_REGION_TAG).c_str(), 0x2000000, 4, ENDIANNESS_LITTLE)->base(); + m_rom = (uint32_t *)device().machine().memory().region_alloc(std::string(tag).append(GBASLOT_ROM_REGION_TAG), 0x2000000, 4, ENDIANNESS_LITTLE)->base(); else { - m_rom = (uint32_t *)device().machine().memory().region_alloc(std::string(tag).append(GBASLOT_ROM_REGION_TAG).c_str(), 0x4000000, 4, ENDIANNESS_LITTLE)->base(); - m_romhlp = (uint32_t *)device().machine().memory().region_alloc(std::string(tag).append(GBAHELP_ROM_REGION_TAG).c_str(), 0x2000000, 4, ENDIANNESS_LITTLE)->base(); + m_rom = (uint32_t *)device().machine().memory().region_alloc(std::string(tag).append(GBASLOT_ROM_REGION_TAG), 0x4000000, 4, ENDIANNESS_LITTLE)->base(); + m_romhlp = (uint32_t *)device().machine().memory().region_alloc(std::string(tag).append(GBAHELP_ROM_REGION_TAG), 0x2000000, 4, ENDIANNESS_LITTLE)->base(); } m_rom_size = size; } diff --git a/src/devices/bus/generic/slot.cpp b/src/devices/bus/generic/slot.cpp index 73a47bfd0e0..8827706e657 100644 --- a/src/devices/bus/generic/slot.cpp +++ b/src/devices/bus/generic/slot.cpp @@ -95,7 +95,7 @@ void device_generic_cart_interface::rom_alloc(u32 size, int width, endianness_t std::string fulltag(tag); fulltag.append(GENERIC_ROM_REGION_TAG); device().logerror("Allocating %u byte ROM region with tag '%s' (width %d)\n", size, fulltag, width); - m_rom = device().machine().memory().region_alloc(fulltag.c_str(), size, width, endian)->base(); + m_rom = device().machine().memory().region_alloc(fulltag, size, width, endian)->base(); m_rom_size = size; } diff --git a/src/devices/bus/intv/slot.cpp b/src/devices/bus/intv/slot.cpp index f956f01c0fe..97d5b9ee308 100644 --- a/src/devices/bus/intv/slot.cpp +++ b/src/devices/bus/intv/slot.cpp @@ -116,11 +116,11 @@ device_intv_cart_interface::~device_intv_cart_interface() // rom_alloc - alloc the space for the cart //------------------------------------------------- -void device_intv_cart_interface::rom_alloc(uint32_t size, const char *tag) +void device_intv_cart_interface::rom_alloc(uint32_t size) { if (m_rom == nullptr) { - m_rom = device().machine().memory().region_alloc(std::string(tag).append(INTVSLOT_ROM_REGION_TAG).c_str(), size, 1, ENDIANNESS_LITTLE)->base(); + m_rom = device().machine().memory().region_alloc(device().subtag("^cart:rom"), size, 1, ENDIANNESS_LITTLE)->base(); memset(m_rom, 0xff, size); m_rom_size = size; } @@ -251,7 +251,7 @@ image_init_result intv_cart_slot_device::load_fullpath() if (temp != (num_segments ^ 0xff)) return image_init_result::FAIL; - m_cart->rom_alloc(0x20000, tag()); + m_cart->rom_alloc(0x20000); ROM = (uint8_t *)m_cart->get_rom_base(); for (int i = 0; i < num_segments; i++) @@ -300,7 +300,7 @@ image_init_result intv_cart_slot_device::load_fullpath() int mapper, rom[5], ram, extra; std::string extrainfo; - m_cart->rom_alloc(0x20000, tag()); + m_cart->rom_alloc(0x20000); ROM = (uint8_t *)m_cart->get_rom_base(); if (!hashfile_extrainfo(*this, extrainfo)) @@ -401,7 +401,7 @@ image_init_result intv_cart_slot_device::call_load() uint16_t address; uint8_t *ROM, *region; - m_cart->rom_alloc(extra_bank ? 0x22000 : 0x20000, tag()); + m_cart->rom_alloc(extra_bank ? 0x22000 : 0x20000); ROM = m_cart->get_rom_base(); for (int i = 0; i < 16; i++) diff --git a/src/devices/bus/intv/slot.h b/src/devices/bus/intv/slot.h index 185f15128c9..4e4bc130730 100644 --- a/src/devices/bus/intv/slot.h +++ b/src/devices/bus/intv/slot.h @@ -70,7 +70,7 @@ public: virtual void write_rome0(offs_t offset, uint16_t data) {} virtual void write_romf0(offs_t offset, uint16_t data) {} - void rom_alloc(uint32_t size, const char *tag); + void rom_alloc(uint32_t size); void ram_alloc(uint32_t size); uint8_t* get_rom_base() { return m_rom; } uint8_t* get_ram_base() { return &m_ram[0]; } @@ -181,8 +181,6 @@ DECLARE_DEVICE_TYPE(INTV_CART_SLOT, intv_cart_slot_device) DEVICE CONFIGURATION MACROS ***************************************************************************/ -#define INTVSLOT_ROM_REGION_TAG ":cart:rom" - void intv_cart(device_slot_interface &device); #endif // MAME_BUS_INTV_SLOT_H diff --git a/src/devices/bus/jakks_gamekey/slot.cpp b/src/devices/bus/jakks_gamekey/slot.cpp index ab4908ea3be..40fd58b0713 100644 --- a/src/devices/bus/jakks_gamekey/slot.cpp +++ b/src/devices/bus/jakks_gamekey/slot.cpp @@ -42,7 +42,7 @@ void device_jakks_gamekey_interface::rom_alloc(uint32_t size, const char *tag) { if (m_rom == nullptr) { - m_rom = device().machine().memory().region_alloc(std::string(tag).append(JAKKSSLOT_ROM_REGION_TAG).c_str(), size, 1, ENDIANNESS_BIG)->base(); + m_rom = device().machine().memory().region_alloc(std::string(tag).append(JAKKSSLOT_ROM_REGION_TAG), size, 1, ENDIANNESS_BIG)->base(); m_rom_size = size; } } diff --git a/src/devices/bus/m5/slot.cpp b/src/devices/bus/m5/slot.cpp index 8dba25c70a5..f82ba409d1e 100644 --- a/src/devices/bus/m5/slot.cpp +++ b/src/devices/bus/m5/slot.cpp @@ -48,7 +48,7 @@ void device_m5_cart_interface::rom_alloc(uint32_t size, const char *tag) { if (m_rom == nullptr) { - m_rom = device().machine().memory().region_alloc(std::string(tag).append(M5SLOT_ROM_REGION_TAG).c_str(), size, 1, ENDIANNESS_LITTLE)->base(); + m_rom = device().machine().memory().region_alloc(std::string(tag).append(M5SLOT_ROM_REGION_TAG), size, 1, ENDIANNESS_LITTLE)->base(); m_rom_size = size; } } diff --git a/src/devices/bus/mc10/mc10_cart.cpp b/src/devices/bus/mc10/mc10_cart.cpp index 40047de0fb2..cd10e800410 100644 --- a/src/devices/bus/mc10/mc10_cart.cpp +++ b/src/devices/bus/mc10/mc10_cart.cpp @@ -110,7 +110,7 @@ image_init_result mc10cart_slot_device::call_load() if (!loaded_through_softlist()) { LOG("Allocating %u byte cartridge ROM region\n", len); - romregion = machine().memory().region_alloc(subtag("rom").c_str(), len, 1, ENDIANNESS_BIG); + romregion = machine().memory().region_alloc(subtag("rom"), len, 1, ENDIANNESS_BIG); u32 const cnt(fread(romregion->base(), len)); if (cnt != len) { diff --git a/src/devices/bus/megadrive/md_slot.cpp b/src/devices/bus/megadrive/md_slot.cpp index 769bdbdc173..b62209d549e 100644 --- a/src/devices/bus/megadrive/md_slot.cpp +++ b/src/devices/bus/megadrive/md_slot.cpp @@ -82,11 +82,11 @@ device_md_cart_interface::~device_md_cart_interface() // rom_alloc - alloc the space for the cart //------------------------------------------------- -void device_md_cart_interface::rom_alloc(size_t size, const char *tag) +void device_md_cart_interface::rom_alloc(size_t size) { if (m_rom == nullptr) { - m_rom = (uint16_t *)device().machine().memory().region_alloc(std::string(tag).append(MDSLOT_ROM_REGION_TAG).c_str(), size, 2, ENDIANNESS_BIG)->base(); + m_rom = (uint16_t *)device().machine().memory().region_alloc(device().subtag("^cart:rom"), size, 2, ENDIANNESS_BIG)->base(); m_rom_size = size; } } @@ -360,7 +360,7 @@ image_init_result base_md_cart_slot_device::load_list() // if cart size is not (2^n * 64K), the system will see anyway that size so we need to alloc a bit more space length = m_cart->get_padded_size(length); - m_cart->rom_alloc(length, tag()); + m_cart->rom_alloc(length); ROM = m_cart->get_rom_base(); memcpy((uint8_t *)ROM, get_software_region("rom"), get_software_region_length("rom")); @@ -472,8 +472,8 @@ image_init_result base_md_cart_slot_device::load_nonlist() // if cart size is not (2^n * 64K), the system will see anyway that size so we need to alloc a bit more space len = m_cart->get_padded_size(tmplen - offset); - // this contains an hack for SSF2: its current bankswitch code needs larger rom space to work - m_cart->rom_alloc((len == 0x500000) ? 0x900000 : len, tag()); + // this contains an hack for SSF2: its current bankswitch code needs larger ROM space to work + m_cart->rom_alloc((len == 0x500000) ? 0x900000 : len); // STEP 3: copy the game data in the appropriate way ROM = (unsigned char *)m_cart->get_rom_base(); @@ -1080,10 +1080,10 @@ void base_md_cart_slot_device::file_logging(uint8_t *ROM8, uint32_t rom_len, uin } logerror("Checksum: %X\n", checksum); logerror(" - Calculated Checksum: %X\n", csum); - logerror("Supported I/O Devices: %.16s\n%s", io, ctrl.c_str()); + logerror("Supported I/O Devices: %.16s\n%s", io, ctrl); logerror("Modem: %.12s\n", modem); logerror("Memo: %.40s\n", memo); - logerror("Country: %.16s\n%s", country, reg.c_str()); + logerror("Country: %.16s\n%s", country, reg); logerror("ROM Start: 0x%.8X\n", rom_start); logerror("ROM End: 0x%.8X\n", rom_end); logerror("RAM Start: 0x%.8X\n", ram_start); diff --git a/src/devices/bus/megadrive/md_slot.h b/src/devices/bus/megadrive/md_slot.h index ca16a38ba92..ede1a032c2e 100644 --- a/src/devices/bus/megadrive/md_slot.h +++ b/src/devices/bus/megadrive/md_slot.h @@ -111,7 +111,7 @@ public: // this probably should do more, like make Genesis V2 'die' if the SEGA string is not written promptly virtual void write_tmss_bank(offs_t offset, uint16_t data) { device().logerror("Write to TMSS bank: offset %x data %x\n", 0xa14000 + (offset << 1), data); } - virtual void rom_alloc(size_t size, const char *tag); + virtual void rom_alloc(size_t size); virtual void nvram_alloc(size_t size); virtual uint16_t* get_rom_base() { return m_rom; } virtual uint16_t* get_nvram_base() { return &m_nvram[0]; } @@ -268,11 +268,4 @@ DECLARE_DEVICE_TYPE(MD_CART_SLOT, md_cart_slot_device) DECLARE_DEVICE_TYPE(PICO_CART_SLOT, pico_cart_slot_device) DECLARE_DEVICE_TYPE(COPERA_CART_SLOT, copera_cart_slot_device) - -/*************************************************************************** - DEVICE CONFIGURATION MACROS - ***************************************************************************/ - -#define MDSLOT_ROM_REGION_TAG ":cart:rom" - #endif // MAME_BUS_MEGADRIVE_MD_SLOT_H diff --git a/src/devices/bus/mtx/exp.cpp b/src/devices/bus/mtx/exp.cpp index 4b3f376977a..e2a4f9c8ed0 100644 --- a/src/devices/bus/mtx/exp.cpp +++ b/src/devices/bus/mtx/exp.cpp @@ -42,7 +42,7 @@ void device_mtx_exp_interface::rom_alloc(uint32_t size, const char *tag) { if (m_rom == nullptr) { - m_rom = device().machine().memory().region_alloc(std::string(tag).append(":cart:rom").c_str(), size, 1, ENDIANNESS_LITTLE)->base(); + m_rom = device().machine().memory().region_alloc(std::string(tag).append(":cart:rom"), size, 1, ENDIANNESS_LITTLE)->base(); m_rom_size = size; } } diff --git a/src/devices/bus/nes/nes_ines.hxx b/src/devices/bus/nes/nes_ines.hxx index 69b01ed120a..95f35e14735 100644 --- a/src/devices/bus/nes/nes_ines.hxx +++ b/src/devices/bus/nes/nes_ines.hxx @@ -1104,9 +1104,9 @@ void nes_cart_slot_device::call_load_ines() // SETUP step 5: allocate pointers for PRG/VROM if (prg_size) - m_cart->prg_alloc(prg_size, tag()); + m_cart->prg_alloc(prg_size); if (vrom_size) - m_cart->vrom_alloc(vrom_size, tag()); + m_cart->vrom_alloc(vrom_size); // if there is a trainer, skip it for the moment if (m_cart->get_trainer()) diff --git a/src/devices/bus/nes/nes_pcb.hxx b/src/devices/bus/nes/nes_pcb.hxx index 600809c121d..d9b63863b04 100644 --- a/src/devices/bus/nes/nes_pcb.hxx +++ b/src/devices/bus/nes/nes_pcb.hxx @@ -752,11 +752,11 @@ void nes_cart_slot_device::call_load_pcb() logerror("-- PRG WRAM: %d\n", prgram_size); // SETUP steps 5/6: allocate pointers for PRG/VROM and load the data! - m_cart->prg_alloc(prg_size, tag()); + m_cart->prg_alloc(prg_size); memcpy(m_cart->get_prg_base(), get_software_region("prg"), prg_size); if (vrom_size) { - m_cart->vrom_alloc(vrom_size, tag()); + m_cart->vrom_alloc(vrom_size); memcpy(m_cart->get_vrom_base(), get_software_region("chr"), vrom_size); } @@ -766,7 +766,7 @@ void nes_cart_slot_device::call_load_pcb() uint32_t dpcm_size = get_software_region_length("dpcm"); if (dpcm_size) { - m_cart->misc_rom_alloc(dpcm_size, tag()); + m_cart->misc_rom_alloc(dpcm_size); memcpy(m_cart->get_misc_rom_base(), get_software_region("dpcm"), dpcm_size); } } diff --git a/src/devices/bus/nes/nes_slot.cpp b/src/devices/bus/nes/nes_slot.cpp index 5e9365d97ea..aae391d27c9 100644 --- a/src/devices/bus/nes/nes_slot.cpp +++ b/src/devices/bus/nes/nes_slot.cpp @@ -158,11 +158,11 @@ device_nes_cart_interface::~device_nes_cart_interface() // pointer allocators //------------------------------------------------- -void device_nes_cart_interface::prg_alloc(size_t size, const char *tag) +void device_nes_cart_interface::prg_alloc(size_t size) { if (m_prg == nullptr) { - m_prg = device().machine().memory().region_alloc(std::string(tag).append(NESSLOT_PRGROM_REGION_TAG).c_str(), size, 1, ENDIANNESS_LITTLE)->base(); + m_prg = device().machine().memory().region_alloc(device().subtag("^cart:prg_rom"), size, 1, ENDIANNESS_LITTLE)->base(); m_prg_size = size; m_prg_chunks = size / 0x4000; if (size % 0x2000) @@ -223,25 +223,21 @@ void device_nes_cart_interface::prg_alloc(size_t size, const char *tag) } } -void device_nes_cart_interface::vrom_alloc(size_t size, const char *tag) +void device_nes_cart_interface::vrom_alloc(size_t size) { if (m_vrom == nullptr) { - std::string tempstring(tag); - tempstring.append(NESSLOT_CHRROM_REGION_TAG); - m_vrom = device().machine().memory().region_alloc(tempstring.c_str(), size, 1, ENDIANNESS_LITTLE)->base(); + m_vrom = device().machine().memory().region_alloc(device().subtag("^cart:chr_rom"), size, 1, ENDIANNESS_LITTLE)->base(); m_vrom_size = size; m_vrom_chunks = size / 0x2000; } } -void device_nes_cart_interface::misc_rom_alloc(size_t size, const char *tag) +void device_nes_cart_interface::misc_rom_alloc(size_t size) { if (m_misc_rom == nullptr) { - std::string tempstring(tag); - tempstring.append(NESSLOT_MISC_ROM_REGION_TAG); - m_misc_rom = device().machine().memory().region_alloc(tempstring.c_str(), size, 1, ENDIANNESS_LITTLE)->base(); + m_misc_rom = device().machine().memory().region_alloc(device().subtag("^cart:misc_rom"), size, 1, ENDIANNESS_LITTLE)->base(); m_misc_rom_size = size; } } diff --git a/src/devices/bus/nes/nes_slot.h b/src/devices/bus/nes/nes_slot.h index 932bff1d41d..b135f957afe 100644 --- a/src/devices/bus/nes/nes_slot.h +++ b/src/devices/bus/nes/nes_slot.h @@ -205,9 +205,9 @@ public: // hack until disk system is made modern! virtual void disk_flip_side() { } - void prg_alloc(size_t size, const char *tag); - void vrom_alloc(size_t size, const char *tag); - void misc_rom_alloc(size_t size, const char *tag); + void prg_alloc(size_t size); + void vrom_alloc(size_t size); + void misc_rom_alloc(size_t size); void prgram_alloc(size_t size); void vram_alloc(size_t size); void battery_alloc(size_t size); @@ -454,13 +454,4 @@ protected: // device type definition DECLARE_DEVICE_TYPE(NES_CART_SLOT, nes_cart_slot_device) - -/*************************************************************************** - DEVICE CONFIGURATION MACROS - ***************************************************************************/ - -#define NESSLOT_PRGROM_REGION_TAG ":cart:prg_rom" -#define NESSLOT_CHRROM_REGION_TAG ":cart:chr_rom" -#define NESSLOT_MISC_ROM_REGION_TAG ":cart:misc_rom" - #endif // MAME_BUS_NES_NES_SLOT_H diff --git a/src/devices/bus/nes/nes_unif.hxx b/src/devices/bus/nes/nes_unif.hxx index 8c153e869a2..b3d3a95f694 100644 --- a/src/devices/bus/nes/nes_unif.hxx +++ b/src/devices/bus/nes/nes_unif.hxx @@ -479,13 +479,13 @@ void nes_cart_slot_device::call_load_unif() // SETUP steps 5/6: allocate pointers for PRG/VROM and load the data! if (prg_size == 0x4000) { - m_cart->prg_alloc(0x8000, tag()); + m_cart->prg_alloc(0x8000); memcpy(m_cart->get_prg_base(), &temp_prg[0], 0x4000); memcpy(m_cart->get_prg_base() + 0x4000, m_cart->get_prg_base(), 0x4000); } else { - m_cart->prg_alloc(prg_size, tag()); + m_cart->prg_alloc(prg_size); memcpy(m_cart->get_prg_base(), &temp_prg[0], prg_size); } @@ -494,7 +494,7 @@ void nes_cart_slot_device::call_load_unif() if (vrom_size) { - m_cart->vrom_alloc(vrom_size, tag()); + m_cart->vrom_alloc(vrom_size); memcpy(m_cart->get_vrom_base(), &temp_chr[0], vrom_size); } diff --git a/src/devices/bus/pce/pce_slot.cpp b/src/devices/bus/pce/pce_slot.cpp index 5e30efbe283..e49642447de 100644 --- a/src/devices/bus/pce/pce_slot.cpp +++ b/src/devices/bus/pce/pce_slot.cpp @@ -48,11 +48,11 @@ device_pce_cart_interface::~device_pce_cart_interface() // rom_alloc - alloc the space for the cart //------------------------------------------------- -void device_pce_cart_interface::rom_alloc(uint32_t size, const char *tag) +void device_pce_cart_interface::rom_alloc(uint32_t size) { if (m_rom == nullptr) { - m_rom = device().machine().memory().region_alloc(std::string(tag).append(PCESLOT_ROM_REGION_TAG).c_str(), size, 1, ENDIANNESS_LITTLE)->base(); + m_rom = device().machine().memory().region_alloc(device().subtag("^cart:rom"), size, 1, ENDIANNESS_LITTLE)->base(); m_rom_size = size; } } @@ -227,7 +227,7 @@ image_init_result pce_cart_slot_device::call_load() fseek(offset, SEEK_SET); } - m_cart->rom_alloc(len, tag()); + m_cart->rom_alloc(len); ROM = m_cart->get_rom_base(); if (!loaded_through_softlist()) diff --git a/src/devices/bus/pce/pce_slot.h b/src/devices/bus/pce/pce_slot.h index 0d2a032cb38..3770002ca5c 100644 --- a/src/devices/bus/pce/pce_slot.h +++ b/src/devices/bus/pce/pce_slot.h @@ -37,7 +37,7 @@ public: virtual uint8_t read_cart(offs_t offset) { return 0xff; } virtual void write_cart(offs_t offset, uint8_t data) {} - void rom_alloc(uint32_t size, const char *tag); + void rom_alloc(uint32_t size); void ram_alloc(uint32_t size); uint8_t* get_rom_base() { return m_rom; } uint8_t* get_ram_base() { return &m_ram[0]; } @@ -114,11 +114,4 @@ protected: // device type definition DECLARE_DEVICE_TYPE(PCE_CART_SLOT, pce_cart_slot_device) - -/*************************************************************************** - DEVICE CONFIGURATION MACROS - ***************************************************************************/ - -#define PCESLOT_ROM_REGION_TAG ":cart:rom" - #endif // MAME_BUS_PCE_PCE_SLOT_H diff --git a/src/devices/bus/saturn/sat_slot.cpp b/src/devices/bus/saturn/sat_slot.cpp index 068e34a3f93..975a67403f0 100644 --- a/src/devices/bus/saturn/sat_slot.cpp +++ b/src/devices/bus/saturn/sat_slot.cpp @@ -57,11 +57,11 @@ device_sat_cart_interface::~device_sat_cart_interface() // rom_alloc - alloc the space for the cart //------------------------------------------------- -void device_sat_cart_interface::rom_alloc(uint32_t size, const char *tag) +void device_sat_cart_interface::rom_alloc(uint32_t size) { if (m_rom == nullptr) { - m_rom = (uint32_t *)device().machine().memory().region_alloc(std::string(tag).append(SATSLOT_ROM_REGION_TAG).c_str(), size, 4, ENDIANNESS_LITTLE)->base(); + m_rom = (uint32_t *)device().machine().memory().region_alloc(device().subtag("^cart:rom"), size, 4, ENDIANNESS_LITTLE)->base(); m_rom_size = size; } } @@ -147,7 +147,7 @@ image_init_result sat_cart_slot_device::call_load() uint32_t len = loaded_through_softlist() ? get_software_region_length("rom") : length(); uint32_t *ROM; - m_cart->rom_alloc(len, tag()); + m_cart->rom_alloc(len); ROM = m_cart->get_rom_base(); if (loaded_through_softlist()) diff --git a/src/devices/bus/saturn/sat_slot.h b/src/devices/bus/saturn/sat_slot.h index e4370e4c592..0a501866374 100644 --- a/src/devices/bus/saturn/sat_slot.h +++ b/src/devices/bus/saturn/sat_slot.h @@ -31,7 +31,7 @@ public: int get_cart_type() const { return m_cart_type; } - void rom_alloc(uint32_t size, const char *tag); + void rom_alloc(uint32_t size); void bram_alloc(uint32_t size); void dram0_alloc(uint32_t size); void dram1_alloc(uint32_t size); @@ -113,11 +113,4 @@ private: // device type definition DECLARE_DEVICE_TYPE(SATURN_CART_SLOT, sat_cart_slot_device) - -/*************************************************************************** - DEVICE CONFIGURATION MACROS - ***************************************************************************/ - -#define SATSLOT_ROM_REGION_TAG ":cart:rom" - #endif // MAME_BUS_SATURN_SAT_SLOT_H diff --git a/src/devices/bus/scv/slot.cpp b/src/devices/bus/scv/slot.cpp index 448131cbd17..b3ca1e08873 100644 --- a/src/devices/bus/scv/slot.cpp +++ b/src/devices/bus/scv/slot.cpp @@ -44,11 +44,11 @@ device_scv_cart_interface::~device_scv_cart_interface() // rom_alloc - alloc the space for the cart //------------------------------------------------- -void device_scv_cart_interface::rom_alloc(uint32_t size, const char *tag) +void device_scv_cart_interface::rom_alloc(uint32_t size) { if (m_rom == nullptr) { - m_rom = device().machine().memory().region_alloc(std::string(tag).append(SCVSLOT_ROM_REGION_TAG).c_str(), size, 1, ENDIANNESS_LITTLE)->base(); + m_rom = device().machine().memory().region_alloc(device().subtag("^cart:rom"), size, 1, ENDIANNESS_LITTLE)->base(); m_rom_size = size; } } @@ -161,7 +161,7 @@ image_init_result scv_cart_slot_device::call_load() return image_init_result::FAIL; } - m_cart->rom_alloc(len, tag()); + m_cart->rom_alloc(len); if (has_ram) m_cart->ram_alloc(get_software_region_length("ram")); diff --git a/src/devices/bus/scv/slot.h b/src/devices/bus/scv/slot.h index 8d818221be2..24ce208ab3d 100644 --- a/src/devices/bus/scv/slot.h +++ b/src/devices/bus/scv/slot.h @@ -39,7 +39,7 @@ public: virtual void write_cart(offs_t offset, uint8_t data) { } virtual void write_bank(uint8_t data) { } - void rom_alloc(uint32_t size, const char *tag); + void rom_alloc(uint32_t size); void ram_alloc(uint32_t size); uint8_t* get_rom_base() { return m_rom; } uint8_t* get_ram_base() { return &m_ram[0]; } @@ -113,11 +113,4 @@ protected: // device type definition DECLARE_DEVICE_TYPE(SCV_CART_SLOT, scv_cart_slot_device) - -/*************************************************************************** - DEVICE CONFIGURATION MACROS - ***************************************************************************/ - -#define SCVSLOT_ROM_REGION_TAG ":cart:rom" - #endif // MAME_BUS_SCV_SLOT_H diff --git a/src/devices/bus/sega8/sega8_slot.cpp b/src/devices/bus/sega8/sega8_slot.cpp index fdde1bb9401..f2ac85c896e 100644 --- a/src/devices/bus/sega8/sega8_slot.cpp +++ b/src/devices/bus/sega8/sega8_slot.cpp @@ -83,11 +83,11 @@ device_sega8_cart_interface::~device_sega8_cart_interface() // rom_alloc - alloc the space for the cart //------------------------------------------------- -void device_sega8_cart_interface::rom_alloc(uint32_t size, const char *tag) +void device_sega8_cart_interface::rom_alloc(uint32_t size) { if (m_rom == nullptr) { - m_rom = device().machine().memory().region_alloc(std::string(tag).append(S8SLOT_ROM_REGION_TAG).c_str(), size, 1, ENDIANNESS_LITTLE)->base(); + m_rom = device().machine().memory().region_alloc(device().subtag("^cart:rom"), size, 1, ENDIANNESS_LITTLE)->base(); m_rom_size = size; m_rom_page_count = size / 0x4000; if (!m_rom_page_count) @@ -413,7 +413,7 @@ image_init_result sega8_cart_slot_device::call_load() if (len & 0x3fff) len = ((len >> 14) + 1) << 14; - m_cart->rom_alloc(len, tag()); + m_cart->rom_alloc(len); ROM = m_cart->get_rom_base(); if (!loaded_through_softlist()) diff --git a/src/devices/bus/sega8/sega8_slot.h b/src/devices/bus/sega8/sega8_slot.h index 831d0500f0a..01f34842343 100644 --- a/src/devices/bus/sega8/sega8_slot.h +++ b/src/devices/bus/sega8/sega8_slot.h @@ -64,7 +64,7 @@ public: virtual uint8_t read_io(offs_t offset) { return 0xff; } virtual void write_io(offs_t offset, uint8_t data) { } - void rom_alloc(uint32_t size, const char *tag); + void rom_alloc(uint32_t size); void ram_alloc(uint32_t size); virtual void late_bank_setup() { } @@ -346,12 +346,6 @@ DECLARE_DEVICE_TYPE(GAMEGEAR_CART_SLOT, gamegear_cart_slot_device) DECLARE_DEVICE_TYPE(SMS_CARD_SLOT, sms_card_slot_device) DECLARE_DEVICE_TYPE(SG1000_CARD_SLOT, sg1000_card_slot_device) -/*************************************************************************** - DEVICE CONFIGURATION MACROS - ***************************************************************************/ - -#define S8SLOT_ROM_REGION_TAG ":cart:rom" - // slot interfaces void sg1000_cart(device_slot_interface &device); diff --git a/src/devices/bus/snes/snes_slot.cpp b/src/devices/bus/snes/snes_slot.cpp index b6764119233..7d9dbf5e9a2 100644 --- a/src/devices/bus/snes/snes_slot.cpp +++ b/src/devices/bus/snes/snes_slot.cpp @@ -88,11 +88,11 @@ device_sns_cart_interface::~device_sns_cart_interface() // rom_alloc - alloc the space for the cart //------------------------------------------------- -void device_sns_cart_interface::rom_alloc(uint32_t size, const char *tag) +void device_sns_cart_interface::rom_alloc(uint32_t size) { if (m_rom == nullptr) { - m_rom = device().machine().memory().region_alloc(std::string(tag).append(SNSSLOT_ROM_REGION_TAG).c_str(), size, 1, ENDIANNESS_LITTLE)->base(); + m_rom = device().machine().memory().region_alloc(device().subtag("^cart:rom"), size, 1, ENDIANNESS_LITTLE)->base(); m_rom_size = size; } } @@ -669,7 +669,7 @@ image_init_result base_sns_cart_slot_device::call_load() len = !loaded_through_softlist() ? (length() - offset) : get_software_region_length("rom"); - m_cart->rom_alloc(len, tag()); + m_cart->rom_alloc(len); ROM = m_cart->get_rom_base(); if (!loaded_through_softlist()) fread(ROM, len); @@ -851,37 +851,37 @@ void base_sns_cart_slot_device::setup_addon_from_fullpath() switch (m_addon) { case ADDON_DSP1: - ROM = machine().root_device().memregion(region.c_str())->base(); + ROM = machine().root_device().memregion(region)->base(); m_cart->addon_bios_alloc(0x2800); memcpy(m_cart->get_addon_bios_base(), ROM, 0x2800); break; case ADDON_DSP1B: - ROM = machine().root_device().memregion(region.c_str())->base(); + ROM = machine().root_device().memregion(region)->base(); m_cart->addon_bios_alloc(0x2800); memcpy(m_cart->get_addon_bios_base(), ROM, 0x2800); break; case ADDON_DSP2: - ROM = machine().root_device().memregion(region.c_str())->base(); + ROM = machine().root_device().memregion(region)->base(); m_cart->addon_bios_alloc(0x2800); memcpy(m_cart->get_addon_bios_base(), ROM, 0x2800); break; case ADDON_DSP3: - ROM = machine().root_device().memregion(region.c_str())->base(); + ROM = machine().root_device().memregion(region)->base(); m_cart->addon_bios_alloc(0x2800); memcpy(m_cart->get_addon_bios_base(), ROM, 0x2800); break; case ADDON_DSP4: - ROM = machine().root_device().memregion(region.c_str())->base(); + ROM = machine().root_device().memregion(region)->base(); m_cart->addon_bios_alloc(0x2800); memcpy(m_cart->get_addon_bios_base(), ROM, 0x2800); break; case ADDON_ST010: - ROM = machine().root_device().memregion(region.c_str())->base(); + ROM = machine().root_device().memregion(region)->base(); m_cart->addon_bios_alloc(0x11000); memcpy(m_cart->get_addon_bios_base(), ROM, 0x11000); break; case ADDON_ST011: - ROM = machine().root_device().memregion(region.c_str())->base(); + ROM = machine().root_device().memregion(region)->base(); m_cart->addon_bios_alloc(0x11000); memcpy(m_cart->get_addon_bios_base(), ROM, 0x11000); break; diff --git a/src/devices/bus/snes/snes_slot.h b/src/devices/bus/snes/snes_slot.h index cb90c41d64f..ec777ee8cc1 100644 --- a/src/devices/bus/snes/snes_slot.h +++ b/src/devices/bus/snes/snes_slot.h @@ -123,7 +123,7 @@ public: virtual void chip_write(offs_t offset, uint8_t data) { } virtual void speedup_addon_bios_access() {} - void rom_alloc(uint32_t size, const char *tag); + void rom_alloc(uint32_t size); void nvram_alloc(uint32_t size); void rtc_ram_alloc(uint32_t size); void addon_bios_alloc(uint32_t size); @@ -312,12 +312,4 @@ DECLARE_DEVICE_TYPE(SNS_CART_SLOT, sns_cart_slot_device) DECLARE_DEVICE_TYPE(SNS_SUFAMI_CART_SLOT, sns_sufami_cart_slot_device) DECLARE_DEVICE_TYPE(SNS_BSX_CART_SLOT, sns_bsx_cart_slot_device) - -/*************************************************************************** - DEVICE CONFIGURATION MACROS - ***************************************************************************/ - -#define SNSSLOT_ROM_REGION_TAG ":cart:rom" - - #endif // MAME_BUS_SNES_SNES_SLOT_H diff --git a/src/devices/bus/vboy/slot.cpp b/src/devices/bus/vboy/slot.cpp index abbbd527941..1fe0c1c651e 100644 --- a/src/devices/bus/vboy/slot.cpp +++ b/src/devices/bus/vboy/slot.cpp @@ -69,7 +69,7 @@ image_init_result vboy_cart_slot_device::call_load() if (!loaded_through_softlist()) { LOG("Allocating %u byte cartridge ROM region\n", len); - romregion = machine().memory().region_alloc(subtag("rom").c_str(), len, 4, ENDIANNESS_LITTLE); + romregion = machine().memory().region_alloc(subtag("rom"), len, 4, ENDIANNESS_LITTLE); u32 const cnt(fread(romregion->base(), len)); if (cnt != len) { diff --git a/src/devices/bus/vc4000/slot.cpp b/src/devices/bus/vc4000/slot.cpp index ce8acfcbf43..4c8f2dd77c4 100644 --- a/src/devices/bus/vc4000/slot.cpp +++ b/src/devices/bus/vc4000/slot.cpp @@ -45,11 +45,11 @@ device_vc4000_cart_interface::~device_vc4000_cart_interface() // rom_alloc - alloc the space for the cart //------------------------------------------------- -void device_vc4000_cart_interface::rom_alloc(uint32_t size, const char *tag) +void device_vc4000_cart_interface::rom_alloc(uint32_t size) { if (m_rom == nullptr) { - m_rom = device().machine().memory().region_alloc(std::string(tag).append(VC4000SLOT_ROM_REGION_TAG).c_str(), size, 1, ENDIANNESS_LITTLE)->base(); + m_rom = device().machine().memory().region_alloc(device().subtag("^cart:rom"), size, 1, ENDIANNESS_LITTLE)->base(); m_rom_size = size; } } @@ -180,7 +180,7 @@ image_init_result vc4000_cart_slot_device::call_load() return image_init_result::FAIL; } - m_cart->rom_alloc(size, tag()); + m_cart->rom_alloc(size); if (!loaded_through_softlist()) fread(m_cart->get_rom_base(), size); diff --git a/src/devices/bus/vc4000/slot.h b/src/devices/bus/vc4000/slot.h index 39de8414d0b..90f75232699 100644 --- a/src/devices/bus/vc4000/slot.h +++ b/src/devices/bus/vc4000/slot.h @@ -6,8 +6,6 @@ #include "imagedev/cartrom.h" -#define VC4000SLOT_ROM_REGION_TAG ":cart:rom" - /* PCB */ enum { @@ -32,7 +30,7 @@ public: virtual uint8_t read_ram(offs_t offset) { return 0xff; } virtual void write_ram(offs_t offset, uint8_t data) { } - void rom_alloc(uint32_t size, const char *tag); + void rom_alloc(uint32_t size); void ram_alloc(uint32_t size); uint8_t* get_rom_base() { return m_rom; } uint8_t* get_ram_base() { return &m_ram[0]; } diff --git a/src/devices/bus/vcs/vcs_slot.cpp b/src/devices/bus/vcs/vcs_slot.cpp index cc6fd49d7b4..7b9e620c740 100644 --- a/src/devices/bus/vcs/vcs_slot.cpp +++ b/src/devices/bus/vcs/vcs_slot.cpp @@ -80,7 +80,7 @@ void device_vcs_cart_interface::rom_alloc(uint32_t size, const char *tag) { if (m_rom == nullptr) { - m_rom = device().machine().memory().region_alloc(std::string(tag).append(":cart:rom").c_str(), size, 1, ENDIANNESS_LITTLE)->base(); + m_rom = device().machine().memory().region_alloc(std::string(tag).append(":cart:rom"), size, 1, ENDIANNESS_LITTLE)->base(); m_rom_size = size; } } diff --git a/src/devices/bus/vectrex/slot.cpp b/src/devices/bus/vectrex/slot.cpp index 71b9be61a83..0b527eaeb27 100644 --- a/src/devices/bus/vectrex/slot.cpp +++ b/src/devices/bus/vectrex/slot.cpp @@ -44,11 +44,11 @@ device_vectrex_cart_interface::~device_vectrex_cart_interface() // rom_alloc - alloc the space for the cart //------------------------------------------------- -void device_vectrex_cart_interface::rom_alloc(uint32_t size, const char *tag) +void device_vectrex_cart_interface::rom_alloc(uint32_t size) { if (m_rom == nullptr) { - m_rom = device().machine().memory().region_alloc(std::string(tag).append(VECSLOT_ROM_REGION_TAG).c_str(), size, 1, ENDIANNESS_LITTLE)->base(); + m_rom = device().machine().memory().region_alloc(device().subtag("^cart:rom"), size, 1, ENDIANNESS_LITTLE)->base(); m_rom_size = size; } } @@ -149,7 +149,7 @@ image_init_result vectrex_cart_slot_device::call_load() return image_init_result::FAIL; } - m_cart->rom_alloc((size < 0x1000) ? 0x1000 : size, tag()); + m_cart->rom_alloc((size < 0x1000) ? 0x1000 : size); ROM = m_cart->get_rom_base(); if (!loaded_through_softlist()) diff --git a/src/devices/bus/vectrex/slot.h b/src/devices/bus/vectrex/slot.h index d010bae8e62..577338f80fa 100644 --- a/src/devices/bus/vectrex/slot.h +++ b/src/devices/bus/vectrex/slot.h @@ -43,7 +43,7 @@ public: virtual void write_ram(offs_t offset, uint8_t data) { } virtual void write_bank(uint8_t data) { } - void rom_alloc(uint32_t size, const char *tag); + void rom_alloc(uint32_t size); uint8_t* get_rom_base() { return m_rom; } uint32_t get_rom_size() { return m_rom_size; } @@ -99,11 +99,4 @@ protected: // device type definition DECLARE_DEVICE_TYPE(VECTREX_CART_SLOT, vectrex_cart_slot_device) - -/*************************************************************************** - DEVICE CONFIGURATION MACROS - ***************************************************************************/ - -#define VECSLOT_ROM_REGION_TAG ":cart:rom" - #endif // MAME_BUS_VECTREX_SLOT_H diff --git a/src/devices/bus/vsmile/vsmile_slot.cpp b/src/devices/bus/vsmile/vsmile_slot.cpp index f7a44c3014a..5be96466c64 100644 --- a/src/devices/bus/vsmile/vsmile_slot.cpp +++ b/src/devices/bus/vsmile/vsmile_slot.cpp @@ -44,12 +44,12 @@ device_vsmile_cart_interface::~device_vsmile_cart_interface() // rom_alloc - alloc the space for the cart //------------------------------------------------- -void device_vsmile_cart_interface::rom_alloc(uint32_t size, const char *tag) +void device_vsmile_cart_interface::rom_alloc(uint32_t size) { if (m_rom == nullptr) { // We always alloc 8MB of ROM region - m_rom = (uint16_t *)device().machine().memory().region_alloc(std::string(tag).append(VSMILE_SLOT_ROM_REGION_TAG).c_str(), size, 2, ENDIANNESS_BIG)->base(); + m_rom = (uint16_t *)device().machine().memory().region_alloc(device().subtag("^cart:rom"), size, 2, ENDIANNESS_BIG)->base(); m_rom_size = size; } } @@ -143,7 +143,7 @@ image_init_result vsmile_cart_slot_device::call_load() return image_init_result::FAIL; } - m_cart->rom_alloc(size, tag()); + m_cart->rom_alloc(size); uint8_t *rom = (uint8_t *)m_cart->get_rom_base(); if (!loaded_through_softlist()) diff --git a/src/devices/bus/vsmile/vsmile_slot.h b/src/devices/bus/vsmile/vsmile_slot.h index 910e352db21..5313abe092b 100644 --- a/src/devices/bus/vsmile/vsmile_slot.h +++ b/src/devices/bus/vsmile/vsmile_slot.h @@ -12,8 +12,6 @@ TYPE DEFINITIONS ***************************************************************************/ -#define VSMILE_SLOT_ROM_REGION_TAG ":cart:rom" - enum { VSMILE_STD = 0, @@ -41,7 +39,7 @@ public: // banking virtual void set_cs2(bool cs2) = 0; - void rom_alloc(uint32_t size, const char *tag); + void rom_alloc(uint32_t size); void nvram_alloc(uint32_t size); uint16_t* get_rom_base() { return m_rom; } uint16_t* get_nvram_base() { return &m_nvram[0]; } diff --git a/src/devices/bus/wswan/slot.cpp b/src/devices/bus/wswan/slot.cpp index 6062540b4cf..959f43f4bd0 100644 --- a/src/devices/bus/wswan/slot.cpp +++ b/src/devices/bus/wswan/slot.cpp @@ -47,11 +47,11 @@ device_ws_cart_interface::~device_ws_cart_interface() // rom_alloc - alloc the space for the cart //------------------------------------------------- -void device_ws_cart_interface::rom_alloc(u32 size, const char *tag) +void device_ws_cart_interface::rom_alloc(u32 size) { if (m_rom == nullptr) { - m_rom = (u16 *)device().machine().memory().region_alloc(std::string(tag).append(WSSLOT_ROM_REGION_TAG).c_str(), size, 2, ENDIANNESS_LITTLE)->base(); + m_rom = (u16 *)device().machine().memory().region_alloc(device().subtag("^cart:rom"), size, 2, ENDIANNESS_LITTLE)->base(); m_rom_size = size; m_bank_mask = ((m_rom_size >> 16) - 1); } @@ -158,7 +158,7 @@ image_init_result ws_cart_slot_device::call_load() u32 size = !loaded_through_softlist() ? length() : get_software_region_length("rom"); u32 nvram_size = 0; - m_cart->rom_alloc(size, tag()); + m_cart->rom_alloc(size); ROM = m_cart->get_rom_base(); if (!loaded_through_softlist()) diff --git a/src/devices/bus/wswan/slot.h b/src/devices/bus/wswan/slot.h index 8a743a2ac07..fd9d1928b92 100644 --- a/src/devices/bus/wswan/slot.h +++ b/src/devices/bus/wswan/slot.h @@ -101,7 +101,7 @@ public: virtual u16 read_io(offs_t offset, u16 mem_mask) { return 0xffff; } virtual void write_io(offs_t offset, u16 data, u16 mem_mask) { } - void rom_alloc(u32 size, const char *tag); + void rom_alloc(u32 size); void nvram_alloc(u32 size); u16* get_rom_base() { return m_rom; } uint8_t* get_nvram_base() { return &m_nvram[0]; } @@ -184,11 +184,4 @@ protected: // device type definition DECLARE_DEVICE_TYPE(WS_CART_SLOT, ws_cart_slot_device) - -/*************************************************************************** - DEVICE CONFIGURATION MACROS - ***************************************************************************/ - -#define WSSLOT_ROM_REGION_TAG ":cart:rom" - #endif // MAME_BUS_WSWAN_SLOT_H diff --git a/src/mame/interpro/interpro.cpp b/src/mame/intergraph/interpro.cpp similarity index 100% rename from src/mame/interpro/interpro.cpp rename to src/mame/intergraph/interpro.cpp diff --git a/src/mame/interpro/interpro_arbga.cpp b/src/mame/intergraph/interpro_arbga.cpp similarity index 100% rename from src/mame/interpro/interpro_arbga.cpp rename to src/mame/intergraph/interpro_arbga.cpp diff --git a/src/mame/interpro/interpro_arbga.h b/src/mame/intergraph/interpro_arbga.h similarity index 100% rename from src/mame/interpro/interpro_arbga.h rename to src/mame/intergraph/interpro_arbga.h diff --git a/src/mame/interpro/interpro_ioga.cpp b/src/mame/intergraph/interpro_ioga.cpp similarity index 100% rename from src/mame/interpro/interpro_ioga.cpp rename to src/mame/intergraph/interpro_ioga.cpp diff --git a/src/mame/interpro/interpro_ioga.h b/src/mame/intergraph/interpro_ioga.h similarity index 100% rename from src/mame/interpro/interpro_ioga.h rename to src/mame/intergraph/interpro_ioga.h diff --git a/src/mame/interpro/interpro_mcga.cpp b/src/mame/intergraph/interpro_mcga.cpp similarity index 100% rename from src/mame/interpro/interpro_mcga.cpp rename to src/mame/intergraph/interpro_mcga.cpp diff --git a/src/mame/interpro/interpro_mcga.h b/src/mame/intergraph/interpro_mcga.h similarity index 100% rename from src/mame/interpro/interpro_mcga.h rename to src/mame/intergraph/interpro_mcga.h diff --git a/src/mame/interpro/interpro_sga.cpp b/src/mame/intergraph/interpro_sga.cpp similarity index 100% rename from src/mame/interpro/interpro_sga.cpp rename to src/mame/intergraph/interpro_sga.cpp diff --git a/src/mame/interpro/interpro_sga.h b/src/mame/intergraph/interpro_sga.h similarity index 100% rename from src/mame/interpro/interpro_sga.h rename to src/mame/intergraph/interpro_sga.h