Previous 199869 Revisions Next

r21849 Thursday 14th March, 2013 at 09:23:20 UTC by Fabio Priuli
(MESS) romload: fixed loaded rom percentage going beyond 100% with softlist entries. nw.

previously, loading from softlist was using the bios romsize as totalsize to load, explaining both the erratic
percentage values in systems like AES and the totalsize = 0 error in NES and other bios-less systems, which
was requiring a special workaround.

handling is still not perfect (e.g I think that first the bios is loaded and counter goes to 100%, then the cart
is loaded and the count restarts from 0%, so it would be better to have a separate message for the softlist
loading, but I need to study in depth the code before such a change), but it's definitely better than having
AES carts loading up to 12575% or NES skipping completely the soft percentage due to totalsize =0...
[src/emu]romload.c

trunk/src/emu/romload.c
r21848r21849
469469{
470470   char buffer[200];
471471
472   // 2010-04, FP - FIXME: in MESS, load_software_part_region sometimes calls this with romstotalsize = 0!
473   // as a temp workaround, I added a check for romstotalsize !=0.
474   if (name != NULL && romdata->romstotalsize)
472   if (name != NULL)
475473      sprintf(buffer, "Loading (%d%%)", (UINT32)(100 * (UINT64)romdata->romsloadedsize / (UINT64)romdata->romstotalsize));
476474   else
477475      sprintf(buffer, "Loading Complete");
r21848r21849
13751373      else
13761374         fill_random(romdata->machine(), romdata->region->base(), romdata->region->bytes());
13771375#endif
1378
1376     
1377      /* update total number of roms */
1378      for (const rom_entry *rom = rom_first_file(region); rom != NULL; rom = rom_next_file(rom))
1379         if (ROM_GETBIOSFLAGS(rom) == 0 || ROM_GETBIOSFLAGS(rom) == device->system_bios())
1380         {
1381            romdata->romstotal++;
1382            romdata->romstotalsize += rom_file_size(rom);
1383         }
1384     
13791385      /* now process the entries in the region */
13801386      if (ROMREGION_ISROMDATA(region))
13811387         process_rom_entries(romdata, locationtag, region, region + 1, device);
r21848r21849
13841390   }
13851391
13861392   /* now go back and post-process all the regions */
1387   for (region = start_region; region != NULL; region = rom_next_region(region)) {
1393   for (region = start_region; region != NULL; region = rom_next_region(region))
1394   {
13881395      device->subtag(regiontag, ROMREGION_GETTAG(region));
13891396      region_post_process(romdata, regiontag.cstr(), ROMREGION_ISINVERTED(region));
13901397   }

Previous 199869 Revisions Next


© 1997-2024 The MAME Team