src/mess/image.c
| r8075 | r8076 | |
| 854 | 854 | /* success! */ |
| 855 | 855 | |
| 856 | 856 | done: |
| 857 | | if (slot->err) |
| 858 | | image_clear(slot); |
| 857 | if (slot->err) { |
| 858 | if (mame_get_phase(machine) == MAME_PHASE_RUNNING) |
| 859 | popmessage("Error: Unable to %s image '%s': %s", is_create ? "create" : "load", path, image_error(image)); |
| 860 | else |
| 861 | mame_printf_error("Error: Unable to %s image '%s': %s", is_create ? "create" : "load", path, image_error(image)); |
| 862 | image_clear(slot); |
| 863 | } |
| 859 | 864 | else { |
| 860 | 865 | /* do we need to reset the CPU? only schedule it if load/create is successful */ |
| 861 | 866 | if ((attotime_compare(timer_get_time(machine), attotime_zero) > 0) && slot->info.reset_on_load) |
| 862 | 867 | mame_schedule_hard_reset(machine); |
| 868 | else |
| 869 | { |
| 870 | if (mame_get_phase(machine) == MAME_PHASE_RUNNING) |
| 871 | popmessage("Image '%s' was successfully %s.", path, is_create ? "created" : "loaded"); |
| 872 | else |
| 873 | mame_printf_info("Image '%s' was successfully %s.", path, is_create ? "created" : "loaded"); |
| 874 | } |
| 863 | 875 | } |
| 864 | 876 | |
| 865 | 877 | return slot->err ? INIT_FAIL : INIT_PASS; |
src/mess/osd/windows/menu.c
| r8075 | r8076 | |
| 929 | 929 | dialog_box *dialog = NULL; |
| 930 | 930 | char filter[2048]; |
| 931 | 931 | char filename[MAX_PATH]; |
| 932 | | char buffer[512]; |
| 933 | 932 | const char *initial_dir; |
| 934 | 933 | BOOL result; |
| 935 | 934 | int create_format = 0; |
| 936 | 935 | option_resolution *create_args = NULL; |
| 937 | | image_error_t err; |
| 938 | 936 | image_device_info info; |
| 939 | 937 | |
| 940 | 938 | // sanity check |
| r8075 | r8076 | |
| 980 | 978 | { |
| 981 | 979 | // mount the image |
| 982 | 980 | if (is_save) |
| 983 | | err = (image_error_t)image_create(device, filename, image_device_get_indexed_creatable_format(device, create_format), create_args); |
| 981 | (image_error_t)image_create(device, filename, image_device_get_indexed_creatable_format(device, create_format), create_args); |
| 984 | 982 | else |
| 985 | | err = (image_error_t)image_load(device, filename); |
| 983 | (image_error_t)image_load(device, filename); |
| 986 | 984 | |
| 987 | | // error? |
| 988 | | if (err) |
| 989 | | { |
| 990 | | snprintf(buffer, ARRAY_LENGTH(buffer), |
| 991 | | "Error when %s the image: %s", |
| 992 | | is_save ? "creating" : "loading", |
| 993 | | image_error(device)); |
| 994 | | |
| 995 | | win_message_box_utf8(wnd, buffer, APPNAME, MB_OK); |
| 996 | | } |
| 985 | // no need to check the returnvalue and show a messagebox anymore. |
| 986 | // a UI message will now be generated by the image code |
| 997 | 987 | } |
| 998 | 988 | |
| 999 | 989 | done: |