comparison src/compass_ops.asm @ 300:5ad479f2a868

Merged Screen layout mod #1 into Screen layout work #3
author Janos Kovacs <kovjanos@gmail.com>
date Sun, 31 May 2015 21:24:16 +0200
parents 7d9edd3b8c86
children 508d7fb98b34
comparison
equal deleted inserted replaced
299:6c4800af27ac 300:5ad479f2a868
395 STRCPY_TEXT_PRINT tHeading ; Heading: 395 STRCPY_TEXT_PRINT tHeading ; Heading:
396 return 396 return
397 397
398 global TFT_dive_compass_mask 398 global TFT_dive_compass_mask
399 TFT_dive_compass_mask: 399 TFT_dive_compass_mask:
400 WIN_FRAME_STD dive_compass_graph_row, dive_compass_graph_row+dive_compass_graph_height, .0, .159 400 WIN_FRAME_STD dm_custom_compass_graph_row, dm_custom_compass_graph_row+dm_custom_compass_graph_height, .0, .159
401 return 401 return
402 402
403 global TFT_surface_compass_heading 403 global TFT_surface_compass_heading
404 TFT_surface_compass_heading: 404 TFT_surface_compass_heading:
405 rcall compass_heading_common 405 rcall compass_heading_common
1083 movlw color_green 1083 movlw color_green
1084 call TFT_set_color 1084 call TFT_set_color
1085 btfsc compass_bearing_lft 1085 btfsc compass_bearing_lft
1086 bra TFT_dive_compass_dir_ldir ; bearing_lft=1, print the left marker 1086 bra TFT_dive_compass_dir_ldir ; bearing_lft=1, print the left marker
1087 ;TFT_dive_compass_text_rdir: 1087 ;TFT_dive_compass_text_rdir:
1088 WIN_SMALL dive_compass_rdir_column,dive_compass_head_row 1088 WIN_SMALL dm_custom_compass_rdir_column, dm_custom_compass_head_row
1089 STRCPY_PRINT ">>" 1089 STRCPY_PRINT ">>"
1090 ; do not forget to clear the left 1090 ; do not forget to clear the left
1091 rcall TFT_dive_compass_dir_lclr 1091 rcall TFT_dive_compass_dir_lclr
1092 bra TFT_dive_compass_text 1092 bra TFT_dive_compass_text
1093 1093
1094 TFT_dive_compass_dir_ldir: 1094 TFT_dive_compass_dir_ldir:
1095 WIN_SMALL dive_compass_ldir_column,dive_compass_head_row 1095 WIN_SMALL dm_custom_compass_ldir_column, dm_custom_compass_head_row
1096 STRCPY_PRINT "<<" 1096 STRCPY_PRINT "<<"
1097 ; do not forget to clear the right 1097 ; do not forget to clear the right
1098 rcall TFT_dive_compass_dir_rclr 1098 rcall TFT_dive_compass_dir_rclr
1099 ;bra TFT_dive_compass_text 1099 ;bra TFT_dive_compass_text
1100 1100
1101 TFT_dive_compass_text: 1101 TFT_dive_compass_text:
1102 ; Text output 1102 ; Text output
1103 call TFT_standard_color 1103 call TFT_standard_color
1104 WIN_SMALL dive_compass_head_column,dive_compass_head_row 1104 WIN_SMALL dm_custom_compass_head_column, dm_custom_compass_head_row
1105 rcall TFT_surface_compass_heading_com ; Show "000° N" 1105 rcall TFT_surface_compass_heading_com ; Show "000° N"
1106 return 1106 return
1107 1107
1108 TFT_dive_compass_dir_lclr: 1108 TFT_dive_compass_dir_lclr:
1109 WIN_SMALL dive_compass_ldir_column,dive_compass_head_row 1109 WIN_SMALL dm_custom_compass_ldir_column, dm_custom_compass_head_row
1110 STRCPY_PRINT " " 1110 STRCPY_PRINT " "
1111 return 1111 return
1112 1112
1113 TFT_dive_compass_dir_rclr: 1113 TFT_dive_compass_dir_rclr:
1114 WIN_SMALL dive_compass_rdir_column,dive_compass_head_row 1114 WIN_SMALL dm_custom_compass_rdir_column, dm_custom_compass_head_row
1115 STRCPY_PRINT " " 1115 STRCPY_PRINT " "
1116 return 1116 return
1117 1117
1118 TFT_dive_compass_label_proc: 1118 TFT_dive_compass_label_proc:
1119 ; Input: 1119 ; Input:
1161 TFT_dive_compass_label_proc_p: 1161 TFT_dive_compass_label_proc_p:
1162 ; 4. print the SQ on the screen 1162 ; 4. print the SQ on the screen
1163 call TFT_standard_color 1163 call TFT_standard_color
1164 bsf print_compass_label 1164 bsf print_compass_label
1165 ;TFT_dive_compass_label_print: 1165 ;TFT_dive_compass_label_print:
1166 movlw dive_compass_label_row 1166 movlw dm_custom_compass_label_row
1167 movff WREG,win_top 1167 movff WREG,win_top
1168 movff lo,win_leftx2 1168 movff lo,win_leftx2
1169 movlw FT_SMALL 1169 movlw FT_SMALL
1170 movff WREG,win_font 1170 movff WREG,win_font
1171 ; 6. retain the new display positions 1171 ; 6. retain the new display positions
1250 addwf lo,0 1250 addwf lo,0
1251 ; rcall TFT_dive_compass_mk_print_3 1251 ; rcall TFT_dive_compass_mk_print_3
1252 ; return 1252 ; return
1253 TFT_dive_compass_mk_print_3: 1253 TFT_dive_compass_mk_print_3:
1254 movff WREG,win_leftx2 1254 movff WREG,win_leftx2
1255 movlw dive_compass_label_row 1255 movlw dm_custom_compass_label_row
1256 movff WREG,win_top 1256 movff WREG,win_top
1257 movlw dive_compass_label_height-.2 1257 movlw dm_custom_compass_label_height-.2
1258 movff WREG,win_height 1258 movff WREG,win_height
1259 bra TFT_dive_compass_mk_print_4 1259 bra TFT_dive_compass_mk_print_4
1260 TFT_dive_compass_mk_print_dot: 1260 TFT_dive_compass_mk_print_dot:
1261 movff WREG,win_leftx2 1261 movff WREG,win_leftx2
1262 movlw dive_compass_label_row + .9 1262 movlw dm_custom_compass_label_row + .9
1263 movff WREG,win_top 1263 movff WREG,win_top
1264 movlw d'4' 1264 movlw d'4'
1265 movff WREG,win_height 1265 movff WREG,win_height
1266 TFT_dive_compass_mk_print_4: 1266 TFT_dive_compass_mk_print_4:
1267 movlw d'2' 1267 movlw d'2'
1273 call TFT_set_color 1273 call TFT_set_color
1274 call TFT_box 1274 call TFT_box
1275 return 1275 return
1276 1276
1277 TFT_dive_compass_clr_label: 1277 TFT_dive_compass_clr_label:
1278 movlw dive_compass_label_row-.2 ; set top & height 1278 movlw dm_custom_compass_label_row-.2 ; set top & height
1279 movff WREG,win_top 1279 movff WREG,win_top
1280 movlw dive_compass_label_height+.2 1280 movlw dm_custom_compass_label_height+.2
1281 movff WREG,win_height 1281 movff WREG,win_height
1282 rcall TFT_dive_compass_clear 1282 rcall TFT_dive_compass_clear
1283 return 1283 return
1284 1284
1285 TFT_dive_compass_clr_ruler: 1285 TFT_dive_compass_clr_ruler:
1286 ; top tick 1286 ; top tick
1287 movlw dive_compass_tick_top_top ; set top & height 1287 movlw dm_custom_compass_tick_top_top ; set top & height
1288 movff WREG,win_top 1288 movff WREG,win_top
1289 movlw dive_compass_tick_height 1289 movlw dm_custom_compass_tick_height
1290 movff WREG,win_height 1290 movff WREG,win_height
1291 rcall TFT_dive_compass_clear 1291 rcall TFT_dive_compass_clear
1292 ;bottom tick 1292 ;bottom tick
1293 movlw dive_compass_tick_bot_top ; set top & height 1293 movlw dm_custom_compass_tick_bot_top ; set top & height
1294 movff WREG,win_top 1294 movff WREG,win_top
1295 movlw dive_compass_tick_height 1295 movlw dm_custom_compass_tick_height
1296 movff WREG,win_height 1296 movff WREG,win_height
1297 ; rcall TFT_dive_compass_clear 1297 ; rcall TFT_dive_compass_clear
1298 ; return 1298 ; return
1299 TFT_dive_compass_clear: 1299 TFT_dive_compass_clear:
1300 ; we receive RM in lo and DD in hi 1300 ; we receive RM in lo and DD in hi
1311 call TFT_box 1311 call TFT_box
1312 return 1312 return
1313 1313
1314 TFT_dive_compass_ruler_print: 1314 TFT_dive_compass_ruler_print:
1315 ; we receive RM in lo and DD in hi 1315 ; we receive RM in lo and DD in hi
1316 movlw dive_compass_tick_top_top 1316 movlw dm_custom_compass_tick_top_top
1317 movff WREG,win_top 1317 movff WREG,win_top
1318 movlw dive_compass_tick_height 1318 movlw dm_custom_compass_tick_height
1319 movff WREG,win_height 1319 movff WREG,win_height
1320 movlw d'2' 1320 movlw d'2'
1321 movff WREG,win_width 1321 movff WREG,win_width
1322 movff WREG,win_bargraph 1322 movff WREG,win_bargraph
1323 movff lo,win_leftx2 ; 0..159 1323 movff lo,win_leftx2 ; 0..159
1324 call TFT_standard_color 1324 call TFT_standard_color
1325 call TFT_box 1325 call TFT_box
1326 movlw dive_compass_tick_bot_top 1326 movlw dm_custom_compass_tick_bot_top
1327 movff WREG,win_top 1327 movff WREG,win_top
1328 movlw dive_compass_tick_height 1328 movlw dm_custom_compass_tick_height
1329 movff WREG,win_height 1329 movff WREG,win_height
1330 call TFT_standard_color ; color in WREG is trashed, must be set again! 1330 call TFT_standard_color ; color in WREG is trashed, must be set again!
1331 call TFT_box 1331 call TFT_box
1332 return 1332 return
1333 1333
1334 TFT_dive_compass_cline: 1334 TFT_dive_compass_cline:
1335 movlw color_yellow 1335 movlw color_yellow
1336 WIN_BOX_COLOR dive_compass_tick_top_top,dive_compass_tick_bot_bot,.80,.81 1336 WIN_BOX_COLOR dm_custom_compass_tick_top_top, dm_custom_compass_tick_bot_bot,.80,.81
1337 return 1337 return
1338 1338
1339 tft_compass_cardinal: 1339 tft_compass_cardinal:
1340 btfsc hi,0 ; Heading >255°? 1340 btfsc hi,0 ; Heading >255°?
1341 bra tft_compass_cardinal2 ; Yes must be W, NW or N 1341 bra tft_compass_cardinal2 ; Yes must be W, NW or N