summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/jakks_gamekey/slot.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/jakks_gamekey/slot.cpp')
-rw-r--r--src/devices/bus/jakks_gamekey/slot.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/devices/bus/jakks_gamekey/slot.cpp b/src/devices/bus/jakks_gamekey/slot.cpp
index f680211859a..7da3904f32c 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;
}
}
@@ -56,7 +56,7 @@ void device_jakks_gamekey_interface::rom_alloc(uint32_t size, const char *tag)
//-------------------------------------------------
jakks_gamekey_slot_device::jakks_gamekey_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, JAKKS_GAMEKEY_SLOT, tag, owner, clock),
- device_image_interface(mconfig, *this),
+ device_cartrom_image_interface(mconfig, *this),
device_single_card_slot_interface<device_jakks_gamekey_interface>(mconfig, *this),
m_type(JAKKS_GAMEKEY_PLAIN),
m_cart(nullptr)
@@ -125,16 +125,15 @@ static const char *jakks_gamekey_get_slot(int type)
call load
-------------------------------------------------*/
-image_init_result jakks_gamekey_slot_device::call_load()
+std::pair<std::error_condition, std::string> jakks_gamekey_slot_device::call_load()
{
if (m_cart)
{
- uint8_t *ROM;
- 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());
- ROM = m_cart->get_rom_base();
+ uint8_t *const ROM = m_cart->get_rom_base();
if (!loaded_through_softlist())
fread(ROM, len);
@@ -153,11 +152,9 @@ image_init_result jakks_gamekey_slot_device::call_load()
if (pcb_name)
m_type = jakks_gamekey_get_pcb_id(pcb_name);
}
-
- return image_init_result::PASS;
}
- return image_init_result::PASS;
+ return std::make_pair(std::error_condition(), std::string());
}
@@ -186,8 +183,7 @@ std::string jakks_gamekey_slot_device::get_default_card_software(get_default_car
hook.image_file()->length(len); // FIXME: check error return, guard against excessively large files
std::vector<uint8_t> rom(len);
- size_t actual;
- hook.image_file()->read(&rom[0], len, actual); // FIXME: check error return or read returning short
+ read(*hook.image_file(), &rom[0], len); // FIXME: check error return or read returning short
int const type = get_cart_type(&rom[0], len);
char const *const slot_string = jakks_gamekey_get_slot(type);