mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-04 15:04:31 +00:00
Set up multiversion assets with ZAPD and match gc-eu (#1967)
* Add ZAPD hack to deal with extracted/VERSION/ in include paths
* Extract assets to extracted/VERSION
* Add ZAPD flags to override virtual address / start offset / end offset
* Configure offsets for code and overlay assets
* Reorganize ZAPD configs
* Match gc-eu-mq
* Match gc-eu
* Remove old asset dirs during distclean
* Revert "Remove old asset dirs during distclean"
This reverts commit fc8027a75f
.
* make zapd addresses globals int64_t so they can store uint32_t addresses and -1
* slight cleanup extract_assets.py
* git subrepo pull --force tools/ZAPD
subrepo:
subdir: "tools/ZAPD"
merged: "0285e11f0"
upstream:
origin: "https://github.com/zeldaret/ZAPD.git"
branch: "master"
commit: "0285e11f0"
git-subrepo:
version: "0.4.6"
origin: "git@github.com:ingydotnet/git-subrepo.git"
commit: "110b9eb"
---------
Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
This commit is contained in:
parent
b2d80568b9
commit
9def6f4d0d
92 changed files with 4911 additions and 487 deletions
|
@ -18,18 +18,30 @@ PROJECT_ROOT = Path(__file__).parent.parent
|
|||
|
||||
@dataclasses.dataclass
|
||||
class VersionConfig:
|
||||
# Version name
|
||||
version: str
|
||||
# ROM offset to start of DMA table
|
||||
dmadata_start: int
|
||||
# DMA segment information, in ROM order
|
||||
dmadata_segments: OrderedDict[str, SegmentInfo]
|
||||
# Addresses of important variables needed for asset extraction
|
||||
variables: Dict[str, int]
|
||||
variables: dict[str, int]
|
||||
# Assets to extract
|
||||
assets: list[AssetConfig]
|
||||
|
||||
|
||||
@dataclasses.dataclass
|
||||
class SegmentInfo:
|
||||
name: str
|
||||
vram: int | None
|
||||
vram: Optional[int]
|
||||
|
||||
|
||||
@dataclasses.dataclass
|
||||
class AssetConfig:
|
||||
name: str
|
||||
xml_path: Path
|
||||
start_offset: Optional[int]
|
||||
end_offset: Optional[int]
|
||||
|
||||
|
||||
def load_dmadata_segments(version: str) -> OrderedDict[str, SegmentInfo]:
|
||||
|
@ -46,8 +58,19 @@ def load_dmadata_segments(version: str) -> OrderedDict[str, SegmentInfo]:
|
|||
def load_version_config(version: str) -> VersionConfig:
|
||||
with open(PROJECT_ROOT / f"baseroms/{version}/config.yml", "r") as f:
|
||||
config = yaml.load(f, Loader=yaml.Loader)
|
||||
|
||||
assets = []
|
||||
for asset in config["assets"]:
|
||||
name = asset["name"]
|
||||
xml_path = Path(asset["xml_path"])
|
||||
start_offset = asset.get("start_offset", None)
|
||||
end_offset = asset.get("end_offset", None)
|
||||
assets.append(AssetConfig(name, xml_path, start_offset, end_offset))
|
||||
|
||||
return VersionConfig(
|
||||
version=version,
|
||||
dmadata_start=config["dmadata_start"],
|
||||
dmadata_segments=load_dmadata_segments(version),
|
||||
variables=config["variables"],
|
||||
assets=assets,
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue