void legacy_memory_device_config_base::device_config_complete() { m_space_config.m_name = "memory"; m_space_config.m_endianness = static_cast<endianness_t>(get_legacy_config_int(DEVINFO_INT_ENDIANNESS)); m_space_config.m_databus_width = get_legacy_config_int(DEVINFO_INT_DATABUS_WIDTH); m_space_config.m_addrbus_width = get_legacy_config_int(DEVINFO_INT_ADDRBUS_WIDTH); m_space_config.m_addrbus_shift = get_legacy_config_int(DEVINFO_INT_ADDRBUS_SHIFT); m_space_config.m_logaddr_width = m_space_config.m_addrbus_width; m_space_config.m_page_shift = 0; m_space_config.m_internal_map = reinterpret_cast<address_map_constructor>(get_legacy_config_fct(DEVINFO_PTR_INTERNAL_MEMORY_MAP)); m_space_config.m_default_map = reinterpret_cast<address_map_constructor>(get_legacy_config_fct(DEVINFO_PTR_DEFAULT_MEMORY_MAP)); }
legacy_device_config_base::legacy_device_config_base(const machine_config &mconfig, device_type type, const char *tag, const device_config *owner, UINT32 clock, device_get_config_func get_config) : device_config(mconfig, type, "Legacy Device", tag, owner, clock), m_get_config_func(get_config), m_inline_config(NULL) { // allocate a buffer for the inline configuration UINT32 configlen = (UINT32)get_legacy_config_int(DEVINFO_INT_INLINE_CONFIG_BYTES); if (configlen != 0) m_inline_config = global_alloc_array_clear(UINT8, configlen); // set the proper name m_name = get_legacy_config_string(DEVINFO_STR_NAME); }
void legacy_image_device_config_base::device_config_complete() { const device_config_image_interface *image = NULL; int count = 0; int index = -1; image_device_format **formatptr; image_device_format *format; formatptr = &m_formatlist; int cnt = 0; m_type = static_cast<iodevice_t>(get_legacy_config_int(DEVINFO_INT_IMAGE_TYPE)); m_readable = get_legacy_config_int(DEVINFO_INT_IMAGE_READABLE)!=0; m_writeable = get_legacy_config_int(DEVINFO_INT_IMAGE_WRITEABLE)!=0; m_creatable = get_legacy_config_int(DEVINFO_INT_IMAGE_CREATABLE)!=0; m_must_be_loaded = get_legacy_config_int(DEVINFO_INT_IMAGE_MUST_BE_LOADED)!=0; m_reset_on_load = get_legacy_config_int(DEVINFO_INT_IMAGE_RESET_ON_LOAD)!=0; m_has_partial_hash = get_legacy_config_int(DEVINFO_FCT_IMAGE_PARTIAL_HASH)!=0; m_interface_name = get_legacy_config_string(DEVINFO_STR_IMAGE_INTERFACE); m_file_extensions = get_legacy_config_string(DEVINFO_STR_IMAGE_FILE_EXTENSIONS); m_create_option_guide = reinterpret_cast<const option_guide *>(get_legacy_config_ptr(DEVINFO_PTR_IMAGE_CREATE_OPTGUIDE)); int format_count = get_legacy_config_int(DEVINFO_INT_IMAGE_CREATE_OPTCOUNT); for (int i = 0; i < format_count; i++) { // only add if creatable if (get_legacy_config_string(DEVINFO_PTR_IMAGE_CREATE_OPTSPEC + i)) { // allocate a new format format = global_alloc_clear(image_device_format); // populate it format->m_index = cnt; format->m_name = get_legacy_config_string(DEVINFO_STR_IMAGE_CREATE_OPTNAME + i); format->m_description = get_legacy_config_string(DEVINFO_STR_IMAGE_CREATE_OPTDESC + i); format->m_extensions = get_legacy_config_string(DEVINFO_STR_IMAGE_CREATE_OPTEXTS + i); format->m_optspec = get_legacy_config_string(DEVINFO_PTR_IMAGE_CREATE_OPTSPEC + i); // and append it to the list *formatptr = format; formatptr = &format->m_next; cnt++; } } for (bool gotone = device_config::m_machine_config.m_devicelist.first(image); gotone; gotone = image->next(image)) { if (this == image) index = count; if (image->image_type_direct() == m_type) count++; } if (count > 1) { m_instance_name.printf("%s%d", device_typename(m_type), index + 1); m_brief_instance_name.printf("%s%d", device_brieftypename(m_type), index + 1); } else { m_instance_name = device_typename(m_type); m_brief_instance_name = device_brieftypename(m_type); } // Override in case of hardcoded values if (strlen(get_legacy_config_string(DEVINFO_STR_IMAGE_INSTANCE_NAME))>0) { m_instance_name = get_legacy_config_string(DEVINFO_STR_IMAGE_INSTANCE_NAME); } if (strlen(get_legacy_config_string(DEVINFO_STR_IMAGE_BRIEF_INSTANCE_NAME))>0) { m_brief_instance_name = get_legacy_config_string(DEVINFO_STR_IMAGE_BRIEF_INSTANCE_NAME); } }