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 emit6_line_count equ 24 ;; was 22
15 emit6_line_width equ 42
17 $FORTH_CONST (E6FONTADDR) font6x8_addr
18 font6x8_addr: defw font6x8_data
20 $FORTH_CONST (E6CURXY) emit6y
21 $FORTH_CONST (E6CURX) emit6x
22 $FORTH_CONST (E6CURY) emit6y
23 $FORTH_CONST (E6WASSCROLL) emit6wasscrl
24 $FORTH_CONST CONWIDTH emit6_line_width
34 emit6_allowattr: defb 1
36 $FORTH_CONST EMIT-ATTRS? 1
38 $FORTH_CODE_WORD TATTRS
45 jr z,fword_tattrz_zero
48 ld (emit6_allowattr),a
50 $FORTH_END_CODE_WORD TATTRS
52 $FORTH_CODE_WORD TATTRS?
55 ld a,(emit6_allowattr)
59 $FORTH_END_CODE_WORD TATTRS?
63 call #0DFE ;; CL-SC-ALL
64 ; set attribute for the lower part
65 ld hl,scrattr8x8(0,23)
66 ld de,scrattr8x8(1,23)
74 $FORTH_CONST EMIT-ATTRS? 0
75 emit6_do_scroll_subr equ #0DFE ;; CL-SC-ALL
77 $FORTH_CODE_WORD TATTRS
83 $FORTH_END_CODE_WORD TATTRS
85 $FORTH_CODE_WORD TATTRS?
90 $FORTH_END_CODE_WORD TATTRS?
99 ;; check for the new line
103 jr c,emit6i_0 ;; no new line
112 jr c,emit6i_1 ;; no scroll
115 ld (hl),emit6_line_count-1
118 call emit6_do_scroll_subr
128 ;; draw6InvMask: char inverse mask (norm: #00; inv: #FC)
129 ;; draw6CharMask: screen AND mask (norm: #03; over: #FF)
130 ;; draw6PutALU0: OR(#B2)/XOR(#AA) -- curr. XOR
131 ;; draw6PutALU1: OR(#B3)/XOR(#AB) -- curr. XOR
142 ;; calc screen address
177 ld (emit6_scraddr),hl
182 ld (Draw6Shift),a ; [#00] [#00]
188 draw6InvMask: equ $+1
193 draw6CharMask: equ $+2
228 and #1F ;; char byte is zero?
251 ld a,(emit6_allowattr)
256 emit6_scraddr equ $-2
257 ; conver to attribute
280 ;; end of internal EmitChar
285 ;; check for the new line
299 ld (hl),emit6_line_count-1
302 jp #0DFE ;; CL-SC-ALL
303 ;; end of internal CR proc
306 ;; draw one char, advance pos, scroll if necessary
307 $FORTH_CODE_WORD XEMIT
316 $FORTH_END_CODE_WORD XEMIT
335 $FORTH_END_CODE_WORD CLS
338 ;; backspace (back one char)
339 $FORTH_CODE_WORD EMITBS
346 jp z,i_next ;; can't move above the top
349 jr z,bs6_0 ;; up one line
354 ld h,emit6_line_width-1
358 $FORTH_END_CODE_WORD EMITBS
361 ;; draw one char, advance pos, scroll if necessary
369 ;; #13 -- cr (no line feed)
370 $FORTH_CODE_WORD EMIT
406 $FORTH_END_CODE_WORD EMIT
418 $FORTH_END_CODE_WORD CR
422 $FORTH_CODE_WORD VSCROLL
426 call emit6_do_scroll_subr
429 $FORTH_END_CODE_WORD VSCROLL
432 ;; vertical tab (#10)
433 $FORTH_CODE_WORD VTAB
441 $FORTH_END_CODE_WORD VTAB
443 ;; horizontal tab (#9)
444 $FORTH_CODE_WORD HTAB
452 jr c,htab6_0 ;; no new line
457 jr c,htab6_q ;; there were spaces, so tab is complete %-)
477 $FORTH_END_CODE_WORD HTAB
480 $FORTH_CODE_WORD WHEREX
488 $FORTH_END_CODE_WORD WHEREX
490 $FORTH_CODE_WORD WHEREY
495 $FORTH_END_CODE_WORD WHEREY
497 $FORTH_CODE_WORD GOTOXY
505 $FORTH_END_CODE_WORD GOTOXY
508 $FORTH_CODE_WORD TOVER
533 $FORTH_END_CODE_WORD TOVER
535 $FORTH_CODE_WORD TOVER?
545 $FORTH_END_CODE_WORD TOVER?
547 $FORTH_CODE_WORD TINV
558 $FORTH_END_CODE_WORD TINV
560 $FORTH_CODE_WORD TINV?
571 $FORTH_END_CODE_WORD TINV?
574 $FORTH_CODE_WORD SPACE
579 $FORTH_END_CODE_WORD SPACE
581 $FORTH_CODE_WORD EMITCR
587 $FORTH_END_CODE_WORD EMITCR
589 $FORTH_CODE_WORD SPACES
609 $FORTH_END_CODE_WORD SPACES
615 dup 0 > 0BRANCH type1
630 dup 0 > 0BRANCH xtype1
640 $FORTH_END_WORD XTYPE
643 IF USE_PRINT_ATTRS|USE_EMIT8_DRIVER
644 $FORTH_CONST SV-ATTR_P emit6_attrp
646 $FORTH_CODE_WORD PAPER
662 $FORTH_END_CODE_WORD PAPER
677 $FORTH_END_CODE_WORD INK
679 $FORTH_CODE_WORD FLASH
685 jr z,fword_flash_zero
694 $FORTH_END_CODE_WORD FLASH
696 $FORTH_CODE_WORD BRIGHT
702 jr z,fword_bright_zero
711 $FORTH_END_CODE_WORD BRIGHT
714 include "main_emit8.zas"