Previous 15994 Revisions Next

r4899 Sunday 31st May, 2009 at 22:10:34 UTC by Fabio Priuli
Added configuration settings, port categories and analog adjusters to xml output. MAME part sent to MAMEDev as well.
[src/emu]info.c
[src/mess]infomess.c infomess.h

src/emu/info.c
r4898r4899
6565         }
6666}
6767
68/*-------------------------------------------------
69    print_game_configs - print the Configuration
70    settings for a game
71-------------------------------------------------*/
6872
73static void print_game_configs(FILE *out, const game_driver *game, const input_port_config *portlist)
74{
75   const input_port_config *port;
76   const input_field_config *field;
77
78   /* iterate looking for configurations */
79   for (port = portlist; port != NULL; port = port->next)
80      for (field = port->fieldlist; field != NULL; field = field->next)
81         if (field->type == IPT_CONFIG)
82         {
83            const input_setting_config *setting;
84
85            /* output the configuration name information */
86            fprintf(out, "\t\t<configuration name=\"%s\">\n", xml_normalize_string(input_field_name(field)));
87
88            /* loop over settings */
89            for (setting = field->settinglist; setting != NULL; setting = setting->next)
90            {
91               fprintf(out, "\t\t\t<confsetting name=\"%s\"", xml_normalize_string(setting->name));
92               if (setting->value == field->defvalue)
93                  fprintf(out, " default=\"yes\"");
94               fprintf(out, "/>\n");
95            }
96
97            /* terminate the configuration entry */
98            fprintf(out, "\t\t</configuration>\n");
99         }
100}
101
69102/*-------------------------------------------------
103    print_game_adjusters - print the Analog
104   Adjusters for a game
105-------------------------------------------------*/
106
107static void print_game_adjusters(FILE *out, const game_driver *game, const input_port_config *portlist)
108{
109   const input_port_config *port;
110   const input_field_config *field;
111
112   /* iterate looking for Adjusters */
113   for (port = portlist; port != NULL; port = port->next)
114      for (field = port->fieldlist; field != NULL; field = field->next)
115         if (field->type == IPT_ADJUSTER)
116         {
117            /* output the adjuster information */
118            fprintf(out, "\t\t<adjuster name=\"%s\" default=\"%d\"/>\n", xml_normalize_string(input_field_name(field)), field->defvalue);
119         }
120}
121
122/*-------------------------------------------------
70123    print_game_input - print a summary of a game's
71124    input
72125-------------------------------------------------*/
r4898r4899
835888   print_game_sound(out, game, config);
836889   print_game_input(out, game, portconfig);
837890   print_game_switches(out, game, portconfig);
891   print_game_configs(out, game, portconfig);
892#ifdef MESS
893   print_game_categories(out, game, portconfig);
894#endif /* MESS */
895   print_game_adjusters(out, game, portconfig);
838896   print_game_driver(out, game, config);
839897#ifdef MESS
840898   print_game_device(out, game, config);
r4898r4899
865923      "\t<!ATTLIST " XML_ROOT " build CDATA #IMPLIED>\n"
866924      "\t<!ATTLIST " XML_ROOT " debug (yes|no) \"no\">\n"
867925#ifdef MESS
868      "\t<!ELEMENT " XML_TOP " (description, year?, manufacturer, biosset*, rom*, disk*, sample*, chip*, display*, sound?, input?, dipswitch*, driver?, device*, ramoption*)>\n"
926      "\t<!ELEMENT " XML_TOP " (description, year?, manufacturer, biosset*, rom*, disk*, sample*, chip*, display*, sound?, input?, dipswitch*, configuration*, category*, adjuster*, driver?, device*, ramoption*)>\n"
869927#else
870      "\t<!ELEMENT " XML_TOP " (description, year?, manufacturer, biosset*, rom*, disk*, sample*, chip*, display*, sound?, input?, dipswitch*, driver?)>\n"
928      "\t<!ELEMENT " XML_TOP " (description, year?, manufacturer, biosset*, rom*, disk*, sample*, chip*, display*, sound?, input?, dipswitch*, configuration*, adjuster*, driver?)>\n"
871929#endif
872930      "\t\t<!ATTLIST " XML_TOP " name CDATA #REQUIRED>\n"
873931      "\t\t<!ATTLIST " XML_TOP " sourcefile CDATA #IMPLIED>\n"
r4898r4899
9441002      "\t\t\t<!ELEMENT dipvalue EMPTY>\n"
9451003      "\t\t\t\t<!ATTLIST dipvalue name CDATA #REQUIRED>\n"
9461004      "\t\t\t\t<!ATTLIST dipvalue default (yes|no) \"no\">\n"
1005      "\t\t<!ELEMENT configuration (confsetting*)>\n"
1006      "\t\t\t<!ATTLIST configuration name CDATA #REQUIRED>\n"
1007      "\t\t\t<!ELEMENT confsetting EMPTY>\n"
1008      "\t\t\t\t<!ATTLIST confsetting name CDATA #REQUIRED>\n"
1009      "\t\t\t\t<!ATTLIST confsetting default (yes|no) \"no\">\n"
1010#ifdef MESS
1011      "\t\t<!ELEMENT category (item*)>\n"
1012      "\t\t\t<!ATTLIST category name CDATA #REQUIRED>\n"
1013      "\t\t\t<!ELEMENT item EMPTY>\n"
1014      "\t\t\t\t<!ATTLIST item name CDATA #REQUIRED>\n"
1015      "\t\t\t\t<!ATTLIST item default (yes|no) \"no\">\n"
1016#endif
1017      "\t\t<!ELEMENT adjuster EMPTY>\n"
1018      "\t\t\t<!ATTLIST adjuster name CDATA #REQUIRED>\n"
1019      "\t\t\t<!ATTLIST adjuster default CDATA #REQUIRED>\n"
9471020      "\t\t<!ELEMENT driver EMPTY>\n"
9481021      "\t\t\t<!ATTLIST driver status (good|imperfect|preliminary) #REQUIRED>\n"
9491022      "\t\t\t<!ATTLIST driver emulation (good|imperfect|preliminary) #REQUIRED>\n"
src/mess/infomess.c
r4898r4899
2121 *
2222 *************************************/
2323
24/*-------------------------------------------------
25    print_game_categories - print the Categories
26    settings for a system
27-------------------------------------------------*/
2428
29void print_game_categories(FILE *out, const game_driver *game, const input_port_config *portlist)
30{
31   const input_port_config *port;
32   const input_field_config *field;
33
34   /* iterate looking for Categories */
35   for (port = portlist; port != NULL; port = port->next)
36      for (field = port->fieldlist; field != NULL; field = field->next)
37         if (field->type == IPT_CATEGORY)
38         {
39            const input_setting_config *setting;
40
41            /* output the category name information */
42            fprintf(out, "\t\t<category name=\"%s\">\n", xml_normalize_string(input_field_name(field)));
43
44            /* loop over item settings */
45            for (setting = field->settinglist; setting != NULL; setting = setting->next)
46            {
47               fprintf(out, "\t\t\t<item name=\"%s\"", xml_normalize_string(setting->name));
48               if (setting->value == field->defvalue)
49                  fprintf(out, " default=\"yes\"");
50               fprintf(out, "/>\n");
51            }
52
53            /* terminate the category entry */
54            fprintf(out, "\t\t</category>\n");
55         }
56}
57
2558/*-------------------------------------------------
2659    print_game_device - prints out all info on
2760   MESS-specific devices
src/mess/infomess.h
r4898r4899
1010#define INFOMESS_H
1111
1212/* code used by print_mame_xml() */
13void print_game_categories(FILE *out, const game_driver *game, const input_port_config *portlist);
1314void print_game_device(FILE *out, const game_driver *game, const machine_config *config);
1415void print_game_ramoptions(FILE *out, const game_driver *game, const machine_config *config);
1516

Previous 15994 Revisions Next


© 1998-2018 The MESS Team