Mercurial > public > mk2
comparison code_part1/OSTC_code_asm_part1/aa_wordprocessor.asm @ 681:6e456a6398e0
Hardware4 support
author | heinrichsweikamp |
---|---|
date | Fri, 25 Jan 2013 18:00:49 +0100 |
parents | bde83cac971f |
children | 55983c4d6b2d |
comparison
equal
deleted
inserted
replaced
680:c6220d340684 | 681:6e456a6398e0 |
---|---|
330 | 330 |
331 btfss aa_color_half,ACCESS | 331 btfss aa_color_half,ACCESS |
332 bra aa_decode_12 | 332 bra aa_decode_12 |
333 | 333 |
334 movff aa_temp+0,PRODH ; Add color/2 if bit set. | 334 movff aa_temp+0,PRODH ; Add color/2 if bit set. |
335 movff aa_temp+1,PRODL ; OLED is big endian, so swap here. | 335 movff aa_temp+1,PRODL ; DISPLAY is big endian, so swap here. |
336 aa_decode_12: | 336 aa_decode_12: |
337 btfss aa_color_quart,ACCESS | 337 btfss aa_color_quart,ACCESS |
338 bra aa_decode_3 | 338 bra aa_decode_3 |
339 | 339 |
340 ; Divide it once again by 2. Max red = 7/31. | 340 ; Divide it once again by 2. Max red = 7/31. |
358 xorlw 0x80 ; YES: invert levels. | 358 xorlw 0x80 ; YES: invert levels. |
359 bn aa_decode_2 ; Then test high bit. | 359 bn aa_decode_2 ; Then test high bit. |
360 | 360 |
361 ; WHITE pixel (ie. full color) | 361 ; WHITE pixel (ie. full color) |
362 movff win_color1,PRODH ; current draw color | 362 movff win_color1,PRODH ; current draw color |
363 movff win_color2,PRODL ; (rem: OLED is big endian) | 363 movff win_color2,PRODL ; (rem: DISPLAY is big endian) |
364 setf win_color3 | |
364 bra aa_decode_3 | 365 bra aa_decode_3 |
365 | 366 |
366 aa_decode_2: | 367 aa_decode_2: |
367 clrf PRODH,A ; BLACK pixel | 368 clrf PRODH,A ; BLACK pixel |
368 clrf PRODL,A | 369 clrf PRODL,A |
370 clrf win_color3 | |
369 | 371 |
370 aa_decode_3: | 372 aa_decode_3: |
371 ;---- PIXEL WRITE LOOP ----------------------------------------------- | 373 ;---- PIXEL WRITE LOOP ----------------------------------------------- |
372 AA_DATA_WRITE_PROD | 374 AA_DATA_WRITE_PROD |
373 decf aa_bitlen,F,ACCESS | 375 decf aa_bitlen,F,ACCESS |
385 return | 387 return |
386 | 388 |
387 ;------------------------------------------------------------------------------ | 389 ;------------------------------------------------------------------------------ |
388 ; Setup pointers for a char: | 390 ; Setup pointers for a char: |
389 ; Inputs : letter : string to print (SHOULD BE NULL TERMINATED) | 391 ; Inputs : letter : string to print (SHOULD BE NULL TERMINATED) |
390 ; Output : OLED commands on port D + clocks. | 392 ; Output : DISPLAY commands on port D + clocks. |
391 ; | 393 ; |
392 global aa_wordprocessor ; Callable from C-code. | 394 global aa_wordprocessor ; Callable from C-code. |
393 aa_wordprocessor: | 395 aa_wordprocessor: |
394 ; Make sure context is well known | 396 ; Make sure context is well known |
395 movlb HIGH win_top ; Switch to bank 0... | 397 movlb HIGH win_top ; Switch to bank 0... |
396 | 398 |
397 rcall aa_string_width ; Set win_height, compute win_width | 399 rcall aa_string_width ; Set win_height, compute win_width |
398 rcall PLED_box_write ; Use that for the box. | 400 call DISP_box_write ; Use that for the box. |
399 | 401 |
400 ; Restart the loop for each char to print | 402 ; Restart the loop for each char to print |
401 lfsr FSR2, letter ; FSR2 pointer to start of string. | 403 lfsr FSR2, letter ; FSR2 pointer to start of string. |
402 | 404 |
403 ; DATA bloc commande: | 405 ; DATA bloc commande: |