From e6ad2ef0c8083c603d014d4b37addb9b1bf98294 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Wed, 6 Jan 2016 19:31:41 -0500 Subject: change bg/text colors in title screen, plus Esc for help --- Makefile | 14 ++++++++---- help.txt | 3 +++ mkver.pl | 2 +- newtitle.s | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++----- taipan.c | 5 +++- text2screen.pl | 38 +++++++++++++++++++++++++++++++ 6 files changed, 122 insertions(+), 12 deletions(-) create mode 100644 help.txt create mode 100644 text2screen.pl diff --git a/Makefile b/Makefile index 7873ad9..f83b13e 100644 --- a/Makefile +++ b/Makefile @@ -108,11 +108,17 @@ comptitle.xex: titledata.xex titlecomp.pl comptitle.s.in # since it's a lot easier to homebrew an init segment than it is # to get cc65 to build an init segment (would need a custom linker # script at least). -newtitle.xex: newtitle.s ver.dat +newtitle.xex: newtitle.s ver.dat help.dat cl65 -l newtitle.lst -m newtitle.map -o newtitle.xex -t none newtitle.s -ver.dat: mkver.pl - perl mkver.pl $(VERSION) > ver.dat +ver.dat: text2screen.pl + echo "$(VERSION)" | perl text2screen.pl > ver.dat + +help.dat: help.txt text2screen.pl + perl text2screen.pl < help.txt > help.dat + +#ver.dat: mkver.pl +# perl mkver.pl $(VERSION) > ver.dat # The main executable. All the C and asm code goes here, except the init # segment in newtitle.s. @@ -170,7 +176,7 @@ convfont: convfont.c # Obligatory clean and distclean rules. clean: - rm -f *.o *.lst convfont *.xex AUTORUN.SYS taipan.atr ver.dat + rm -f *.o *.lst convfont *.xex AUTORUN.SYS taipan.atr ver.dat help.dat distclean: clean rm -f *~ core .*.swp 1.* 2.* 1 2 3 map map.* *.map a b c foo bar baz comptitle.s comptitle.dat diff --git a/help.txt b/help.txt new file mode 100644 index 0000000..583833e --- /dev/null +++ b/help.txt @@ -0,0 +1,3 @@ +\B:Change BG Color \E\s\c = more +\T:Change Text Color \E\s\c = more +\A\n\y other key: Start \E\s\c = more diff --git a/mkver.pl b/mkver.pl index c76ccc8..6e2f501 100644 --- a/mkver.pl +++ b/mkver.pl @@ -11,7 +11,7 @@ if(length($ver) > 32) { substr($ver, 32) = ""; } -$blanks = 40; +$blanks = 32; for(map { ord } split "", $ver) { my $byte = $_; if($_ < 32) { diff --git a/newtitle.s b/newtitle.s index 0d66fa2..dd15ff8 100644 --- a/newtitle.s +++ b/newtitle.s @@ -19,24 +19,50 @@ screendata = $9000 version: .incbin "ver.dat" +help: + .incbin "help.dat" + +helphitbl: + .byte >version + .byte >help + .byte >(help+32) + .byte >(help+64) + .byte 0 + +helplotbl: + .byte ) { + chomp; + + s/\\(.)/chr(ord($1)|0x80)/ge; + + if(length > $linelen) { + warn "$0: line $. truncated to 32 characters!\n"; + substr($_, 32) = ""; + } + + my $blanks = $linelen; + for(map { ord } split "", $_) { + my $byte = $_ & 0x7f; + my $inv = $_ & 0x80; +#warn sprintf("\$_ %02x, \$byte %02x, \$inv %02x", $_, $byte, $inv); + if($byte < 32) { + $byte += 64; + } elsif($byte >= 32 && $byte <= 96) { + $byte -= 32; + } +#warn sprintf("result: %02x", ($byte | $inv)); + print chr($byte | $inv); + $blanks--; + } + print chr(0) x $blanks; +} -- cgit v1.2.3