static int ProcessAuditResults(int game, audit_record *audit, int audit_records) { output_callback prevcb; void *prevparam; int res; mame_set_output_channel(OUTPUT_CHANNEL_INFO, Mame32Output, NULL, &prevcb, &prevparam); res = audit_summary(game, audit_records, audit, TRUE); mame_set_output_channel(OUTPUT_CHANNEL_INFO, prevcb ? prevcb : mame_null_output_callback, prevparam, NULL, NULL); return res; }
static int info_verifysamples(core_options *options, const char *gamename) { int correct = 0; int incorrect = 0; int notfound = FALSE; int drvindex; /* now iterate over drivers */ for (drvindex = 0; drivers[drvindex]; drvindex++) if (mame_strwildcmp(gamename, drivers[drvindex]->name) == 0) { audit_record *audit; int audit_records; int res; /* audit the samples in this set */ audit_records = audit_samples(options, drivers[drvindex], &audit); res = audit_summary(drivers[drvindex], audit_records, audit, TRUE); if (audit_records > 0) free(audit); else continue; /* if not found, print a message and set the flag */ if (res == NOTFOUND) { mame_printf_error("sampleset \"%s\" not found!\n", drivers[drvindex]->name); notfound = TRUE; } /* else display information about what we discovered */ else { mame_printf_info("sampleset %s ", drivers[drvindex]->name); /* switch off of the result */ switch (res) { case INCORRECT: mame_printf_info("is bad\n"); incorrect++; break; case CORRECT: mame_printf_info("is good\n"); correct++; break; case BEST_AVAILABLE: mame_printf_info("is best available\n"); correct++; break; } } } /* clear out any cached files */ zip_file_cache_clear(); /* if we didn't get anything at all because of an unsupported set, display message */ if (correct + incorrect == 0) { if (!notfound) mame_printf_error("sampleset \"%s\" not supported!\n", gamename); return MAMERR_NO_SUCH_GAME; } /* otherwise, print a summary */ else { mame_printf_info("%d samplesets found, %d were OK.\n", correct + incorrect, correct); return (incorrect > 0) ? MAMERR_MISSING_FILES : MAMERR_NONE; } }
static int info_verifyroms(core_options *options, const char *gamename) { int correct = 0; int incorrect = 0; int notfound = 0; int drvindex; /* iterate over drivers */ for (drvindex = 0; drivers[drvindex]; drvindex++) if (mame_strwildcmp(gamename, drivers[drvindex]->name) == 0) { audit_record *audit; int audit_records; int res; /* audit the ROMs in this set */ audit_records = audit_images(options, drivers[drvindex], AUDIT_VALIDATE_FAST, &audit); res = audit_summary(drivers[drvindex], audit_records, audit, TRUE); if (audit_records > 0) free(audit); /* if not found, count that and leave it at that */ if (res == NOTFOUND) notfound++; /* else display information about what we discovered */ else { const game_driver *clone_of; /* output the name of the driver and its clone */ mame_printf_info("romset %s ", drivers[drvindex]->name); clone_of = driver_get_clone(drivers[drvindex]); if (clone_of != NULL) mame_printf_info("[%s] ", clone_of->name); /* switch off of the result */ switch (res) { case INCORRECT: mame_printf_info("is bad\n"); incorrect++; break; case CORRECT: mame_printf_info("is good\n"); correct++; break; case BEST_AVAILABLE: mame_printf_info("is best available\n"); correct++; break; } } } /* clear out any cached files */ zip_file_cache_clear(); /* if we didn't get anything at all, display a generic end message */ if (correct + incorrect == 0) { if (notfound > 0) mame_printf_info("romset \"%s\" not found!\n", gamename); else mame_printf_info("romset \"%s\" not supported!\n", gamename); return MAMERR_NO_SUCH_GAME; } /* otherwise, print a summary */ else { mame_printf_info("%d romsets found, %d were OK.\n", correct + incorrect, correct); return (incorrect > 0) ? MAMERR_MISSING_FILES : MAMERR_NONE; } }