comparison code_part1/OSTC_code_asm_part1/aa_wordprocessor.asm @ 96:25433449bcb5

adding anti-aliased fonts!
author heinrichsweikamp
date Sat, 11 Dec 2010 19:13:26 +0100
parents d79bf9df55d7
children 14a074e1a375
comparison
equal deleted inserted replaced
95:d79bf9df55d7 96:25433449bcb5
279 ; Inputs : win_top, win_leftx2, aa_height, aa_width. 279 ; Inputs : win_top, win_leftx2, aa_height, aa_width.
280 ; Output : PortD commands. 280 ; Output : PortD commands.
281 ; Trashed: PROD 281 ; Trashed: PROD
282 ; 282 ;
283 aa_box_cmd: 283 aa_box_cmd:
284 AA_CMD_WRITE 0x35 ; this is the left border
285 movf win_leftx2,W,BANKED ; Compute left = 2*leftx2 284 movf win_leftx2,W,BANKED ; Compute left = 2*leftx2
286 mullw 2 285 mullw 2
286 AA_CMD_WRITE 0x35 ; this is the left border
287 AA_DATA_WRITE_PROD 287 AA_DATA_WRITE_PROD
288 288
289 movf aa_width,W,BANKED ; right = left + width - 1 289 movf aa_width,W,BANKED ; right = left + width - 1
290 addwf PRODL,F,A 290 addwf PRODL,F,A
291 movf aa_width+1,W,BANKED 291 movf aa_width+1,W,BANKED
292 addwfc PRODH,F,A 292 addwfc PRODH,F,A
293 AA_CMD_WRITE 0x36 ; Write and the right border
294 decf PRODL,F,A ; decrement result 293 decf PRODL,F,A ; decrement result
295 bc aa_box_cmd_1 ; No borrow (/Carry) ? skip propagating. 294 bc aa_box_cmd_1 ; No borrow (/Carry) ? skip propagating.
296 decf PRODH,F,A 295 decf PRODH,F,A
297 aa_box_cmd_1: 296 aa_box_cmd_1:
297 AA_CMD_WRITE 0x36 ; Write and the right border
298 AA_DATA_WRITE_PROD 298 AA_DATA_WRITE_PROD
299 299
300 movf win_top,W,BANKED ; Write top / bottom window 300 movf win_top,W,BANKED ; Write top / bottom window
301 movwf PRODH,A ; (remember PRODH output first) 301 movwf PRODH,A ; (remember PRODH output first)
302 addwf aa_height,W,BANKED 302 addwf aa_height,W,BANKED
303 decf WREG,A 303 decf WREG,A
304 movwf PRODL,A ; And PRODL is later... 304 movwf PRODL,A ; And PRODL is later...
305 AA_CMD_WRITE 0x37 305 AA_CMD_WRITE 0x37
306 nop 306 AA_DATA_WRITE_PROD
307 nop 307
308 AA_DATA_WRITE_PROD 308 movf win_top,W,BANKED ; Start ptr top
309 309 mullw 1 ; Load into PRODH:L
310 AA_CMD_WRITE 0x20 310 AA_CMD_WRITE 0x20
311 AA_DATA_WRITE_PROD
312
311 movf win_leftx2,W,BANKED ; Start ptr left 313 movf win_leftx2,W,BANKED ; Start ptr left
312 mullw 2 314 mullw 2
313 AA_DATA_WRITE_PROD
314
315 AA_CMD_WRITE 0x21 315 AA_CMD_WRITE 0x21
316 movf win_top,W,BANKED ; Start ptr top
317 mullw 1 ; Load into PRODH:L
318 AA_DATA_WRITE_PROD 316 AA_DATA_WRITE_PROD
319 317
320 return 318 return
321 319
322 ;------------------------------------------------------------------------------ 320 ;------------------------------------------------------------------------------
441 439
442 ;---- BYTE-CODE LOOP --------------------------------------------- 440 ;---- BYTE-CODE LOOP ---------------------------------------------
443 ; Are we done ? 441 ; Are we done ?
444 movf TBLPTRL,W,A ; Compare TBLPTR to aa_end 442 movf TBLPTRL,W,A ; Compare TBLPTR to aa_end
445 cpfseq aa_end,BANKED 443 cpfseq aa_end,BANKED
446 bra aa_decode_1 ; Loop if LOW is different 444 bra aa_decode_1 ; Loop if LOW is different
447 movf TBLPTRH,W,A 445 movf TBLPTRH,W,A
448 cpfseq aa_end+1,BANKED ; Loop to if HIGH is different 446 cpfseq aa_end+1,BANKED ; Loop to if HIGH is different
449 bra aa_decode_1 447 bra aa_decode_1
450 448
451 return 449 return