8bitlenser/lenser/nes/exporter.py
2026-07-03 19:35:35 -07:00

13 lines
455 B
Python

"""Build an NES (.nes) cartridge from a conversion."""
from __future__ import annotations
from . import cartridge
def export_nes(conv, output_path, source_path=None, display="forever",
seconds=0, video="ntsc"):
if not output_path.lower().endswith((".nes", ".unf")):
output_path += ".nes"
d = conv.data
rom = cartridge.build_rom(d["palette"], d["nametable"], d["chr"])
return cartridge.write_nes(rom, output_path)