From aaafda3dd1d51a05968e75e0fe1807c406a27b66 Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Thu, 24 Sep 2009 07:17:51 +0000 Subject: [PATCH] > From: Oliver Stoeneberg [mailto:oliverst@online.de] > Sent: Wednesday, September 23, 2009 4:41 AM > To: submit@mamedev.org > Subject: optional flag in -listxml > > This patch: > - adds an "optional" flag for rom/disk entries to -listxml output > - removed the obsolete "dispose" flag from the DTD in the -listxml > output --- src/emu/info.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/emu/info.c b/src/emu/info.c index d40e786dd17..63602465a1b 100644 --- a/src/emu/info.c +++ b/src/emu/info.c @@ -518,10 +518,14 @@ static void print_game_rom(FILE *out, const game_driver *game, const machine_con /* for non-disk entries, print offset */ if (!is_disk) fprintf(out, " offset=\"%x\"", offset); - /* for disk entries, add the disk index */ else fprintf(out, " index=\"%x\"", DISK_GETINDEX(rom)); + + /* add optional flag */ + if ((!is_disk && ROM_ISOPTIONAL(rom)) || (is_disk && DISK_ISOPTIONAL(rom))) + fprintf(out, " optional=\"yes\""); + fprintf(out, "/>\n"); } } @@ -948,7 +952,7 @@ void print_mame_xml(FILE *out, const game_driver *const games[], const char *gam "\t\t\t\n" "\t\t\t\n" "\t\t\t\n" - "\t\t\t\n" + "\t\t\t\n" "\t\t\n" "\t\t\t\n" "\t\t\t\n" @@ -957,6 +961,7 @@ void print_mame_xml(FILE *out, const game_driver *const games[], const char *gam "\t\t\t\n" "\t\t\t\n" "\t\t\t\n" + "\t\t\t\n" "\t\t\n" "\t\t\t\n" "\t\t\n"