summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/emu/softlist.cpp31
-rw-r--r--src/emu/softlist.h3
-rw-r--r--src/emu/softlist_dev.cpp6
-rw-r--r--src/emu/softlist_dev.h2
-rw-r--r--src/frontend/mame/clifront.cpp10
5 files changed, 46 insertions, 6 deletions
diff --git a/src/emu/softlist.cpp b/src/emu/softlist.cpp
index 34517aa13ce..8ee8d0d8500 100644
--- a/src/emu/softlist.cpp
+++ b/src/emu/softlist.cpp
@@ -196,6 +196,7 @@ public:
std::string_view filename,
std::string &listname,
std::string &description,
+ std::string &notes,
std::list<software_info> &infolist,
std::ostream &errors);
@@ -236,6 +237,7 @@ private:
void parse_soft_start(const char *tagname, const char **attributes);
void parse_part_start(const char *tagname, const char **attributes);
void parse_data_start(const char *tagname, const char **attributes);
+ void parse_main_end(const char *tagname);
void parse_soft_end(const char *name);
// internal parsing state
@@ -245,6 +247,7 @@ private:
struct XML_ParserStruct * m_parser;
std::string & m_listname;
std::string & m_description;
+ std::string & m_notes;
bool m_data_accum_expected;
std::string m_data_accum;
software_info * m_current_info;
@@ -262,6 +265,7 @@ softlist_parser::softlist_parser(
std::string_view filename,
std::string &listname,
std::string &description,
+ std::string &notes,
std::list<software_info> &infolist,
std::ostream &errors) :
m_filename(filename),
@@ -269,6 +273,7 @@ softlist_parser::softlist_parser(
m_errors(errors),
m_listname(listname),
m_description(description),
+ m_notes(notes),
m_data_accum_expected(false),
m_current_info(nullptr),
m_current_part(nullptr),
@@ -472,6 +477,7 @@ void softlist_parser::end_handler(void *data, const char *name)
break;
case POS_MAIN:
+ state->parse_main_end(name);
state->m_current_info = nullptr;
break;
@@ -563,13 +569,25 @@ void softlist_parser::parse_main_start(const char *tagname, const char **attribu
else
parse_error("No name defined for item");
}
+ // <notes>
+ else if (strcmp(tagname, "notes") == 0)
+ {
+ m_data_accum_expected = true;
+ }
else
unknown_tag(tagname);
}
+void softlist_parser::parse_main_end(const char *tagname)
+{
+ if (strcmp(tagname, "notes") == 0)
+ m_notes = m_data_accum;
+}
+
+
//-------------------------------------------------
-// parse_main_start - handle tag start within
+// parse_soft_start - handle tag start within
// a software tag
//-------------------------------------------------
@@ -594,6 +612,10 @@ void softlist_parser::parse_soft_start(const char *tagname, const char **attribu
else if (strcmp(tagname, "publisher") == 0)
m_data_accum_expected = true;
+ // <notes>
+ else if (strcmp(tagname, "notes") == 0)
+ m_data_accum_expected = true;
+
// <info name='' value=''>
else if (strcmp(tagname, "info") == 0)
{
@@ -859,6 +881,10 @@ void softlist_parser::parse_soft_end(const char *tagname)
else if (strcmp(tagname, "publisher") == 0)
m_current_info->m_publisher = m_data_accum;
+ // <notes>
+ else if (strcmp(tagname, "notes") == 0)
+ m_current_info->m_notes = m_data_accum;
+
// </part>
else if (strcmp(tagname, "part") == 0)
{
@@ -887,10 +913,11 @@ void parse_software_list(
std::string_view filename,
std::string &listname,
std::string &description,
+ std::string &notes,
std::list<software_info> &infolist,
std::ostream &errors)
{
- detail::softlist_parser(file, filename, listname, description, infolist, errors);
+ detail::softlist_parser(file, filename, listname, description, notes, infolist, errors);
}
diff --git a/src/emu/softlist.h b/src/emu/softlist.h
index 7622e7e00d1..2c7a4e545dd 100644
--- a/src/emu/softlist.h
+++ b/src/emu/softlist.h
@@ -120,6 +120,7 @@ public:
const std::string &parentname() const { return m_parentname; }
const std::string &year() const { return m_year; }
const std::string &publisher() const { return m_publisher; }
+ const std::string &notes() const { return m_notes; }
const std::list<feature_list_item> &other_info() const { return m_other_info; }
const std::list<feature_list_item> &shared_info() const { return m_shared_info; }
software_support supported() const { return m_supported; }
@@ -137,6 +138,7 @@ private:
std::string m_parentname;
std::string m_year; // Copyright year on title screen, actual release dates can be tracked in external resources
std::string m_publisher;
+ std::string m_notes;
std::list<feature_list_item> m_other_info; // Here we store info like developer, serial #, etc. which belong to the software entry as a whole
std::list<feature_list_item> m_shared_info; // Here we store info like TV standard compatibility, or add-on requirements, etc. which get inherited
// by each part of this software entry (after loading these are stored in partdata->featurelist)
@@ -152,6 +154,7 @@ void parse_software_list(
std::string_view filename,
std::string &listname,
std::string &description,
+ std::string &notes,
std::list<software_info> &infolist,
std::ostream &errors);
diff --git a/src/emu/softlist_dev.cpp b/src/emu/softlist_dev.cpp
index 7d25dd17013..7d7e1930089 100644
--- a/src/emu/softlist_dev.cpp
+++ b/src/emu/softlist_dev.cpp
@@ -89,7 +89,8 @@ software_list_device::software_list_device(const machine_config &mconfig, const
m_list_type(softlist_type::ORIGINAL_SYSTEM),
m_filter(nullptr),
m_parsed(false),
- m_description("")
+ m_description(""),
+ m_notes("")
{
}
@@ -180,6 +181,7 @@ void software_list_device::release()
m_filename.clear();
m_shortname.clear();
m_description.clear();
+ m_notes.clear();
m_errors.clear();
m_infolist.clear();
}
@@ -294,7 +296,7 @@ void software_list_device::parse()
{
// parse if no error
std::ostringstream errs;
- parse_software_list(file, m_filename, m_shortname, m_description, m_infolist, errs);
+ parse_software_list(file, m_filename, m_shortname, m_description, m_notes, m_infolist, errs);
file.close();
m_errors = errs.str();
}
diff --git a/src/emu/softlist_dev.h b/src/emu/softlist_dev.h
index e0e912a67f1..2de72bd3b8f 100644
--- a/src/emu/softlist_dev.h
+++ b/src/emu/softlist_dev.h
@@ -116,6 +116,7 @@ public:
// getters that may trigger a parse
const std::string &description() { if (!m_parsed) parse(); return m_description; }
+ const std::string &notes() { if (!m_parsed) parse(); return m_notes; }
bool valid() { if (!m_parsed) parse(); return !m_infolist.empty(); }
const char *errors_string() { if (!m_parsed) parse(); return m_errors.c_str(); }
const std::list<software_info> &get_info() { if (!m_parsed) parse(); return m_infolist; }
@@ -152,6 +153,7 @@ private:
std::string m_filename;
std::string m_shortname;
std::string m_description;
+ std::string m_notes;
std::string m_errors;
std::list<software_info> m_infolist;
};
diff --git a/src/frontend/mame/clifront.cpp b/src/frontend/mame/clifront.cpp
index eb77ead8e5c..bc78cb1112c 100644
--- a/src/frontend/mame/clifront.cpp
+++ b/src/frontend/mame/clifront.cpp
@@ -1059,16 +1059,18 @@ const char cli_frontend::s_softlist_xml_dtd[] =
"<?xml version=\"1.0\"?>\n" \
"<!DOCTYPE softwarelists [\n" \
"<!ELEMENT softwarelists (softwarelist*)>\n" \
- "\t<!ELEMENT softwarelist (software+)>\n" \
+ "\t<!ELEMENT softwarelist (notes?, software+)>\n" \
"\t\t<!ATTLIST softwarelist name CDATA #REQUIRED>\n" \
"\t\t<!ATTLIST softwarelist description CDATA #IMPLIED>\n" \
- "\t\t<!ELEMENT software (description, year, publisher, info*, sharedfeat*, part*)>\n" \
+ "\t\t<!ELEMENT notes (#PCDATA)>\n" \
+ "\t\t<!ELEMENT software (description, year, publisher, notes?, info*, sharedfeat*, part*)>\n" \
"\t\t\t<!ATTLIST software name CDATA #REQUIRED>\n" \
"\t\t\t<!ATTLIST software cloneof CDATA #IMPLIED>\n" \
"\t\t\t<!ATTLIST software supported (yes|partial|no) \"yes\">\n" \
"\t\t\t<!ELEMENT description (#PCDATA)>\n" \
"\t\t\t<!ELEMENT year (#PCDATA)>\n" \
"\t\t\t<!ELEMENT publisher (#PCDATA)>\n" \
+ "\t\t\t<!ELEMENT notes (#PCDATA)>\n" \
"\t\t\t<!ELEMENT info EMPTY>\n" \
"\t\t\t\t<!ATTLIST info name CDATA #REQUIRED>\n" \
"\t\t\t\t<!ATTLIST info value CDATA #IMPLIED>\n" \
@@ -1116,6 +1118,8 @@ const char cli_frontend::s_softlist_xml_dtd[] =
void cli_frontend::output_single_softlist(std::ostream &out, software_list_device &swlistdev)
{
util::stream_format(out, "\t<softwarelist name=\"%s\" description=\"%s\">\n", swlistdev.list_name(), util::xml::normalize_string(swlistdev.description().c_str()));
+ if (!swlistdev.notes().empty())
+ util::stream_format(out, "\t\t<notes>%s</notes>\n", util::xml::normalize_string(swlistdev.notes().c_str()));
for (const software_info &swinfo : swlistdev.get_info())
{
util::stream_format(out, "\t\t<software name=\"%s\"", util::xml::normalize_string(swinfo.shortname().c_str()));
@@ -1129,6 +1133,8 @@ void cli_frontend::output_single_softlist(std::ostream &out, software_list_devic
util::stream_format(out, "\t\t\t<description>%s</description>\n", util::xml::normalize_string(swinfo.longname().c_str()));
util::stream_format(out, "\t\t\t<year>%s</year>\n", util::xml::normalize_string(swinfo.year().c_str()));
util::stream_format(out, "\t\t\t<publisher>%s</publisher>\n", util::xml::normalize_string(swinfo.publisher().c_str()));
+ if (!swinfo.notes().empty())
+ util::stream_format(out, "\t\t\t<notes>%s</notes>\n", util::xml::normalize_string(swinfo.notes().c_str()));
for (const feature_list_item &flist : swinfo.other_info())
util::stream_format(out, "\t\t\t<info name=\"%s\" value=\"%s\"/>\n", flist.name(), util::xml::normalize_string(flist.value().c_str()));