Previous 15994 Revisions Next

r2492 Sunday 27th April, 2008 at 22:23:48 UTC by Nathan Woods
Fixed bug #1587 (again)
[src/mess]image.c
[src/mess/osd/winui]messui.c

src/mess/image.c
r2491r2492
458458
459459image_device_info image_device_getinfo(const machine_config *config, const device_config *device)
460460{
461   const device_config *this_device;
461462   image_device_info info;
463   int found;
462464
463465   /* sanity checks */
464466   assert((device->machine == NULL) || (device->machine->config == config));
467   if (device->machine == NULL)
468   {
469      found = FALSE;
470      for (this_device = image_device_first(config); this_device != NULL; this_device = image_device_next(this_device))
471      {
472         if (this_device == device)
473            found = TRUE;
474      }
475      assert(found);
476   }
465477
466478   /* clear return value */
467479   memset(&info, 0, sizeof(info));
src/mess/osd/winui/messui.c
r2491r2492
481481// Places the specified image in the specified slot; nID = -1 means don't matter
482482static void MessSpecifyImage(int drvindex, const device_config *device, LPCSTR pszFilename)
483483{
484   machine_config *config;
485484   const char *s;
486485
487486   if (LOG_SOFTWARE)
488487      dprintf("MessSpecifyImage(): device=%p pszFilename='%s'\n", device, pszFilename);
489488
490   // allocate the machine config
491   config = machine_config_alloc_with_mess_devices(drivers[drvindex]);
492
493489   // if device is NULL, this is a special case; try to find existing image
494490   if (device == NULL)
495491   {
496      for (device = image_device_first(config); device != NULL; device = image_device_next(device))
492      for (device = image_device_first(config->mconfig); device != NULL; device = image_device_next(device))
497493      {
498         s = GetSelectedSoftware(drvindex, config, device);
494         s = GetSelectedSoftware(drvindex, config->mconfig, device);
499495         if ((s != NULL) && !mame_stricmp(s, pszFilename))
500496            break;
501497      }
r2491r2492
513509
514510      if (file_extension != NULL)
515511      {
516         for (device = image_device_first(config); device != NULL; device = image_device_next(device))
512         for (device = image_device_first(config->mconfig); device != NULL; device = image_device_next(device))
517513         {
518            s = GetSelectedSoftware(drvindex, config, device);
514            s = GetSelectedSoftware(drvindex, config->mconfig, device);
519515            if (is_null_or_empty(s) && image_device_uses_file_extension(device, file_extension))
520516               break;
521517         }
r2491r2492
525521   if (device != NULL)
526522   {
527523      // place the image
528      InternalSetSelectedSoftware(drvindex, config, device, pszFilename);
524      InternalSetSelectedSoftware(drvindex, config->mconfig, device, pszFilename);
529525   }
530526   else
531527   {
r2491r2492
533529      if (LOG_SOFTWARE)
534530         dprintf("MessSpecifyImage(): Failed to place image '%s'\n", pszFilename);
535531   }
536
537   machine_config_free(config);
538532}
539533
540534

Previous 15994 Revisions Next


© 1998-2018 The MESS Team