diff --git a/data/database/compatibility.xml b/data/database/compatibility.xml index fceb4bc06..1840e759b 100644 --- a/data/database/compatibility.xml +++ b/data/database/compatibility.xml @@ -1,265 +1,265 @@ - + - + No Issues - + No Issues - + No Issues - + No Issues - + No Issues - + No Issues - + No Issues - + No Issues - + No Issues - + No Issues - + No Issues - + No Issues - + No Issues - + No Issues Unofficial translation works too - + No Issues 0.1-774-g5a1b008 - + No Issues - + No Issues - + No Issues - + No Issues - + No Issues - + No Issues - + No Issues - + No Issues - + No Issues - + No Issues - + No Issues Background gradient is rendered incorrectly with scaled dithering or true color. 0.1-814-g8139230 - + No Issues 0.1-841-g777809b - + No Issues 0.1-841-g777809b - + No Issues - + No Issues - + No Issues - + No Issues - + No Issues - + No Issues - + No Issues - + No Issues - + No Issues - + + No Issues + + No Issues 0.1-826-g712168c Notice bottom the line of FMV is a little odd but work fine. - + No Issues 0.1-826-g712168c Notice bottom the line of FMV is a little odd but work fine. - + No Issues 0.1-826-g712168c Notice bottom the line of FMV is a little odd but work fine. - + No Issues - + No Issues - + No Issues - - No Issues - - + No Issues 0.1-826-g712168c Notice bottom the line of game is a little odd but work fine. - + No Issues 0.1-826-g712168c Notice bottom the line of FMV is a little odd but work fine. - + No Issues - + No Issues - + No Issues 0.1-826-g712168c Notice bottom the line of FMV is a little odd but work fine. - + Graphical/Audio Issues Works, except dynamic lighting on character is broken. - + No Issues - + Doesn't Boot Issue 419 - + No Issues 0.1-774-g5a1b008 - + No Issues 0.1-774-g5a1b008 - + No Issues 2D elements on title screen - + No Issues - + No Issues - + No Issues - + No Issues 0.1-826-g712168c Notice bottom the line of game is a little odd but work fine. - + No Issues 0.1-826-g712168c Noticed bottom the line of FMV is a little odd but works fine. - + No Issues - + No Issues 0.1-826-g712168c Noticed bottom the line of FMV is a little odd but works fine. - + Doesn't Boot Crashes in Cached/Recompiler; seems to work in Intrepeter - + No Issues 0.1-841-g777809b - + No Issues 9d1eb32 - + No Issues 0.1-774-g5a1b008 - + No Issues - + No Issues - + No Issues - + No Issues - + No Issues - + No Issues - + No Issues - + Graphical/Audio Issues - + + Doesn't Boot + + No Issues Sprite glitches - - Doesn't Boot - - + \ No newline at end of file diff --git a/scripts/merge_compatibility_list.py b/scripts/merge_compatibility_list.py new file mode 100644 index 000000000..3fa384759 --- /dev/null +++ b/scripts/merge_compatibility_list.py @@ -0,0 +1,59 @@ +from copy import deepcopy +import sys +import argparse +import xml.etree.ElementTree as ET +from xml.dom import minidom + +# https://pymotw.com/2/xml/etree/ElementTree/create.html +def prettify(elem): + """Return a pretty-printed XML string for the Element. + """ + rough_string = ET.tostring(elem, 'utf-8') + reparsed = minidom.parseString(rough_string) + dom_string = reparsed.toprettyxml(indent=" ") + return '\n'.join([s for s in dom_string.splitlines() if s.strip()]) + + +# https://stackoverflow.com/questions/25338817/sorting-xml-in-python-etree/25339725#25339725 +def sortchildrenby(parent, attr): + parent[:] = sorted(parent, key=lambda child: child.get(attr)) + + +def add_entries_from_file(filename, new_tree, overwrite_existing = False): + tree = ET.parse(filename) + for child in tree.getroot(): + if (child.tag != "entry"): + print("!!! Skipping invalid tag '%s'" % child.tag) + continue + + game_code = child.get("code") + existing_node = new_tree.getroot().find(".//*[@code='%s']" % game_code) + if existing_node is not None: + if overwrite_existing: + print("*** Replacing %s from new list" % game_code) + new_tree.getroot().remove(existing_node) + else: + print("*** Skipping %s from new list" % game_code) + continue + + new_tree.getroot().append(deepcopy(child)) + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("--overwrite", action="store_true") + parser.add_argument("existing_list", action="store") + parser.add_argument("list_to_merge", action="store") + parser.add_argument("output_list", action="store") + args = parser.parse_args() + + new_tree = ET.ElementTree(ET.Element("compatibility-list")) + add_entries_from_file(args.existing_list, new_tree, False) + add_entries_from_file(args.list_to_merge, new_tree, args.overwrite) + + sortchildrenby(new_tree.getroot(), "title") + + output_file = open(args.output_list, "w") + output_file.write(prettify(new_tree.getroot())) + output_file.close() +