19 lines
578 B
Python
19 lines
578 B
Python
"""Build an Atari 7800 cartridge (.a78) from a conversion."""
|
|
from __future__ import annotations
|
|
|
|
import os
|
|
|
|
from .viewer import assemble
|
|
|
|
_EXTS = (".a78", ".bin")
|
|
|
|
|
|
def export_a78(conv, output_path, source_path=None, display="forever",
|
|
seconds=0, video="ntsc"):
|
|
if not output_path.lower().endswith(_EXTS):
|
|
output_path += ".a78"
|
|
title = os.path.splitext(os.path.basename(source_path or output_path))[0]
|
|
rom = assemble.build_cart(bytes(conv.data), title=title)
|
|
with open(output_path, "wb") as f:
|
|
f.write(rom)
|
|
return output_path
|