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

24
lenser/bbc/exporter.py Normal file
View file

@ -0,0 +1,24 @@
"""Build a BBC Micro DFS disk (.ssd) from a conversion."""
from __future__ import annotations
from . import ssd
from .viewer.assemble import LOAD_ADDR, build_viewer
def export_ssd(conv, output_path, source_path=None, display="forever",
seconds=0, video="pal") -> str:
"""Two DFS files: the !BOOT loader (sets mode + palette, *LOADs IMG) and the
IMG screen data. Boot option 2 (*RUN !BOOT) so SHIFT+BREAK autostarts it."""
if not output_path.lower().endswith(".ssd"):
output_path += ".ssd"
m = conv.meta
viewer = build_viewer(m["bbc_mode"], m["ncol"], m["physicals"], m["base"],
display=display, seconds=seconds, video=video)
# !BOOT autostarts on SHIFT+BREAK (real hardware); PIC is the same loader
# under a name with no '!' so it can be *RUN from a command line / emulator.
files = [
("!BOOT", LOAD_ADDR, LOAD_ADDR, viewer),
("PIC", LOAD_ADDR, LOAD_ADDR, viewer),
("IMG", m["base"], m["base"], conv.data),
]
return ssd.write_ssd(output_path, files, title="8BITLENSER", boot_option=2)