trunk/src/emu/diimage.c
| r20210 | r20211 | |
| 936 | 936 | if (m_err) |
| 937 | 937 | goto done; |
| 938 | 938 | |
| 939 | | /* Check if there's a software list defined for this device and use that if we're not creating an image */ |
| 940 | | if (!filename_has_period && !just_load) |
| 939 | if (core_opens_image_file()) |
| 941 | 940 | { |
| 942 | | softload = load_software_part( device().machine().options(), this, path, &m_software_info_ptr, &m_software_part_ptr, &m_full_software_name, &m_software_list_name ); |
| 943 | | // if we had launched from softlist with a specified part, e.g. "shortname:part" |
| 944 | | // we would have recorded the wrong name, so record it again based on software_info |
| 945 | | if (m_software_info_ptr && m_full_software_name) |
| 946 | | m_err = set_image_filename(m_full_software_name); |
| 941 | /* Check if there's a software list defined for this device and use that if we're not creating an image */ |
| 942 | if (!filename_has_period && !just_load) |
| 943 | { |
| 944 | softload = load_software_part( device().machine().options(), this, path, &m_software_info_ptr, &m_software_part_ptr, &m_full_software_name, &m_software_list_name ); |
| 945 | // if we had launched from softlist with a specified part, e.g. "shortname:part" |
| 946 | // we would have recorded the wrong name, so record it again based on software_info |
| 947 | if (m_software_info_ptr && m_full_software_name) |
| 948 | m_err = set_image_filename(m_full_software_name); |
| 947 | 949 | |
| 948 | | m_from_swlist = TRUE; |
| 949 | | } |
| 950 | m_from_swlist = TRUE; |
| 951 | } |
| 950 | 952 | |
| 951 | | if (is_create || filename_has_period) |
| 952 | | { |
| 953 | | /* determine open plan */ |
| 954 | | determine_open_plan(is_create, open_plan); |
| 953 | if (is_create || filename_has_period) |
| 954 | { |
| 955 | /* determine open plan */ |
| 956 | determine_open_plan(is_create, open_plan); |
| 955 | 957 | |
| 956 | | /* attempt to open the file in various ways */ |
| 957 | | for (i = 0; !m_file && open_plan[i]; i++) |
| 958 | /* attempt to open the file in various ways */ |
| 959 | for (i = 0; !m_file && open_plan[i]; i++) |
| 960 | { |
| 961 | /* open the file */ |
| 962 | m_err = load_image_by_path(open_plan[i], path); |
| 963 | if (m_err && (m_err != IMAGE_ERROR_FILENOTFOUND)) |
| 964 | goto done; |
| 965 | } |
| 966 | } |
| 967 | |
| 968 | /* Copy some image information when we have been loaded through a software list */ |
| 969 | if ( m_software_info_ptr ) |
| 958 | 970 | { |
| 959 | | /* open the file */ |
| 960 | | m_err = load_image_by_path(open_plan[i], path); |
| 961 | | if (m_err && (m_err != IMAGE_ERROR_FILENOTFOUND)) |
| 962 | | goto done; |
| 971 | m_longname = m_software_info_ptr->longname; |
| 972 | m_manufacturer = m_software_info_ptr->publisher; |
| 973 | m_year = m_software_info_ptr->year; |
| 974 | //m_playable = m_software_info_ptr->supported; |
| 963 | 975 | } |
| 964 | | } |
| 965 | 976 | |
| 966 | | /* Copy some image information when we have been loaded through a software list */ |
| 967 | | if ( m_software_info_ptr ) |
| 968 | | { |
| 969 | | m_longname = m_software_info_ptr->longname; |
| 970 | | m_manufacturer = m_software_info_ptr->publisher; |
| 971 | | m_year = m_software_info_ptr->year; |
| 972 | | //m_playable = m_software_info_ptr->supported; |
| 977 | /* did we fail to find the file? */ |
| 978 | if (!is_loaded() && !softload) |
| 979 | { |
| 980 | m_err = IMAGE_ERROR_FILENOTFOUND; |
| 981 | goto done; |
| 982 | } |
| 973 | 983 | } |
| 974 | 984 | |
| 975 | | /* did we fail to find the file? */ |
| 976 | | if (!is_loaded() && !softload) |
| 977 | | { |
| 978 | | m_err = IMAGE_ERROR_FILENOTFOUND; |
| 979 | | goto done; |
| 980 | | } |
| 981 | | |
| 982 | 985 | /* call device load or create */ |
| 983 | 986 | m_create_format = create_format; |
| 984 | 987 | m_create_args = create_args; |