summaryrefslogtreecommitdiff
path: root/tools/decompress_baserom.py
diff options
context:
space:
mode:
authorDerek Hensley <hensley.derek58@gmail.com>2024-02-12 17:10:20 -0800
committerGitHub <noreply@github.com>2024-02-12 20:10:20 -0500
commit0ac4448d99d2598f8b39602b9f385b03f7f6e98f (patch)
tree0de05b61c1e4109b4f9e53a2a3ecf0d796e21146 /tools/decompress_baserom.py
parent6c405b6ea3fc00f1a335353b9140bbe5f0486a59 (diff)
Syms DMA Entries Extraction Support (#1708)
* Archive compression support + small cleanups * UNSET spec and PR comment * UNSET -> SYMS * Syms comment * PR review * remove stderr * Format * format2 * Remove trailing ,s
Diffstat (limited to 'tools/decompress_baserom.py')
-rwxr-xr-xtools/decompress_baserom.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/tools/decompress_baserom.py b/tools/decompress_baserom.py
index dad9887a8..799c66a1e 100755
--- a/tools/decompress_baserom.py
+++ b/tools/decompress_baserom.py
@@ -5,11 +5,11 @@
from __future__ import annotations
+import argparse
import hashlib
import io
-import struct
from pathlib import Path
-import argparse
+import struct
import crunch64
import ipl3checksum
@@ -67,7 +67,7 @@ def decompress_rom(
v_end = dma_entry.vrom_end
p_start = dma_entry.rom_start
p_end = dma_entry.rom_end
- if p_start == 0xFFFFFFFF and p_end == 0xFFFFFFFF:
+ if dma_entry.is_syms():
new_dmadata.append(dma_entry)
continue
if dma_entry.is_compressed():
@@ -160,9 +160,9 @@ def find_baserom(version: str) -> Path | None:
def main():
- description = "Convert a rom that uses dmadata to an uncompressed one."
-
- parser = argparse.ArgumentParser(description=description)
+ parser = argparse.ArgumentParser(
+ description="Convert a rom that uses dmadata to an uncompressed one."
+ )
parser.add_argument(
"version",
help="Version of the game to decompress.",
@@ -245,7 +245,7 @@ def main():
exit(1)
# Write out our new ROM
- print(f"Writing new ROM {uncompressed_path}.")
+ print(f"Writing new ROM {uncompressed_path}...")
uncompressed_path.write_bytes(file_content)
print("Done!")