hashfile.c: fixed parent .hsi files not being used by clones, for MESS only. no whatsnew.

This commit is contained in:
Fabio Priuli 2011-08-15 08:59:05 +00:00
parent b95b97d98c
commit 5d8889e3ae

View File

@ -556,7 +556,7 @@ const char *read_hash_config(device_image_interface &image, const char *sysname)
return NULL; return NULL;
} }
extra_info = auto_strdup(image.device().machine(),info->extrainfo); extra_info = auto_strdup(image.device().machine(), info->extrainfo);
if (!extra_info) if (!extra_info)
{ {
hashfile_close(hashfile); hashfile_close(hashfile);
@ -576,13 +576,21 @@ const char *hashfile_extrainfo(device_image_interface &image)
/* now read the hash file */ /* now read the hash file */
image.crc(); image.crc();
extra_info = NULL; extra_info = NULL;
int drv = driver_list::find(image.device().machine().system()); int compat, drv = driver_list::find(image.device().machine().system());
do do
{ {
rc = read_hash_config(image,driver_list::driver(drv).name); rc = read_hash_config(image, driver_list::driver(drv).name);
drv = driver_list::compatible_with(drv); // 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; return rc;
} }