Files

22 lines
987 B
Python

# SPDX-License-Identifier: GPL-3.0-or-later
"""Build the guest disk and exercise LOADM/EXEC on the three BASIC storage profiles."""
from pathlib import Path
import shutil
import subprocess
def check_disk_launch(runtime, core, roms, work, lander):
fixture = Path(__file__).resolve().parent
destination = Path(work) / "disk-launch"
destination.mkdir()
shutil.copyfile(lander, destination / "LANDER.BIN")
disk = destination / "LANDER.DSK"
disk.write_bytes(b"\xff" * (35 * 18 * 256))
subprocess.run([runtime / "bin/writecocofile", "--binary", disk, "LANDER.BIN"],
cwd=destination, check=True)
(destination / "startup.cfg").write_text("0=LANDER.DSK\n")
runner = destination / "disk"
subprocess.run(["xcrun", "clang++", "-std=c++17", "-O2", "-mmacosx-version-min=14.0",
"-I", fixture.parents[2] / "src", fixture / "disk.cpp", core, "-o", runner], check=True)
subprocess.run([runner, roms, disk], check=True)