a2d/res/pxmap.pl
2018-12-30 20:35:23 -08:00

18 lines
273 B
Perl
Executable File

#!/usr/bin/env perl
use strict;
use warnings;
while (<STDIN>) {
chomp;
s/[^ #]//g;
tr/ #/01/;
next unless $_;
$_ .= '0' while length($_) % 7 != 0;
my @a = m/(.......)/g;
print ' .byte ' . join(',', map { "px(\%$_)" } @a) . "\n";
}