1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2 ;; common printing routines
3 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5 $IF USE_EMIT_DRIVER_AS_DEFAULT == 6
6 $FORTH_VALUE CONWIDTH emit6_line_width
8 $FORTH_VALUE CONWIDTH 32
10 conwidth_addr: equ $-2
12 $FORTH_CONST SV-ATTR-P emit6_attrp
14 emit_allowattr: defb 1
18 ;; defered words for printer driver
19 $FORTH_DEFER EMIT NOOP ;;EMIT6
20 $FORTH_DEFER XEMIT NOOP ;;XEMIT6
21 $FORTH_DEFER WHEREX NOOP ;;WHEREX6
22 $FORTH_DEFER WHEREY NOOP ;;WHEREY6
23 $FORTH_DEFER GOTOXY NOOP ;;GOTOXY6
24 $FORTH_DEFER GOTOXY16 NOOP ;;GOTOXY6_16
25 $FORTH_DEFER WHEREXY16 NOOP ;;WHEREXY6_16
31 $FORTH_END_WORD EMIT6?
37 $FORTH_END_WORD EMIT8?
45 $IF forthexists("WHEREX6")
48 $IF forthexists("WHEREY6")
51 $IF forthexists("GOTOXY6")
54 $IF forthexists("GOTOXY6_16")
55 ['] GOTOXY6_16 TO GOTOXY16
57 $IF forthexists("WHEREXY6_16")
58 ['] WHEREXY6_16 TO WHEREXY16
60 LIT emit6_line_width TO CONWIDTH
62 $FORTH_END_WORD SET-EMIT6
71 $IF forthexists("WHEREX8")
74 $IF forthexists("WHEREY8")
77 $IF forthexists("GOTOXY8")
80 $IF forthexists("GOTOXY8_16")
81 ['] GOTOXY8_16 TO GOTOXY16
83 $IF forthexists("WHEREXY8_16")
84 ['] WHEREXY8_16 TO WHEREXY16
88 $FORTH_END_WORD SET-EMIT8
91 ;; doesn't do CR if the cursor is at 0 col
102 call #0DFE ;; CL-SC-ALL
103 ; set attribute for the lower part
104 ld hl,scrattr8x8(0,23)
105 ld de,scrattr8x8(1,23)
113 $FORTH_CODE_WORD TATTRS
116 ;; allow attr setting
120 jr z,fword_tattrz_zero
123 ld (emit_allowattr),a
125 $FORTH_END_CODE_WORD TATTRS
127 $FORTH_CODE_WORD TATTRS?
130 ld a,(emit_allowattr)
134 $FORTH_END_CODE_WORD TATTRS?
137 $FORTH_CODE_WORD TOVER
142 ld (fword_xemit8_over0),a
143 ld (fword_xemit8_over1),a
144 ld (fword_xemit8_over2),a
162 ld (fword_xemit8_over0),a
163 ld (fword_xemit8_over1),a
164 ld (fword_xemit8_over2),a
175 ld (fword_xemit8_over0),a
176 ld (fword_xemit8_over1),a
177 ld (fword_xemit8_over2),a
190 $FORTH_END_CODE_WORD TOVER
192 $FORTH_CODE_WORD TOVER?
196 ld a,(fword_xemit8_over0)
215 $FORTH_END_CODE_WORD TOVER?
217 $FORTH_CODE_WORD TINV
234 ld (fword_xemit8_inv0),a
235 ld (fword_xemit8_inv1),a
236 ld (fword_xemit8_inv2),a
240 $FORTH_END_CODE_WORD TINV
242 $FORTH_CODE_WORD TINV?
248 ld (fword_xemit8_inv0),a
253 $FORTH_END_CODE_WORD TINV?
258 $FORTH_CODE_WORD TBOLD
267 $FORTH_END_CODE_WORD TBOLD
269 $FORTH_CODE_WORD TBOLD?
278 $FORTH_END_CODE_WORD TBOLD?
286 fword_emittest_aaa_loop:
288 I LIT 15 AND LIT 15 = 0BRANCH fword_emittest_aaa_skip
290 fword_emittest_aaa_skip:
291 (LOOP) fword_emittest_aaa_loop
313 $FORTH_END_CODE_WORD CLS
317 $FORTH_CODE_WORD VSCROLL
321 call emit_do_scroll_subr
324 $FORTH_END_CODE_WORD VSCROLL
330 CHCR EMIT CHLF EMIT ;S
337 $FORTH_END_WORD EMITCR
343 $FORTH_END_WORD EMITBS
361 $FORTH_END_WORD SPACE
367 DUP 0> 0BRANCH fword_spaces_err
371 (LOOP) fword_spaces_loop
376 $FORTH_END_WORD SPACES
382 DUP 0> 0BRANCH fword_type_err
386 (LOOP) fword_type_loop
396 DUP 0> 0BRANCH fword_xtype_err
400 (LOOP) fword_xtype_loop
405 $FORTH_END_WORD XTYPE
408 $FORTH_CODE_WORD PAPER?
417 $FORTH_END_CODE_WORD PAPER?
419 $FORTH_CODE_WORD PAPER
435 $FORTH_END_CODE_WORD PAPER
437 $FORTH_CODE_WORD INK?
443 $FORTH_END_CODE_WORD INK?
458 $FORTH_END_CODE_WORD INK
460 $FORTH_CODE_WORD FLASH?
467 $FORTH_END_CODE_WORD FLASH?
469 $FORTH_CODE_WORD FLASH
475 jr z,fword_flash_zero
484 $FORTH_END_CODE_WORD FLASH
486 $FORTH_CODE_WORD BRIGHT?
493 $FORTH_END_CODE_WORD BRIGHT?
495 $FORTH_CODE_WORD BRIGHT
501 jr z,fword_bright_zero
510 $FORTH_END_CODE_WORD BRIGHT
513 $FORTH_CODE_WORD BORDER
522 $FORTH_END_CODE_WORD BORDER