aboutsummaryrefslogtreecommitdiff
path: root/mkver.pl
diff options
context:
space:
mode:
Diffstat (limited to 'mkver.pl')
-rw-r--r--mkver.pl26
1 files changed, 26 insertions, 0 deletions
diff --git a/mkver.pl b/mkver.pl
new file mode 100644
index 0000000..c76ccc8
--- /dev/null
+++ b/mkver.pl
@@ -0,0 +1,26 @@
+#!/usr/bin/perl -w
+
+# turn version string into raw screen data, so we can easily display
+# it on the title screen.
+
+use bytes;
+my $ver = shift;
+
+if(length($ver) > 32) {
+ warn "$0: version string > 32 chars, will be cut off!\n";
+ substr($ver, 32) = "";
+}
+
+$blanks = 40;
+for(map { ord } split "", $ver) {
+ my $byte = $_;
+ if($_ < 32) {
+ $byte += 64;
+ } elsif($_ >= 32 && $_ <= 96) {
+ $byte -= 32;
+ }
+ print chr($byte);
+ $blanks--;
+}
+
+print chr(0) x $blanks;