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