1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-11-11 03:39:59 +00:00

Fix type errors

This commit is contained in:
cadmic 2024-01-24 14:38:01 -08:00
parent 95745454e9
commit 96e94ae1f5
4 changed files with 9 additions and 9 deletions

View file

@ -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

View file

@ -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,

View file

@ -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

View file

@ -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

1 name vrom_start vrom_end rom_start rom_end overlay_vram_start vram_start overlay_dir
2 boot 1060 7170 1060 0 80000460
3 code A88000 B8A230 A580D0 AF27E0 80010F00
4 ovl_title B8A230 B8AA80 AF27E0 AF2E20 80800000 80800000 gamestates
5 ovl_select B8AA80 B8D700 AF2E20 AF4900 80800850 80800850 gamestates
6 ovl_opening B8D700 B8D860 AF4900 AF4A30 808034D0 808034D0 gamestates