summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/wswan/slot.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/wswan/slot.cpp')
-rw-r--r--src/devices/bus/wswan/slot.cpp22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/devices/bus/wswan/slot.cpp b/src/devices/bus/wswan/slot.cpp
index 3e11eb00908..31edbc6d971 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);
}
@@ -78,7 +78,7 @@ void device_ws_cart_interface::nvram_alloc(u32 size)
//-------------------------------------------------
ws_cart_slot_device::ws_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
device_t(mconfig, WS_CART_SLOT, tag, owner, clock),
- device_image_interface(mconfig, *this),
+ device_cartrom_image_interface(mconfig, *this),
device_single_card_slot_interface<device_ws_cart_interface>(mconfig, *this),
m_type(WS_STD),
m_cart(nullptr)
@@ -150,22 +150,21 @@ static const char *ws_get_slot(int type)
call load
-------------------------------------------------*/
-image_init_result ws_cart_slot_device::call_load()
+std::pair<std::error_condition, std::string> ws_cart_slot_device::call_load()
{
if (m_cart)
{
- u16 *ROM;
- u32 size = !loaded_through_softlist() ? length() : get_software_region_length("rom");
- u32 nvram_size = 0;
+ u32 const size = !loaded_through_softlist() ? length() : get_software_region_length("rom");
- m_cart->rom_alloc(size, tag());
- ROM = m_cart->get_rom_base();
+ m_cart->rom_alloc(size);
+ u16 *const ROM = m_cart->get_rom_base();
if (!loaded_through_softlist())
fread(ROM, size);
else
memcpy(ROM, get_software_region("rom"), size);
+ u32 nvram_size = 0;
if (!loaded_through_softlist())
{
// get cart type and nvram length
@@ -203,7 +202,7 @@ image_init_result ws_cart_slot_device::call_load()
internal_header_logging(ROM, ((size >> 16) - 1) << 16, size);
}
- return image_init_result::PASS;
+ return std::make_pair(std::error_condition(), std::string());
}
/*-------------------------------------------------
@@ -291,8 +290,7 @@ std::string ws_cart_slot_device::get_default_card_software(get_default_card_soft
int type;
u32 nvram;
- size_t actual;
- hook.image_file()->read(&rom[0], size, actual);
+ /*[err, actual] =*/ read(*hook.image_file(), &rom[0], size);
// nvram size is not really used here, but we set it up nevertheless
type = get_cart_type(&rom[0], size, nvram);