diff code_part1/OSTC_code_asm_part1/oled_samsung.asm @ 426:07f5b0baaa57

Adding temperature & ceiling curves * Pink Temperature curve, using fixed scale minTp .. minTp+10.0?C. * Vertical line fill for ceiling. * Dark red coloring when overflowing ceiling, dark green if ok.
author JeanDo
date Sun, 31 Jul 2011 13:27:23 +0200
parents e6e1b89b7c3e
children 05ec97e106da
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/oled_samsung.asm	Sun Jul 31 13:27:20 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/oled_samsung.asm	Sun Jul 31 13:27:23 2011 +0200
@@ -127,12 +127,36 @@
     	bra     PLED_DataWrite_PROD   
 
 ;-----------------------------------------------------------------------------
+; Writes a vertical line of half-pixel at position (win_top,win_leftx2,win_height).
+; Inputs: win_leftx2, win_top, win_height, win_color:2
+; Trashed: WREG, PROD, TABLAT, TBLPTRL
+half_vertical_line:
+        movff   win_leftx2,WREG         ; Init X position.
+        mullw   2
+        rcall   pixel_write_col320      ; Start Address Vertical (.0 - .319)
+
+        clrf    TABLAT                  ; Loop index.
+
+half_vertical_line_loop:
+        movff   win_height,WREG         ; Index reached height (Bank0 read) ?
+        xorwf   TABLAT,W
+        btfsc   STATUS,Z                ; Equals ?
+        return                          ; Yes: done.
+        movff   win_top,WREG            ; Y = top + index (Bank0 read)
+        addwf   TABLAT,W
+        rcall   half_pixel_write_1
+        incf    TABLAT,F                ; index++
+        bra     half_vertical_line_loop
+
+;-----------------------------------------------------------------------------
 ; Writes one half-pixel at position (win_top,win_leftx2).
 ; Inputs: win_leftx2, win_top, win_color:2
 ; Trashed: WREG, PROD
 half_pixel_write:
     	movff  	win_top,WREG            ; d'0' ... d'239'
 
+; Variant with Y position in WREG.
+half_pixel_write_1:
         movff   win_flags,PRODL         ; BEWARE: bank0 bit-test
     	btfsc   PRODL,0                 ; 180° rotation ?
     	sublw   .239                    ; 239-Y --> Y