Files
Brian Holman d412e35c4e Implement CoCo 3 Quadrapassel and deliver build 01
Add gameplay, keyboard/joystick controls, disk-backed high scores and settings,
standard CMOC effects, and the approved C graphics renderer. Include the clearer
attributed font, title/credits updates, source-verified Modern and Classic (40.2)
scoring, meaningful regression fixtures, and recorded guest validation.

Deliver QUADPSL01.DSK with fresh high scores. Retain source, licenses and selected
guest evidence; exclude personal disks, private connections and build scratch.

Host rules/input/persistence/video checks and memory guards pass. Official
512 KB playtests pass the recorded checks; actual 128 KB/physical joystick
qualification and the normal-window buzzing retest remain pending.
2026-11-11 03:14:14 -07:00

24 lines
1.1 KiB
Perl

# SPDX-License-Identifier: GPL-3.0-or-later
# Build bounded, independently checked 512-byte menu text pages.
use strict;
use warnings;
my ($source,$target)=@ARGV;
open my $in,'<',$source or die "$source: $!";
my @pages=map { [] } 0..11;
while(<$in>){chomp;next if /^#/ || /^$/;my ($scene,$id,$text)=split /\t/,$_,3;
die "invalid text record" unless defined($text) && $scene=~/^\d+$/ && $scene<12 && $id=~/^\d+$/ && $id>0 && $id<256 && $text=~/^[ -~]*$/;
push @{$pages[$scene]},[$id,$text];
}
close $in;
open my $out,'>:raw',$target or die "$target: $!";
for my $scene (0..11){
my @entries=@{$pages[$scene]};my $offset=8+3*@entries;
my $head=pack('a4CCCC','QPTX',$scene,scalar(@entries),1,0);my $strings='';
for(@entries){$head.=pack('Cn',$_->[0],$offset);$strings.=$_->[1]."\0";$offset+=length($_->[1])+1;}
die "menu page exceeds 510 bytes" if $offset>510;
my $data=$head.$strings.("\0" x (510-$offset));my $crc=0xFFFF;
for my $byte(unpack('C*',$data)){$crc^=$byte<<8;for(1..8){$crc=(($crc&0x8000)?(($crc<<1)^0x1021):($crc<<1))&65535;}}
print {$out} $data,pack('n',$crc);
}
close $out or die "$target: $!";