18 lines
550 B
Python
18 lines
550 B
Python
"""Build an Amstrad CPC .sna snapshot from a conversion."""
|
|
from __future__ import annotations
|
|
|
|
from . import snapshot
|
|
|
|
_EXTS = (".sna",)
|
|
|
|
|
|
def export_sna(conv, output_path, source_path=None, display="forever",
|
|
seconds=0, video="ntsc"):
|
|
if not output_path.lower().endswith(_EXTS):
|
|
output_path += ".sna"
|
|
inks = conv.meta["inks"]
|
|
mode = conv.meta["cpc_mode"]
|
|
sna = snapshot.build_sna(bytes(conv.data), inks, mode, border=inks[0])
|
|
with open(output_path, "wb") as f:
|
|
f.write(sna)
|
|
return output_path
|