mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-04-16 05:42:31 -05:00
feat: add --platform and --target to cross_reference.py
This commit is contained in:
@@ -181,6 +181,8 @@ def main():
|
|||||||
parser.add_argument("--platforms-dir", default=DEFAULT_PLATFORMS_DIR)
|
parser.add_argument("--platforms-dir", default=DEFAULT_PLATFORMS_DIR)
|
||||||
parser.add_argument("--db", default=DEFAULT_DB)
|
parser.add_argument("--db", default=DEFAULT_DB)
|
||||||
parser.add_argument("--emulator", "-e", help="Analyze single emulator")
|
parser.add_argument("--emulator", "-e", help="Analyze single emulator")
|
||||||
|
parser.add_argument("--platform", "-p", help="Platform name (required for --target)")
|
||||||
|
parser.add_argument("--target", "-t", help="Hardware target (e.g., switch, rpi4)")
|
||||||
parser.add_argument("--json", action="store_true", help="JSON output")
|
parser.add_argument("--json", action="store_true", help="JSON output")
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
@@ -188,6 +190,15 @@ def main():
|
|||||||
if args.emulator:
|
if args.emulator:
|
||||||
profiles = {k: v for k, v in profiles.items() if k == args.emulator}
|
profiles = {k: v for k, v in profiles.items() if k == args.emulator}
|
||||||
|
|
||||||
|
if args.target:
|
||||||
|
if not args.platform:
|
||||||
|
parser.error("--target requires --platform")
|
||||||
|
from common import load_target_config, resolve_platform_cores
|
||||||
|
target_cores = load_target_config(args.platform, args.target, args.platforms_dir)
|
||||||
|
config = load_platform_config(args.platform, args.platforms_dir)
|
||||||
|
relevant = resolve_platform_cores(config, profiles, target_cores=target_cores)
|
||||||
|
profiles = {k: v for k, v in profiles.items() if k in relevant}
|
||||||
|
|
||||||
if not profiles:
|
if not profiles:
|
||||||
print("No emulator profiles found.", file=sys.stderr)
|
print("No emulator profiles found.", file=sys.stderr)
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user