When sharing ROMs with your friends, very often we encounter the problem of merginggamelist.xml
for each type of ROM. Since the game previews are already provided, it would be very useful to be able to merge those gamelist.xml
without the need to re-scrape everything from raw scratch. I have searched online but could not find a very good gamelist merger in open-source repository so I created one myself on my Github.
Utility Tool 1 (gamelist-merge.py):
I claim it as the world’s best program (up to today 🤩) for merging gamelist.xml
because:
- It can merge multiple game lists in one go
- It can resolve duplicates both within the same gamelist.xml (e.g., “Ace Combat 2 (USA).chd” and “Ace Combat 2 (USA).PBP”) and across multiple gamelist.xml
- It can work on just the list files (gamelist.xml) only or together with the directory of all the files
- For input: you can keep different sources in different folders or lump every source into one single folder (because ROM pack can be huge, taking lots of disk space, so it takes much more space to keep them in separate folders)
- For output: you can modify resources in place (by specifying the same input/output directory) or output to a different folder (same disk-space consideration as in 4)
- You can specify merge rules (or no internal merge), for string field you can choose to keep “longer” or “shorter” string, for files you can choose to keep “bigger” or “smaller” file
By default, it will keep longer string field (more detailed description is better), smaller ROM file (more efficient compression is better), and bigger resource file (higher resolution image/video is better), but you can customize the merge rule by yourself.
Since different retro-gaming OS takes slightly different gamelist.xml
, if certain XML fields (such as <sortname>
) is not needed, you can use simple shell commands such as sed
to delete those lines.
Utility Tool 2 (copy-if-absent.py):
In another scenario, you might have a folder of ROMs without scrape info, i.e., no gamelist.xml
. You want to copy over ROMs without duplicates in different filename extensions. For example, you have “Phoenix 3 (USA).iso” in one folder, “Phoenix 3 (USA).CHD” in a second folder, and “Phoenix 3 (USA).cue/img/ccd/sub” in a third folder. They all refer to the same game “Phoenix 3 (USA)”, just in different ROM formats, but for the same emulator. So how to merge them into one folder without creating duplicates. This tool allows you to do so. You need to specify source folders and destination folder, and file extensions that indicate ROMs (e.g., “iso chd cue”). When a ROM needs to be copied over (e.g., Phoenix 3 (USA).cue
as stated in the path
field in gamelist.xml
), all files with the same base name (Phoenix 3 (USA).cue
, Phoenix 3 (USA).img
, Phoenix 3 (USA).ccd
, Phoenix 3 (USA).sub
, etc.) will be copied over, even though the other three are not referred in gamelist.xml
. Moreover, you also have the option of moving files over instead of copying file over (--move
option).
Hope with these toolkit, we can build better ROM packs with fewer duplicates.