mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-30 10:51:21 +00:00
dmadata file names no longer hardcoded for gc-eu-mq-dbg
This commit is contained in:
parent
e8e15eca9f
commit
8aaaca4fe0
5 changed files with 32 additions and 1574 deletions
|
@ -76,33 +76,6 @@ def get_scene_id_from_rom_file_name(rom_file_name: str) -> int:
|
|||
return scene_id_by_rom_file_name[rom_file_name]
|
||||
|
||||
|
||||
from . import dmadata_table
|
||||
|
||||
|
||||
def get_dmadata_table_rom_file_names() -> Sequence[str]:
|
||||
return dmadata_table.DATA
|
||||
|
||||
|
||||
dmadata = None
|
||||
|
||||
|
||||
def get_dmadata_table_rom_file_name_from_vrom(vromStart: int, vromEnd: int) -> str:
|
||||
global dmadata
|
||||
if dmadata is None:
|
||||
import struct
|
||||
|
||||
# FIXME handle multiversion
|
||||
with open("extracted/gc-eu-mq-dbg/baserom/dmadata", "rb") as f:
|
||||
bytes = f.read()
|
||||
dmadata = list(struct.iter_unpack(">IIII", bytes))
|
||||
for i, (e_vromStart, e_vromEnd, e_romStart, e_romEnd) in enumerate(dmadata):
|
||||
if e_vromStart == vromStart and e_vromEnd == vromEnd:
|
||||
break
|
||||
if i >= len(dmadata_table.DATA):
|
||||
raise ValueError("Can't find rom file", hex(vromStart), hex(vromEnd))
|
||||
return dmadata_table.DATA[i]
|
||||
|
||||
|
||||
from . import audio_ids
|
||||
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue