-
Notifications
You must be signed in to change notification settings - Fork 470
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* extract incbins infastructure * rspboot incbin * rsptext incbin * rspdata incbin * aspMainStack incbin * ipl3 incbin
- Loading branch information
Showing
11 changed files
with
162 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.include "macro.inc" | ||
|
||
.section .data | ||
|
||
dlabel aspMainStack | ||
.incbin "incbin/aspMainStack" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.include "macro.inc" | ||
|
||
.section .data | ||
|
||
dlabel rspbootTextStart | ||
.incbin "incbin/rspbootText" | ||
dlabel rspbootTextEnd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
.include "macro.inc" | ||
|
||
.section .rodata | ||
|
||
dlabel aspMainDataStart | ||
.incbin "incbin/aspMainData" | ||
dlabel aspMainDataEnd | ||
|
||
dlabel gspF3DZEX2_NoN_PosLight_fifoTextStart | ||
.incbin "incbin/gspF3DZEX2_NoN_PosLight_fifoText" | ||
dlabel gspF3DZEX2_NoN_PosLight_fifoTextEnd | ||
|
||
dlabel gspF3DZEX2_NoN_PosLight_fifoDataStart | ||
.incbin "incbin/gspF3DZEX2_NoN_PosLight_fifoData" | ||
dlabel gspF3DZEX2_NoN_PosLight_fifoDataEnd | ||
|
||
dlabel gspS2DEX2_fifoDataStart | ||
.incbin "incbin/gspS2DEX2_fifoData" | ||
dlabel gspS2DEX2_fifoDataEnd | ||
|
||
dlabel njpgdspMainDataStart | ||
.incbin "incbin/njpgdspMainData" | ||
dlabel njpgdspMainDataEnd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
.include "macro.inc" | ||
|
||
.section .data | ||
|
||
dlabel aspMainTextStart | ||
.incbin "incbin/aspMainText" | ||
dlabel aspMainTextEnd | ||
|
||
dlabel gspS2DEX2_fifoTextStart | ||
.incbin "incbin/gspS2DEX2_fifoText" | ||
dlabel gspS2DEX2_fifoTextEnd | ||
|
||
dlabel njpgdspMainTextStart | ||
.incbin "incbin/njpgdspMainText" | ||
dlabel njpgdspMainTextEnd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
.text | ||
.incbin "extracted/n64-us/baserom/makerom", 0x40, 0xFC0 | ||
.section .text | ||
|
||
.incbin "incbin/ipl3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# SPDX-FileCopyrightText: © 2024 ZeldaRET | ||
# SPDX-License-Identifier: CC0-1.0 | ||
|
||
from __future__ import annotations | ||
|
||
import argparse | ||
from pathlib import Path | ||
|
||
from version import version_config | ||
|
||
|
||
def main(): | ||
parser = argparse.ArgumentParser( | ||
description="Extract incbin pieces from an uncompressed ROM." | ||
) | ||
parser.add_argument( | ||
"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", | ||
"--version", | ||
required=True, | ||
help="MM version", | ||
) | ||
|
||
args = parser.parse_args() | ||
|
||
config = version_config.load_version_config(args.version) | ||
|
||
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_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) | ||
incbin_path.write_bytes(incbin_data) | ||
|
||
print(f"Extracted {len(config.incbins)} incbin pieces to {args.output_dir}") | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |