First public commit.

This commit is contained in:
The Dust Council 2026-07-03 19:35:35 -07:00
parent 2a48f52979
commit 4bac9d83ed
288 changed files with 18417 additions and 1076 deletions

23
lenser/c128/exporter.py Normal file
View file

@ -0,0 +1,23 @@
"""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