diff options
Diffstat (limited to 'src/devices/bus/arcadia/slot.cpp')
-rw-r--r-- | src/devices/bus/arcadia/slot.cpp | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/src/devices/bus/arcadia/slot.cpp b/src/devices/bus/arcadia/slot.cpp index 19d2b1459f8..5390ca91bf4 100644 --- a/src/devices/bus/arcadia/slot.cpp +++ b/src/devices/bus/arcadia/slot.cpp @@ -7,7 +7,6 @@ ***********************************************************************************************************/ - #include "emu.h" #include "slot.h" @@ -45,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; } } @@ -64,7 +63,7 @@ void device_arcadia_cart_interface::rom_alloc(uint32_t size, const char *tag) //------------------------------------------------- arcadia_cart_slot_device::arcadia_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, EA2001_CART_SLOT, tag, owner, clock), - device_image_interface(mconfig, *this), + device_cartrom_image_interface(mconfig, *this), device_single_card_slot_interface<device_arcadia_cart_interface>(mconfig, *this), m_type(ARCADIA_STD), m_cart(nullptr) { @@ -110,7 +109,7 @@ static int arcadia_get_pcb_id(const char *slot) { for (auto & elem : slot_list) { - if (!core_stricmp(elem.slot_option, slot)) + if (!strcmp(elem.slot_option, slot)) return elem.pcb_id; } @@ -120,7 +119,7 @@ static int arcadia_get_pcb_id(const char *slot) #if 0 static const char *arcadia_get_slot(int type) { - for (int i = 0; i < ARRAY_LENGTH(slot_list); i++) + for (int i = 0; i < std::size(slot_list); i++) { if (slot_list[i].pcb_id == type) return slot_list[i].slot_option; @@ -134,13 +133,13 @@ static const char *arcadia_get_slot(int type) call load -------------------------------------------------*/ -image_init_result arcadia_cart_slot_device::call_load() +std::pair<std::error_condition, std::string> arcadia_cart_slot_device::call_load() { if (m_cart) { - uint32_t len = !loaded_through_softlist() ? length() : get_software_region_length("rom"); + uint32_t const 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); @@ -194,11 +193,9 @@ image_init_result arcadia_cart_slot_device::call_load() } //printf("Type: %s\n", arcadia_get_slot(m_type)); - - return image_init_result::PASS; } - return image_init_result::PASS; + return std::make_pair(std::error_condition(), std::string()); } @@ -215,10 +212,10 @@ std::string arcadia_cart_slot_device::get_default_card_software(get_default_card read -------------------------------------------------*/ -READ8_MEMBER(arcadia_cart_slot_device::read_rom) +uint8_t arcadia_cart_slot_device::read_rom(offs_t offset) { if (m_cart) - return m_cart->read_rom(space, offset); + return m_cart->read_rom(offset); else return 0xff; } @@ -227,10 +224,10 @@ READ8_MEMBER(arcadia_cart_slot_device::read_rom) write -------------------------------------------------*/ -READ8_MEMBER(arcadia_cart_slot_device::extra_rom) +uint8_t arcadia_cart_slot_device::extra_rom(offs_t offset) { if (m_cart) - return m_cart->extra_rom(space, offset); + return m_cart->extra_rom(offset); else return 0xff; } |