0
|
1 ;=============================================================================
|
|
2 ;
|
634
|
3 ; File aa_wordprocessor.asm * combined next generation V3.08.4l
|
0
|
4 ;
|
|
5 ; Anti-aliased word processor
|
|
6 ;
|
|
7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved.
|
|
8 ;=============================================================================
|
|
9 ; HISTORY
|
604
|
10 ; 2010-11-22 : [jDG] Creation
|
|
11 ; 2010-12-01 : [jDG] Adding 3bits anti-aliased fonts
|
0
|
12 ; 2010-12-30 : [jDG] Revised to put temp into ACCESSRAM0
|
|
13 ; 2012-08-12 : [mH] Moved font28 into bootloader section 0x1C000
|
634
|
14
|
|
15
|
|
16 ;-----------------------------------------------------------------------------
|
|
17 ; Attention:
|
|
18 ; If the fonts are not in the same half of the PROM memory, TBLPTRU
|
|
19 ; will be set wrong and gibberish font output will result
|
|
20 ;-----------------------------------------------------------------------------
|
|
21
|
|
22
|
|
23 ;-----------------------------------------------------------------------------
|
|
24 ; Input registers:
|
|
25 ; ----------------
|
|
26 ; buffer:26 string to print
|
|
27 ; font_size font size (0=tiny, 1=small, 2=std, 3=medium, 4=large, 5=XL)
|
|
28 ; font_color font color (8 bit)
|
|
29 ; win_top, win_leftx2 output position on screen
|
|
30 ; win_inverse inverse video mode selection
|
0
|
31 ;
|
634
|
32 ; Trashed:
|
|
33 ; --------
|
|
34 ; PRODH, PRODL needed for array indexing
|
|
35 ; FSRx 12 bits, used for indirect addressing
|
0
|
36 ;
|
634
|
37 ;-----------------------------------------------------------------------------
|
|
38
|
0
|
39
|
275
|
40 #include "hwos.inc"
|
0
|
41 #include "tft.inc"
|
|
42
|
582
|
43 extern aa_font16_block
|
|
44 extern aa_font28_block
|
623
|
45 extern aa_font34_block
|
582
|
46 extern aa_font48_block
|
|
47 extern aa_font90_block
|
623
|
48 extern aa_font92_block
|
|
49
|
608
|
50 extern convert_for_display2
|
623
|
51
|
|
52
|
634
|
53 ;=============================================================================
|
604
|
54 aa_word CODE
|
634
|
55 ;=============================================================================
|
604
|
56
|
623
|
57
|
0
|
58 ;------------------------------------------------------------------------------
|
634
|
59 ; Setup Pointers for a Char
|
|
60 ;
|
|
61 ; Input WREG char to draw
|
|
62 ; font_size selected font
|
|
63 ;
|
|
64 ; Output aa_start pointer to start of character bitmap
|
|
65 ; aa_end pointer to end of character bitmap
|
|
66 ; win_height font height
|
|
67 ; AA_flags font attributes
|
|
68 ;
|
|
69 ; Trashed PRODH
|
|
70 ; PRODL
|
|
71 ; TBLPTR
|
|
72 ; TABLAT
|
0
|
73 ;
|
|
74 aa_char_setup:
|
634
|
75 movwf PRODL ; save char to draw in PROD for later use
|
|
76 movf font_size,W ; get font size
|
0
|
77
|
623
|
78 ; 0: TINY font -------------------------------------------------------
|
582
|
79 ; Font TINY character folding...
|
0
|
80 aa_char_0:
|
634
|
81 tstfsz WREG ; requested tiny font?
|
|
82 bra aa_char_1 ; NO
|
|
83
|
|
84 aa_char_00:
|
623
|
85 movlw LOW aa_font16_block
|
582
|
86 movwf TBLPTRL
|
623
|
87 movlw HIGH aa_font16_block
|
582
|
88 movwf TBLPTRH
|
|
89 movlw UPPER aa_font16_block
|
|
90 movwf TBLPTRU
|
|
91 bra aa_char_99
|
0
|
92
|
623
|
93 ; 1: SMALL font ------------------------------------------------------
|
582
|
94 ; Font SMALL character folding...
|
|
95 aa_char_1:
|
604
|
96 decfsz WREG ; requested small font?
|
|
97 bra aa_char_2 ; NO
|
634
|
98
|
623
|
99 movlw LOW aa_font28_block
|
582
|
100 movwf TBLPTRL
|
623
|
101 movlw HIGH aa_font28_block
|
582
|
102 movwf TBLPTRH
|
|
103 movlw UPPER aa_font28_block
|
|
104 movwf TBLPTRU
|
|
105 bra aa_char_99
|
0
|
106
|
623
|
107 ; 2: STD font --------------------------------------------------------
|
|
108 ; Font STANDARD character folding...
|
582
|
109 aa_char_2:
|
604
|
110 decfsz WREG ; requested std font?
|
|
111 bra aa_char_3 ; NO
|
634
|
112
|
623
|
113 movlw LOW aa_font34_block
|
582
|
114 movwf TBLPTRL
|
623
|
115 movlw HIGH aa_font34_block
|
582
|
116 movwf TBLPTRH
|
623
|
117 movlw UPPER aa_font34_block
|
582
|
118 movwf TBLPTRU
|
|
119 bra aa_char_99
|
0
|
120
|
623
|
121 ; 3: MEDIUM font -----------------------------------------------------
|
0
|
122 aa_char_3:
|
604
|
123 decfsz WREG ; requested medium font?
|
|
124 bra aa_char_4 ; NO
|
634
|
125
|
623
|
126 movlw LOW aa_font48_block
|
582
|
127 movwf TBLPTRL
|
623
|
128 movlw HIGH aa_font48_block
|
582
|
129 movwf TBLPTRH
|
|
130 movlw UPPER aa_font48_block
|
|
131 movwf TBLPTRU
|
|
132 bra aa_char_99
|
0
|
133
|
623
|
134 ; 4: LARGE font ------------------------------------------------------
|
0
|
135 aa_char_4:
|
623
|
136 decfsz WREG ; requested large font?
|
|
137 bra aa_char_5 ; NO
|
634
|
138
|
623
|
139 movlw LOW aa_font90_block
|
582
|
140 movwf TBLPTRL
|
623
|
141 movlw HIGH aa_font90_block
|
582
|
142 movwf TBLPTRH
|
|
143 movlw UPPER aa_font90_block
|
|
144 movwf TBLPTRU
|
623
|
145 bra aa_char_99
|
|
146
|
634
|
147 ; 5: EXTRA LARGE font ------------------------------------------------
|
623
|
148 aa_char_5:
|
634
|
149 decfsz WREG ; requested extra large font?
|
|
150 bra aa_char_00 ; NO - illegal font code, default to tiny font
|
|
151
|
623
|
152 movlw LOW aa_font92_block
|
|
153 movwf TBLPTRL
|
|
154 movlw HIGH aa_font92_block
|
|
155 movwf TBLPTRH
|
|
156 movlw UPPER aa_font92_block
|
|
157 movwf TBLPTRU
|
634
|
158 ;bra aa_char_99
|
628
|
159
|
0
|
160
|
634
|
161 ; Execute Font Block -------------------------------------------------
|
582
|
162 aa_char_99:
|
634
|
163 ; this is safe if all fonts are in the same code segment
|
|
164 ; (and this segment does not cross the 64 K boundary)
|
582
|
165 movlw UPPER aa_font16_block
|
|
166 movwf TBLPTRU
|
|
167
|
634
|
168 ; execute the character substitutions
|
0
|
169 aa_char_30:
|
604
|
170 tblrd*+ ; read FROM char
|
634
|
171 movf TABLAT,W ; get FROM char
|
|
172 bz aa_char_32 ; break at end of translation table
|
0
|
173
|
604
|
174 tblrd*+ ; read TO char
|
634
|
175 cpfseq PRODL ; FROM char == current char ?
|
|
176 bra aa_char_30 ; NO - different, loop
|
|
177 movff TABLAT, PRODL ; YES - make substitution
|
|
178 bra aa_char_30 ; - loop to consume the rest of the translations
|
0
|
179
|
634
|
180 ; make sure char is within the font set
|
582
|
181 aa_char_32:
|
634
|
182 tblrd*+ ; read code of first char in font set
|
|
183 movf TABLAT,W ; get code of first char in font set
|
|
184 subwf PRODL,F ; compute code of current char - of first char
|
|
185 tblrd*+ ; read number of chars in font set
|
|
186 movf TABLAT,W ; get number of chars in font set
|
604
|
187 tblrd*+ ; read default char
|
634
|
188 cpfslt PRODL ; current char beyond last char in font set?
|
|
189 movff TABLAT,PRODL ; YES - current char with default char
|
0
|
190
|
634
|
191 ; decode font height and anti-aliasing mode
|
623
|
192 bcf aa_antialias ; default to no AA
|
604
|
193 tblrd*+ ; read font height + AA flag
|
634
|
194 movf TABLAT,W ; get font height + AA flag
|
|
195 btfsc WREG,7 ; AA bit set?
|
604
|
196 bsf aa_antialias ; YES - then the font is AA
|
634
|
197 andlw 0x7F ; strip the AA bit
|
|
198 movwf win_height ; store the font height
|
0
|
199
|
634
|
200 ; set PROM pointer to the char index
|
604
|
201 movf PRODL,W ; read back char
|
582
|
202 mullw 2 ; PROD = 2*(char - base), TBLPTR=idx
|
634
|
203 movf PRODL,W ; add to base address of font data
|
|
204 addwf TBLPTRL,F ; ...
|
|
205 movf PRODH,W ; ...
|
|
206 addwfc TBLPTRH,F ; ...
|
0
|
207
|
634
|
208 ; read pointers to character bitmap
|
582
|
209 tblrd*+ ; aa_start = PROM16(*tblptr++)
|
604
|
210 movff TABLAT,aa_start+0 ; read low byte
|
582
|
211 tblrd*+
|
|
212 movff TABLAT,aa_start+1 ; and high byte
|
0
|
213
|
582
|
214 tblrd*+ ; aa_end = PROM16(*tblptr++)
|
604
|
215 movff TABLAT,aa_end+0 ; read low byte
|
582
|
216 tblrd*+
|
|
217 movff TABLAT,aa_end+1 ; and high byte
|
0
|
218
|
634
|
219 return ; done
|
0
|
220
|
623
|
221
|
0
|
222 ;------------------------------------------------------------------------------
|
634
|
223 ; Compute Character Width
|
623
|
224 ; Input aa_start, aa_end, win_width, win_height, AA_flags
|
|
225 ; Output width added to win_width
|
|
226 ; Trashed aa_bitlen, TBLPTR, TABLAT
|
0
|
227 ;
|
|
228 aa_char_width:
|
582
|
229 movff aa_start+0, TBLPTRL ; TBLPTR = aa_start
|
634
|
230 movff aa_start+1, TBLPTRH ; ...
|
|
231 clrf aa_bitlen ; clear remaining pixels counter
|
582
|
232
|
634
|
233 ; read bitmap byte and decode length
|
|
234 aa_char_width_1:
|
|
235 ifdef AA_BYTE_SWAP
|
|
236 btg TBLPTRL ; toggle low ptr bit
|
|
237 tblrd* ; read bitmap data
|
|
238 movf TABLAT,W ; store to WREG
|
|
239 btg TBLPTRL ; toggle back
|
|
240 tblrd*+ ; do a dummy read to increment the pointer
|
|
241 movwf TABLAT ; restore TABLAT
|
|
242 else
|
|
243 tblrd*+ ; read bitmap data
|
|
244 movf TABLAT,W ; store to WREG
|
|
245 endif
|
604
|
246 btfss aa_antialias ; anti-aliased font ?
|
634
|
247 bra aa_char_width_10 ; NO - always 7 bit count
|
|
248 btfss WREG,7 ; YES - none-white pixels?
|
|
249 andlw 0x1F ; YES - 5 bit count
|
0
|
250 aa_char_width_10:
|
634
|
251 andlw 0x7F ; mask out none-white pixel flag
|
|
252 incf WREG,W ; WREG = repetition count
|
|
253 addwf aa_bitlen,F ; add to remaining pixels
|
582
|
254
|
604
|
255 movf win_height,W ; WREG -= height
|
634
|
256 negf WREG ; ...
|
0
|
257
|
634
|
258 ; this is a hand-made division by successive subtraction of the height
|
0
|
259 aa_char_width_2:
|
634
|
260 addwf aa_bitlen,F ; try to subtract win_height, does it fit?
|
|
261 bn aa_char_width_3 ; NO - done
|
|
262 infsnz win_width+0,F ; YES - do a 16 bit increment of the win_width
|
|
263 incf win_width+1,F ; - ...
|
|
264 bra aa_char_width_2 ; - loop
|
0
|
265
|
|
266 aa_char_width_3:
|
582
|
267 negf WREG ; WREG = +height
|
604
|
268 addwf aa_bitlen,F ; restore true reminder
|
0
|
269
|
634
|
270 ; all pixel data processed?
|
|
271 movf TBLPTRL,W ; get TBLPTR, low byte
|
|
272 cpfseq aa_end+0 ; TBLPTR, low byte == end pointer, low byte?
|
|
273 bra aa_char_width_1 ; NO - loop
|
|
274 movf TBLPTRH,W ; YES - get TBLPTR, high byte
|
|
275 cpfseq aa_end+1 ; - TBLPTR, high byte == end pointer, high byte?
|
|
276 bra aa_char_width_1 ; NO - loop
|
|
277 return ; YES - done
|
0
|
278
|
623
|
279
|
0
|
280 ;------------------------------------------------------------------------------
|
634
|
281 ; Compute String Width
|
|
282 ; Input buffer (NEEDS TO BE NULL TERMINATED)
|
582
|
283 ; Output win_width, win_height
|
623
|
284 ; Trashed PROD, TBLPTR, FSR2, aa_bitlen, aa_start, aa_end, AA_flags
|
0
|
285 ;
|
|
286 aa_string_width:
|
582
|
287 lfsr FSR2, buffer ; FSR2 pointer to start of string
|
634
|
288 clrf win_width+0 ; clear 16 bit width sum
|
|
289 clrf win_width+1 ; ...
|
0
|
290
|
|
291 aa_string_width_1:
|
634
|
292 movf POSTINC2,W ; get character
|
604
|
293 bz aa_string_width99 ; exit if null byte encountered
|
0
|
294
|
634
|
295 rcall aa_char_setup ; setup pointers for the char
|
|
296 rcall aa_char_width ; win_width += character width
|
|
297 bra aa_string_width_1 ; loop
|
0
|
298
|
|
299 aa_string_width99:
|
634
|
300 return ; done
|
0
|
301
|
623
|
302
|
0
|
303 ;------------------------------------------------------------------------------
|
634
|
304 ; Print a Character
|
623
|
305 ; Input aa_start, aa_end, win_height, win_invert, win_color1, win_color2
|
582
|
306 ; Output none
|
623
|
307 ; Trashed TBLPTR, TABLAT, PROD, aa_bitlen, AA_flags, aa_colorDir:2
|
0
|
308 ;
|
|
309 aa_decode_char:
|
634
|
310 movff aa_start+0, TBLPTRL ; set TBLPTR to start of character data
|
|
311 movff aa_start+1, TBLPTRH ; ...
|
582
|
312
|
634
|
313 ; read bitmap byte and decode color & length
|
|
314 aa_decode_1:
|
|
315 ifdef AA_BYTE_SWAP
|
|
316 btg TBLPTRL ; toggle low ptr bit
|
|
317 tblrd* ; read bitmap data
|
|
318 movf TABLAT,W ; back-up TABLAT
|
|
319 btg TBLPTRL ; toggle back
|
|
320 tblrd*+ ; do a dummy read to increment the pointer
|
|
321 movwf TABLAT ; restore TABLAT
|
|
322 else
|
|
323 tblrd*+ ; normal read...
|
|
324 movf TABLAT,W ; store copy to WREG
|
|
325 endif
|
|
326 btfss aa_antialias ; anti-aliased font ?
|
|
327 bra aa_decode_10 ; NO - always 7 bit count
|
|
328 btfss WREG,7 ; YES - none-white pixels?
|
|
329 andlw 0x1F ; YES - 5 bit count
|
582
|
330 aa_decode_10:
|
634
|
331 andlw 0x7F ; mask out none-white pixel flag
|
|
332 incf WREG,W ; WREG = repetition count
|
582
|
333 movwf aa_bitlen ; repetition count --> aa_bitlen
|
0
|
334
|
582
|
335 ;---- COLOR DECODING -------------------------------------------------
|
|
336 ;
|
|
337 ; Code Normal Inverse
|
604
|
338 ; 1xx 0% 100% : Managed by aa_decode_13
|
582
|
339 ; 011 25% 75%
|
|
340 ; 010 50% 50%
|
|
341 ; 001 75% 25%
|
604
|
342 ; 000 100% 0% : Managed by aa_decode_13, too
|
634
|
343
|
|
344 movf TABLAT,W ; get back pixel data
|
604
|
345 btfss aa_antialias ; anti-aliased font?
|
|
346 bra aa_decode_13 ; NO - 1 bit case
|
0
|
347
|
634
|
348 ; asymmetry test: 1xx code is another case for 1 bit color
|
|
349 ; This has to be done before inverse video, because of the asymmetric processing!
|
604
|
350 bn aa_decode_13 ; decode as none-aa
|
0
|
351
|
634
|
352 ; manage 000 special case
|
623
|
353 andlw 0xE0 ; select color bits, is it a 000 ?
|
|
354 bz aa_decode_13 ; YES
|
582
|
355
|
634
|
356 ; apply reverse video, in a reversed way
|
604
|
357 btfss win_invert ; inverse video mode?
|
|
358 sublw 0x80 ; NO
|
0
|
359
|
634
|
360 ; extract color quarter and color half information
|
623
|
361 bsf aa_antialias ; set AA mode
|
|
362 bcf aa_color_quarter ; default to no color quarter
|
|
363 btfsc WREG,5 ; color quarter encoded?
|
|
364 bsf aa_color_quarter ; YES - set flag
|
|
365 bcf aa_color_half ; default to no color half
|
|
366 btfsc WREG,6 ; color half encoded?
|
|
367 bsf aa_color_half ; YES - set flag
|
0
|
368
|
582
|
369 ;---- 2 bit x RGB(16bits) computation --------------------------------
|
634
|
370 clrf PRODL ; clear accumulator
|
|
371 clrf PRODH ; ...
|
0
|
372
|
634
|
373 ; take color / 2 into aa_temp (max red = 15/31)
|
604
|
374 rrcf win_color1,W ; xRRRRxGG
|
582
|
375 andlw b'01111011' ; 0RRRR0GG (don't change C)
|
|
376 movwf aa_temp+0
|
604
|
377 rrcf win_color2,W ; GGGxBBBB
|
582
|
378 andlw b'11101111' ; GGG0BBBB
|
|
379 movwf aa_temp+1
|
0
|
380
|
634
|
381 btfss aa_color_half ; color half encoded?
|
|
382 bra aa_decode_12 ; NO
|
|
383 movff aa_temp+0,PRODH ; YES - add color/2, TFT is big endian, so swap here
|
|
384 movff aa_temp+1,PRODL ; - ...
|
0
|
385
|
|
386 aa_decode_12:
|
634
|
387 btfss aa_color_quarter ; color quarter encoded?
|
|
388 bra aa_decode_3 ; NO
|
0
|
389
|
634
|
390 ; divide once again by 2 (max red = 7/31)
|
582
|
391 rrcf aa_temp+0,W ; xxRRRxxG
|
|
392 andlw b'00111001' ; 00RRR00G (don't change C)
|
|
393 movwf aa_temp+0
|
|
394 rrcf aa_temp+1,W ; GGGxxBBB
|
|
395 andlw b'11100111' ; GGG00BBB
|
|
396 movwf aa_temp+1
|
0
|
397
|
604
|
398 movf aa_temp+1,W ; add color/4
|
582
|
399 addwf PRODL,F ; NOTE: 7/31+15/31=22/31,
|
|
400 movf aa_temp+0,W ; hence components won't overlap
|
604
|
401 addwfc PRODH,F ; in right order, to propagate carry
|
0
|
402
|
623
|
403 aa_decode_12b:
|
634
|
404 btfsc screen_type2 ; display type 2 ?
|
|
405 call convert_for_display2 ; YES - convert 16 bit RGB b'RRRRRGGG GGGBBBBB' into 24 bit RGB b'RRRRRR00 GGGGGG00 BBBBBB00'
|
|
406 bra aa_decode_3 ; continue
|
608
|
407
|
634
|
408 ; ---- simple BLACK and WHITE cases ------------------------------
|
|
409 aa_decode_13: ; got a 1xx or a 000 code
|
|
410 btfsc win_invert ; inverse video mode?
|
623
|
411 xorlw 0x80 ; YES - invert levels
|
634
|
412 bn aa_decode_2 ; black pixel? -> YES
|
0
|
413
|
623
|
414 ; WHITE pixel (i.e. full color)
|
634
|
415 movff win_color1,PRODH ; set current drawing color (display is big endian)
|
|
416 movff win_color2,PRODL ; ...
|
|
417 bra aa_decode_12b ; post-process in case of display type 2
|
0
|
418
|
|
419 aa_decode_2:
|
634
|
420 clrf PRODH ; set drawing color to black
|
|
421 clrf PRODL ; ...
|
|
422 clrf win_color5 ; set drawing color to black (display type 2)
|
|
423 clrf win_color4 ; ...
|
|
424 clrf win_color3 ; ...
|
0
|
425
|
|
426 aa_decode_3:
|
623
|
427 ;---- PIXEL WRITE LOOP -----------------------------------------------
|
|
428 bsf tft_rs ; Data!
|
608
|
429
|
623
|
430 btfsc screen_type2 ; display 2 ?
|
|
431 bra aa_decode_3_display2 ; YES
|
628
|
432 btfsc screen_type3 ; display 3 ?
|
|
433 bra aa_decode_3_display3 ; YES
|
582
|
434
|
623
|
435 movff PRODH,PORTA ; move high byte to PORTA
|
|
436 movff PRODL,PORTH ; move low byte to PORTH
|
608
|
437 aa_decode_3_display0and1:
|
634
|
438 bcf tft_nwr ; tick
|
|
439 bsf tft_nwr ; ...
|
|
440 decfsz aa_bitlen,F ; decrement length counter, became zero?
|
|
441 bra aa_decode_3_display0and1; NO - loop
|
|
442 bra aa_decode_3_done ; YES - done
|
0
|
443
|
608
|
444 aa_decode_3_display2:
|
634
|
445 movff win_color5,PORTH ; move high byte to PORTH (display is big endian)
|
|
446 bcf tft_nwr ; tick
|
|
447 bsf tft_nwr ; ...
|
|
448 movff win_color4,PORTH ; move low byte to PORTH
|
|
449 bcf tft_nwr ; tick
|
|
450 bsf tft_nwr ; ...
|
|
451 movff win_color3,PORTH ; move low(est) byte to PORTH
|
|
452 bcf tft_nwr ; tick
|
|
453 bsf tft_nwr ; ...
|
|
454 decfsz aa_bitlen,F ; decrement length counter, became zero?
|
|
455 bra aa_decode_3_display2 ; NO - loop
|
|
456 bra aa_decode_3_done ; YES - done
|
628
|
457
|
|
458 aa_decode_3_display3:
|
634
|
459 movff PRODH,PORTH ; move high byte to PORTH (display is big endian)
|
|
460 bcf tft_nwr ; tick
|
|
461 bsf tft_nwr ; ...
|
|
462 movff PRODL,PORTH ; move low byte to PORTH
|
|
463 bcf tft_nwr ; tick
|
|
464 bsf tft_nwr ; ...
|
|
465 decfsz aa_bitlen,F ; decrement length counter, became zero?
|
|
466 bra aa_decode_3_display3 ; NO - loop
|
623
|
467
|
608
|
468 aa_decode_3_done:
|
623
|
469 ;---- BYTE-CODE LOOP -------------------------------------------------
|
634
|
470 ; all pixel data processed?
|
|
471 movf TBLPTRL,W ; get TBLPTR, low byte
|
|
472 cpfseq aa_end+0 ; TBLPTR, low byte == end pointer, low byte?
|
|
473 bra aa_decode_1 ; NO - loop
|
|
474 movf TBLPTRH,W ; YES - get TBLPTR, high byte
|
|
475 cpfseq aa_end+1 ; - TBLPTR, high byte == end pointer, high byte?
|
|
476 bra aa_decode_1 ; NO - loop
|
|
477 return ; YES - done
|
623
|
478
|
0
|
479
|
|
480 ;------------------------------------------------------------------------------
|
634
|
481 ; Print the Output Buffer to Screen
|
623
|
482 ;
|
634
|
483 ; Input buffer - string to print (NULL TERMINATED)
|
|
484 ; Output chars printed to screen
|
|
485 ;
|
|
486 global aa_wordprocessor
|
0
|
487 aa_wordprocessor:
|
634
|
488 movf font_color,W ; get selected font color (8 bit)
|
|
489 call TFT_set_color ; compute printing color (16 bit)
|
|
490 rcall aa_string_width ; set win_height and compute win_width:2
|
|
491 call TFT_box_write ; set up output box
|
|
492 lfsr FSR2,buffer ; set FSR2 to the start of the output buffer
|
|
493 Index_out 0x22 ; DATA block command (macro defined in tft.inc)
|
0
|
494
|
|
495 aa_wordprocessor_1:
|
634
|
496 movf POSTINC2,W ; read character from the buffer
|
|
497 bz aa_wordprocessor_99 ; done if null byte encountered
|
0
|
498
|
634
|
499 rcall aa_char_setup ; setup pointers for the char
|
|
500 rcall aa_decode_char ; print character to screen
|
|
501 bra aa_wordprocessor_1 ; loop
|
0
|
502
|
|
503 aa_wordprocessor_99:
|
634
|
504 Index_out 0x00 ; send end of bloc command
|
|
505 bcf win_invert ; terminate inverse printing
|
|
506 return ; done
|
|
507
|
|
508 ;------------------------------------------------------------------------------
|
0
|
509
|
582
|
510 END
|