Previous 199869 Revisions Next

r18735 Saturday 27th October, 2012 at 17:02:21 UTC by O. Galibert
romload: Tell in which zips a missing rom was searched for [O. Galibert]
[src/emu]romload.c

trunk/src/emu/romload.c
r18734r18735
374374    for missing files
375375-------------------------------------------------*/
376376
377static void handle_missing_file(romload_private *romdata, const rom_entry *romp)
377static void handle_missing_file(romload_private *romdata, const rom_entry *romp, astring tried_file_names)
378378{
379   if(tried_file_names.len() != 0)
380      tried_file_names = " (tried in " + tried_file_names + ")";
381
379382   /* optional files are okay */
380383   if (ROM_ISOPTIONAL(romp))
381384   {
382      romdata->errorstring.catprintf("OPTIONAL %s NOT FOUND\n", ROM_GETNAME(romp));
385      romdata->errorstring.catprintf("OPTIONAL %s NOT FOUND%s\n", ROM_GETNAME(romp), tried_file_names.cstr());
383386      romdata->warnings++;
384387   }
385388
386389   /* no good dumps are okay */
387390   else if (hash_collection(ROM_GETHASHDATA(romp)).flag(hash_collection::FLAG_NO_DUMP))
388391   {
389      romdata->errorstring.catprintf("%s NOT FOUND (NO GOOD DUMP KNOWN)\n", ROM_GETNAME(romp));
392      romdata->errorstring.catprintf("%s NOT FOUND (NO GOOD DUMP KNOWN)%s\n", ROM_GETNAME(romp), tried_file_names.cstr());
390393      romdata->knownbad++;
391394   }
392395
393396   /* anything else is bad */
394397   else
395398   {
396      romdata->errorstring.catprintf("%s NOT FOUND\n", ROM_GETNAME(romp));
399      romdata->errorstring.catprintf("%s NOT FOUND%s\n", ROM_GETNAME(romp), tried_file_names.cstr());
397400      romdata->errors++;
398401   }
399402}
r18734r18735
552555    up the parent and loading by checksum
553556-------------------------------------------------*/
554557
555static int open_rom_file(romload_private *romdata, const char *regiontag, const rom_entry *romp)
558static int open_rom_file(romload_private *romdata, const char *regiontag, const rom_entry *romp, astring &tried_file_names)
556559{
557560   file_error filerr = FILERR_NOT_FOUND;
558561   UINT32 romsize = rom_file_size(romp);
562   tried_file_names = "";
559563
560564   /* update status display */
561565   display_loading_rom_message(romdata, ROM_GETNAME(romp));
r18734r18735
567571   /* attempt reading up the chain through the parents. It automatically also
568572     attempts any kind of load by checksum supported by the archives. */
569573   romdata->file = NULL;
570   for (int drv = driver_list::find(romdata->machine().system()); romdata->file == NULL && drv != -1; drv = driver_list::clone(drv))
574   for (int drv = driver_list::find(romdata->machine().system()); romdata->file == NULL && drv != -1; drv = driver_list::clone(drv)) {
575      if(tried_file_names.len() != 0)
576         tried_file_names += " ";
577      tried_file_names += driver_list::driver(drv).name;
571578      filerr = common_process_file(romdata->machine().options(), driver_list::driver(drv).name, has_crc, crc, romp, &romdata->file);
579   }
572580
573581   /* if the region is load by name, load the ROM from there */
574582   if (romdata->file == NULL && regiontag != NULL)
r18734r18735
618626      // - if we are not using lists, we have regiontag only;
619627      // - if we are using lists, we have: list/clonename, list/parentname, clonename, parentname
620628      if (!is_list)
629      {
630         tried_file_names += " " + tag1;
621631         filerr = common_process_file(romdata->machine().options(), tag1.cstr(), has_crc, crc, romp, &romdata->file);
632      }
622633      else
623634      {
624635         // try to load from list/setname
625636         if ((romdata->file == NULL) && (tag2.cstr() != NULL))
637         {
638            tried_file_names += " " + tag2;
626639            filerr = common_process_file(romdata->machine().options(), tag2.cstr(), has_crc, crc, romp, &romdata->file);
640         }
627641         // try to load from list/parentname
628642         if ((romdata->file == NULL) && has_parent && (tag3.cstr() != NULL))
643         {
644            tried_file_names += " " + tag3;
629645            filerr = common_process_file(romdata->machine().options(), tag3.cstr(), has_crc, crc, romp, &romdata->file);
646         }
630647         // try to load from setname
631648         if ((romdata->file == NULL) && (tag4.cstr() != NULL))
649         {
650            tried_file_names += " " + tag4;
632651            filerr = common_process_file(romdata->machine().options(), tag4.cstr(), has_crc, crc, romp, &romdata->file);
652         }
633653         // try to load from parentname
634654         if ((romdata->file == NULL) && has_parent && (tag5.cstr() != NULL))
655         {
656            tried_file_names += " " + tag5;
635657            filerr = common_process_file(romdata->machine().options(), tag5.cstr(), has_crc, crc, romp, &romdata->file);
658         }
636659      }
637660   }
638661
r18734r18735
881904
882905         /* open the file if it is a non-BIOS or matches the current BIOS */
883906         LOG(("Opening ROM file: %s\n", ROM_GETNAME(romp)));
884         if (!irrelevantbios && !open_rom_file(romdata, regiontag, romp))
885            handle_missing_file(romdata, romp);
907         astring tried_file_names;
908         if (!irrelevantbios && !open_rom_file(romdata, regiontag, romp, tried_file_names))
909            handle_missing_file(romdata, romp, tried_file_names);
886910
887911         /* loop until we run out of reloads */
888912         do

Previous 199869 Revisions Next


© 1997-2024 The MAME Team