comparison src/aa_wordprocessor.asm @ 628:cd58f7fc86db

3.05 stable work
author heinrichsweikamp
date Thu, 19 Sep 2019 12:01:29 +0200
parents c40025d8e750
children 4050675965ea
comparison
equal deleted inserted replaced
627:bf5fee575701 628:cd58f7fc86db
1 ;============================================================================= 1 ;=============================================================================
2 ; 2 ;
3 ; File aa_wordprocessor.asm combined next generation V3.03.1 3 ; File aa_wordprocessor.asm combined next generation V3.03.7
4 ; 4 ;
5 ; Anti-aliased word processor 5 ; Anti-aliased word processor
6 ; 6 ;
7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved. 7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved.
8 ;============================================================================= 8 ;=============================================================================
45 extern aa_font16_block 45 extern aa_font16_block
46 extern aa_font28_block 46 extern aa_font28_block
47 extern aa_font34_block 47 extern aa_font34_block
48 extern aa_font48_block 48 extern aa_font48_block
49 extern aa_font90_block 49 extern aa_font90_block
50
51 IFDEF _huge_font
52 extern aa_font92_block 50 extern aa_font92_block
53 ENDIF
54 51
55 extern convert_for_display2 52 extern convert_for_display2
56 53
57 54
58 aa_word CODE 55 aa_word CODE
119 movwf TBLPTRU 116 movwf TBLPTRU
120 bra aa_char_99 117 bra aa_char_99
121 118
122 ; 4: LARGE font ------------------------------------------------------ 119 ; 4: LARGE font ------------------------------------------------------
123 aa_char_4: 120 aa_char_4:
124 IFDEF _huge_font
125 decfsz WREG ; requested large font? 121 decfsz WREG ; requested large font?
126 bra aa_char_5 ; NO 122 bra aa_char_5 ; NO
127 ENDIF
128 movlw LOW aa_font90_block 123 movlw LOW aa_font90_block
129 movwf TBLPTRL 124 movwf TBLPTRL
130 movlw HIGH aa_font90_block 125 movlw HIGH aa_font90_block
131 movwf TBLPTRH 126 movwf TBLPTRH
132 movlw UPPER aa_font90_block 127 movlw UPPER aa_font90_block
133 movwf TBLPTRU 128 movwf TBLPTRU
134 bra aa_char_99 129 bra aa_char_99
135 130
136 IFDEF _huge_font
137 ; 5: XTRA LARGE font ------------------------------------------------- 131 ; 5: XTRA LARGE font -------------------------------------------------
138 aa_char_5: 132 aa_char_5:
139 movlw LOW aa_font92_block 133 movlw LOW aa_font92_block
140 movwf TBLPTRL 134 movwf TBLPTRL
141 movlw HIGH aa_font92_block 135 movlw HIGH aa_font92_block
142 movwf TBLPTRH 136 movwf TBLPTRH
143 movlw UPPER aa_font92_block 137 movlw UPPER aa_font92_block
144 movwf TBLPTRU 138 movwf TBLPTRU
145 ENDIF 139
146 140
147 ; Execute font block ------------------------------------------------- 141 ; Execute font block -------------------------------------------------
148 aa_char_99: 142 aa_char_99:
149 ; This is safe if all fonts are in the same code segment 143 ; This is safe if all fonts are in the same code segment
150 ; (and that segment does not span the 64K edge...) 144 ; (and that segment does not span the 64K edge...)
153 147
154 ; Proceed to character substitutions 148 ; Proceed to character substitutions
155 aa_char_30: 149 aa_char_30:
156 tblrd*+ ; read FROM char 150 tblrd*+ ; read FROM char
157 movf TABLAT,W ; get it, and set Z,N 151 movf TABLAT,W ; get it, and set Z,N
158 bz aa_char_32 ; branch if end of translation table reached 152 bz aa_char_32 ; break at end of translations
159 153
160 tblrd*+ ; read TO char 154 tblrd*+ ; read TO char
161 cpfseq PRODL ; FROM == current char ? 155 cpfseq PRODL ; FROM == current char ?
162 bra aa_char_30 ; different -> loop 156 bra aa_char_30 ; different -> loop
163 movff TABLAT, PRODL ; make substitution 157 movff TABLAT, PRODL ; make substitution
424 ;---- PIXEL WRITE LOOP ----------------------------------------------- 418 ;---- PIXEL WRITE LOOP -----------------------------------------------
425 bsf tft_rs ; Data! 419 bsf tft_rs ; Data!
426 420
427 btfsc screen_type2 ; display 2 ? 421 btfsc screen_type2 ; display 2 ?
428 bra aa_decode_3_display2 ; YES 422 bra aa_decode_3_display2 ; YES
423 btfsc screen_type3 ; display 3 ?
424 bra aa_decode_3_display3 ; YES
429 425
430 movff PRODH,PORTA ; move high byte to PORTA 426 movff PRODH,PORTA ; move high byte to PORTA
431 movff PRODL,PORTH ; move low byte to PORTH 427 movff PRODL,PORTH ; move low byte to PORTH
432 aa_decode_3_display0and1: 428 aa_decode_3_display0and1:
433 bcf tft_nwr 429 bcf tft_nwr
446 movff win_color3,PORTH ; move low(est) byte to PORTH 442 movff win_color3,PORTH ; move low(est) byte to PORTH
447 bcf tft_nwr 443 bcf tft_nwr
448 bsf tft_nwr ; tick 444 bsf tft_nwr ; tick
449 decf aa_bitlen,F 445 decf aa_bitlen,F
450 bnz aa_decode_3_display2 446 bnz aa_decode_3_display2
447 bra aa_decode_3_done
448
449 aa_decode_3_display3:
450 movff PRODH,PORTH ; move high byte to PORTH (DISPLAY is big endian)
451 bcf tft_nwr
452 bsf tft_nwr ; tick
453 movff PRODL,PORTH ; move low byte to PORTH
454 bcf tft_nwr
455 bsf tft_nwr ; tick
456 decf aa_bitlen,F
457 bnz aa_decode_3_display3
451 458
452 aa_decode_3_done: 459 aa_decode_3_done:
453 ;---- BYTE-CODE LOOP ------------------------------------------------- 460 ;---- BYTE-CODE LOOP -------------------------------------------------
454 ; are we done ? 461 ; are we done ?
455 movf TBLPTRL,W ; compare TBLPTR with aa_end 462 movf TBLPTRL,W ; compare TBLPTR with aa_end
462 469
463 470
464 ;------------------------------------------------------------------------------ 471 ;------------------------------------------------------------------------------
465 ; Setup pointers for a char: 472 ; Setup pointers for a char:
466 ; Inputs : buffer : string to print (NULL TERMINATED) 473 ; Inputs : buffer : string to print (NULL TERMINATED)
467 ; Output : TFT commands on port D + clocks 474 ; Output : TFT commands on PORTH (Upper) and PORTA (lower) + clocks
468 ; 475 ;
469 global aa_wordprocessor ; callable from C-code 476 global aa_wordprocessor ; callable from C-code
470 aa_wordprocessor: 477 aa_wordprocessor:
471 rcall aa_string_width ; set win_height, compute win_width:2 478 rcall aa_string_width ; set win_height, compute win_width:2
472 call TFT_box_write ; use that for the box 479 call TFT_box_write ; use that for the box