mirror of
https://github.com/RetroPortingToolKit/psxrecomp
synced 2026-10-28 02:56:36 -04:00
19 lines
800 B
Python
19 lines
800 B
Python
"""Generate the native launcher's metadata table from the Python intake registry."""
|
|
from pathlib import Path
|
|
import json
|
|
from disc_companion import REQUIRED_SBI
|
|
|
|
|
|
def render():
|
|
rows = []
|
|
for (size, _), entry in REQUIRED_SBI.items():
|
|
values = [entry[key] for key in ("data_sha256", "sbi_sha256", "title", "serial")]
|
|
rows.append(" {" + str(size) + "ULL, " + ", ".join(json.dumps(v) for v in values) + "},")
|
|
return ("// Generated by tools/generate_sbi_registry.py. Metadata only; no SBI records.\n"
|
|
"#pragma once\nstatic constexpr SbiRequirement kSbiRequirements[] = {\n"
|
|
+ "\n".join(rows) + "\n};\n")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
(Path(__file__).resolve().parents[1] / "runtime/include/sbi_registry.h").write_text(render(), encoding="utf-8")
|