Previous 15994 Revisions Next

r8081 Wednesday 19th May, 2010 at 00:47:23 UTC by Firewave
Check image loading result in device post-init - will now bail out on any image loading error and not just missing/inaccessible files (fixes bug 1955)
[docs]messnew.txt
[src/mess]image.c mess.c

src/mess/mess.c
r8080r8081
132132    {
133133        if (is_image_device(device))
134134      {
135         image_finish_load(device);
135         int result = image_finish_load(device);
136         /* did the image load fail? */
137         if (result)
138         {
139            /* retrieve image error message */
140            const char *image_err = image_error(device);
141            char *image_basename_str = auto_strdup(machine, image_basename(device));
142            image_device_info info = image_device_getinfo(machine->config, device);
143
144            /* unload all images */
145            image_unload_all(machine);
146
147            fatalerror_exitcode(machine, MAMERR_DEVICE, "Device %s load (%s) failed: %s",
148               info.name,
149               image_basename_str,
150               image_err);
151         }
136152      }
137153   }
138154
src/mess/image.c
r8080r8081
855855
856856done:
857857    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\n", is_create ? "create" : "load", path, image_error(image));
858      if (slot->not_init_phase)
859      {
860         if (mame_get_phase(machine) == MAME_PHASE_RUNNING)
861            popmessage("Error: Unable to %s image '%s': %s\n", is_create ? "create" : "load", path, image_error(image));
862         else
863            mame_printf_error("Error: Unable to %s image '%s': %s", is_create ? "create" : "load", path, image_error(image));
864      }
862865      image_clear(slot);
863866   }
864867   else {
r8080r8081
867870         mame_schedule_hard_reset(machine);
868871      else
869872      {
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.\n", path, is_create ? "created" : "loaded");
873         if (slot->not_init_phase)
874         {
875            if (mame_get_phase(machine) == MAME_PHASE_RUNNING)
876               popmessage("Image '%s' was successfully %s.", path, is_create ? "created" : "loaded");
877            else
878               mame_printf_info("Image '%s' was successfully %s.\n", path, is_create ? "created" : "loaded");
879         }
874880      }
875881   }
876882
docs/messnew.txt
r8080r8081
251251  (or print to console when specified on command-line / fixes bug 1031) [Oliver
252252  Stoeneberg]
253253
254- Check image loading result in device post-init - will now bail out on any image
255  loading error and not just missing/inaccessible files (fixes bug 1955) [Oliver
256  Stoeneberg]
257
254258- [C2040] Added DOS 1 FDC ROM (parsed from disassembly). [Curt Coder]
255259
256260- [MESSUI] Removed "File->Create Image...". It never worked and offered invalid

Previous 15994 Revisions Next


© 1998-2018 The MESS Team