20 lines
647 B
Python
20 lines
647 B
Python
"""Build a Mattel Intellivision cartridge from a conversion."""
|
|
from __future__ import annotations
|
|
|
|
import os
|
|
|
|
from . import cartridge
|
|
|
|
_EXTS = (".int", ".bin", ".rom")
|
|
|
|
|
|
def export_int(conv, output_path, source_path=None, display="forever",
|
|
seconds=0, video="ntsc"):
|
|
if not output_path.lower().endswith(_EXTS):
|
|
output_path += ".int"
|
|
title = os.path.splitext(os.path.basename(source_path or output_path))[0]
|
|
rom = cartridge.build_rom(conv.data, title, display=display,
|
|
seconds=seconds, video=video)
|
|
with open(output_path, "wb") as f:
|
|
f.write(rom)
|
|
return output_path
|