summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/ekara/slot.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/ekara/slot.cpp')
-rw-r--r--src/devices/bus/ekara/slot.cpp28
1 files changed, 12 insertions, 16 deletions
diff --git a/src/devices/bus/ekara/slot.cpp b/src/devices/bus/ekara/slot.cpp
index 459e14317b6..33f4e087fa4 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;
}
}
@@ -56,7 +56,7 @@ void device_ekara_cart_interface::rom_alloc(uint32_t size, const char *tag)
//-------------------------------------------------
ekara_cart_slot_device::ekara_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, EKARA_CART_SLOT, tag, owner, clock),
- device_image_interface(mconfig, *this),
+ device_cartrom_image_interface(mconfig, *this),
device_single_card_slot_interface<device_ekara_cart_interface>(mconfig, *this),
m_type(EKARA_PLAIN),
m_cart(nullptr)
@@ -127,16 +127,15 @@ static const char *ekara_get_slot(int type)
call load
-------------------------------------------------*/
-image_init_result ekara_cart_slot_device::call_load()
+std::pair<std::error_condition, std::string> ekara_cart_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());
+ m_cart->rom_alloc(len);
- ROM = m_cart->get_rom_base();
+ uint8_t *const ROM = m_cart->get_rom_base();
if (!loaded_through_softlist())
fread(ROM, len);
@@ -155,11 +154,9 @@ image_init_result ekara_cart_slot_device::call_load()
if (pcb_name)
m_type = ekara_get_pcb_id(pcb_name);
}
-
- return image_init_result::PASS;
}
- return image_init_result::PASS;
+ return std::make_pair(std::error_condition(), std::string());
}
@@ -188,8 +185,7 @@ std::string ekara_cart_slot_device::get_default_card_software(get_default_card_s
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
+ /*auto const [err, actual] =*/ 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 = ekara_get_slot(type);
@@ -261,17 +257,17 @@ bool ekara_cart_slot_device::is_write_access_not_rom(void)
direct seeprom access (popira2, gc0010)
-------------------------------------------------*/
-WRITE_LINE_MEMBER(ekara_cart_slot_device::write_sda)
+void ekara_cart_slot_device::write_sda(int state)
{
m_cart->write_sda(state);
}
-WRITE_LINE_MEMBER(ekara_cart_slot_device::write_scl)
+void ekara_cart_slot_device::write_scl(int state)
{
m_cart->write_scl(state);
}
-READ_LINE_MEMBER(ekara_cart_slot_device::read_sda )
+int ekara_cart_slot_device::read_sda()
{
return m_cart->read_sda();
}