Mercurial > public > hwos_code
comparison src/color_processor.asm @ 608:d866684249bd
work on 2.99 stable
author | heinrichsweikamp |
---|---|
date | Mon, 07 Jan 2019 21:13:43 +0100 |
parents | ca4556fb60b9 |
children | c40025d8e750 |
comparison
equal
deleted
inserted
replaced
607:c5151a490d88 | 608:d866684249bd |
---|---|
127 subwfb img_pixels+2,F | 127 subwfb img_pixels+2,F |
128 | 128 |
129 infsnz img_count+0 ; Increment count | 129 infsnz img_count+0 ; Increment count |
130 incf img_count+1 | 130 incf img_count+1 |
131 | 131 |
132 ; Loop sending pixel color | 132 ; Loop sending pixel color |
133 incf img_count+1 ; Because we decrement first, should add one here ! | 133 incf img_count+1 ; Because we decrement first, should add one here ! |
134 bsf tft_rs,0 ; RS_H Data | 134 bsf tft_rs,0 ; RS_H ; Data |
135 movff PRODH,PORTA ; Move high byte to PORTA | 135 bcf INTCON,GIE |
136 movff PRODL,PORTH ; Move low byte to PORTH | 136 |
137 bcf INTCON,GIE | 137 color_image_loop_pixel: |
138 color_image_loop_pixel: | 138 btfsc screen_type2 ; Display 2? |
139 bcf tft_nwr,0 ; WR_L | 139 bra color_image_display2 ; Yes |
140 bsf tft_nwr,0 ; WR_H Tick | 140 |
141 decfsz img_count+0 | 141 movff PRODH,PORTA ; Move high byte to PORTA |
142 bra color_image_loop_pixel | 142 movff PRODL,PORTH ; Move low byte to PORTH |
143 decfsz img_count+1 | 143 bcf tft_nwr |
144 bra color_image_loop_pixel | 144 bsf tft_nwr |
145 bsf INTCON,GIE | 145 decfsz img_count+0 |
146 | 146 bra color_image_loop_pixel |
147 ; And count (on a 24bit counter) | 147 decfsz img_count+1 |
148 clrf WREG ; Make a 24bit decrement | 148 bra color_image_loop_pixel |
149 decf img_pixels+0 | 149 bra color_image_loop_pixel2 |
150 subwfb img_pixels+1,F | 150 |
151 subwfb img_pixels+2,F | 151 color_image_display2: |
152 | 152 extern convert_for_display2 |
153 bnn color_image_loop_xy ; Not finished ? loop... | 153 call convert_for_display2 ; Convert 16Bit RGB b'RRRRRGGG GGGBBBBB' into 24Bit RGB b'RRRRRR00 GGGGGG00 BBBBBB00' |
154 | 154 color_image_display2_loop: |
155 ;---- Closeup -------------------------------------------------------- | 155 movff win_color5,PORTH ; Move high byte to PORTH (DISPLAY is bigendian) |
156 Index_out 0x00 | 156 bcf tft_nwr |
157 return | 157 bsf tft_nwr |
158 movff win_color4,PORTH ; Move low byte to PORTH | |
159 bcf tft_nwr | |
160 bsf tft_nwr | |
161 movff win_color3,PORTH ; Move low(est) byte to PORTH | |
162 bcf tft_nwr | |
163 bsf tft_nwr | |
164 decfsz img_count+0 | |
165 bra color_image_display2_loop | |
166 decfsz img_count+1 | |
167 bra color_image_display2_loop | |
168 | |
169 color_image_loop_pixel2: | |
170 bsf INTCON,GIE | |
171 ; And count (on a 24bit counter) | |
172 clrf WREG ; Make a 24bit decrement. | |
173 decf img_pixels+0 | |
174 subwfb img_pixels+1,F | |
175 subwfb img_pixels+2,F | |
176 | |
177 bnn color_image_loop_xy ; Not finished ? loop... | |
178 | |
179 ;---- Closeup -------------------------------------------------------- | |
180 ; Index_out 0x00 | |
181 return | |
158 | 182 |
159 | 183 |
160 global get_colors | 184 global get_colors |
161 get_colors: | 185 get_colors: |
162 tblrd*+ ; read number of image colors | 186 tblrd*+ ; read number of image colors |