summaryrefslogtreecommitdiffstats
path: root/docs/release/src/frontend/mame/audit.cpp
diff options
context:
space:
mode:
author Robbbert <Robbbert@users.noreply.github.com>2020-03-26 12:54:28 +1100
committer Robbbert <Robbbert@users.noreply.github.com>2020-03-26 12:54:28 +1100
commit75e0ed7918a4656755a08bdb7025af579615e033 (patch)
tree7e5061afb9d701862e2f27369a4019e8cd5fdb13 /docs/release/src/frontend/mame/audit.cpp
parent053c04ffc930159c538bcd77dd3255c74cdd2951 (diff)
0.220 Release filestag220
Diffstat (limited to 'docs/release/src/frontend/mame/audit.cpp')
-rw-r--r--docs/release/src/frontend/mame/audit.cpp33
1 files changed, 15 insertions, 18 deletions
diff --git a/docs/release/src/frontend/mame/audit.cpp b/docs/release/src/frontend/mame/audit.cpp
index cbc6a67c30b..448cf55549b 100644
--- a/docs/release/src/frontend/mame/audit.cpp
+++ b/docs/release/src/frontend/mame/audit.cpp
@@ -29,7 +29,7 @@
media_auditor::media_auditor(const driver_enumerator &enumerator)
: m_enumerator(enumerator)
, m_validation(AUDIT_VALIDATE_FULL)
- , m_searchpath(nullptr)
+ , m_searchpath()
{
}
@@ -47,10 +47,6 @@ media_auditor::summary media_auditor::audit_media(const char *validation)
// store validation for later
m_validation = validation;
-// temporary hack until romload is update: get the driver path and support it for
-// all searches
-const char *driverpath = m_enumerator.config()->root_device().searchpath();
-
std::size_t found = 0;
std::size_t required = 0;
std::size_t shared_found = 0;
@@ -60,17 +56,17 @@ const char *driverpath = m_enumerator.config()->root_device().searchpath();
for (device_t &device : device_iterator(m_enumerator.config()->root_device()))
{
// determine the search path for this source and iterate through the regions
- m_searchpath = device.searchpath();
+ m_searchpath.clear();
+ for (const std::string &path : device.searchpath())
+ {
+ if (!m_searchpath.empty())
+ m_searchpath += ';';
+ m_searchpath += path;
+ }
// now iterate over regions and ROMs within
for (const rom_entry *region = rom_first_region(device); region; region = rom_next_region(region))
{
-// temporary hack: add the driver path & region name
-std::string combinedpath = util::string_format("%s;%s", device.searchpath(), driverpath);
-if (device.shortname())
- combinedpath.append(";").append(device.shortname());
-m_searchpath = combinedpath.c_str();
-
for (const rom_entry *rom = rom_first_file(region); rom; rom = rom_next_file(rom))
{
char const *const name(ROM_GETNAME(rom));
@@ -166,7 +162,7 @@ media_auditor::summary media_auditor::audit_software(const std::string &list_nam
locationtag.append(swinfo->parentname());
combinedpath.append(util::string_format(";%s;%s%s%s", swinfo->parentname(), list_name, PATH_SEPARATOR, swinfo->parentname()));
}
- m_searchpath = combinedpath.c_str();
+ m_searchpath = combinedpath;
std::size_t found = 0;
std::size_t required = 0;
@@ -220,14 +216,14 @@ media_auditor::summary media_auditor::audit_samples()
// look for the files
emu_file file(m_enumerator.options().sample_path(), OPEN_FLAG_READ | OPEN_FLAG_NO_PRELOAD);
- path_iterator path(searchpath.c_str());
+ path_iterator path(searchpath);
std::string curpath;
while (path.next(curpath, samplename))
{
// attempt to access the file (.flac) or (.wav)
- osd_file::error filerr = file.open(curpath.c_str(), ".flac");
+ osd_file::error filerr = file.open(curpath + ".flac");
if (filerr != osd_file::error::NONE)
- filerr = file.open(curpath.c_str(), ".wav");
+ filerr = file.open(curpath + ".wav");
if (filerr == osd_file::error::NONE)
{
@@ -392,14 +388,15 @@ media_auditor::audit_record &media_auditor::audit_one_rom(const rom_entry *rom)
file.set_restrict_to_mediapath(true);
path_iterator path(m_searchpath);
std::string curpath;
+ // FIXME: needs to be adjusted to match ROM loading behaviour
while (path.next(curpath, record.name()))
{
// open the file if we can
osd_file::error filerr;
if (has_crc)
- filerr = file.open(curpath.c_str(), crc);
+ filerr = file.open(curpath, crc);
else
- filerr = file.open(curpath.c_str());
+ filerr = file.open(curpath);
// if it worked, get the actual length and hashes, then stop
if (filerr == osd_file::error::NONE)