diff --git a/blk/001 b/blk/001 index 32b46bd..e84934b 100644 --- a/blk/001 +++ b/blk/001 @@ -8,7 +8,7 @@ MASTER INDEX 280 Z80 boot code 350 ACIA driver 370 SD Card driver 390 Inner core 420 Core words 480 AT28 Driver -490 TRS-80 Recipe +490 TRS-80 Recipe 520 Fonts diff --git a/blk/520 b/blk/520 new file mode 100644 index 0000000..a317715 --- /dev/null +++ b/blk/520 @@ -0,0 +1,13 @@ +Fonts + +Fonts are kept in "source" form in the following blocks and +then compiled to binary bitmasks by the following code. In +source form, fonts are a simple sequence of '.' and 'X'. '.' +means empty, 'X' means filled. Glyphs are entered one after the +other, starting at 0x21 and ending at 0x7e. To be space +efficient in blocks, we align glyphs horizontally in the blocks +to fit as many character as we can. For example, a 5x7 font +would mean that we would have 12x2 glyphs per block. + +521 Font compiler 530 3x5 font +532 5x7 font 536 7x7 font diff --git a/blk/521 b/blk/521 new file mode 100644 index 0000000..f2bc28d --- /dev/null +++ b/blk/521 @@ -0,0 +1,6 @@ +( Converts "dot-X" fonts to binary "glyph rows". One byte for + each row. In a 5x7 font, each glyph thus use 7 bytes. + Resulting bytes are aligned to the left of the byte. + Therefore, for a 5-bit wide char, "X.X.X" translates to + 0b10101000. Left-aligned bytes are easier to work with when + compositing glyphs. ) diff --git a/blk/522 b/blk/522 new file mode 100644 index 0000000..f6e8c7e --- /dev/null +++ b/blk/522 @@ -0,0 +1,16 @@ +: _g ( given a top-left of dot-X in BLK(, spit 5 bin lines ) + 5 0 DO + 0 3 0 DO ( a r ) + 2 * + OVER J 64 * I + + C@ 'X' = IF 1+ THEN + LOOP 32 * C, LOOP DROP ; +: _l ( spit a line of u glyphs ) + ( u ) 0 DO ( a ) + DUP I 3 * + _g + LOOP DROP ; +: CPFNT3x5 + 0 , 0 , 0 C, ( space char ) + 530 LOAD BLK( 21 _l 192 + 21 _l 192 + 21 _l ( 63 ) + 531 LOAD BLK( 21 _l 192 + 10 _l ( 94! ) +; + diff --git a/blk/530 b/blk/530 new file mode 100644 index 0000000..13ae8ef --- /dev/null +++ b/blk/530 @@ -0,0 +1,16 @@ +.X.X.XX.X.XXX...X..X...XX...X...............X.X..X.XX.XX.X.XXXX +.X.X.XXXXXX...XX.X.X..X..X.XXX.X............XX.XXX...X..XX.XX.. +.X........XX.X..X.....X..X..X.XXX...XXX....X.X.X.X..X.XX.XXXXX. +......XXXXX.X..X.X....X..X.X.X.X..X.......X..X.X.X.X....X..X..X +.X....X.X.X...X.XX.....XX........X......X.X...X.XXXXXXXX...XXX. +.XXXXXXXXXXX........X...X..XX..X..X.XX..XXXX.XXXXXX.XXX.XXXXXXX +X....XX.XX.X.X..X..X.XXX.X...XXXXX.XX.XX..X.XX..X..X..X.X.X...X +XXX.X.XXXXXX......X.......X.X.XXXXXXXX.X..X.XXX.XX.X.XXXX.X...X +X.XX..X.X..X.X..X..X.XXX.X....X..X.XX.XX..X.XX..X..X.XX.X.X...X +XXXX..XXXXX....X....X...X...X..XXX.XXX..XXXX.XXXX...XXX.XXXXXX. +X.XX..X.XXX.XXXXX.XXXXX..XXXXXX.XX.XX.XX.XX.XXXXXXXX..XXX.X.... +XX.X..XXXX.XX.XX.XX.XX.XX...X.X.XX.XX.XX.XX.X..XX..X....XX.X... +X..X..XXXX.XX.XXX.X.XXX..X..X.X.XX.XXXX.X..X..X.X...X...X...... +XX.X..X.XX.XX.XX..XXXX.X..X.X.X.XX.XXXXX.X.X.X..X....X..X...... +X.XXXXX.XX.XXXXX...XXX.XXX..X.XXX.X.X.XX.X.X.XXXXXX..XXXX...XXX +!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_ diff --git a/blk/531 b/blk/531 new file mode 100644 index 0000000..db3e3d0 --- /dev/null +++ b/blk/531 @@ -0,0 +1,11 @@ +X.....X.......X....XX...X...X...XX..XX.......................X. +.X.XX.X...XX..X.X.X...X.X........X.X.X.X.XXX..X.XX..XX.XX.XXXXX +.....XXX.X...XXX.XXX.X.XXX..X...XXX..X.XXXX.XX.XX.XX.XX..XX..X. +...XXXX.XX..X.XXX.X...XXX.X.X...XX.X.X.X.XX.XX.XXX..XXX....X.X. +...XXXXX..XX.XX.XXX..XX.X.X.X.XX.X.X.XXX.XX.X.X.X....XX..XX..XX +...................XX.X.XX..................................... +X.XX.XX.XX.XX.XXXX.X..X..X..XX +X.XX.XX.X.X..X..XXX...X...XXX. +X.XX.XXXX.X..X.XX..X..X..X.... +XXX.X.X.XX.X.X.XXX.XX.X.XX.... +`abcdefghijklmnopqrstuvwxyz{|}~ diff --git a/blk/532 b/blk/532 new file mode 100644 index 0000000..fa7dc69 --- /dev/null +++ b/blk/532 @@ -0,0 +1,17 @@ +............................................................... +............................................................... +............................................................... +............................................................... +............................................................... +............................................................... +............................................................... +............................................................... +............................................................... +............................................................... +............................................................... +............................................................... +............................................................... +............................................................... +............................................................... + +