diff --git a/src/emu/hashfile.c b/src/emu/hashfile.c index d3c1b16a223..f5b6561652c 100644 --- a/src/emu/hashfile.c +++ b/src/emu/hashfile.c @@ -556,7 +556,7 @@ const char *read_hash_config(device_image_interface &image, const char *sysname) return NULL; } - extra_info = auto_strdup(image.device().machine(),info->extrainfo); + extra_info = auto_strdup(image.device().machine(), info->extrainfo); if (!extra_info) { hashfile_close(hashfile); @@ -576,13 +576,21 @@ const char *hashfile_extrainfo(device_image_interface &image) /* now read the hash file */ image.crc(); extra_info = NULL; - int drv = driver_list::find(image.device().machine().system()); + int compat, drv = driver_list::find(image.device().machine().system()); do { - rc = read_hash_config(image,driver_list::driver(drv).name); - drv = driver_list::compatible_with(drv); + rc = read_hash_config(image, driver_list::driver(drv).name); + // first check if there are compatible systems + compat = driver_list::compatible_with(drv); + // if so, try to open its hashfile + if (compat != -1) + drv = compat; + // otherwise, try with the parent + else + drv = driver_list::clone(drv); } - while(rc!=NULL && drv != -1); + // if no extrainfo has been found but we can try a compatible or a parent set, go back + while (rc == NULL && drv != -1); return rc; }