├── .gitignore ├── helper └── wiitdb2romcollectionbrowser.bat ├── src ├── test │ └── java │ │ └── TestStart.java └── main │ └── java │ └── com │ └── scilor │ └── wii │ └── wiitdb2romcollectionbrowser │ ├── GameControl.java │ ├── GameWiFi.java │ ├── GameInput.java │ ├── GameRating.java │ ├── GameLocale.java │ ├── Main.java │ ├── Game.java │ ├── FlatFileCreator.java │ └── XmlFileParser.java ├── .github └── FUNDING.yml ├── rcb ├── wiitdb.flat.scraper.xml └── config.xml.example └── pom.xml /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | release/ 3 | *.iml 4 | target/ -------------------------------------------------------------------------------- /helper/wiitdb2romcollectionbrowser.bat: -------------------------------------------------------------------------------- 1 | java -jar wiitdb2romcollectionbrowser-1.0.0-shaded.jar %* -------------------------------------------------------------------------------- /src/test/java/TestStart.java: -------------------------------------------------------------------------------- 1 | import com.scilor.wii.wiitdb2romcollectionbrowser.Main; 2 | 3 | /** 4 | * Created by SciLor on 30.01.2017. 5 | */ 6 | public class TestStart { 7 | public static void main(String[] args) throws Exception { 8 | args = new String[] { 9 | "-i", "D:\\_Programmierung\\IntelliJ\\WiiTDB2RomCollectionBrowser\\test\\wiitdb.xml", 10 | "-o", "D:\\_Programmierung\\IntelliJ\\WiiTDB2RomCollectionBrowser\\test\\output\\", 11 | "-lp", "DE", "EN" 12 | }; 13 | Main.main(args); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/scilor/wii/wiitdb2romcollectionbrowser/GameControl.java: -------------------------------------------------------------------------------- 1 | package com.scilor.wii.wiitdb2romcollectionbrowser; 2 | 3 | /** 4 | * Created by SciLor on 30.01.2017. 5 | */ 6 | public class GameControl { 7 | private String type; //wiimote 8 | private boolean required; 9 | 10 | public String getType() { 11 | return type; 12 | } 13 | 14 | public void setType(String type) { 15 | this.type = type; 16 | } 17 | 18 | public boolean isRequired() { 19 | return required; 20 | } 21 | 22 | public void setRequired(boolean required) { 23 | this.required = required; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/scilor/wii/wiitdb2romcollectionbrowser/GameWiFi.java: -------------------------------------------------------------------------------- 1 | package com.scilor.wii.wiitdb2romcollectionbrowser; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * Created by SciLor on 30.01.2017. 7 | */ 8 | public class GameWiFi { 9 | private byte players; 10 | private List features; //online 11 | 12 | public byte getPlayers() { 13 | return players; 14 | } 15 | 16 | public void setPlayers(byte players) { 17 | this.players = players; 18 | } 19 | 20 | public List getFeatures() { 21 | return features; 22 | } 23 | 24 | public void setFeatures(List features) { 25 | this.features = features; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: SciLor # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 13 | -------------------------------------------------------------------------------- /src/main/java/com/scilor/wii/wiitdb2romcollectionbrowser/GameInput.java: -------------------------------------------------------------------------------- 1 | package com.scilor.wii.wiitdb2romcollectionbrowser; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | /** 7 | * Created by SciLor on 30.01.2017. 8 | */ 9 | public class GameInput { 10 | private byte players; 11 | private List controls; 12 | 13 | public GameInput() { 14 | controls = new ArrayList(); 15 | } 16 | 17 | public byte getPlayers() { 18 | return players; 19 | } 20 | 21 | public void setPlayers(byte players) { 22 | this.players = players; 23 | } 24 | 25 | public List getControls() { 26 | return controls; 27 | } 28 | 29 | public void setControls(List controls) { 30 | this.controls = controls; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/scilor/wii/wiitdb2romcollectionbrowser/GameRating.java: -------------------------------------------------------------------------------- 1 | package com.scilor.wii.wiitdb2romcollectionbrowser; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * Created by SciLor on 30.01.2017. 7 | */ 8 | public class GameRating { 9 | private String type; //ESRB 10 | private String value; //E10+ 11 | private List descriptors; //cartoon violence //mild suggestive themes 12 | 13 | public String getType() { 14 | return type; 15 | } 16 | 17 | public void setType(String type) { 18 | this.type = type; 19 | } 20 | 21 | public String getValue() { 22 | return value; 23 | } 24 | 25 | public void setValue(String value) { 26 | this.value = value; 27 | } 28 | 29 | public List getDescriptors() { 30 | return descriptors; 31 | } 32 | 33 | public void setDescriptors(List descriptors) { 34 | this.descriptors = descriptors; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/scilor/wii/wiitdb2romcollectionbrowser/GameLocale.java: -------------------------------------------------------------------------------- 1 | package com.scilor.wii.wiitdb2romcollectionbrowser; 2 | 3 | /** 4 | * Created by SciLor on 30.01.2017. 5 | */ 6 | public class GameLocale { 7 | private String languageCode; //EN 8 | private String title; //Teenage Mutant Ninja Turtles: Smash-Up 9 | private String synopsis; //This four-player fighting game features[...] 10 | 11 | public String getLanguageCode() { 12 | return languageCode; 13 | } 14 | 15 | public void setLanguageCode(String languageCode) { 16 | this.languageCode = languageCode; 17 | } 18 | 19 | public String getTitle() { 20 | return title; 21 | } 22 | 23 | public void setTitle(String title) { 24 | this.title = title; 25 | } 26 | 27 | public String getSynopsis() { 28 | return synopsis; 29 | } 30 | 31 | public void setSynopsis(String synopsis) { 32 | this.synopsis = synopsis; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /rcb/wiitdb.flat.scraper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Id: 5 | 6 | Name: 7 | 8 | Platform: 9 | 10 | Region: 11 | 12 | 13 | Languages: 14 | 15 | Title: 16 | 17 | Developer: 18 | 19 | Publisher: 20 | 21 | Release Year: 22 | 23 | 24 | Release Month: 25 | Release Day: 26 | 27 | Genre: 28 | 29 | Rating: 30 | 31 | Players: 32 | 33 | Controllers: 34 | 35 | Description: 36 | 37 | 38 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | com.scilor.wii 8 | wiitdb2romcollectionbrowser 9 | 1.0.0 10 | jar 11 | 12 | 13 | 14 | commons-cli 15 | commons-cli 16 | 1.3.1 17 | 18 | 19 | 20 | 21 | 22 | org.apache.maven.plugins 23 | maven-shade-plugin 24 | 2.3 25 | 26 | false 27 | 28 | 29 | com.scilor.wii.wiitdb2romcollectionbrowser.Main 30 | 31 | 32 | 33 | 34 | 35 | package 36 | 37 | shade 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /src/main/java/com/scilor/wii/wiitdb2romcollectionbrowser/Main.java: -------------------------------------------------------------------------------- 1 | package com.scilor.wii.wiitdb2romcollectionbrowser; 2 | 3 | import org.apache.commons.cli.*; 4 | import org.xml.sax.SAXException; 5 | 6 | import javax.xml.parsers.ParserConfigurationException; 7 | import java.io.File; 8 | import java.io.IOException; 9 | import java.util.Arrays; 10 | import java.util.List; 11 | 12 | /** 13 | * Created by SciLor on 30.01.2017. 14 | */ 15 | public class Main { 16 | public static void main(String[] args) throws Exception { 17 | Options options = generateOptions(); 18 | 19 | CommandLineParser parser = new DefaultParser(); 20 | HelpFormatter formatter = new HelpFormatter(); 21 | CommandLine cmd; 22 | 23 | try { 24 | cmd = parser.parse(options, args); 25 | } catch (ParseException e) { 26 | System.out.println(e.getMessage()); 27 | formatter.printHelp("WiiTDB.xml to flat file converter", options); 28 | 29 | System.exit(1); 30 | return; 31 | } 32 | 33 | XmlFileParser xmlParser = new XmlFileParser(); 34 | List games = xmlParser.readGames(new File(cmd.getOptionValue("input"))); 35 | FlatFileCreator creator = new FlatFileCreator(); 36 | 37 | for (Game game : games) { 38 | creator.createFile(cmd.getOptionValue("output") + game.getId() + ".txt", game, Arrays.asList(cmd.getOptionValues("lang-priority"))); 39 | } 40 | } 41 | 42 | private static Options generateOptions() { 43 | Options options = new Options(); 44 | 45 | Option option; 46 | option = new Option("i", "input", true, "WiiTDB.xml file path"); 47 | option.setRequired(true); 48 | options.addOption(option); 49 | 50 | option = new Option("o", "output", true, "directory to put the flat files"); 51 | option.setRequired(true); 52 | options.addOption(option); 53 | 54 | option = new Option("lp", "lang-priority", true, "List of language codes (EN DE FR etc.) to extract the game name / description. First serves first!"); 55 | option.setRequired(true); 56 | option.setArgs(Option.UNLIMITED_VALUES); 57 | options.addOption(option); 58 | 59 | return options; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/scilor/wii/wiitdb2romcollectionbrowser/Game.java: -------------------------------------------------------------------------------- 1 | package com.scilor.wii.wiitdb2romcollectionbrowser; 2 | 3 | import java.time.LocalDateTime; 4 | import java.util.HashMap; 5 | import java.util.List; 6 | import java.util.Map; 7 | 8 | /** 9 | * Created by SciLor on 30.01.2017. 10 | */ 11 | public class Game { 12 | private String id; //R2TE41 13 | private String name; //Teenage Mutant Ninja Turtles: Smash-Up (USA) (EN,ES) 14 | private String type; // 15 | private String region; //NTSC-U 16 | private List languages; //EN,DE,ES 17 | private Map locales; 18 | private String developer; //Game Arts 19 | private String publisher; //Ubi Soft Entertainment 20 | private LocalDateTime releaseDate; 21 | 22 | private GameRating rating; 23 | private List genres; 24 | private GameWiFi wifi; 25 | private GameInput input; 26 | 27 | public Game() { 28 | this.locales = new HashMap(); 29 | } 30 | 31 | public String getId() { 32 | return id; 33 | } 34 | 35 | public void setId(String id) { 36 | this.id = id; 37 | } 38 | 39 | public String getName() { 40 | return name; 41 | } 42 | 43 | public void setName(String name) { 44 | this.name = name; 45 | } 46 | 47 | public String getType() { 48 | return type; 49 | } 50 | 51 | public void setType(String type) { 52 | this.type = type; 53 | } 54 | 55 | public String getRegion() { 56 | return region; 57 | } 58 | 59 | public void setRegion(String region) { 60 | this.region = region; 61 | } 62 | 63 | public List getLanguages() { 64 | return languages; 65 | } 66 | 67 | public void setLanguages(List languages) { 68 | this.languages = languages; 69 | } 70 | 71 | public Map getLocales() { 72 | return locales; 73 | } 74 | 75 | public void setLocales(Map locales) { 76 | this.locales = locales; 77 | } 78 | 79 | public String getDeveloper() { 80 | return developer; 81 | } 82 | 83 | public GameRating getRating() { 84 | return rating; 85 | } 86 | 87 | public void setRating(GameRating rating) { 88 | this.rating = rating; 89 | } 90 | 91 | public void setDeveloper(String developer) { 92 | this.developer = developer; 93 | } 94 | 95 | public String getPublisher() { 96 | return publisher; 97 | } 98 | 99 | public void setPublisher(String publisher) { 100 | this.publisher = publisher; 101 | } 102 | 103 | public LocalDateTime getReleaseDate() { 104 | return releaseDate; 105 | } 106 | 107 | public void setReleaseDate(LocalDateTime releaseDate) { 108 | this.releaseDate = releaseDate; 109 | } 110 | 111 | public List getGenres() { 112 | return genres; 113 | } 114 | 115 | public void setGenres(List genres) { 116 | this.genres = genres; 117 | } 118 | 119 | public GameWiFi getWifi() { 120 | return wifi; 121 | } 122 | 123 | public void setWifi(GameWiFi wifi) { 124 | this.wifi = wifi; 125 | } 126 | 127 | public GameInput getInput() { 128 | return input; 129 | } 130 | 131 | public void setInput(GameInput input) { 132 | this.input = input; 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /src/main/java/com/scilor/wii/wiitdb2romcollectionbrowser/FlatFileCreator.java: -------------------------------------------------------------------------------- 1 | package com.scilor.wii.wiitdb2romcollectionbrowser; 2 | 3 | import java.io.FileNotFoundException; 4 | import java.io.IOException; 5 | import java.io.PrintWriter; 6 | import java.io.UnsupportedEncodingException; 7 | import java.util.List; 8 | 9 | /** 10 | * Created by SciLor on 30.01.2017. 11 | */ 12 | public class FlatFileCreator { 13 | public void createFile(String path, Game game, List langPriority) throws Exception { 14 | try{ 15 | PrintWriter writer = new PrintWriter(path, "UTF-8"); 16 | writer.print(generateText(game, langPriority)); 17 | writer.close(); 18 | } catch (Exception e) { 19 | throw e; 20 | } 21 | } 22 | 23 | private String generateText(Game game, List langPriority) { 24 | final String newline = "\r\n"; 25 | StringBuilder sb = new StringBuilder(); 26 | 27 | sb.append("Id: ").append(game.getId()).append(newline); 28 | sb.append("Name: ").append(game.getName()).append(newline); 29 | sb.append("Platform: ").append(game.getType() == null ? "Wii" : game.getType()).append(newline); 30 | sb.append("Region: ").append(game.getRegion()).append(newline); 31 | 32 | sb.append("Languages: "); 33 | appendList(sb, game.getLanguages()).append(newline); 34 | 35 | sb.append("Title: "); 36 | for (String langCode : langPriority) { 37 | if (game.getLocales().containsKey(langCode)) { 38 | String text = game.getLocales().get(langCode).getTitle(); 39 | if (text != null) 40 | sb.append(text); 41 | break; 42 | } 43 | } 44 | sb.append(newline); 45 | 46 | sb.append("Developer: ").append(game.getDeveloper()).append(newline); 47 | sb.append("Publisher: ").append(game.getPublisher()).append(newline); 48 | sb.append("Release Year: ").append(game.getReleaseDate().getYear()).append(newline); 49 | sb.append("Release Month: ").append(game.getReleaseDate().getMonthValue()).append(newline); 50 | sb.append("Release Day: ").append(game.getReleaseDate().getDayOfMonth()).append(newline); 51 | 52 | sb.append("Genre: "); 53 | appendList(sb, game.getGenres()).append(newline); 54 | 55 | sb.append("Rating: ").append(game.getRating().getType()).append(" ").append(game.getRating().getValue()).append(newline); 56 | sb.append("Players: ").append(game.getInput().getPlayers()).append(newline); 57 | 58 | sb.append("Controllers: "); 59 | for (GameControl control : game.getInput().getControls()) { 60 | sb.append(control.getType()); 61 | if (control.isRequired()) { 62 | sb.append(" required,"); 63 | } else { 64 | sb.append(" optional,"); 65 | } 66 | } 67 | if (game.getInput().getControls().size() > 0) 68 | sb.setLength(sb.length()-1); 69 | sb.append(newline); 70 | 71 | sb.append("Description: "); 72 | for (String langCode : langPriority) { 73 | if (game.getLocales().containsKey(langCode)) { 74 | String text = game.getLocales().get(langCode).getSynopsis(); 75 | if (text != null) 76 | sb.append(text); 77 | break; 78 | } 79 | } 80 | sb.append(newline); 81 | 82 | sb.append("***EOF***"); 83 | 84 | return sb.toString(); 85 | } 86 | 87 | private StringBuilder appendList(StringBuilder sb, List list) { 88 | for (Object entry : list) { 89 | sb.append(entry.toString()); 90 | sb.append(","); 91 | } 92 | if (list.size()>0) 93 | sb.setLength(sb.length()-1); //remove last comma 94 | return sb; 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /src/main/java/com/scilor/wii/wiitdb2romcollectionbrowser/XmlFileParser.java: -------------------------------------------------------------------------------- 1 | package com.scilor.wii.wiitdb2romcollectionbrowser; 2 | 3 | import org.w3c.dom.Document; 4 | import org.w3c.dom.Element; 5 | import org.w3c.dom.Node; 6 | import org.w3c.dom.NodeList; 7 | import org.xml.sax.SAXException; 8 | 9 | import javax.xml.parsers.DocumentBuilder; 10 | import javax.xml.parsers.DocumentBuilderFactory; 11 | import javax.xml.parsers.ParserConfigurationException; 12 | import java.io.File; 13 | import java.io.IOException; 14 | import java.time.LocalDateTime; 15 | import java.util.ArrayList; 16 | import java.util.Arrays; 17 | import java.util.List; 18 | 19 | /** 20 | * Created by SciLor on 30.01.2017. 21 | */ 22 | public class XmlFileParser { 23 | 24 | public List readGames(File file) throws ParserConfigurationException, IOException, SAXException { 25 | List games = new ArrayList(); 26 | DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); 27 | DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); 28 | Document doc = dBuilder.parse(file); 29 | 30 | NodeList nodes = doc.getElementsByTagName("game"); 31 | for (int i=0; i descriptors = new ArrayList(); 79 | for (int i=0; i features = new ArrayList(); 90 | for (int i=0; i getTextList(Element element, String tag) { 120 | return Arrays.asList(getText(element, tag).split(",")); 121 | } 122 | private String emptyToOne(String value) { 123 | if (value == null || "".equals(value)) 124 | return "1"; 125 | return value; 126 | } 127 | } 128 | -------------------------------------------------------------------------------- /rcb/config.xml.example: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | False 5 | 6 | \Wii\Dolphin\Dolphin.exe 7 | "%ROM%" 8 | X:\USB1\backup\wii\wbfs\*.wbfs 9 | 10 | 11 | X:\USB1\backup\wii\images\3d\%GAME%.* 12 | X:\USB1\backup\wii\images\front\%GAME%.* 13 | X:\USB1\backup\wii\images\disc\%GAME%.* 14 | X:\USB1\backup\wii\images\full\%GAME%.* 15 | 16 | 17 | False 18 | False 19 | False 20 | True 21 | True 22 | True 23 | False 24 | 9999 25 | False 26 | False 27 | _Disk.* 28 | gameinfosmall 29 | gameinfosmall 30 | 31 | 32 | 33 | 34 | 35 | image 36 | game 37 | 38 | 39 | image 40 | game 41 | 42 | 43 | image 44 | game 45 | 46 | 47 | image 48 | game 49 | 50 | 51 | image 52 | game 53 | 54 | 55 | image 56 | game 57 | 58 | 59 | image 60 | game 61 | 62 | 63 | image 64 | game 65 | 66 | 67 | image 68 | romcollection 69 | 70 | 71 | image 72 | developer 73 | 74 | 75 | image 76 | publisher 77 | 78 | 79 | video 80 | game 81 | 82 | 83 | image 84 | game 85 | 86 | 87 | image 88 | game 89 | 90 | 91 | 92 | 93 | boxfront 94 | screenshot 95 | title 96 | action 97 | boxfront 98 | screenshot 99 | title 100 | action 101 | fanart 102 | boxfront 103 | screenshot 104 | title 105 | action 106 | screenshot 107 | boxfront 108 | action 109 | title 110 | publisher 111 | romcollection 112 | developer 113 | 114 | 115 | boxfront 116 | screenshot 117 | title 118 | action 119 | boxfront 120 | screenshot 121 | title 122 | action 123 | fanart 124 | boxfront 125 | screenshot 126 | title 127 | action 128 | screenshot 129 | action 130 | title 131 | boxfront 132 | cartridge 133 | boxback 134 | title 135 | publisher 136 | romcollection 137 | developer 138 | 139 | 140 | marquee 141 | boxfront 142 | title 143 | marquee 144 | boxfront 145 | title 146 | boxfront 147 | title 148 | action 149 | cabinet 150 | title 151 | action 152 | publisher 153 | romcollection 154 | developer 155 | 156 | 157 | cabinet 158 | boxfront 159 | title 160 | cabinet 161 | boxfront 162 | title 163 | boxfront 164 | title 165 | action 166 | title 167 | action 168 | marquee 169 | publisher 170 | romcollection 171 | developer 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | --------------------------------------------------------------------------------