comparison code_part1/OSTC_code_asm_part1/aa_wordprocessor.asm @ 91:3bcccb697bce

Added HW logo and dimmed cursor in small font.
author JeanDo
date Fri, 10 Dec 2010 02:35:26 +0100
parents 3e351e25f5d1
children d79bf9df55d7
comparison
equal deleted inserted replaced
90:6655b1c59adc 91:3bcccb697bce
57 bnz aa_char_1 57 bnz aa_char_1
58 58
59 ; SMALL font ----------------------------------------------------- 59 ; SMALL font -----------------------------------------------------
60 ; Font SMALL character folding... 60 ; Font SMALL character folding...
61 aa_char_0: 61 aa_char_0:
62 ; movlw 0x7E ; Skip chars between ~ and ¡
63 ; cpfsgt PRODL,A ; Compare with char;
64 ; bra aa_char_01
65 ; movlw -.34 ; substract 34 (decimal!)
66 ; addwf PRODL,F,A ; put back to PRODL
67 ;aa_char_01:
68 movlw LOW aa_font28_block 62 movlw LOW aa_font28_block
69 movwf TBLPTRL,A 63 movwf TBLPTRL,A
70 movlw HIGH aa_font28_block 64 movlw HIGH aa_font28_block
71 movwf TBLPTRH,A 65 movwf TBLPTRH,A
72 bra aa_char_3 66 bra aa_char_3
94 ; Execute font block --------------------------------------------- 88 ; Execute font block ---------------------------------------------
95 aa_char_3: 89 aa_char_3:
96 movlw UPPER aa_font28_block 90 movlw UPPER aa_font28_block
97 movwf TBLPTRU,A 91 movwf TBLPTRU,A
98 92
93 ; Proceed to character substitutions
99 aa_char_30: 94 aa_char_30:
100 tblrd*+ ; Read FROM char 95 tblrd*+ ; Read FROM char
101 movf TABLAT,W ; Get it, and set Z,N 96 movf TABLAT,W ; Get it, and set Z,N
102 bz aa_char_32 ; Break at end of translations 97 bz aa_char_32 ; Break at end of translations
103 98
105 cpfseq PRODL,A ; FROM == current char ? 100 cpfseq PRODL,A ; FROM == current char ?
106 bra aa_char_30 ; Different: loop 101 bra aa_char_30 ; Different: loop
107 movff TABLAT, PRODL ; make substitution 102 movff TABLAT, PRODL ; make substitution
108 bra aa_char_30 ; Loop. 103 bra aa_char_30 ; Loop.
109 104
105 ; Make sure char is in the available range
110 aa_char_32: 106 aa_char_32:
111 tblrd*+ ; Read first char 107 tblrd*+ ; Read first char
112 movf TABLAT,W ; get it. 108 movf TABLAT,W ; get it.
113 subwf PRODL,F ; (char - first) --> PRODL 109 subwf PRODL,F ; (char - first) --> PRODL
114 110
115 tblrd*+ ; Read nb chars 111 tblrd*+ ; Read nb chars
116 movf TABLAT,W ; nbchars --> WREG 112 movf TABLAT,W ; nbchars --> WREG
117 tblrd*+ ; Read default char 113 tblrd*+ ; Read default char
118 cpfslt PRODL ; if char > WREG ? 114 cpfslt PRODL ; if char > WREG ?
119 movff TABLAT,PRODL ; replace PRODL 115 movff TABLAT,PRODL ; replace PRODL
120 aa_char_33: 116
117 ; Decode font height and anti-aliasing mode
121 clrf aa_flags,BANKED ; Default to no AA 118 clrf aa_flags,BANKED ; Default to no AA
122 tblrd*+ ; Read font height + AA flag 119 tblrd*+ ; Read font height + AA flag
123 movf TABLAT,W ; into WREG 120 movf TABLAT,W ; into WREG
124 bnn aa_char_34 ; High bit set ? 121 bnn aa_char_34 ; High bit set ?
125 bsf aa_antialias,BANKED ; YES : then the font is AA. 122 bsf aa_antialias,BANKED ; YES : then the font is AA.
126 aa_char_34 123 aa_char_34
127 andlw 0x7F ; Keep just font height, 124 andlw 0x7F ; Keep just font height,
128 movwf aa_height,BANKED ; then save it (its a register) 125 movwf aa_height,BANKED ; then save it (its a register)
129 126
127 ; Set PROM pointer to the char index
130 movf PRODL,W ; Read back char 128 movf PRODL,W ; Read back char
131 mullw 2 ; PROD = 2*(char - base), TBLPTR=idx 129 mullw 2 ; PROD = 2*(char - base), TBLPTR=idx
132 movf PRODL,W 130 movf PRODL,W
133 addwf TBLPTRL,F ; Add into TBLPTR (low byte) 131 addwf TBLPTRL,F ; Add into TBLPTR (low byte)
134 movf PRODH,W 132 movf PRODH,W
135 addwfc TBLPTRH,F ; and high byte. 133 addwfc TBLPTRH,F ; and high byte.
136 134
135 ; Read start and stop pointers
137 tblrd*+ ; aa_start = PROM16(*tblptr++) 136 tblrd*+ ; aa_start = PROM16(*tblptr++)
138 movff TABLAT,aa_start ; Read low byte 137 movff TABLAT,aa_start ; Read low byte
139 tblrd*+ 138 tblrd*+
140 movff TABLAT,aa_start+1 ; and high byte 139 movff TABLAT,aa_start+1 ; and high byte
141 140