From 17cc28e211aadf5cbb33e5145307819588ee1b54 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Mon, 11 Nov 2019 13:24:50 -0500 Subject: [PATCH] recipes/ti84: use a 3x5 font instead of a 5x7 one This allow a lot more characters to fit on that tiny screen... ref #41 --- fonts/3x5.txt | 470 ++++++++++++++++++++++++++++++++++++++++++++++++++ kernel/fnt/3x5.bin | Bin 0 -> 475 bytes recipes/ti84/glue.asm | 10 +- tools/font_compile.pl | 4 +- 4 files changed, 477 insertions(+), 7 deletions(-) create mode 100644 fonts/3x5.txt create mode 100644 kernel/fnt/3x5.bin diff --git a/fonts/3x5.txt b/fonts/3x5.txt new file mode 100644 index 0000000..a9feb67 --- /dev/null +++ b/fonts/3x5.txt @@ -0,0 +1,470 @@ + . + . + . + + . +. . +. . + + + +. . +... + +... +. . + .. +.. + .. +.. + . +. + . + . +. + . + . +. . + . +. . + .. + . + . + + + + . + . + . + . + . +. + . + . + . +. + . +... + . +. . + + + . +... + . + + + + + . +. + + +... + + + + + + + . + . + . + . +. +. + . +. . +. . +. . + . + . +.. + . + . +... +.. + . + . +. +... +.. + . +.. + . +.. +. . +. . +... + . + . +... +. +.. + . +.. + .. +. +... +. . +... +... + . + . +. +. +... +. . +... +. . +... +... +. . +... + . +.. + + . + + . + + + . + + . +. + . + . +. + . + . + +... + +... + +. + . + . + . +. +.. + . + . + + . + . +... +... +. + .. + . +. . +... +. . +. . +.. +. . +.. +. . +.. + .. +. +. +. + .. +.. +. . +. . +. . +.. +... +. +.. +. +... +... +. +.. +. +. + .. +. +. . +. . + .. +. . +. . +... +. . +. . +... + . + . + . +... +... + . + . + . +.. +. . +.. +. +.. +. . +. +. +. +. +... +. . +... +... +. . +. . +.. +. . +. . +. . +. . +... +. . +. . +. . +... +.. +. . +.. +. +. +... +. . +. . +... + .. +.. +. . +.. +. . +. . + .. +. + . + . +.. +... + . + . + . + . +. . +. . +. . +. . +... +. . +. . +. . +. . + . +. . +. . +... +... +. . +. . +. . + . +. . +. . +. . +. . + . + . + . +... + . + . +. +... +... +. +. +. +... +. +. + . + . + . +... + . + . + . +... + . +. . + + + + + + + +... +. + . + + + + +.. + . +... +... +. +. +.. +. . +.. + + .. +. +. + .. + . + . + .. +. . + .. + + . +. . +.. + .. + .. +. +.. +. +. + + . +. . + .. +.. +. +. +.. +. . +. . + . + + . + . + . + . + + . + . +.. +. +. . +.. +. . +. . +.. + . + . + . + .. + +. . +... +. . +. . + +.. +. . +. . +. . + + . +. . +. . + . + +.. +. . +.. +. + + .. +. . + .. + . + + .. +. +. +. + + .. +.. + . +.. + . +... + . + . + .. + +. . +. . +. . +... + +. . +. . +. . + . + +. . +. . +... +. . + +. . + . + . +. . + +. . + . + . + . + +... + .. +.. +... + .. + . +. + . + .. + . + . + . + . + . +.. + . + . + . +.. + .. +.. + + + diff --git a/kernel/fnt/3x5.bin b/kernel/fnt/3x5.bin new file mode 100644 index 0000000000000000000000000000000000000000..31455203219142f820444bd009967b571fcc36e8 GIT binary patch literal 475 zcmW-d2@wD>2m_H)DUpH{q(ll*kaC-AI}jjzt>Q>3*&tt?dwVr6&vFy2dT`z#Mkkm^ zyrrqS0N^8IC}U}*TTBGkzV~iGJ?Fdd&>#X^;zkU9J<4671s|vGrUluX+cVP?^ipq# zE%w;$P)^~$N6Vcx+@S@5H3#iW1gEb-<^wfq?N=m6?4+qN>LWpx&41rLw P%C$y~k*|N+UWWPr(%;YF literal 0 HcmV?d00001 diff --git a/recipes/ti84/glue.asm b/recipes/ti84/glue.asm index a669578..301d60a 100644 --- a/recipes/ti84/glue.asm +++ b/recipes/ti84/glue.asm @@ -23,8 +23,8 @@ .inc "err.h" .inc "core.asm" -.equ FNT_WIDTH 5 -.equ FNT_HEIGHT 7 +.equ FNT_WIDTH 3 +.equ FNT_HEIGHT 5 .inc "fnt/mgm.asm" .equ LCD_RAMSTART RAMSTART .inc "ti/lcd.asm" @@ -44,7 +44,7 @@ boot: di ld hl, RAMEND ld sp, hl - im 1 + im 1 ; enable ON key interrupt in a, (PORT_INT_MASK) @@ -85,11 +85,11 @@ handleInterrupt: pop af ei jp main - + .done: pop af ei reti FNT_DATA: -.bin "fnt/5x7.bin" +.bin "fnt/3x5.bin" diff --git a/tools/font_compile.pl b/tools/font_compile.pl index 67b781b..62cea89 100755 --- a/tools/font_compile.pl +++ b/tools/font_compile.pl @@ -23,10 +23,10 @@ unless (open($handle, '<', $fn)) { die "Can't open $fn"; } print pack('C*', (0) x $height); while (<$handle>) { - unless (/( |\.){${width}}\n/) { die "Invalid line format '$_'"; } + unless (/( |\.){0,${width}}\n/) { die "Invalid line format '$_'"; } my @line = split //, $_; my $num = 0; - for (my $i=0; $i<8; $i++) { + for (my $i=0; $i<$width; $i++) { if (@line[$i] eq '.') { $num += (1 << (7-$i)); }