From 96e94ae1f59cfd499fbac08670efcd9baa9b6018 Mon Sep 17 00:00:00 2001 From: cadmic Date: Wed, 24 Jan 2024 14:38:01 -0800 Subject: [PATCH] Fix type errors --- retail_progress.py | 4 ++-- tools/disasm/disasm.py | 4 ++-- tools/disasm/file_addresses.py | 4 ++-- tools/disasm/gc-eu-mq/file_addresses.csv | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/retail_progress.py b/retail_progress.py index af15af0675..d541daccf9 100755 --- a/retail_progress.py +++ b/retail_progress.py @@ -43,9 +43,9 @@ def parse_inst(func_name: str, line: str) -> Inst: if len(parts) > 3: for part in parts[3].split(","): if "(" in part: # load/store - offset, rest = part.split("(") + offset_str, rest = part.split("(") regs.append(rest[:-1]) - imm = int(offset, 10) + imm = int(offset_str, 10) elif is_branch(mnemonic): try: # convert branch targets to relative offsets diff --git a/tools/disasm/disasm.py b/tools/disasm/disasm.py index 04d680caaa..c1bc65a23e 100755 --- a/tools/disasm/disasm.py +++ b/tools/disasm/disasm.py @@ -35,7 +35,7 @@ def load_file_splits( context, vromStart=0, vromEnd=len(data), - vram=dma_file.overlay_vram_start, + vram=dma_file.vram_start, filename=default_filename, array_of_bytes=data, segmentVromStart=0, @@ -47,7 +47,7 @@ def load_file_splits( context, vromStart=0, vromEnd=len(data), - vram=dma_file.overlay_vram_start, + vram=dma_file.vram_start, filename=default_filename, array_of_bytes=data, segmentVromStart=0, diff --git a/tools/disasm/file_addresses.py b/tools/disasm/file_addresses.py index 28940c3d8b..70d08a2928 100644 --- a/tools/disasm/file_addresses.py +++ b/tools/disasm/file_addresses.py @@ -10,7 +10,7 @@ class DmaFile: vrom_end: int rom_start: int rom_end: int - overlay_vram_start: Optional[int] + vram_start: int overlay_dir: Optional[str] def parse_file_addresses(path: Path) -> List[DmaFile]: @@ -25,7 +25,7 @@ def parse_file_addresses(path: Path) -> List[DmaFile]: vrom_end=int(row["vrom_end"], 16), rom_start=int(row["rom_start"], 16), rom_end=int(row["rom_end"], 16), - overlay_vram_start=int(row["overlay_vram_start"], 16) if row["overlay_vram_start"] else None, + vram_start=int(row["vram_start"], 16), overlay_dir=row["overlay_dir"] if row["overlay_dir"] else None)) return result diff --git a/tools/disasm/gc-eu-mq/file_addresses.csv b/tools/disasm/gc-eu-mq/file_addresses.csv index 8cd2d5939c..d8d095609e 100644 --- a/tools/disasm/gc-eu-mq/file_addresses.csv +++ b/tools/disasm/gc-eu-mq/file_addresses.csv @@ -1,6 +1,6 @@ -name,vrom_start,vrom_end,rom_start,rom_end,overlay_vram_start,overlay_dir -boot,1060,7170,1060,0,, -code,A88000,B8A230,A580D0,AF27E0,, +name,vrom_start,vrom_end,rom_start,rom_end,vram_start,overlay_dir +boot,1060,7170,1060,0,80000460, +code,A88000,B8A230,A580D0,AF27E0,80010F00, ovl_title,B8A230,B8AA80,AF27E0,AF2E20,80800000,gamestates ovl_select,B8AA80,B8D700,AF2E20,AF4900,80800850,gamestates ovl_opening,B8D700,B8D860,AF4900,AF4A30,808034D0,gamestates