Mercurial > public > mk2
comparison code_part1/OSTC_code_asm_part1/display_lowlevel.asm @ 706:d68c6a6b1f38
aa fonts processor
author | heinrichsweikamp |
---|---|
date | Tue, 16 Apr 2013 15:40:27 +0200 |
parents | 55983c4d6b2d |
children | 2129862bbfe6 |
comparison
equal
deleted
inserted
replaced
705:55983c4d6b2d | 706:d68c6a6b1f38 |
---|---|
231 rcall DISP_DataWrite | 231 rcall DISP_DataWrite |
232 | 232 |
233 movlw 0x22 ; Start Writing Data to GRAM | 233 movlw 0x22 ; Start Writing Data to GRAM |
234 rcall DISP_CmdWrite | 234 rcall DISP_CmdWrite |
235 bsf DISPLAY_rs ; Data! | 235 bsf DISPLAY_rs ; Data! |
236 movff win_color1, PORTD | 236 movff win_color4, PORTD |
237 bcf DISPLAY_rw | 237 bcf DISPLAY_rw |
238 bsf DISPLAY_rw ; Upper | 238 bsf DISPLAY_rw ; Upper |
239 movff win_color2, PORTD | 239 movff win_color5, PORTD |
240 bcf DISPLAY_rw | 240 bcf DISPLAY_rw |
241 bsf DISPLAY_rw ; High | 241 bsf DISPLAY_rw ; High |
242 movff win_color3, PORTD | 242 movff win_color6, PORTD |
243 bcf DISPLAY_rw | 243 bcf DISPLAY_rw |
244 bsf DISPLAY_rw ; Lower | 244 bsf DISPLAY_rw ; Lower |
245 return | 245 return |
246 | 246 |
247 | 247 |
525 | 525 |
526 DISP_box2: ; Loop height times | 526 DISP_box2: ; Loop height times |
527 movff win_height,PRODL | 527 movff win_height,PRODL |
528 | 528 |
529 DISP_box3: ; loop width times | 529 DISP_box3: ; loop width times |
530 movff win_flags,WREG ; Display1? win_flags is in bank0... | |
531 btfsc WREG,1 ; Display1? | |
532 bra DISP_box3aa ; Yes | |
533 | |
530 movff win_color1,PORTD | 534 movff win_color1,PORTD |
531 bcf DISPLAY_rw | 535 bcf DISPLAY_rw |
532 bsf DISPLAY_rw ; Upper | 536 bsf DISPLAY_rw ; Upper |
533 movff win_color2,PORTD | 537 movff win_color2,PORTD |
538 bra DISP_box3a ; Done. | |
539 DISP_box3aa: | |
540 movff win_color4,PORTD | |
541 bcf DISPLAY_rw | |
542 bsf DISPLAY_rw ; Upper | |
543 movff win_color5,PORTD | |
534 bcf DISPLAY_rw | 544 bcf DISPLAY_rw |
535 bsf DISPLAY_rw ; Lower/High | 545 bsf DISPLAY_rw ; Lower/High |
536 movff win_flags,WREG ; Display1? win_flags is in bank0... | 546 movff win_color6,PORTD |
537 btfss WREG,1 ; Display1? | |
538 bra DISP_box3a ; No | |
539 movff win_color3,PORTD | |
540 bcf DISPLAY_rw | |
541 bsf DISPLAY_rw ; Lower | |
542 | 547 |
543 DISP_box3a: | 548 DISP_box3a: |
549 bcf DISPLAY_rw | |
550 bsf DISPLAY_rw ; Lower/High | |
551 | |
552 movff win_flags,WREG ; Display1? win_flags is in bank0... | |
553 btfsc WREG,1 ; Display1? | |
554 bra DISP_box3ab ; Yes | |
555 | |
544 movff win_color1,PORTD | 556 movff win_color1,PORTD |
545 bcf DISPLAY_rw | 557 bcf DISPLAY_rw |
546 bsf DISPLAY_rw ; Upper | 558 bsf DISPLAY_rw ; Upper |
547 movff win_color2,PORTD | 559 movff win_color2,PORTD |
548 bcf DISPLAY_rw | 560 bra DISP_box3b |
549 bsf DISPLAY_rw ; Lower/High | 561 |
550 movff win_flags,WREG ; Display1? win_flags is in bank0... | 562 DISP_box3ab: |
551 btfss WREG,1 ; Display1? | 563 movff win_color4,PORTD |
552 bra DISP_box3b ; No | 564 bcf DISPLAY_rw |
553 movff win_color3,PORTD | 565 bsf DISPLAY_rw ; Upper |
566 movff win_color5,PORTD | |
567 bcf DISPLAY_rw | |
568 bsf DISPLAY_rw ; High | |
569 movff win_color6,PORTD | |
570 | |
571 DISP_box3b: | |
554 bcf DISPLAY_rw | 572 bcf DISPLAY_rw |
555 bsf DISPLAY_rw ; Lower | 573 bsf DISPLAY_rw ; Lower |
556 | |
557 DISP_box3b: | |
558 decfsz PRODL,F ; row loop finished ? | 574 decfsz PRODL,F ; row loop finished ? |
559 bra DISP_box3 ; No: continue. | 575 bra DISP_box3 ; No: continue. |
560 | 576 |
561 incf PRODH,F ; column count ++ | 577 incf PRODH,F ; column count ++ |
562 | 578 |
565 bra DISP_box4 ; No: just loop. | 581 bra DISP_box4 ; No: just loop. |
566 | 582 |
567 clrf WREG ; Yes: switch to black | 583 clrf WREG ; Yes: switch to black |
568 movff WREG,win_color1 | 584 movff WREG,win_color1 |
569 movff WREG,win_color2 | 585 movff WREG,win_color2 |
570 movff WREG,win_color3 ; Yes. | 586 movff WREG,win_color3 |
587 movff WREG,win_color4 | |
588 movff WREG,win_color5 | |
589 movff WREG,win_color6 | |
571 DISP_box4: | 590 DISP_box4: |
572 movff win_width,WREG | 591 movff win_width,WREG |
573 cpfseq PRODH | 592 cpfseq PRODH |
574 bra DISP_box2 | 593 bra DISP_box2 |
575 | 594 |
1112 | 1131 |
1113 | 1132 |
1114 DISP_set_color:;Converts 8Bit RGB b'RRRGGGBB' into 16Bit RGB b'RRRRRGGG GGGBBBBB' | 1133 DISP_set_color:;Converts 8Bit RGB b'RRRGGGBB' into 16Bit RGB b'RRRRRGGG GGGBBBBB' |
1115 movwf DISPLAY1_temp ; Get 8Bit RGB b'RRRGGGBB' | 1134 movwf DISPLAY1_temp ; Get 8Bit RGB b'RRRGGGBB' |
1116 movwf DISPLAY2_temp ; Copy | 1135 movwf DISPLAY2_temp ; Copy |
1117 | 1136 movff WREG,win_color6 ; Another (bank-safe) copy |
1118 movff win_flags,WREG ; Display1? win_flags is in bank0... | |
1119 btfsc WREG,1 ; Display1? | |
1120 bra DISP_set_color_display1 ; Yes | |
1121 | 1137 |
1122 ; Display0 | 1138 ; Display0 |
1123 ; Mask Bit 7,6,5,4,3,2 | 1139 ; Mask Bit 7,6,5,4,3,2 |
1124 movlw b'00000011' | 1140 movlw b'00000011' |
1125 andwf DISPLAY2_temp,F | 1141 andwf DISPLAY2_temp,F |
1220 rrcf DISPLAY4_temp,F | 1236 rrcf DISPLAY4_temp,F |
1221 rrcf DISPLAY1_temp,F ; Red done. | 1237 rrcf DISPLAY1_temp,F ; Red done. |
1222 | 1238 |
1223 movff DISPLAY1_temp,win_color1 | 1239 movff DISPLAY1_temp,win_color1 |
1224 movff DISPLAY3_temp,win_color2 ; Set Bank0 Color registers... | 1240 movff DISPLAY3_temp,win_color2 ; Set Bank0 Color registers... |
1225 return | 1241 |
1242 movff win_flags,WREG ; Display1? win_flags is in bank0... | |
1243 btfss WREG,1 ; Display1? | |
1244 return ; No | |
1226 | 1245 |
1227 DISP_set_color_display1:;Converts 8Bit RGB b'RRRGGGBB' into 24Bit RGB b'00RRRRRR 00GGGGGG 00BBBBBB' | 1246 DISP_set_color_display1:;Converts 8Bit RGB b'RRRGGGBB' into 24Bit RGB b'00RRRRRR 00GGGGGG 00BBBBBB' |
1247 movff win_color6,DISPLAY1_temp | |
1248 movff win_color6,DISPLAY2_temp | |
1249 | |
1228 ; Mask Bit 7,6,5,4,3,2 | 1250 ; Mask Bit 7,6,5,4,3,2 |
1229 movlw b'00000011' | 1251 movlw b'00000011' |
1230 andwf DISPLAY2_temp,F | 1252 andwf DISPLAY2_temp,F |
1231 | 1253 |
1232 movlw b'00000000' | 1254 movlw b'00000000' |
1234 movlw b'01010000' | 1256 movlw b'01010000' |
1235 dcfsnz DISPLAY2_temp,F | 1257 dcfsnz DISPLAY2_temp,F |
1236 movlw b'10100000' | 1258 movlw b'10100000' |
1237 dcfsnz DISPLAY2_temp,F | 1259 dcfsnz DISPLAY2_temp,F |
1238 movlw b'11111000' | 1260 movlw b'11111000' |
1239 movff WREG,win_color3 ; B | 1261 movff WREG,win_color6 ; B |
1240 | 1262 |
1241 movff DISPLAY1_temp, DISPLAY2_temp ; Copy | 1263 movff DISPLAY1_temp, DISPLAY2_temp ; Copy |
1242 ; Mask Bit 7,6,5,1,0 | 1264 ; Mask Bit 7,6,5,1,0 |
1243 movlw b'00011100' | 1265 movlw b'00011100' |
1244 andwf DISPLAY2_temp,F | 1266 andwf DISPLAY2_temp,F |
1258 movlw b'01010000' | 1280 movlw b'01010000' |
1259 dcfsnz DISPLAY2_temp,F | 1281 dcfsnz DISPLAY2_temp,F |
1260 movlw b'10000000' | 1282 movlw b'10000000' |
1261 dcfsnz DISPLAY2_temp,F | 1283 dcfsnz DISPLAY2_temp,F |
1262 movlw b'11111100' | 1284 movlw b'11111100' |
1263 movff WREG,win_color2 ; G | 1285 movff WREG,win_color5 ; G |
1264 | 1286 |
1265 ; Mask Bit 4,3,2,1,0 | 1287 ; Mask Bit 4,3,2,1,0 |
1266 movlw b'11100000' | 1288 movlw b'11100000' |
1267 andwf DISPLAY1_temp,F | 1289 andwf DISPLAY1_temp,F |
1268 | 1290 |
1285 movlw b'01010000' | 1307 movlw b'01010000' |
1286 dcfsnz DISPLAY1_temp,F | 1308 dcfsnz DISPLAY1_temp,F |
1287 movlw b'10000000' | 1309 movlw b'10000000' |
1288 dcfsnz DISPLAY1_temp,F | 1310 dcfsnz DISPLAY1_temp,F |
1289 movlw b'11111100' | 1311 movlw b'11111100' |
1290 movff WREG,win_color1 ; R | 1312 movff WREG,win_color4 ; R |
1291 return | 1313 return |