From 30079d38b0b600a876d19d6a8ac9e7bfadc0c6e2 Mon Sep 17 00:00:00 2001 From: AJR Date: Sat, 20 May 2017 02:00:59 -0400 Subject: [PATCH] Have -listroms display a user-friendly message when no ROMs are required --- src/frontend/mame/clifront.cpp | 15 +++++++++++---- 1 file 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 &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 &args) } } } + if (!hasroms) + osd_printf_info("No ROMs required for %s \"%s\".\n", type, root.shortname()); }; // determine which drivers to output