image_init_result z88cart_slot_device::call_load() { if (m_cart) { offs_t read_length; uint8_t *cart_base = m_cart->get_cart_base(); if (cart_base != nullptr) { if (software_entry() == nullptr) { read_length = length(); fread(cart_base + (m_cart->get_cart_size() - read_length), read_length); } else { read_length = get_software_region_length("rom"); memcpy(cart_base + (m_cart->get_cart_size() - read_length), get_software_region("rom"), read_length); } } else return image_init_result::FAIL; } // open the flap m_out_flp_cb(ASSERT_LINE); // setup the timer for close the flap m_flp_timer->adjust(CLOSE_FLAP_TIME); return image_init_result::PASS; }
bool z88cart_slot_device::call_load() { if (m_cart) { offs_t read_length = 0; UINT8 *cart_base = m_cart->get_cart_base(); if (cart_base != NULL) { if (software_entry() == NULL) { read_length = length(); fread(cart_base + (m_cart->get_cart_size() - read_length), read_length); } else { read_length = get_software_region_length("rom"); memcpy(cart_base + (m_cart->get_cart_size() - read_length), get_software_region("rom"), read_length); } } else return IMAGE_INIT_FAIL; } // open the flap m_out_flp_cb(ASSERT_LINE); // setup the timer for close the flap m_flp_timer->adjust(CLOSE_FLAP_TIME); return IMAGE_INIT_PASS; }
void z88cart_slot_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) { if (id == TIMER_FLP_CLEAR) { // close the flap m_out_flp_cb(CLEAR_LINE); } }
void z88cart_slot_device::call_unload() { if (m_cart) memset(m_cart->get_cart_base(), 0xff, m_cart->get_cart_size()); // open the flap m_out_flp_cb(ASSERT_LINE); // setup the timer for close the flap m_flp_timer->adjust(CLOSE_FLAP_TIME); }