cheat.c: added support for cheats with software list shortnames [Fabio Priuli]

This commit is contained in:
Fabio Priuli 2011-01-12 14:55:40 +00:00
parent 413967aa4f
commit c1dcd436fd

View File

@ -1178,14 +1178,23 @@ void cheat_manager::reload()
for (bool gotone = m_machine.m_devicelist.first(image); gotone; gotone = image->next(image)) for (bool gotone = m_machine.m_devicelist.first(image); gotone; gotone = image->next(image))
if (image->exists()) if (image->exists())
{ {
UINT32 crc = image->crc(); // if we are loading through software lists, try to load shortname.xml
if (crc != 0) if (image->software_entry() != NULL)
{ {
astring filename; load_cheats(image->basename());
filename.printf("%08X", crc);
load_cheats(filename);
break; break;
} }
else
{
UINT32 crc = image->crc();
if (crc != 0)
{
astring filename;
filename.printf("%08X", crc);
load_cheats(filename);
break;
}
}
} }
// if we haven't found the cheats yet, load by basename // if we haven't found the cheats yet, load by basename