Sorting and 1G1R
sort-roms moves games between the system directory, 1G1R and Trash, according to your settings.
- Regions mode keeps every game from the
REGIONS_ALLregions in the system directory. - 1G1R mode keeps one game per Parent-Clone group in
1G1R, elected byREGIONS_ONEorder and thePREFER_*settings. - Hybrid mode does both: the 1G1R election, plus every remaining game from the
REGIONS_ALLregions.
Discarded games always go to Trash.
Regions use TOSEC’s two-letter codes, and ZZ, the unknown region, works as a catch-all in REGIONS_ALL.
The 1G1R election
By default, the election only considers games you own.
REGIONS_ONE_STRICT makes it follow your preferences regardless, so a missing game shows as wanted instead of being replaced.
1G1R is useful even without a Parent-Clone DAT: it separates the games you play from, say, Japanese originals kept for translation patches.
Without Parent-Clone data
Without Parent-Clone data, as in Redump’s DATs, every game is a group of its own.
INFER_CLONES groups such a system’s games by title instead, leaving out of a name its regions, languages, versions, release status, and the flags that only tell editions apart: budget lines and reissues, limited editions and bundles, serials, ring codes, and demos.
A game’s disc number and any other flag stay, so Game (Europe) (Disc 2) is grouped with Game (USA) (Disc 2), and Game (USA) (Bonus Disc) has a group of its own.
These groups have no parent, so PREFER_PARENTS doesn’t apply to them.
Clone lists
A clone list imported with import-clone-lists adds to these groups: the titles it names as one game share a group, whatever their names, a filter moving a region’s release to another, and within a region its priorities elect a release before the PREFER_* settings do, a lower number first.
A title naming an edition, as Game (Premium Box), takes precedence over one naming the game for that edition’s releases.
Language first
LANGUAGE_FIRST lifts language above region in the election, on the order set by PREFERRED_LANGUAGES:
- A release shipping a preferred language beats one in a higher-ranked region.
- A release whose languages the DAT doesn’t tell stays below a preferred one, but above a release that ships only unwanted ones.
- A release speaking no preferred language is kept rather than trimmed, so a game whose only release is a language you didn’t ask for still makes 1G1R.
The LANGUAGES filter takes no part in a language-first election; set the language order with PREFERRED_LANGUAGES, which ranks and nothing else.
With LANGUAGE_FIRST off, or PREFERRED_LANGUAGES empty, the region order rules.
Arcade systems
Arcade systems sort by set type instead: see Arcade.
Settings
| Setting | Description | Default |
|---|---|---|
REGIONS_ALL | Regions for which to keep every game, unordered (eg: US,EU,JP) | |
REGIONS_ONE | Regions for 1G1R, by order of preference (eg: US,EU) | |
REGIONS_ALL_SUBFOLDERS | Subfolders for games: none or alpha | none |
REGIONS_ONE_SUBFOLDERS | Subfolders for 1G1R games: none or alpha | none |
REGIONS_ONE_STRICT | Elect 1G1R games whether you own them or not | false |
REGIONS_ALL_ARCADE | Arcade set types for the main directory: bios, parent, clone | |
REGIONS_ONE_ARCADE | Arcade set types for the 1G1R directory: bios, parent, clone | |
INFER_CLONES | Group games by title for 1G1R when their DAT has no Parent-Clone data | false |
PREFER_PARENTS | Favor parents in the 1G1R election | true |
PREFER_REGIONS | Favor games released in more (broad) or fewer (narrow) regions, or neither (none) | none |
PREFER_VERSIONS | Favor new or old revisions, or neither (none) | new |
PREFER_FLAGS | Flags to favor in the 1G1R election (eg: Rumble Version) | |
DISCARD_CATEGORIES | DAT categories to discard (eg: Demos,Coverdiscs) | |
DISCARD_FLAGS | Flags to discard (eg: Virtual Console) | |
DISCARD_RELEASES | Releases to discard (eg: Beta,Proto) | |
LANGUAGES | Languages to keep, for games that list theirs (eg: En,Ja) | |
LANGUAGE_FIRST | Rank the language a game ships above its region in the 1G1R election, instead of filtering by LANGUAGES | false |
PREFERRED_LANGUAGES | The language order for that election, most wanted first (eg: Fr,En) | |
GROUP_SUBSYSTEMS | Put every variant of a system in the same directory | true |
GAME_SUBFOLDERS | Put games in folders named after them: never, multiple (those stored as several files) or always | never |
sort-roms --regions and --1g1r override REGIONS_ALL and REGIONS_ONE for one run.