summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2017-05-20 02:00:59 -0400
committer AJR <ajrhacker@users.noreply.github.com>2017-05-20 02:01:07 -0400
commit30079d38b0b600a876d19d6a8ac9e7bfadc0c6e2 (patch)
tree60a86458b6c696c5f8f6b1a1ce128baa69c86f4b
parentf21e68092fec603f7f441161fa0e66b66f9b39cf (diff)
Have -listroms display a user-friendly message when no ROMs are required
-rw-r--r--src/frontend/mame/clifront.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/frontend/mame/clifront.cpp b/src/frontend/mame/clifront.cpp
index 31aaf75b47b..3681763b76c 100644
--- a/src/frontend/mame/clifront.cpp
+++ b/src/frontend/mame/clifront.cpp
@@ -528,18 +528,23 @@ void cli_frontend::listroms(const std::vector<std::string> &args)
if (!first)
osd_printf_info("\n");
first = false;
- osd_printf_info(
- "ROMs required for %s \"%s\".\n"
- "%-32s %10s %s\n",
- type, root.shortname(), "Name", "Size", "Checksum");
// iterate through roms
+ bool hasroms = false;
for (device_t &device : device_iterator(root))
{
for (const rom_entry *region = rom_first_region(device); region; region = rom_next_region(region))
{
for (const rom_entry *rom = rom_first_file(region); rom; rom = rom_next_file(rom))
{
+ // print a header
+ if (!hasroms)
+ osd_printf_info(
+ "ROMs required for %s \"%s\".\n"
+ "%-32s %10s %s\n",
+ type, root.shortname(), "Name", "Size", "Checksum");
+ hasroms = true;
+
// accumulate the total length of all chunks
int64_t length = -1;
if (ROMREGION_ISROMDATA(region))
@@ -571,6 +576,8 @@ void cli_frontend::listroms(const std::vector<std::string> &args)
}
}
}
+ if (!hasroms)
+ osd_printf_info("No ROMs required for %s \"%s\".\n", type, root.shortname());
};
// determine which drivers to output