summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Phil Bennett <philipjbennett@users.noreply.github.com>2009-12-31 11:15:12 +0000
committer Phil Bennett <philipjbennett@users.noreply.github.com>2009-12-31 11:15:12 +0000
commit4106d2aaf6731ea54bdd30957199ce0c35022824 (patch)
tree3c5c9845a0b2ca7adfc771716bfb233c6a922526
parent2a723ab9be7e58a327dd4e279f531e7470d6cea0 (diff)
Added additional information to the dipswitches and configurations sections in the -listxml output [Oliver Stoneberg]
---------- Forwarded message ---------- From: Oliver Stöneberg <oliverst@online.de> Date: Thu, Dec 31, 2009 at 1:06 AM Subject: enhanced dipswitch/configuration information in -listxml To: submit@mamedev.org This patch adds some additional information to the dipswitches and configurations in the -listxml output, so I can test dipswitches/configurations in mame_regtest by creating .cfg files. By using this I already found two issues in MESS and the 1943 "Service Mode" issue in MAME would have been detected. I am also wondering, if there are any dipswitches, that rely on more than one port. If that's the case I might have to look at them and change the output.
-rw-r--r--src/emu/info.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/emu/info.c b/src/emu/info.c
index 628a3e6f008..74d5853f7e7 100644
--- a/src/emu/info.c
+++ b/src/emu/info.c
@@ -49,12 +49,16 @@ static void print_game_switches(FILE *out, const game_driver *game, const input_
const input_setting_config *setting;
/* output the switch name information */
- fprintf(out, "\t\t<dipswitch name=\"%s\">\n", xml_normalize_string(input_field_name(field)));
+ fprintf(out, "\t\t<dipswitch name=\"%s\"", xml_normalize_string(input_field_name(field)));
+ fprintf(out, " tag=\"%s\"", xml_normalize_string(field->port->tag));
+ fprintf(out, " mask=\"%u\"", field->mask);
+ fprintf(out, ">\n");
/* loop over settings */
for (setting = field->settinglist; setting != NULL; setting = setting->next)
{
fprintf(out, "\t\t\t<dipvalue name=\"%s\"", xml_normalize_string(setting->name));
+ fprintf(out, " value=\"%u\"", setting->value);
if (setting->value == field->defvalue)
fprintf(out, " default=\"yes\"");
fprintf(out, "/>\n");
@@ -83,12 +87,16 @@ static void print_game_configs(FILE *out, const game_driver *game, const input_p
const input_setting_config *setting;
/* output the configuration name information */
- fprintf(out, "\t\t<configuration name=\"%s\">\n", xml_normalize_string(input_field_name(field)));
+ fprintf(out, "\t\t<configuration name=\"%s\"", xml_normalize_string(input_field_name(field)));
+ fprintf(out, " tag=\"%s\"", xml_normalize_string(field->port->tag));
+ fprintf(out, " mask=\"%u\"", field->mask);
+ fprintf(out, ">\n");
/* loop over settings */
for (setting = field->settinglist; setting != NULL; setting = setting->next)
{
fprintf(out, "\t\t\t<confsetting name=\"%s\"", xml_normalize_string(setting->name));
+ fprintf(out, " value=\"%u\"", setting->value);
if (setting->value == field->defvalue)
fprintf(out, " default=\"yes\"");
fprintf(out, "/>\n");
@@ -996,13 +1004,19 @@ void print_mame_xml(FILE *out, const game_driver *const games[], const char *gam
"\t\t\t\t<!ATTLIST control reverse (yes|no) \"no\">\n"
"\t\t<!ELEMENT dipswitch (dipvalue*)>\n"
"\t\t\t<!ATTLIST dipswitch name CDATA #REQUIRED>\n"
+ "\t\t\t<!ATTLIST dipswitch tag CDATA #REQUIRED>\n"
+ "\t\t\t<!ATTLIST dipswitch mask CDATA #REQUIRED>\n"
"\t\t\t<!ELEMENT dipvalue EMPTY>\n"
"\t\t\t\t<!ATTLIST dipvalue name CDATA #REQUIRED>\n"
+ "\t\t\t\t<!ATTLIST dipvalue value CDATA #REQUIRED>\n"
"\t\t\t\t<!ATTLIST dipvalue default (yes|no) \"no\">\n"
"\t\t<!ELEMENT configuration (confsetting*)>\n"
"\t\t\t<!ATTLIST configuration name CDATA #REQUIRED>\n"
+ "\t\t\t<!ATTLIST configuration tag CDATA #REQUIRED>\n"
+ "\t\t\t<!ATTLIST configuration mask CDATA #REQUIRED>\n"
"\t\t\t<!ELEMENT confsetting EMPTY>\n"
"\t\t\t\t<!ATTLIST confsetting name CDATA #REQUIRED>\n"
+ "\t\t\t\t<!ATTLIST confsetting value CDATA #REQUIRED>\n"
"\t\t\t\t<!ATTLIST confsetting default (yes|no) \"no\">\n"
#ifdef MESS
"\t\t<!ELEMENT category (item*)>\n"