| 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 |
| r21848 | r21849 | |
|---|---|---|
| 469 | 469 | { |
| 470 | 470 | char buffer[200]; |
| 471 | 471 | |
| 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) | |
| 475 | 473 | sprintf(buffer, "Loading (%d%%)", (UINT32)(100 * (UINT64)romdata->romsloadedsize / (UINT64)romdata->romstotalsize)); |
| 476 | 474 | else |
| 477 | 475 | sprintf(buffer, "Loading Complete"); |
| r21848 | r21849 | |
| 1375 | 1373 | else |
| 1376 | 1374 | fill_random(romdata->machine(), romdata->region->base(), romdata->region->bytes()); |
| 1377 | 1375 | #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 | ||
| 1379 | 1385 | /* now process the entries in the region */ |
| 1380 | 1386 | if (ROMREGION_ISROMDATA(region)) |
| 1381 | 1387 | process_rom_entries(romdata, locationtag, region, region + 1, device); |
| r21848 | r21849 | |
| 1384 | 1390 | } |
| 1385 | 1391 | |
| 1386 | 1392 | /* 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 | { | |
| 1388 | 1395 | device->subtag(regiontag, ROMREGION_GETTAG(region)); |
| 1389 | 1396 | region_post_process(romdata, regiontag.cstr(), ROMREGION_ISINVERTED(region)); |
| 1390 | 1397 | } |
| Previous | 199869 Revisions | Next |