Publish VCC Plus OSS source distribution for 3.6.2 build 60

This commit is contained in:
Brian Holman committed 2026-11-13 00:14:03 -07:00
commit c652a5276d
1192 files changed
+272368

No files matched your search

@@ -0,0 +1 @@
VCC Plus authored Disk Image Editor fixture. DECB and OS-9 round trips preserve exact file bytes. ˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙Line truncated
Binary file not shown.
@@ -0,0 +1,43 @@
# SPDX-License-Identifier: GPL-3.0-or-later
# Acceptance fixture only. Python 3 is an explicit custom-recipe dependency.
CMOC ?= cmoc
PERL ?= perl
PYTHON ?= python3
WRITECOCOFILE ?= writecocofile
VCC_CONFIGURATION ?= Release
LIMIT := 7800
CFLAGS :=
ifeq ($(VCC_CONFIGURATION),CustomGIME)
CFLAGS += -DCUSTOM_GIME=1
endif
ifeq ($(VCC_CONFIGURATION),Fail)
LIMIT := 2801
endif
.PHONY: all build disk clean
all: disk
build: disk
disk: fixture.debug.json
# Always relink so switching Release/Fail cannot reuse an earlier binary.
.PHONY: force
obj/main.o: main.c Makefile force
@mkdir -p obj
"$(CMOC)" --coco -O2 --intermediate $(CFLAGS) --intdir=obj -c -o $@ $<
FIXTURE.BIN: obj/main.o Makefile force
ifeq ($(VCC_CONFIGURATION),Fail)
@printf 'main.c:1: warning: authored warning before intentional linker-limit failure\n'
endif
"$(CMOC)" --coco -O2 --intermediate --org=2800 --limit=$(LIMIT) --stack-space=2048 -o $@ obj/main.o -lgime
FIXTURE.dsk: FIXTURE.BIN Makefile
$(PERL) -e 'print chr(255) x (35*18*256)' > $@
$(WRITECOCOFILE) $@ FIXTURE.BIN
fixture.debug.json: FIXTURE.dsk export_debug.py main.c
$(PYTHON) export_debug.py $(VCC_CONFIGURATION)
clean:
rm -rf obj
rm -f FIXTURE.BIN FIXTURE.map FIXTURE.link FIXTURE.dsk fixture.debug.json
@@ -0,0 +1,101 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-3.0-or-later
"""Export this fixture's own unpacked DECB placement; no game/host discovery."""
import hashlib
import json
from pathlib import Path
import re
import struct
import sys
ROOT = Path(__file__).resolve().parent
SOURCE_EXTENSIONS = {".c", ".h", ".s", ".asm", ".lwasm", ".inc"}
SECTION = re.compile(r"^Section: ([^\s]+) \((.+)\) load at ([0-9A-Fa-f]{4}), length ([0-9A-Fa-f]{4})$")
def digest(path):
return hashlib.sha256((ROOT / path).read_bytes()).hexdigest()
def decb(data):
segments, used, entry, cursor = [], set(), None, 0
while cursor < len(data):
if cursor + 5 > len(data):
raise ValueError("Truncated fixture DECB record")
kind, length, address = struct.unpack_from(">BHH", data, cursor)
cursor += 5
if kind == 255:
if length or cursor != len(data):
raise ValueError("Invalid fixture DECB trailer")
entry = address
break
if kind or not length or cursor + length > len(data) or address + length > 0x8000:
raise ValueError("Fixture must contain ordinary load segments below $8000")
span = set(range(address, address + length))
if span & used:
raise ValueError("Overlapping fixture DECB segments")
used |= span
segments.append((address, data[cursor:cursor + length]))
cursor += length
if entry is None or not segments:
raise ValueError("Fixture DECB requires segments and an entry trailer")
low = min(address for address, _ in segments)
high = max(address + len(payload) for address, payload in segments)
image = bytearray(high - low)
for address, payload in segments:
image[address - low:address - low + len(payload)] = payload
return low, high, entry, image
def main():
low, high, entry, image = decb((ROOT / "FIXTURE.BIN").read_bytes())
placements = []
for line in (ROOT / "FIXTURE.map").read_text().splitlines():
match = SECTION.fullmatch(line)
if match:
name, _, address, length = match.groups()
address, length = int(address, 16), int(length, 16)
if address + length > 0x8000:
raise ValueError("Fixture section storage must stay below $8000")
placements.append((name, address, length))
elif line.startswith("Section:"):
raise ValueError("Unsupported fixture linker-map section")
if not placements:
raise ValueError("Fixture map has no section placements")
sections = sorted({name for name, _, _ in placements})
if "code" not in sections:
raise ValueError("Fixture map has no executable code section")
raw = "obj/fixture.raw"
(ROOT / raw).write_bytes(image)
files = sorted(path.relative_to(ROOT).as_posix() for path in ROOT.rglob("*") if path.is_file())
sources = {path: digest(path) for path in files if Path(path).suffix.lower() in SOURCE_EXTENSIONS}
artifact_paths = {"FIXTURE.BIN", "FIXTURE.dsk", "FIXTURE.map", raw}
artifact_paths.update(path for path in files if Path(path).suffix.lower() in {".o", ".lst"})
artifacts = {path: digest(path) for path in sorted(artifact_paths)}
# The fixture uses BASIC task 0's standard low-memory mapping. This is a
# declaration for these own sections, not an assumption about other apps.
logical_pages = set(range(low // 8192, (high - 1) // 8192 + 1))
for _, address, length in placements:
if length:
logical_pages.update(range(address // 8192, (address + length - 1) // 8192 + 1))
if any(page >= 4 for page in logical_pages):
raise ValueError("Fixture section requires an unsupported MMU mapping")
manifest = dict(
version=1, entryPoint=entry,
binary=dict(path="FIXTURE.BIN", sha256=artifacts["FIXTURE.BIN"]),
disk=dict(path="FIXTURE.dsk", sha256=artifacts["FIXTURE.dsk"]),
linkMap=dict(path="FIXTURE.map", sha256=artifacts["FIXTURE.map"]),
sources=sources, artifacts=artifacts,
modules=[dict(id="fixture", sections=sections, codeSections=["code"],
image=dict(path=raw, logicalAddress=low),
pages=[dict(logicalPage=page, physicalPage=56 + page) for page in sorted(logical_pages)])],
framebuffers=[dict(id="page_a", physicalAddress=0x40000, mode="hscreen2"),
dict(id="page_b", physicalAddress=0x48000, mode="hscreen2")])
if len(sys.argv) > 1 and sys.argv[1] == "CustomGIME":
manifest["framebuffers"] = [dict(id="canvas_a", physicalAddress=0, mode="current_gime", canvasBytes=65536),
dict(id="canvas_b", physicalAddress=0x20000, mode="current_gime", canvasBytes=65536)]
(ROOT / "fixture.debug.json").write_text(json.dumps(manifest, indent=2) + "\n")
if __name__ == "__main__":
main()
@@ -0,0 +1,124 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Authored acceptance fixture: ordinary guest graphics and keyboard input.
#include <coco.h>
#include <vcc/gime.h>
volatile unsigned fixture_inputs;
volatile unsigned char fixture_last_key;
// A real exported assembly entry, without a fabricated C statement location.
// CMOC appends the return instruction for this pure assembly function.
asm void fixture_entry(void)
{
asm { nop }
}
#ifdef CUSTOM_GIME
// Guest-only authored fixture: fill two 64 KiB canvases through an ordinary MMU
// window, then use the real GIME registers for a panned 320x225 viewport.
static void fill_row(unsigned char bank, unsigned address, unsigned char ink)
{
// Match the SDK's short MMU critical sections: BASIC IRQ code must never
// run with its normal window replaced. Restore mapping before restoring CC.
asm {
pshs cc,y
orcc #$50
lda >$ffa4
pshs a
lda :bank
sta >$ffa4
ldx :address
ldy #256
ldb :ink
@paint stb ,x+
leay -1,y
bne @paint
ldx :address
ldy #8
ldb #$33
@stripe stb ,x+
leay -1,y
bne @stripe
puls a
sta >$ffa4
puls cc,y
}
}
static void fill_canvas(unsigned char first_bank, unsigned char ink)
{
unsigned char bank, row;
for (bank = 0; bank < 8; ++bank)
for (row = 0; row < 32; ++row)
fill_row(first_bank + bank, 0x8000 + (unsigned)row * 256, row ? ink : 0x33);
}
static void present_canvas(unsigned char phase)
{
unsigned origin = (phase ? 0x4000 : 0) + 0x0200; // physical base +4096 bytes
*(unsigned char *)0xff98 = 0x80;
*(unsigned char *)0xff99 = 0x7e; // 320 pixels, 16 colors, 225 lines
*(unsigned char *)0xff9c = 0;
*(unsigned char *)0xff9d = origin >> 8;
*(unsigned char *)0xff9e = origin;
*(unsigned char *)0xff9f = 0xfe; // 256-byte stride; pan252 wraps within a row
}
#endif
int main(void)
{
unsigned char key;
if (!gime_open())
return 1;
gime_set_palette(0, 0);
gime_set_palette(1, 9);
gime_set_palette(2, 18);
gime_set_palette(3, 63);
#ifdef CUSTOM_GIME
{
unsigned char phase = 0;
fill_canvas(0, 0x11);
fill_canvas(16, 0x22);
present_canvas(phase);
for (;;)
{
fixture_entry();
key = inkey();
if (key == 'q' || key == 'Q') break;
if (key == 'm' || key == 'M')
{
phase ^= 1;
present_canvas(phase);
}
}
}
#else
// Opening displays page A and draws into B. Initialize B, then A;
// afterward A is visible and B is an intentionally different hidden page.
gime_clear(1);
gime_fill_rect(24, 24, 96, 48, 3);
if (!gime_present()) { gime_close(); return 2; }
gime_clear(2);
gime_fill_rect(160, 80, 96, 64, 3);
if (!gime_present()) { gime_close(); return 3; }
for (;;)
{
fixture_entry();
key = inkey();
if (!key)
continue;
fixture_last_key = key;
++fixture_inputs;
if (key == 'q' || key == 'Q')
break;
if (key == 'm' || key == 'M')
{
gime_fill_rect(8, 144, 48, 24, 3);
if (!gime_present())
break;
}
}
#endif
gime_close();
return 0;
}
@@ -0,0 +1,18 @@
{
"entrySource": "main.c",
"makefile": "Makefile",
"buildTarget": "disk",
"diskTarget": "disk",
"cleanTarget": "clean",
"binary": "FIXTURE.BIN",
"diskImage": "FIXTURE.dsk",
"debugManifest": "fixture.debug.json",
"launchMode": "disk",
"launchCommands": ["LOADM\"FIXTURE\":EXEC"],
"jobs": 1,
"configurations": [
{"name": "Release", "makeArguments": ["VCC_CONFIGURATION=Release"]},
{"name": "CustomGIME", "makeArguments": ["VCC_CONFIGURATION=CustomGIME"]},
{"name": "Fail", "makeArguments": ["VCC_CONFIGURATION=Fail"]}
]
}
@@ -0,0 +1,29 @@
# SPDX-License-Identifier: GPL-3.0-or-later
CMOC ?= cmoc
PERL ?= perl
WRITECOCOFILE ?= writecocofile
VCC_CONFIGURATION ?= Debug
.PHONY: all disk clean
all: disk
disk: EVIDENCE.dsk
obj/main.o: main.c Makefile
@mkdir -p obj
ifeq ($(VCC_CONFIGURATION),Fail)
@printf 'main.c:1: warning: authored warning before the real error\n'
"$(CMOC)" --coco -O0 --intermediate --intdir=obj -c -o $@ missing.c
else
"$(CMOC)" --coco -O0 -fno-omit-frame-pointer --intermediate --intdir=obj -c -o $@ $<
endif
EVIDENCE.BIN: obj/main.o
"$(CMOC)" --coco --intermediate --org=2800 --limit=7800 -o $@ $<
EVIDENCE.dsk: EVIDENCE.BIN
$(PERL) -e 'print chr(255) x (35*18*256)' > $@
$(WRITECOCOFILE) $@ EVIDENCE.BIN
clean:
rm -rf obj
rm -f EVIDENCE.BIN EVIDENCE.map EVIDENCE.link EVIDENCE.dsk
@@ -0,0 +1,43 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Authored public-MCP acceptance: verified globals and ordinary guest sound.
#include <coco.h>
volatile unsigned fixture_value = 42;
volatile unsigned fixture_visits;
void fixture_ready(void)
{
++fixture_visits;
}
// Called only after an ordinary N key in an HD6309 acceptance run. Remain
// inside authored code after changing mode; no BASIC ROM calls follow LDMD.
void fixture_native(void)
{
for (;;) ++fixture_visits;
}
int main(void)
{
unsigned char key;
cls(0);
printf("MCP EVIDENCE\nL LOW TONE H HIGH TONE\n");
fixture_ready();
for (;;)
{
key = inkey();
if (key == 'l' || key == 'L') sound(80, 30);
if (key == 'h' || key == 'H') sound(180, 30);
if (key == 'v' || key == 'V') ++fixture_value;
if (key == 'n' || key == 'N')
{
asm
{
orcc #$50
fcb $11,$3D,$01
}
fixture_native();
}
}
return 0;
}
@@ -0,0 +1,16 @@
{
"entrySource": "main.c",
"makefile": "Makefile",
"binary": "EVIDENCE.BIN",
"diskImage": "EVIDENCE.dsk",
"buildTarget": "disk",
"diskTarget": "disk",
"cleanTarget": "clean",
"launchMode": "disk",
"launchCommands": ["LOADM\"EVIDENCE\":EXEC"],
"outputDirectories": ["evidence", "captures"],
"configurations": [
{"name": "Debug", "makeArguments": ["VCC_CONFIGURATION=Debug"]},
{"name": "Fail", "makeArguments": ["VCC_CONFIGURATION=Fail"]}
]
}
@@ -0,0 +1,70 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
/* Mission Announcer. Select ssc, input and bcontrol in Project Settings. */
#include <cmoc.h>
#include <coco.h>
#include <vcc/input.h>
#include <vcc/ssc.h>
#define VOICE_SLOT 1
#define ALERT_SLOT 2
#define MESSAGE_SLOT 3
#define POLL_LIMIT 30000
/* Z + "or" + an unstressed vowel: give our invented planet a voice. */
static const unsigned char zora[] = { SSC_AL_ZZ, SSC_AL_OR, SSC_AL_AX };
int main(void)
{
unsigned int route, lastSample, now, landings = 0;
unsigned char key, status;
VccInput stick;
cls(1);
printf("MISSION ANNOUNCER\n");
route = ssc_route_audio();
/* Store each recipe once. The two slot numbers belong to separate banks. */
status = ssc_store_allophones(VOICE_SLOT, zora, sizeof(zora), POLL_LIMIT);
if (status == SSC_OK)
status = ssc_store_phrase(MESSAGE_SLOT, "WELCOME ABOARD", POLL_LIMIT);
if (status == SSC_OK)
status = ssc_store_enveloped_tone(ALERT_SLOT, 0, 420, SSC_ENV_DECAY,
1800, 18, POLL_LIMIT);
if (status == SSC_OK) {
input_init(&stick, INPUT_RIGHT);
lastSample = getTimer();
printf("1 ANNOUNCE ZORA\n2 CREW MESSAGE\nFIRE LANDING ALERT\nQ RETURN TO BASIC\n");
while (status == SSC_OK) {
key = inkey();
if (key == 'Q' || key == 'q')
break;
if (key == '1') {
status = ssc_play_allophones(VOICE_SLOT, POLL_LIMIT);
if (status == SSC_OK)
printf("APPROACHING ZORA\n");
} else if (key == '2') {
status = ssc_play_phrase(MESSAGE_SLOT, POLL_LIMIT);
if (status == SSC_OK)
printf("WELCOME ABOARD\n");
}
/* Joystick readings share the audio mux. Sample once per guest tick. */
now = getTimer();
if (now == lastSample)
continue;
lastSample = now;
input_sample(&stick);
/* A press is an edge: holding the button counts as one landing. */
if (status == SSC_OK && (stick.pressed & INPUT_PRIMARY)) {
status = ssc_play_stored_effect(ALERT_SLOT, POLL_LIMIT);
if (status == SSC_OK)
printf("LANDING ALERT %u\n", ++landings);
}
}
}
/* A partial command may remain after timeout. Reset only on that path. */
if (status == SSC_TIMEOUT)
ssc_reset();
ssc_restore_audio(route);
if (status != SSC_OK)
printf("CHECK CARTRIDGE AND FIRMWARE\n");
return status;
}
@@ -0,0 +1,159 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Planet Atlas creates ATLAS.DAT on drive 0 the first time you run it.
#include <coco.h>
#include <decbfile.h>
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
#define ATLAS_NAME "ATLAS.DAT:0"
#define CARD_SIZE 24
static const char cards[][CARD_SIZE] = {
"MERCURY: CRATERS", "VENUS: CLOUDS", "EARTH: BLUE SEA", "MARS: RED RIDGE"
};
/* Keep any atlas already on the disk. On a fresh disk, write four cards. */
static FILE *openAtlas(void)
{
FILE *atlas = fopen(ATLAS_NAME, "r+b");
int complete;
if (atlas || vcc_file_error() != DECB_ERR_NOT_FOUND)
return atlas;
atlas = fopen(ATLAS_NAME, "wb");
if (!atlas)
return NULL;
complete = fwrite(cards, CARD_SIZE, 4, atlas) == 4;
if (fclose(atlas) == EOF || !complete)
return NULL;
return fopen(ATLAS_NAME, "r+b");
}
/* Read exactly one card from the current position. Leave room for a zero
so even a card that fills all 24 bytes can be displayed as a C string. */
static int showCard(FILE *atlas)
{
char card[CARD_SIZE + 1];
if (fread(card, CARD_SIZE, 1, atlas) != 1)
return 0;
card[CARD_SIZE] = 0;
printf("%s\n", card);
return 1;
}
static int takeTrip(FILE *atlas, int number)
{
/* Card numbers begin at 1. Disk offsets begin at 0. */
long offset = (long)(number - 1) * CARD_SIZE;
long bookmark;
if (fseek(atlas, offset, SEEK_SET) != 0)
return 0;
bookmark = ftell(atlas); // Save the start before reading the card.
if (bookmark < 0)
return 0;
printf("YOUR PICK AT BYTE %ld\n", bookmark);
if (!showCard(atlas))
return 0;
printf("HOME BASE\n");
if (fseek(atlas, 2L * CARD_SIZE, SEEK_SET) != 0 || !showCard(atlas))
return 0;
printf("BACK TO YOUR BOOKMARK\n");
if (fseek(atlas, bookmark, SEEK_SET) != 0 || !showCard(atlas))
return 0;
rewind(atlas); // The first card is Mercury again.
printf("FIRST CARD\n");
return ftell(atlas) == 0L && showCard(atlas);
}
/* Enter a whole record number. Base zero accepts 2 and 0x2 for Venus. */
static int choosePlanet(void)
{
for (;;)
{
char *line, *end;
unsigned long number;
printf("PICK A PLANET (1-4), THEN ENTER\n");
line = readline();
if (!line)
return 0;
if (!isdigit((unsigned char)*line))
{
printf("START WITH A DIGIT\n");
continue;
}
errno = 0;
number = strtoul(line, &end, 0);
if (*end)
printf("EXTRA CHARACTER: %c\n", *end);
else if (errno == ERANGE || number < 1UL || number > 4UL)
printf("CHOOSE A NUMBER FROM 1 TO 4\n");
else
return (int)number; // Now the value is small enough for an int.
}
}
/* The last padding byte is a visit flag. A custom card that uses the whole
field for its description has no spare byte; leave its text intact. */
static int recordVisit(FILE *atlas, int number)
{
char card[CARD_SIZE];
long start = (long)(number - 1) * CARD_SIZE;
if (fseek(atlas, start, SEEK_SET) != 0 || fread(card, CARD_SIZE, 1, atlas) != 1)
return 0;
if (!memchr(card, 0, CARD_SIZE - 1) ||
(card[CARD_SIZE - 1] != 0 && card[CARD_SIZE - 1] != 'V'))
{
printf("NO ROOM FOR VISIT MARK\n");
return 1;
}
if (card[CARD_SIZE - 1] == 'V')
{
printf("ALREADY VISITED\n");
return 1;
}
// Position the update stream between reading the card and writing its flag.
if (fseek(atlas, start + CARD_SIZE - 1, SEEK_SET) != 0 ||
fputc('V', atlas) == EOF || fflush(atlas) == EOF)
return 0;
printf("VISIT SAVED\n");
return 1;
}
int main(void)
{
FILE *atlas;
int number, ok;
cls(1);
atlas = openAtlas();
if (!atlas)
{
printf("CANNOT OPEN ATLAS.DAT\n");
return 1;
}
printf("PLANET ATLAS\n1 MERCURY 2 VENUS\n3 EARTH 4 MARS\n");
number = choosePlanet();
if (!number)
{
fclose(atlas);
printf("CANNOT READ KEYBOARD\n");
return 1;
}
cls(1);
printf("PLANET ATLAS\n\n");
ok = takeTrip(atlas, number);
if (!ok)
printf("CANNOT READ ATLAS CARD\n");
else if (!recordVisit(atlas, number))
{
printf("CANNOT SAVE VISIT\n");
ok = 0;
}
if (fclose(atlas) == EOF)
ok = 0;
if (ok)
printf("ATLAS CLOSED\n");
return ok ? 0 : 1;
}
@@ -0,0 +1,140 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Run on a practice disk. This exercise recognizes the four Planet char cards[][CARD_SIZE].
#include <coco.h>
#include <decbfile.h>
#include <stdio.h>
#define LIVE "ATLAS.DAT:0"
#define DRAFT "ATLAS.NEW:0"
#define BACKUP "ATLAS.BAK:0"
#define CARD_SIZE 24
static const char original[][CARD_SIZE] = {
"MERCURY: CRATERS", "VENUS: CLOUDS", "EARTH: BLUE SEA", "MARS: RED RIDGE"
};
static const char newMars[CARD_SIZE] = "MARS: DUST STORM";
static char live[4][CARD_SIZE], draft[4][CARD_SIZE], backup[4][CARD_SIZE];
enum { ABSENT, FIRST, SECOND, UNRECOGNIZED, DISK_ERROR };
/* A valid edition contains four exact cards. Each may also have a visit mark
in its final byte. Check file length as well as text before changing a name. */
static int inspect(const char *name, char cards[][CARD_SIZE])
{
unsigned i;
FILE *f = fopen(name, "rb");
if (!f)
return vcc_file_error() == DECB_ERR_NOT_FOUND ? ABSENT : DISK_ERROR;
size_t count = fread(cards, 1, sizeof(original), f);
int extra = fgetc(f);
int failed = ferror(f);
if (fclose(f) == EOF || failed)
return DISK_ERROR;
if (count != sizeof(original) || extra != EOF)
return UNRECOGNIZED;
for (i = 0; i < 4; ++i)
{
char mark = cards[i][CARD_SIZE - 1];
if (mark != 0 && mark != 'V')
return UNRECOGNIZED;
if (memcmp(cards[i], original[i], CARD_SIZE - 1) != 0)
{
if (i == 3 && memcmp(cards[3], newMars, CARD_SIZE - 1) == 0)
return SECOND;
return UNRECOGNIZED;
}
}
return FIRST;
}
/* Write only after the caller has checked that the name is unused. */
static int writeCards(const char *name, const void *cards)
{
FILE *f = fopen(name, "wb");
if (!f)
return 0;
int complete = fwrite(cards, 1, sizeof(original), f) == sizeof(original);
return fclose(f) == 0 && complete;
}
static void reviseMars(char cards[][CARD_SIZE])
{
// The old visit mark belongs to the traveler. Keep the last byte.
memcpy(cards[3], newMars, CARD_SIZE - 1);
}
static int recover(int draftState)
{
// The live name was missing. Restore the known old edition first.
if (rename(BACKUP, LIVE) != 0)
return 0;
printf("ORIGINAL ATLAS RESTORED\n%s\n", backup[3]);
reviseMars(backup);
if (draftState == SECOND && memcmp(backup, draft, sizeof(original)) == 0)
return remove(DRAFT) == 0;
if (draftState != ABSENT)
printf("KEPT UNEXPECTED ATLAS.NEW\n");
return 1;
}
static int saveAtlas(void)
{
int current = inspect(LIVE, live);
int old = inspect(BACKUP, backup);
int next = inspect(DRAFT, draft);
if (current == DISK_ERROR || old == DISK_ERROR || next == DISK_ERROR)
return 0;
if (current == ABSENT && old == FIRST)
return recover(next);
if (current == SECOND && next == ABSENT)
{
printf("ATLAS ALREADY UPDATED\n%s\n", live[3]);
return 1;
}
if (current == ABSENT && old == ABSENT && next == ABSENT)
{
if (!writeCards(LIVE, original) || inspect(LIVE, live) != FIRST ||
memcmp(live, original, sizeof(original)) != 0)
return 0;
current = FIRST;
}
if (current != FIRST || old != ABSENT)
{
printf("CHECK THE THREE ATLAS FILES\n");
return 0;
}
reviseMars(live); // Only the copy in RAM has changed.
if (next == ABSENT)
{
if (!writeCards(DRAFT, live))
return 0;
next = inspect(DRAFT, draft);
}
if (next != SECOND || memcmp(live, draft, sizeof(original)) != 0)
{
printf("CHECK ATLAS.NEW\n");
return 0;
}
// Both files are closed. At this checkpoint the old edition is complete
// under BACKUP, and the new edition is complete under DRAFT.
if (rename(LIVE, BACKUP) != 0)
return 0;
printf("BACKUP IN PLACE\nPRESS A KEY TO INSTALL\n");
waitkey(0);
if (rename(DRAFT, LIVE) != 0)
return 0;
printf("UPDATED ATLAS SAVED\n%s\n", draft[3]);
return 1;
}
int main(void)
{
cls(1);
printf("PLANET ATLAS BACKUP\n");
if (saveAtlas())
return 0;
printf("SAVE STOPPED - CHECK DISK\n");
return 1;
}
@@ -0,0 +1,43 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
/* Crew log: each seat holds 1 when occupied and 0 when empty. */
#include <cmoc.h>
#include <stdlib.h>
static unsigned char storage[96];
int main(void)
{
unsigned char *seats, *larger;
if (!vcc_heap_init(storage, sizeof(storage)))
return 1;
seats = (unsigned char *) calloc(2, sizeof(*seats));
if (!seats)
return 1;
printf("CREW AT LAUNCH: %u\n", (unsigned)(seats[0] + seats[1]));
seats[0] = seats[1] = 1;
/* Keep the current seat list until we know it can grow. */
larger = (unsigned char *) realloc(seats, 3);
if (!larger)
{
free(seats);
return 1;
}
seats = larger;
seats[2] = 1;
printf("CREW AFTER GROWTH: %u\n", (unsigned)(seats[0] + seats[1] + seats[2]));
/* The request exceeds the entire 96-byte budget. */
larger = (unsigned char *) realloc(seats, 200);
if (larger)
{
free(larger);
return 1;
}
printf("NO ROOM FOR 200\n");
printf("CREW STILL ABOARD: %u\n", (unsigned)(seats[0] + seats[1] + seats[2]));
free(seats);
printf("CREW LOG CLOSED\n");
return 0;
}
@@ -0,0 +1,44 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
/* Descent Computer. Use the CoCo BASIC float backend and link vcccompat. */
#include <cmoc.h>
#include <coco.h>
#include <vcc/decimal.h>
/* Print a complete instrument reading or mark the field unavailable. */
static void reading(const char *label, float value, byte places, const char *unit)
{
char field[12];
int length = vcc_fixed(field, sizeof(field), value, places);
if (length < 0 || (unsigned)length >= sizeof(field))
printf("%s--- %s\n", label, unit);
else
printf("%s%s %s\n", label, field, unit);
}
static void report(float firstHeight, float lastHeight, float seconds)
{
float speed;
if (seconds <= 0.0f) {
printf("CHECK RADAR INTERVAL\n");
return;
}
/* Falling gives a negative speed. Keep the full value for the estimate. */
speed = (lastHeight - firstHeight) / seconds;
reading("HEIGHT ", lastHeight, 2, "M");
reading("SPEED ", speed, 2, "M/S");
if (speed < 0.0f)
reading("ETA ", lastHeight / -speed, 1, "S");
else
printf("ETA NO DESCENT\n");
}
int main(void)
{
cls(1);
printf("DESCENT COMPUTER\n\n");
/* Two radar heights in metres, measured two seconds apart. */
report(105.50f, 101.75f, 2.0f);
printf("\nRADAR PASS COMPLETE\n");
return 0;
}
@@ -0,0 +1,67 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Work on a practice disk. Each run starts a new FIELD.LOG on drive 0.
#include <coco.h>
#include <stdio.h>
#define LOG_NAME "FIELD.LOG:0"
/* Each reader starts at the beginning and sees the length saved on disk. */
static int showLog(void)
{
char line[40];
FILE *reader = fopen(LOG_NAME, "r");
int ok;
if (!reader)
return 0;
while (fgets(line, sizeof(line), reader))
printf("%s", line);
ok = !ferror(reader);
if (fclose(reader) == EOF)
ok = 0;
return ok;
}
int main(void)
{
FILE *writer;
int ok;
cls(1);
printf("PLANET FIELD LOG\n");
writer = fopen(LOG_NAME, "w");
if (!writer)
{
printf("CANNOT START FIELD.LOG\n");
return 1;
}
/* Publish the first observation while we still hold the writer. */
ok = fputs("EARTH: BLUE SEA\n", writer) != EOF && fflush(writer) == 0;
if (ok)
{
printf("CHECKPOINT READER SEES:\n");
ok = showLog();
}
if (ok)
{
printf("SPACE TO LAND ON MARS\n");
while (waitkey(0) != ' ') {}
ok = fputs("MARS: RED RIDGE\n", writer) != EOF;
}
/* Closing delivers the second observation and releases the stream. */
if (fclose(writer) == EOF)
ok = 0;
if (!ok)
{
printf("CHECK DISK AND LOG\n");
return 1;
}
printf("FINAL READER SEES:\n");
if (!showLog())
{
printf("CANNOT READ FIELD.LOG\n");
return 1;
}
printf("SURVEY FILED\n");
return 0;
}
@@ -0,0 +1,52 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Give Mission Control two observations it can read back in recording order.
#include <coco.h>
#include <vcc/cassette.h>
static int recordFlight(void)
{
int status = vcc_tape_open_write("FLIGHT");
if (status != VCC_TAPE_OK)
return status;
status = vcc_tape_write_line("EARTH BLUE SEA");
if (status == VCC_TAPE_OK)
status = vcc_tape_write_line("MARS RED RIDGE");
/* Closing writes the end-of-file block on a successful recording. */
int closed = vcc_tape_close();
return status == VCC_TAPE_OK ? closed : status;
}
static int replayFlight(void)
{
char observation[32];
int status = vcc_tape_open_read("FLIGHT");
if (status != VCC_TAPE_OK)
return status;
while ((status = vcc_tape_read_line(observation, sizeof observation)) == VCC_TAPE_OK)
printf("%s\n", observation);
int closed = vcc_tape_close();
/* A damaged last block also stops the loop. Only EOF completes the flight. */
return status == VCC_TAPE_EOF ? closed : status;
}
int main(void)
{
cls(1);
printf("FLIGHT RECORDER\n");
printf("W WRITE R READ\n");
char choice;
do {
choice = waitkey(0);
} while (choice != 'W' && choice != 'w' && choice != 'R' && choice != 'r');
int write = choice == 'W' || choice == 'w';
int status = write ? recordFlight() : replayFlight();
if (status != VCC_TAPE_OK) {
printf("TAPE ERROR %d\n", status);
return 1;
}
printf("%s\n", write ? "FLIGHT SAVED" : "END OF FLIGHT");
return 0;
}
@@ -0,0 +1,33 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Send a text report through the CoCo printer port. No disk file is needed.
#include <coco.h>
#include <vcc/printer.h>
static int printLanding(unsigned visit, const char *planet, const char *observation)
{
/* Two digits for the visit, a five-character field for the planet. */
return vcc_printer_printf("%02u %-5s %s\n", visit, planet, observation);
}
int main(void)
{
cls(1);
printf("FLIGHT CONTROL\n");
printf("START CAPTURE IN PRINTER OUTPUT\n");
printf("PRESS SPACE TO SEND REPORT\n");
while (waitkey(0) != ' ') {}
/* Ordinary printf still goes to the screen. These four lines go to the port. */
if (vcc_printer_printf("TP-10 FLIGHT REPORT\n") < 0 ||
printLanding(1, "EARTH", "BLUE SEA") < 0 ||
printLanding(2, "MARS", "RED RIDGE") < 0 ||
vcc_printer_printf("END OF REPORT\n") < 0)
{
printf("REPORT FORMAT ERROR\n");
return 1;
}
/* The guest cannot tell whether the Mac is capturing the port. */
printf("REPORT SENT TO PRINTER PORT\n");
return 0;
}
@@ -0,0 +1,84 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
/* Stereo Flyby. Link orch90, input and bcontrol, in that order. */
#include <cmoc.h>
#include <coco.h>
#include <vcc/input.h>
#include <vcc/orch90.h>
#define FRAMES 2048
#define FIRST_COLUMN 2
#define LAST_COLUMN 29
#define STAR_ROW 8
#define SHIP_ROW 10
/* Keep the sample in guest RAM for as long as the interrupt can read it. */
static struct orch90_frame beacon[FRAMES];
static void makeBeacon(void)
{
static const byte wave[] = {
128, 146, 162, 172, 176, 172, 162, 146,
128, 110, 94, 84, 80, 84, 94, 110
};
unsigned i;
for (i = 0; i < FRAMES; ++i) {
/* The first note comes from the left. The right note is an octave up.
128 in both channels is the quiet space between notes. */
beacon[i].left = i < 768 ? wave[i & 15] : 128;
beacon[i].right = i >= 1024 && i < 1792 ? wave[(i << 1) & 15] : 128;
}
}
static void mark(byte column, byte row, char symbol)
{
locate(column, row);
putchar(symbol);
}
int main(void)
{
VccInput stick;
unsigned lastUpdate, now;
byte ship = 15, star = LAST_COLUMN, key;
width(32);
cls(1);
makeBeacon();
input_init(&stick, INPUT_RIGHT);
printf("STEREO FLYBY\n\n1 TRANSMIT BEACON\nRIGHT STICK STEER Q QUIT\n");
locate(1, 7); printf("+----------------------------+");
locate(1, 12); printf("+----------------------------+");
mark(ship, SHIP_ROW, '^');
mark(star, STAR_ROW, '*');
lastUpdate = getTimer();
for (;;) {
key = inkey();
if (key == 'Q' || key == 'q')
break;
if (key == '1' && !orch90_active()) {
locate(0, 5);
if (orch90_start(beacon, FRAMES, 1, ORCH90_CLOCK_NORMAL))
printf("BEACON ON AIR");
else
printf("PLAYBACK UNAVAILABLE");
}
/* The guest clock drives the flight display. Audio advances between
updates, even when this loop is busy drawing or reading input. */
now = getTimer();
if ((unsigned)(now - lastUpdate) < 4)
continue;
lastUpdate = now;
input_sample(&stick);
mark(ship, SHIP_ROW, ' ');
if (stick.dx < 0 && ship > FIRST_COLUMN) --ship;
if (stick.dx > 0 && ship < LAST_COLUMN) ++ship;
mark(ship, SHIP_ROW, '^');
mark(star, STAR_ROW, ' ');
star = star == FIRST_COLUMN ? LAST_COLUMN : star - 1;
mark(star, STAR_ROW, '*');
}
orch90_stop();
locate(0, 14);
printf("FLYBY COMPLETE\n");
return 0;
}
@@ -0,0 +1,121 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
/* Land on the gold pad. Link gime, bgraph and bcontrol. */
#include <vcc/gime.h>
#include <Primitive.h>
#include <Joystick.h>
enum { SPACE, WHITE, CYAN, GOLD, FLAME, BLUE, VIOLET };
enum { CRAFT_W = 20, CRAFT_H = 16, PAD_LEFT = 220, PAD_RIGHT = 270 };
typedef struct { unsigned x, y; } Position;
/* BGraph supplies the line algorithm. Send each pixel to the hidden page. */
static void pixel(word x, byte y, byte color, void *unused)
{
(void) unused;
gime_plot(x, y, color);
}
static void landscape(void)
{
static const byte ridge[] = {183, 167, 177, 161, 176, 170, 184, 165, 177, 168};
unsigned i; /* Star and ridge x coordinates extend beyond 255. */
/* gime_open cleared both pages to SPACE before the first frame. */
for (i = 0; i < 22; ++i)
gime_plot(7 + i * 14, 8 + (i * 13) % 34, WHITE);
/* The crescent and stars sit above the flight area. */
gime_fill_rect(258, 18, 12, 2, GOLD);
gime_fill_rect(254, 20, 6, 10, GOLD);
gime_fill_rect(258, 30, 12, 2, GOLD);
gime_fill_rect(0, 184, GIME_WIDTH, GIME_HEIGHT - 184, BLUE);
for (i = 0; i < 9; ++i)
Primitive_line(i * 35, ridge[i], (i + 1) * 35, ridge[i + 1], VIOLET, pixel, 0);
gime_fill_rect(PAD_LEFT, 160, PAD_RIGHT - PAD_LEFT, 2, GOLD);
gime_fill_rect(PAD_LEFT + 3, 162, 2, 12, CYAN);
gime_fill_rect(PAD_RIGHT - 5, 162, 2, 12, CYAN);
}
static void drawCraft(unsigned x, unsigned y)
{
gime_fill_rect(x + 7, y, 6, 2, WHITE);
gime_fill_rect(x + 5, y + 2, 10, 5, CYAN);
gime_fill_rect(x + 8, y + 3, 4, 3, BLUE);
gime_fill_rect(x + 2, y + 7, 16, 4, WHITE);
gime_fill_rect(x + 3, y + 11, 2, 4, GOLD);
gime_fill_rect(x + 15, y + 11, 2, 4, GOLD);
gime_fill_rect(x, y + 15, 5, 1, WHITE);
gime_fill_rect(x + 15, y + 15, 5, 1, WHITE);
gime_fill_rect(x + 8, y + 11, 4, 3, FLAME);
}
static int direction(byte axis, byte lowProbe, byte lowBit, byte highProbe, byte highBit)
{
/* When a key is held, it takes precedence over this joystick axis. */
if (isKeyPressed(lowProbe, lowBit))
return -2;
if (isKeyPressed(highProbe, highBit))
return 2;
Joystick_selectAnalogMuxInputs(axis);
if (!Joystick_compareAxis(16))
return -2;
return Joystick_compareAxis(48) ? 2 : 0;
}
static unsigned move(int value, int delta, int minimum, int maximum)
{
value += delta;
if (value < minimum) return minimum;
if (value > maximum) return maximum;
return value;
}
int main(void)
{
Position craft = {144, 82}, previous[2];
byte page = 0, initialized = 0, landed = 0, presented = 1;
static const byte colors[] = {0x00, 0x3F, 0x1B, 0x34, 0x26, 0x08, 0x29};
byte i;
if (!gime_open())
{
printf("USE A SUPPORTED COCO 3 BASIC SETUP\n");
return 1;
}
for (i = 0; i < sizeof(colors); ++i)
gime_set_palette(i, colors[i]);
Joystick_disableSound();
while (!isKeyPressed(KEY_PROBE_Q, KEY_BIT_Q))
{
if (initialized < 2)
{
landscape(); /* Each physical page gets the scenery once. */
++initialized;
}
else
gime_fill_rect(previous[page].x, previous[page].y, CRAFT_W, CRAFT_H, SPACE);
craft.x = move(craft.x, direction(0, KEY_PROBE_A, KEY_BIT_A, KEY_PROBE_D, KEY_BIT_D), 0, GIME_WIDTH - CRAFT_W);
craft.y = move(craft.y, direction(1, KEY_PROBE_W, KEY_BIT_W, KEY_PROBE_S, KEY_BIT_S), 44, 160 - CRAFT_H);
drawCraft(craft.x, craft.y);
previous[page] = craft; /* Where to erase when this page comes around again. */
presented = gime_present();
if (!presented)
break;
page ^= 1;
if (craft.y == 160 - CRAFT_H && craft.x >= PAD_LEFT && craft.x + CRAFT_W <= PAD_RIGHT)
{
landed = 1;
break;
}
}
Joystick_selectAnalogMuxInputs(0);
Joystick_enableSound();
gime_close();
if (!presented)
{
printf("DISPLAY TIMING UNAVAILABLE\n");
return 1;
}
printf("%s\n", landed ? "ON THE PAD!" : "FLIGHT ENDED");
return 0;
}
@@ -0,0 +1,117 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
/* Survey the gold deposit. Link gime, input and bcontrol. */
#include <coco.h>
#include <vcc/gime.h>
#include <vcc/input.h>
enum { SKY, WHITE, CYAN, GOLD, MAGENTA, ROCK, SHADOW };
enum { LAUNCH_Y = 66, DEPOSIT_X = 216, DEPOSIT_Y = 152, MAX_CHARGE = 16 };
typedef struct {
unsigned shipX, probeX;
byte probeY; /* Zero when no probe is in flight. */
} Flight;
/* The craft and probe fly through clear sky, so a hidden page can erase
its previous sprites without saving any of the scenery beneath them. */
static void scenery(void)
{
static const byte horizon[] = {172, 170, 168, 171, 174, 175, 179, 180, 178, 173,
170, 166, 162, 165, 172, 176, 180, 177, 174, 171};
unsigned i;
for (i = 0; i < 20; ++i) {
unsigned x = i * 16;
unsigned top = horizon[i];
gime_fill_rect(x, top, 16, 192 - top, ROCK);
gime_fill_rect(x, top, 16, 1, MAGENTA);
if (i % 3 == 0) gime_fill_rect(x + 6, top + 6, 7, 2, SHADOW);
gime_plot(x + 4, 20 + i * 7 % 23, WHITE);
}
gime_fill_rect(264, 15, 8, 2, GOLD); /* Crescent over the landing site. */
gime_fill_rect(261, 17, 3, 7, GOLD);
gime_fill_rect(264, 24, 8, 2, GOLD);
gime_fill_rect(DEPOSIT_X + 2, DEPOSIT_Y + 3, 4, 11, CYAN);
gime_fill_rect(DEPOSIT_X + 20, DEPOSIT_Y + 3, 4, 22, CYAN);
gime_fill_rect(7, 7, 52, 8, WHITE); /* Charge gauge surround. */
}
static void drawShip(unsigned x)
{
gime_fill_rect(x + 6, 49, 8, 2, WHITE);
gime_fill_rect(x + 4, 51, 12, 6, CYAN);
gime_fill_rect(x + 8, 52, 5, 3, SHADOW);
gime_fill_rect(x, 57, 20, 4, WHITE);
gime_fill_rect(x + 2, 61, 3, 3, GOLD);
gime_fill_rect(x + 15, 61, 3, 3, GOLD);
}
int main(void)
{
static const byte colors[] = {0x00, 0x3f, 0x1b, 0x34, 0x29, 0x08, 0x01};
VccInput stick;
Flight now = {144, 0, 0}, old[2];
unsigned launched = 0;
byte ready = 0, charge = 0, limit = 0, charging = 0, found = 0;
byte page = 0, freshPages = 2, i;
if (!gime_open()) {
printf("USE COCO 3 BASIC WITH 512K OR MORE\n");
return 1;
}
for (i = 0; i < sizeof(colors); ++i) gime_set_palette(i, colors[i]);
input_init(&stick, INPUT_RIGHT);
while (!isKeyPressed(KEY_PROBE_Q, KEY_BIT_Q)) {
input_sample(&stick); /* One sample for this entire update. */
if (stick.dx < 0 && now.shipX >= 2) now.shipX -= 2;
if (stick.dx > 0 && now.shipX < GIME_WIDTH - 20) now.shipX += 2;
if (stick.pressed & INPUT_PRIMARY) {
++launched; /* Start one new probe at the craft. */
now.probeX = now.shipX + 9;
now.probeY = LAUNCH_Y;
limit = LAUNCH_Y + 24 + 4 * ready;
charge = 0;
charging = 1;
} else if (now.probeY) {
if (now.probeY >= limit) now.probeY = 0;
else now.probeY += 2;
}
if (charging && (stick.held & INPUT_PRIMARY) && charge < MAX_CHARGE)
++charge; /* Build energy for the NEXT probe. */
if (charging && (stick.released & INPUT_PRIMARY)) {
ready = charge; /* Lock in the range for the next press. */
charging = 0;
}
if (now.probeY + 3 >= DEPOSIT_Y && now.probeX >= DEPOSIT_X &&
now.probeX < DEPOSIT_X + 26) {
found = 1;
now.probeY = 0;
}
if (freshPages) {
scenery();
--freshPages;
} else {
gime_fill_rect(old[page].shipX, 49, 20, 15, SKY);
if (old[page].probeY)
gime_fill_rect(old[page].probeX, old[page].probeY, 2, 4, SKY);
}
drawShip(now.shipX);
if (now.probeY) gime_fill_rect(now.probeX, now.probeY, 2, 4, CYAN);
gime_fill_rect(DEPOSIT_X, DEPOSIT_Y, 26, 3, found ? CYAN : GOLD);
gime_fill_rect(9, 9, 48, 4, SHADOW);
gime_fill_rect(9, 9, 3 * (charging ? charge : ready), 4, charging ? GOLD : CYAN);
old[page] = now;
if (!gime_present()) {
gime_close();
printf("DISPLAY TIMING UNAVAILABLE\n");
return 1;
}
page ^= 1;
}
gime_close();
printf("PROBES LAUNCHED: %u\n", launched);
if (found) printf("DEPOSIT SURVEYED\n");
return 0;
}
@@ -0,0 +1,106 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Run twice on the same practice disk. Each flight adds one observation.
#include <coco.h>
#include <decbfile.h>
#include <stdio.h>
#include <string.h>
#define LOG_NAME "TRIP.LOG:0"
static int fly(FILE *log)
{
char line[32];
unsigned visits = 0;
const char *planet;
/* a+ opens even a new log at byte zero so we can read earlier flights. */
while (fgets(line, sizeof(line), log))
{
if ((visits == 0 && strcmp(line, "VISIT 1: EARTH\n") == 0) ||
(visits == 1 && strcmp(line, "VISIT 2: MARS\n") == 0))
++visits;
else
{
printf("UNRECOGNIZED TRIP.LOG\n");
return 0;
}
}
if (ferror(log))
return 0;
if (visits == 2)
{
printf("BOTH VISITS ALREADY FILED\n");
return 1;
}
/* Move the cursor to the first record. With a+, output still appends. */
if (fseek(log, 0L, SEEK_SET) != 0)
return 0;
planet = visits ? "MARS" : "EARTH";
printf("AT BYTE ZERO\nFILING %s\n", planet);
if (fprintf(log, "VISIT %u: %s\n", visits + 1, planet) < 0)
return 0;
/* This short record is buffered. Keep the stream open if saving fails. */
while (fflush(log) == EOF)
{
char key;
if (ferror(log) != DECB_ERR_IO)
return 0;
printf("SAVE FAILED\nKEEP THE SAME DISK IN DRIVE 0\n");
printf("IF PROTECTED, TURN PROTECT OFF\nR: RETRY Q: QUIT\n");
do {
key = waitkey(0);
} while (key != 'R' && key != 'r' && key != 'Q' && key != 'q');
if (key == 'Q' || key == 'q')
return 0;
/* Retry just the flush. Printing the observation again could duplicate it. */
clearerr(log);
printf("RETRYING SAVE\n");
}
return 1;
}
int main(void)
{
FILE *log;
char line[32];
int ok;
cls(1);
printf("RETURN TRIP\n");
log = fopen(LOG_NAME, "a+");
if (!log)
{
printf("CANNOT OPEN TRIP.LOG\n");
return 1;
}
ok = fly(log);
/* Check the result of closing the stream, even after an explicit flush. */
if (fclose(log) == EOF)
ok = 0;
if (!ok)
{
printf("CHECK DISK AND LOG\n");
return 1;
}
/* A new reader shows what the next flight will find on the disk. */
log = fopen(LOG_NAME, "r");
if (!log)
{
printf("CANNOT REOPEN TRIP.LOG\n");
return 1;
}
printf("REOPENED TRIP.LOG\n");
while (fgets(line, sizeof(line), log))
printf("%s", line);
ok = !ferror(log);
if (fclose(log) == EOF)
ok = 0;
if (!ok)
{
printf("CANNOT READ TRIP.LOG\n");
return 1;
}
return 0;
}
@@ -0,0 +1,130 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
/* Two landscapes, one working array. Link bank, gime and hirestxt. */
#include <coco.h>
#include <font5x8.h>
#include <vcc/bank.h>
#include <vcc/gime.h>
enum { COLUMNS = 20, FIRST_COLUMN = 10, FLOOR = 169 };
enum { NIGHT, INK, WHITE, GOLD, WINDOW, EARTH_FAR, EARTH_SOIL, EARTH_EDGE,
MARS_FAR, MARS_SOIL, MARS_EDGE };
static const byte earth[COLUMNS] = {
128, 122, 116, 120, 132, 140, 136, 128, 122, 126,
132, 140, 146, 138, 134, 122, 112, 120, 132, 140
};
static const byte mars[COLUMNS] = {
156, 146, 132, 128, 140, 154, 150, 140, 142, 148,
152, 146, 136, 126, 118, 130, 142, 154, 146, 138
};
/* Pierre Sarrazin's HiresText font has five ink columns, encoded as zero bits. */
static void label(unsigned x, byte y, const char *text)
{
while (*text) {
const byte *glyph = font5x8 + ((unsigned)*text++ - ' ') * 8;
byte row, col;
for (row = 0; row < 8; ++row)
for (col = 0; col < 5; ++col)
if (!(glyph[row] & (0x80 >> col)))
gime_plot(x + col, y + row, WHITE);
x += 6;
}
}
static byte draw(const byte *ridge, byte onMars, byte column)
{
char reading[10]; /* "RIDGE $FF" and its terminator. */
unsigned i, x = column * 16;
byte farRock = onMars ? MARS_FAR : EARTH_FAR;
byte soil = onMars ? MARS_SOIL : EARTH_SOIL;
byte edge = onMars ? MARS_EDGE : EARTH_EDGE;
gime_clear(NIGHT);
for (i = 0; i < COLUMNS; ++i) {
unsigned left = i * 16;
unsigned farY = 101 + ((i * 7 + (onMars ? 19 : 5)) % 27);
gime_plot(left + 3, 31 + i * 11 % 43, WHITE);
gime_fill_rect(left, farY, 16, FLOOR - farY, farRock);
gime_fill_rect(left, ridge[i], 16, FLOOR - ridge[i], soil);
gime_fill_rect(left, ridge[i], 16, 2, edge);
if ((i & 1) == 0 && ridge[i] + 9 < FLOOR)
gime_fill_rect(left + 3, ridge[i] + 8, 6, 1, farRock);
}
/* A crescent hangs above the distant range. */
gime_fill_rect(259, 28, 8, 2, edge);
gime_fill_rect(256, 30, 4, 8, edge);
gime_fill_rect(259, 38, 8, 2, edge);
/* A small survey craft and the sounding line beneath it. */
for (i = 67; i < ridge[column]; i += 6)
gime_plot(x + 8, i, GOLD);
gime_fill_rect(x + 5, 51, 8, 5, WINDOW);
gime_fill_rect(x + 2, 56, 13, 3, WHITE);
gime_fill_rect(x, 59, 16, 3, edge);
gime_fill_rect(x + 4, 62, 2, 3, GOLD);
gime_fill_rect(x + 11, 62, 2, 3, GOLD);
label(8, 8, onMars ? "MARS SURVEY" : "EARTH SURVEY");
sprintf(reading, "RIDGE $%02X", (unsigned)ridge[column]);
label(131, 8, reading);
label(258, 8, onMars ? "BANK $29" : "BANK $28");
gime_fill_rect(8, 19, 304, 1, edge);
gime_fill_rect(0, FLOOR, 320, 192 - FLOOR, INK);
label(8, 176, "A/D FLY SPACE SWAP R RAISE ON MARS Q QUIT");
return gime_present();
}
static byte survey(void)
{
byte ridge[COLUMNS], column = FIRST_COLUMN, onMars = 0;
unsigned offset;
/* Seed once. Changing planets must read the saved map, not reseed it. */
if (!bank_write(0, earth, COLUMNS) ||
!bank_write(BANK_PAGE_SIZE, mars, COLUMNS))
return 0;
for (;;) {
byte key;
offset = onMars ? BANK_PAGE_SIZE : 0u;
if (!bank_read(offset, ridge, COLUMNS) || !draw(ridge, onMars, column))
return 0;
do {
key = waitkey(0);
if (key >= 'a' && key <= 'z') key -= 'a' - 'A';
if (key == 'Q') return 1;
if (key == ' ') { onMars ^= 1; break; }
if (key == 'A' && column > 0) { --column; break; }
if (key == 'D' && column + 1 < COLUMNS) { ++column; break; }
if (key == 'R' && onMars && ridge[column] >= 96) {
/* Screen y grows downward. Save just the changed byte. */
ridge[column] -= 16;
if (!bank_write(offset + column, &ridge[column], 1))
return 0;
break;
}
} while (1);
}
}
int main(void)
{
static const byte colors[] = {
0x01, 0x00, 0x3f, 0x36, 0x1b, 0x0a, 0x15, 0x1e, 0x21, 0x26, 0x37
};
byte i, ok;
if (!bank_open()) {
printf("USE STANDARD COCO 3 BASIC WITH 512K OR MORE\n");
return 1;
}
if (!gime_open()) {
bank_close();
printf("GRAPHICS UNAVAILABLE\n");
return 1;
}
for (i = 0; i < sizeof(colors); ++i) gime_set_palette(i, colors[i]);
ok = survey();
gime_close();
bank_close();
printf("%s\n", ok ? "SURVEY COMPLETE" : "SURVEY TRANSFER OR DISPLAY FAILED");
return ok ? 0 : 1;
}
@@ -0,0 +1,15 @@
(bugger-source.asm):00001 ; SPDX-License-Identifier: GPL-3.0-or-later
(bugger-source.asm):00002 ; Authored source-debugger fixture; no ROM or personal media is required.
(bugger-source.asm):00003 ; The first two instructions match the native diagnostic loop.
(bugger-source.asm):00004 org $8000
8000 7C4000 (bugger-source.asm):00005 loop inc $4000
8003 20FB (bugger-source.asm):00006 bra loop
8005 12 (bugger-source.asm):00007 nop
8006 39 (bugger-source.asm):00008 rts
(bugger-source.asm):00009 ; Continuation bytes are display data, not invented instruction associations.
8007 0001020304050607 (bugger-source.asm):00010 bytes fcb $00,$01,$02,$03,$04,$05,$06,$07,$08,$09,$0a,$0b
08090A0B
(bugger-source.asm):00011 ; Address zero is a valid association, unlike the Windows sentinel convention.
(bugger-source.asm):00012 org $0000
0000 12 (bugger-source.asm):00013 zero nop
(bugger-source.asm):00014 end loop
@@ -0,0 +1,9 @@
10 PMODE 1,1:PCLS 0:SCREEN 1,0
20 COLOR 1,0:LINE(16,16)-(95,95),PSET,BF
30 PMODE 1,3:PCLS 0:COLOR 3,0
40 LINE(160,64)-(223,127),PSET,BF
50 SCREEN 1,0
60 IF INKEY$="" THEN 60
70 PMODE 1,1:SCREEN 1,0
80 IF INKEY$="" THEN 80
90 PMODE 1,3:GOTO 50