comparison src/compass_ops.asm @ 264:9dbdb060d44c

Fix compass ruler's missing bottom ticks; Clear between the bearing marker lines and draw a dot.
author janos_kovacs <kovjanos@gmail.com>
date Thu, 26 Mar 2015 14:21:42 +0100
parents 151148e2281f
children 653a3ab08062
comparison
equal deleted inserted replaced
263:5a30b5b9ee4a 264:9dbdb060d44c
854 cpfslt hi,1 854 cpfslt hi,1
855 bra TFT_dive_compass_ruler_loop_zz2 855 bra TFT_dive_compass_ruler_loop_zz2
856 movlw d'79' 856 movlw d'79'
857 cpfsgt lo,1 857 cpfsgt lo,1
858 bra TFT_dive_compass_ruler_loop_zz2 858 bra TFT_dive_compass_ruler_loop_zz2
859 rcall TFT_dive_compass_c_mk 859 rcall TFT_dive_compass_cline ;enough to print cline as bearing marker is not in the ticker area
860 TFT_dive_compass_ruler_loop_zz2: 860 TFT_dive_compass_ruler_loop_zz2:
861 ; 5. set D = RM + 2 : position after the 2px tick 861 ; 5. set D = RM + 2 : position after the 2px tick
862 movff lo,hi 862 movff lo,hi
863 movlw d'2' 863 movlw d'2'
864 addwf hi,1 864 addwf hi,1
878 movwf lo 878 movwf lo
879 ; 10. clear it 879 ; 10. clear it
880 rcall TFT_dive_compass_clr_ruler 880 rcall TFT_dive_compass_clr_ruler
881 881
882 TFT_dive_compass_ruler_lend2: 882 TFT_dive_compass_ruler_lend2:
883 rcall TFT_dive_compass_c_mk
884 ; done with the compass ruler, put the labels on the screen 883 ; done with the compass ruler, put the labels on the screen
885 ; get the RD abck to sub_b 884 ; get the RD abck to sub_b
886 movff xRD+0,sub_b+0 885 movff xRD+0,sub_b+0
887 movff xRD+1,sub_b+1 886 movff xRD+1,sub_b+1
888 ; hi stores the display position 887 ; hi stores the display position
1224 return 1223 return
1225 1224
1226 TFT_dive_compass_mk_print: 1225 TFT_dive_compass_mk_print:
1227 movlw d'1' 1226 movlw d'1'
1228 cpfsgt lo 1227 cpfsgt lo
1229 bra TFT_dive_compass_mk_print_2 ; lo<1, skip the first line 1228 bra TFT_dive_compass_mk_print_2 ; lo<=1, skip the first line
1230 movlw d'2' 1229 movlw d'2'
1231 subwf lo,0 1230 subwf lo,0
1232 ; movff WREG,win_leftx2 1231 ; movff WREG,win_leftx2
1233 rcall TFT_dive_compass_mk_print_3 1232 rcall TFT_dive_compass_mk_print_3
1234 TFT_dive_compass_mk_print_2: 1233 TFT_dive_compass_mk_print_2:
1234 ; save hi/lo
1235 movff hi,divA+1
1236 movff lo,divA+0
1237 ; clear the middle of hte bearing marker
1238 movff lo,hi
1239 movlw d'2'
1240 addwf lo,1
1241 rcall TFT_dive_compass_clr_label
1242 ; restore hi/lo
1243 movff divA+1,hi
1244 movff divA+0,lo
1245 ; print a dot on the middle
1246 movff lo,WREG
1247 rcall TFT_dive_compass_mk_print_dot
1248 ; finally print the right marker line
1235 movlw d'2' 1249 movlw d'2'
1236 addwf lo,0 1250 addwf lo,0
1237 ; rcall TFT_dive_compass_mk_print_3 1251 ; rcall TFT_dive_compass_mk_print_3
1238 ; return 1252 ; return
1239 TFT_dive_compass_mk_print_3: 1253 TFT_dive_compass_mk_print_3:
1240 movff WREG,win_leftx2 1254 movff WREG,win_leftx2
1241 movlw dive_compass_label_row 1255 movlw dive_compass_label_row
1242 movff WREG,win_top 1256 movff WREG,win_top
1243 movlw dive_compass_label_height-.2 1257 movlw dive_compass_label_height-.2
1244 movff WREG,win_height 1258 movff WREG,win_height
1259 bra TFT_dive_compass_mk_print_4
1260 TFT_dive_compass_mk_print_dot:
1261 movff WREG,win_leftx2
1262 movlw dive_compass_label_row + .9
1263 movff WREG,win_top
1264 movlw d'4'
1265 movff WREG,win_height
1266 TFT_dive_compass_mk_print_4:
1245 movlw d'2' 1267 movlw d'2'
1246 movff WREG,win_width 1268 movff WREG,win_width
1247 movlw d'2'
1248 movff WREG,win_bargraph 1269 movff WREG,win_bargraph
1249 movlw color_green 1270 movlw color_green
1250 btfss print_compass_label 1271 btfss print_compass_label
1251 movlw color_red 1272 movlw color_red
1252 call TFT_set_color 1273 call TFT_set_color
1296 movff WREG,win_top 1317 movff WREG,win_top
1297 movlw dive_compass_tick_height 1318 movlw dive_compass_tick_height
1298 movff WREG,win_height 1319 movff WREG,win_height
1299 movlw d'2' 1320 movlw d'2'
1300 movff WREG,win_width 1321 movff WREG,win_width
1301 movlw d'2'
1302 movff WREG,win_bargraph 1322 movff WREG,win_bargraph
1303 movff lo,win_leftx2 ; 0..159 1323 movff lo,win_leftx2 ; 0..159
1304 call TFT_standard_color 1324 call TFT_standard_color
1305 call TFT_box 1325 call TFT_box
1306 movlw dive_compass_tick_bot_top 1326 movlw dive_compass_tick_bot_top
1307 movff WREG,win_top 1327 movff WREG,win_top
1308 movlw dive_compass_tick_height 1328 movlw dive_compass_tick_height
1309 movff WREG,win_height 1329 movff WREG,win_height
1330 call TFT_standard_color ; color in WREG is trashed, must be set again!
1310 call TFT_box 1331 call TFT_box
1311 return 1332 return
1312 1333
1313 TFT_dive_compass_cline: 1334 TFT_dive_compass_cline:
1314 movlw color_yellow 1335 movlw color_yellow