23 lines
937 B
Python
23 lines
937 B
Python
"""Build a C128 autobooting .d64 (the VDC viewer PRG, loaded with RUN"PIC")."""
|
|
from __future__ import annotations
|
|
|
|
import os
|
|
|
|
from .. import diskimage
|
|
from .viewer import assemble
|
|
|
|
|
|
def export_d64(conv, output_path, source_path=None, display="forever",
|
|
seconds=0, video="ntsc"):
|
|
if not output_path.lower().endswith(".d64"):
|
|
output_path += ".d64"
|
|
# "color" = 80x100 chunky solid cells; "hicolor" (also used by mono) =
|
|
# 640x200 custom-charset font mode.
|
|
if conv.meta.get("vdc_mode") == "color":
|
|
prg = assemble.build_prg_color(bytes(conv.data), conv.meta.get("fgbg", 0x0F))
|
|
else:
|
|
prg = assemble.build_prg_hicolor(bytes(conv.data), conv.meta.get("fgbg", 0x00))
|
|
name = os.path.splitext(os.path.basename(source_path or output_path))[0]
|
|
diskimage.build_disk(output_path, "d64", name[:16] or "8bitlenser", "cv",
|
|
[("pic", prg)])
|
|
return output_path
|