Mercurial > public > mk2
comparison code_part1/OSTC_code_asm_part1/aa_wordprocessor.asm @ 95:d79bf9df55d7
aa_wordprocessor too fast ?
author | JeanDo |
---|---|
date | Sat, 11 Dec 2010 16:23:43 +0100 |
parents | 3bcccb697bce |
children | 25433449bcb5 |
comparison
equal
deleted
inserted
replaced
94:ce3283064cde | 95:d79bf9df55d7 |
---|---|
1 ;============================================================================= | 1 ;============================================================================= |
2 ; | 2 ; |
3 ; file aa_wordprocessor.asm | 3 ; File aa_wordprocessor.asm |
4 ; brief Anti-aliased word processor | 4 ; |
5 ; author JD Gascuel. | 5 ; Anti-aliased word processor |
6 ; | 6 ; |
7 ; copyright (c) 2010, JD Gascuel. All rights reserved. | 7 ; This program is free software: you can redistribute it and/or modify |
8 ; $Id: aa_wordprocessor.asm 72 2010-11-29 22:45:12Z gascuel $ | 8 ; it under the terms of the GNU General Public License as published by |
9 ; the Free Software Foundation, either version 3 of the License, or | |
10 ; (at your option) any later version. | |
11 ; | |
12 ; This program is distributed in the hope that it will be useful, | |
13 ; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 ; GNU General Public License for more details. | |
16 ; | |
17 ; You should have received a copy of the GNU General Public License | |
18 ; along with this program. If not, see <http://www.gnu.org/licenses/>. | |
19 ; | |
20 ; Copyright (c) 2010, JD Gascuel. | |
9 ;============================================================================= | 21 ;============================================================================= |
10 ; HISTORY | 22 ; HISTORY |
11 ; 2010-11-22 : [jDG] Creation. | 23 ; 2010-11-22 : [jDG] Creation. |
12 ; | 24 ; 2010-12-01 : [jDG] Adding 3bits antialiased fonts. |
13 ; BUGS : None known yet... | 25 ; |
26 ; BUGS : | |
27 ; * If the three fonts are not in the same half of the PROM memory, TBLPTRU | |
28 ; will be badly set, and font48 or font90 will display giberish... | |
14 ;============================================================================= | 29 ;============================================================================= |
15 ; | 30 ; |
16 ; MEMORY FOOTPRINT: | 31 ; MEMORY FOOTPRINT: |
17 ;------------------ | 32 ;------------------ |
18 ; | 33 ; |
264 ; Inputs : win_top, win_leftx2, aa_height, aa_width. | 279 ; Inputs : win_top, win_leftx2, aa_height, aa_width. |
265 ; Output : PortD commands. | 280 ; Output : PortD commands. |
266 ; Trashed: PROD | 281 ; Trashed: PROD |
267 ; | 282 ; |
268 aa_box_cmd: | 283 aa_box_cmd: |
284 AA_CMD_WRITE 0x35 ; this is the left border | |
269 movf win_leftx2,W,BANKED ; Compute left = 2*leftx2 | 285 movf win_leftx2,W,BANKED ; Compute left = 2*leftx2 |
270 mullw 2 | 286 mullw 2 |
271 AA_CMD_WRITE 0x35 ; this is the left border | |
272 AA_DATA_WRITE_PROD | 287 AA_DATA_WRITE_PROD |
273 | 288 |
274 movf aa_width,W,BANKED ; right = left + width - 1 | 289 movf aa_width,W,BANKED ; right = left + width - 1 |
275 addwf PRODL,F,A | 290 addwf PRODL,F,A |
276 movf aa_width+1,W,BANKED | 291 movf aa_width+1,W,BANKED |
277 addwfc PRODH,F,A | 292 addwfc PRODH,F,A |
293 AA_CMD_WRITE 0x36 ; Write and the right border | |
278 decf PRODL,F,A ; decrement result | 294 decf PRODL,F,A ; decrement result |
279 bc aa_box_cmd_1 ; No borrow (/Carry) ? skip propagating. | 295 bc aa_box_cmd_1 ; No borrow (/Carry) ? skip propagating. |
280 decf PRODH,F,A | 296 decf PRODH,F,A |
281 aa_box_cmd_1: | 297 aa_box_cmd_1: |
282 | |
283 AA_CMD_WRITE 0x36 ; Write and the right border | |
284 AA_DATA_WRITE_PROD | 298 AA_DATA_WRITE_PROD |
285 | 299 |
286 movf win_top,W,BANKED ; Write top / bottom window | 300 movf win_top,W,BANKED ; Write top / bottom window |
287 movwf PRODH,A ; (remember PRODH output first) | 301 movwf PRODH,A ; (remember PRODH output first) |
288 addwf aa_height,W,BANKED | 302 addwf aa_height,W,BANKED |
289 decf WREG,A | 303 decf WREG,A |
290 movwf PRODL,A ; And PRODL is later... | 304 movwf PRODL,A ; And PRODL is later... |
291 AA_CMD_WRITE 0x37 | 305 AA_CMD_WRITE 0x37 |
292 AA_DATA_WRITE_PROD | 306 nop |
293 | 307 nop |
308 AA_DATA_WRITE_PROD | |
309 | |
310 AA_CMD_WRITE 0x20 | |
294 movf win_leftx2,W,BANKED ; Start ptr left | 311 movf win_leftx2,W,BANKED ; Start ptr left |
295 mullw 2 | 312 mullw 2 |
296 AA_CMD_WRITE 0x20 | 313 AA_DATA_WRITE_PROD |
297 AA_DATA_WRITE_PROD | 314 |
298 | 315 AA_CMD_WRITE 0x21 |
299 movf win_top,W,BANKED ; Start ptr top | 316 movf win_top,W,BANKED ; Start ptr top |
300 mullw 1 ; Load into PRODH:L | 317 mullw 1 ; Load into PRODH:L |
301 AA_CMD_WRITE 0x21 | |
302 AA_DATA_WRITE_PROD | 318 AA_DATA_WRITE_PROD |
303 | 319 |
304 return | 320 return |
305 | 321 |
306 ;------------------------------------------------------------------------------ | 322 ;------------------------------------------------------------------------------ |