1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2 ;; 6x8 font printing engine
3 ;; the font was stolen from the
4 ;; BYTEX font editor, (c) BYTEX Group
5 ;; all dumb code is mine.
6 ;; all smart code is taken from
7 ;; the font editor & slighly tweaked.
9 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
12 incbin "main_font6x8.fnt"
14 $FORTH_CONST (E6FONTADDR) font6x8_addr
15 font6x8_addr: defw font6x8_data
16 $FORTH_CONST (E6CURXY) emit6y
17 $FORTH_CONST (E6CURX) emit6x
18 $FORTH_CONST (E6CURY) emit6y
19 $FORTH_CONST (E6WASSCROLL) emit6wasscrl
20 $FORTH_CONST CONWIDTH 42
32 ;; check for the new line
36 jr c,emit6i_0 ;; no new line
45 jr c,emit6i_1 ;; no scroll
51 call #0DFE ;; CL-SC-ALL
61 ;; draw6InvMask: char inverse mask (norm: #00; inv: #FC)
62 ;; draw6CharMask: screen AND mask (norm: #03; over: #FF)
63 ;; draw6PutALU0: OR(#B2)/XOR(#AA) -- curr. XOR
64 ;; draw6PutALU1: OR(#B3)/XOR(#AB) -- curr. XOR
75 ;; calc screen address
110 ld (Draw6Shift),a ; [#00] [#00]
116 draw6InvMask: equ $+1
121 draw6CharMask: equ $+2
156 and #1F ;; char byte is zero?
178 ;; end of internal EmitChar
183 ;; check for the new line
200 jp #0DFE ;; CL-SC-ALL
201 ;; end of internal CR proc
204 ;; draw one char, advance pos, scroll if necessary
205 $FORTH_CODE_WORD XEMIT
213 $FORTH_END_CODE_WORD XEMIT
228 $FORTH_END_CODE_WORD CLS
231 ;; backspace (back one char)
232 $FORTH_CODE_WORD EMITBS
238 jp z,i_next ;; can't move above the top
241 jr z,bs6_0 ;; up one line
250 $FORTH_END_CODE_WORD EMITBS
253 ;; draw one char, advance pos, scroll if necessary
261 ;; #13 -- cr (no line feed)
262 $FORTH_CODE_WORD EMIT
297 $FORTH_END_CODE_WORD EMIT
308 $FORTH_END_CODE_WORD CR
311 ;; vertical tab (#10)
312 $FORTH_CODE_WORD VTAB
319 $FORTH_END_CODE_WORD VTAB
322 ;; horizontal tab (#9)
323 $FORTH_CODE_WORD HTAB
330 jr c,htab6_0 ;; no new line
335 jr c,htab6_q ;; there were spaces, so tab is complete %-)
355 $FORTH_END_CODE_WORD HTAB
357 $FORTH_CODE_WORD WHEREX
363 $FORTH_END_CODE_WORD WHEREX
365 $FORTH_CODE_WORD WHEREY
371 $FORTH_END_CODE_WORD WHEREY
373 $FORTH_CODE_WORD GOTOXY
383 $FORTH_END_CODE_WORD GOTOXY
385 $FORTH_CODE_WORD TOVER
409 $FORTH_END_CODE_WORD TOVER
411 $FORTH_CODE_WORD TOVER?
420 $FORTH_END_CODE_WORD TOVER?
422 $FORTH_CODE_WORD TINV
432 $FORTH_END_CODE_WORD TINV
434 $FORTH_CODE_WORD TINV?
444 $FORTH_END_CODE_WORD TINV?
447 $FORTH_CODE_WORD SPACE
451 $FORTH_END_CODE_WORD SPACE
453 $FORTH_CODE_WORD EMITCR
458 $FORTH_END_CODE_WORD EMITCR
460 $FORTH_CODE_WORD SPACES
480 $FORTH_END_CODE_WORD SPACES
486 dup 0 > 0BRANCH type1
501 dup 0 > 0BRANCH xtype1
511 $FORTH_END_WORD XTYPE
514 $FORTH_WORD (.") ;; "
516 R@ COUNT dup 1+ R> + >R TYPE ;S
517 $FORTH_END_WORD (.") ;; "