Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions setup_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,22 @@
def get_target_path(version = config.get_default_version()):
return config.get_versioned_data_path(version) / "main.nso"

def get_uncompressed_target_path(version = config.get_default_version()):
return config.get_versioned_data_path(version) / "main.uncompressed.nso"

def get_target_elf_path(version = config.get_default_version()):
return config.get_versioned_data_path(version) / "main.elf"


def fail(error: str):
print(">>> " + error)
sys.exit(1)

def _convert_nso_to_elf(nso_path: Path, export_uncompressed_nso=True):
def _convert_nso_to_elf(nso_path: Path, elf_out_path = get_target_elf_path(), uncompressed_nso_out_path = get_uncompressed_target_path()):
print(">>>> converting NSO to ELF...")
command = [tools.find_tool("nx2elf"), str(nso_path)];
if export_uncompressed_nso:
command = [tools.find_tool("nx2elf"), str(nso_path), "--export-elf", elf_out_path];
if uncompressed_nso_out_path is not None:
command.append("--export-uncompressed")
command.append(uncompressed_nso_out_path)
subprocess.check_call(command)


Expand Down