1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-23 22:08:05 +11:00

Begin copying fonts (and compiler) to blk

This commit is contained in:
Virgil Dupras 2020-05-07 12:09:52 -04:00
parent be66d7b4a2
commit f2f3474698
7 changed files with 80 additions and 1 deletions

View File

@ -8,7 +8,7 @@ MASTER INDEX
280 Z80 boot code 350 ACIA driver 280 Z80 boot code 350 ACIA driver
370 SD Card driver 390 Inner core 370 SD Card driver 390 Inner core
420 Core words 480 AT28 Driver 420 Core words 480 AT28 Driver
490 TRS-80 Recipe 490 TRS-80 Recipe 520 Fonts

13
blk/520 Normal file
View File

@ -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

6
blk/521 Normal file
View File

@ -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. )

16
blk/522 Normal file
View File

@ -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! )
;

16
blk/530 Normal file
View File

@ -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[\]^_

11
blk/531 Normal file
View File

@ -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{|}~

17
blk/532 Normal file
View File

@ -0,0 +1,17 @@
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................