summaryrefslogtreecommitdiffstatshomepage
path: root/src/frontend/mame/infoxml.cpp
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2022-06-28 16:33:06 +1000
committer Vas Crabb <vas@vastheman.com>2022-06-28 16:33:06 +1000
commit513e30cbbb75a4c81bc4a7cc2dde47e0ad064644 (patch)
tree511c7c367db3f2454b52314e45e567c9b8b4771b /src/frontend/mame/infoxml.cpp
parentdbf04f771a146d6cc1884470ff43a1101f5973a4 (diff)
Added make opions for filter file, adjusted source path display.
Added SOURCEFILTER option to specify a driver filter file in your make options, e.g. like make SUBTARGET=custom SOURCEFILTER=mydrivers.flt (or put it in your useroptions.mak if you'll be using it a lot). It functions more-or-less like SOURCES on steroids. Changed the way system/device source file paths are displayed to suit the new source layout better. INI file loading hasn't changed, that still just uses the base file name. Added overlooked trigger to src/bus.lua to include NES controller bus if the NES zapper sensor is needed.
Diffstat (limited to 'src/frontend/mame/infoxml.cpp')
-rw-r--r--src/frontend/mame/infoxml.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/frontend/mame/infoxml.cpp b/src/frontend/mame/infoxml.cpp
index 70270e0a0f9..8ca6dfcc875 100644
--- a/src/frontend/mame/infoxml.cpp
+++ b/src/frontend/mame/infoxml.cpp
@@ -748,11 +748,13 @@ void output_one(std::ostream &out, driver_enumerator &drivlist, const game_drive
util::stream_format(out, "\t<%s name=\"%s\"", XML_TOP, normalize_string(driver.name));
// strip away any path information from the source_file and output it
- const char *start = strrchr(driver.type.source(), '/');
- if (!start)
- start = strrchr(driver.type.source(), '\\');
- start = start ? (start + 1) : driver.type.source();
- util::stream_format(out, " sourcefile=\"%s\"", normalize_string(start));
+ std::string_view src(driver.type.source());
+ auto prefix(src.find("src/mame/"));
+ if (std::string_view::npos == prefix)
+ prefix = src.find("src\\mame\\");
+ if (std::string_view::npos != prefix)
+ src.remove_prefix(prefix + 9);
+ util::stream_format(out, " sourcefile=\"%s\"", normalize_string(src));
// append bios and runnable flags
if (driver.flags & machine_flags::IS_BIOS_ROOT)
@@ -844,8 +846,12 @@ void output_one_device(std::ostream &out, machine_config &config, device_t &devi
// start to output info
util::stream_format(out, "\t<%s name=\"%s\"", XML_TOP, normalize_string(device.shortname()));
- std::string src(device.source());
- strreplace(src,"../", "");
+ std::string_view src(device.source());
+ auto prefix(src.find("src/"));
+ if (std::string_view::npos == prefix)
+ prefix = src.find("src\\");
+ if (std::string_view::npos != prefix)
+ src.remove_prefix(prefix + 4);
util::stream_format(out, " sourcefile=\"%s\" isdevice=\"yes\" runnable=\"no\"", normalize_string(src));
auto const parent(device.type().parent_rom_device_type());
if (parent)