Publish the reproducible Sound Lab and FPGA Colour Lab sources

This commit is contained in:
bholman committed 2026-11-18 12:28:31 -07:00
commit 88254d7e24
27 files changed
+4574

No files matched your search

+40
View File
@@ -0,0 +1,40 @@
#!/usr/bin/env python3
"""Build/check Sound Lab; optional isolated native qualification uses explicit private inputs."""
# SPDX-License-Identifier: GPL-3.0-or-later
import argparse
import os
from pathlib import Path
import subprocess
import sys
PROJECT=Path(__file__).resolve().parent
REPO=PROJECT.parents[1]
def main():
parser=argparse.ArgumentParser(description=__doc__)
parser.add_argument('--toolchain',type=Path,default=REPO/'platforms/macos/LocalResources/ToolchainBundle')
parser.add_argument('--output',type=Path,default=REPO/'.build/sound-lab')
parser.add_argument('--core',type=Path,help='Existing libVCCCore.a; never changes or rebuilds the emulator')
parser.add_argument('--roms',type=Path,help='Private local CoCo3/Disk BASIC/PIC/SP ROM directory; not packaged')
args=parser.parse_args()
if bool(args.core)!=bool(args.roms): parser.error('--core and --roms must be supplied together')
output=args.output.resolve()
env=dict(os.environ,PYTHONDONTWRITEBYTECODE='1')
def run(*command): subprocess.run([str(p) for p in command],check=True,env=env)
run(sys.executable,'-m','unittest','discover','-s',PROJECT/'tests','-v')
run(sys.executable,PROJECT/'build.py','--toolchain',args.toolchain,'--output',output)
assembly=(output/'main.s').read_text()
status=assembly.split('_raw_status\tEQU\t*',1)[1].split('funcend_raw_status',1)[0]
if status.upper().count('LDB $FF7E')!=1:
raise RuntimeError('Generated raw status reader must contain exactly one actual FF7E load')
if args.core:
run('xcrun','clang++','-std=c++17','-O2','-mmacosx-version-min=14.0',
PROJECT/'native/run.cpp',args.core.resolve(),'-o',output/'run')
run(output/'run',args.roms.resolve(),output/'SOUNDLAB.DSK',output/'qualification')
run(sys.executable,PROJECT/'verify_reports.py','--build-dir',output)
else:
print('Native execution SKIPPED: provide --core and --roms for real-ROM qualification.')
if __name__=='__main__': main()