Skip to content

Commit

Permalink
Add support for Aftermarket ROMS
Browse files Browse the repository at this point in the history
Fixes #37
  • Loading branch information
cscribn committed Oct 4, 2022
1 parent 43d99be commit d7378c8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ Options:
--no-demo Filter out demo ROMs
--no-sample Filter out sample ROMs
--no-pirate Filter out pirate ROMs
--no-aftermarket Filter out aftermarket ROMs
--no-promo Filter out promotion ROMs
--no-all Apply all filters above (WILL STILL ALLOW UNLICENSED ROMs)
--no-unlicensed Filter out unlicensed ROMs
Expand Down
12 changes: 12 additions & 0 deletions generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
ENHANCEMENT_CHIP_REGEX = re.compile(r'\(Enhancement\s*Chip\)', re.IGNORECASE)
UNL_REGEX = re.compile(re.escape('(Unl)'), re.IGNORECASE)
PIRATE_REGEX = re.compile(re.escape('(Pirate)'), re.IGNORECASE)
AFTERMARKET_REGEX = re.compile(re.escape('(Aftermarket)'), re.IGNORECASE)
PROMO_REGEX = re.compile(re.escape('(Promo)'), re.IGNORECASE)
BETA_REGEX = re.compile(r'\(Beta(?:\s*([a-z0-9.]+))?\)', re.IGNORECASE)
PROTO_REGEX = re.compile(r'\(Proto(?:\s*([a-z0-9.]+))?\)', re.IGNORECASE)
Expand Down Expand Up @@ -207,6 +208,7 @@ def parse_games(
filter_program: bool,
filter_enhancement_chip: bool,
filter_pirate: bool,
filter_aftermarket: bool,
filter_promo: bool,
filter_unlicensed: bool,
filter_proto: bool,
Expand All @@ -228,6 +230,8 @@ def parse_games(
continue
if filter_pirate and PIRATE_REGEX.search(game.name):
continue
if filter_aftermarket and AFTERMARKET_REGEX.search(game.name):
continue
if filter_promo and PROMO_REGEX.search(game.name):
continue
if filter_program and PROGRAM_REGEX.search(game.name):
Expand Down Expand Up @@ -494,6 +498,7 @@ def main(argv: List[str]):
'no-sample',
'no-proto',
'no-pirate',
'no-aftermarket',
'no-promo',
'no-all',
'no-unlicensed',
Expand Down Expand Up @@ -540,6 +545,7 @@ def main(argv: List[str]):
filter_enhancement_chip = False
filter_unlicensed = False
filter_pirate = False
filter_aftermarket = False
filter_promo = False
filter_proto = False
filter_beta = False
Expand Down Expand Up @@ -609,6 +615,7 @@ def main(argv: List[str]):
filter_demo |= opt in ('--no-demo', '--no-all')
filter_sample |= opt in ('--no-sample', '--no-all')
filter_pirate |= opt in ('--no-pirate', '--no-all')
filter_aftermarket |= opt in ('--no-aftermarket', '--no-all')
filter_promo |= opt in ('--no-promo', '--no-all')
filter_unlicensed |= opt == '--no-unlicensed'
all_regions |= opt == '--all-regions'
Expand Down Expand Up @@ -742,6 +749,7 @@ def main(argv: List[str]):
filter_program,
filter_enhancement_chip,
filter_pirate,
filter_aftermarket,
filter_promo,
filter_unlicensed,
filter_proto,
Expand All @@ -765,6 +773,7 @@ def main(argv: List[str]):
(filter_sample, 'Samples'),
(filter_unlicensed, 'Unlicensed ROMs'),
(filter_pirate, 'Pirate ROMs'),
(filter_aftermarket, 'Aftermarket ROMs'),
(filter_promo, 'Promo ROMs'),
(only_selected_lang, 'ROMs not matching selected languages'),
(bool(exclude_str), 'Excluded ROMs by name'),
Expand Down Expand Up @@ -1189,6 +1198,9 @@ def help_msg(s: Optional[Union[str, Exception]] = None) -> str:
'\t--no-pirate\t\t'
'Filter out pirate ROMs',

'\t--no-aftermarket\t\t'
'Filter out aftermarket ROMs',

'\t--no-promo\t\t'
'Filter out promotion ROMs',

Expand Down

0 comments on commit d7378c8

Please sign in to comment.