1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-05 15:34:41 +00:00

Cleanup: Pass all paths to tools rather than tools constructing them (#2017)

* Pass all paths to tools rather than tools constructing them

* fix: make --baserom-segments required

* sync with mm reviews

* --version everywhere
This commit is contained in:
Dragorn421 2024-09-04 20:49:16 +02:00 committed by GitHub
parent 907e440f3a
commit e833011ccd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 96 additions and 64 deletions

View file

@ -18,21 +18,22 @@ def main():
description="Extract incbin pieces from an uncompressed ROM."
)
parser.add_argument(
"baserom_dir", metavar="BASEROM_DIR", type=Path, help="Directory of uncompressed ROM segments"
"baserom_segments_dir",
type=Path,
help="Directory of uncompressed ROM segments",
)
parser.add_argument(
"output_dir",
type=Path,
help="Output directory for incbin pieces",
)
parser.add_argument(
"-v",
"--oot-version",
"--version",
dest="oot_version",
required=True,
help="OOT version",
)
parser.add_argument(
"-o",
"--output-dir",
type=Path,
required=True,
help="Output directory for incbin pieces",
)
args = parser.parse_args()
@ -41,7 +42,7 @@ def main():
args.output_dir.mkdir(parents=True, exist_ok=True)
for incbin in config.incbins:
incbin_path = args.output_dir / incbin.name
with open(args.baserom_dir / incbin.segment, "rb") as f:
with open(args.baserom_segments_dir / incbin.segment, "rb") as f:
offset = incbin.vram - config.dmadata_segments[incbin.segment].vram
f.seek(offset)
incbin_data = f.read(incbin.size)