diff options
author | Vas Crabb <vas@vastheman.com> | 2020-04-15 23:25:57 +1000 |
---|---|---|
committer | Vas Crabb <vas@vastheman.com> | 2020-04-16 00:11:41 +1000 |
commit | 8f393f526f725eca1ab20173fc899d5afbe6d2d6 (patch) | |
tree | 3fcec63a40a31428f01b43c3d836f119ed84656f /src/emu/diimage.cpp | |
parent | 2abd76d57ce125291845387ba46cae48f774cc84 (diff) |
softlist_dev.cpp: start adding validation for data areas
romload.cpp: reduce copy-pasta (nw)
(nw) I fixed the errors found by adding validation to software list data areas.
Most of them seem to be simple copy-paste errors hidden by the fact that the
default device_image_interface loader ignores the data area size (as opposed to
the "ROM" loader). There was one C64 cartridge with a missing zero on the data
area size that was pretty clearly wrong.
Diffstat (limited to 'src/emu/diimage.cpp')
-rw-r--r-- | src/emu/diimage.cpp | 26 |
1 files changed, 1 insertions, 25 deletions
diff --git a/src/emu/diimage.cpp b/src/emu/diimage.cpp index 4ec5ff7898c..8a38739933a 100644 --- a/src/emu/diimage.cpp +++ b/src/emu/diimage.cpp @@ -906,31 +906,7 @@ bool device_image_interface::load_software(software_list_device &swlist, const c u32 crc = 0; const bool has_crc = util::hash_collection(ROM_GETHASHDATA(romp)).crc(crc); std::vector<const software_info *> parents; - std::vector<std::string> searchpath; - - // search <rompath>/<list>/<software> following parents - searchpath.emplace_back(util::string_format("%s" PATH_SEPARATOR "%s", swlist.list_name(), swname)); - for (const software_info *i = swinfo; i && !i->parentname().empty(); i = swlist.find(i->parentname())) - { - if (std::find(parents.begin(), parents.end(), i) != parents.end()) - { - osd_printf_warning("WARNING: parent/clone relationships form a loop for software %s (in list %s)\n", swname, swlist.list_name()); - break; - } - parents.emplace_back(i); - searchpath.emplace_back(util::string_format("%s" PATH_SEPARATOR "%s", swlist.list_name(), i->parentname())); - } - - // search <rompath>/<software> following parents - searchpath.emplace_back(swname); - parents.clear(); - for (software_info const *i = swinfo; i && !i->parentname().empty(); i = swlist.find(i->parentname())) - { - if (std::find(parents.begin(), parents.end(), i) != parents.end()) - break; - parents.emplace_back(i); - searchpath.emplace_back(i->parentname()); - } + std::vector<std::string> searchpath = rom_load_manager::get_software_searchpath(swlist, *swinfo); // for historical reasons, add the search path for the software list device's owner const device_t *const listowner = swlist.owner(); |