comparison src/aa_wordprocessor.asm @ 656:8af5aefbcdaf default tip

Update to 3.31 beta
author heinrichsweikamp
date Thu, 27 Nov 2025 18:32:58 +0100
parents 75e90cd0c2c3
children
comparison
equal deleted inserted replaced
655:c7b7b8a358cd 656:8af5aefbcdaf
489 movf TBLPTRH,W ; YES - get TBLPTR, high byte 489 movf TBLPTRH,W ; YES - get TBLPTR, high byte
490 cpfseq aa_end+1 ; - TBLPTR, high byte == end pointer, high byte? 490 cpfseq aa_end+1 ; - TBLPTR, high byte == end pointer, high byte?
491 bra aa_decode_1 ; NO - loop 491 bra aa_decode_1 ; NO - loop
492 return ; YES - done 492 return ; YES - done
493 493
494 494 ;------------------------------------------------------------------------------
495 ; Convert the output buffer to all caps, leave anything outside "a" to "z" untouched
496 ; Input buffer (NEEDS TO BE NULL TERMINATED)
497 ; Output buffer
498 ; Trashed PROD
499
500 all_caps:
501 lfsr FSR2, buffer ; FSR2 pointer to start of string
502
503 all_caps_1:
504 movf POSTINC2,W ; get character
505 bz all_caps_3 ; exit if null byte encountered
506 movwf PRODL
507
508 btfsc force_all_caps
509 bra all_caps_2
510 movlw .58
511 cpfslt PRODL
512 bra all_caps_2 ; >57, can't be a "0" to "9", continue
513
514 movlw .47
515 cpfsgt PRODL
516 bra all_caps_2 ; <48, can't be a "0" to "9", continue
517 bra all_caps_3 ; "0" to "9" found, exit here
518
519 all_caps_2:
520 movlw .96
521 cpfsgt PRODL
522 bra all_caps_1 ; <97 ("a") -> skip character
523
524 movlw .123
525 cpfslt PRODL
526 bra all_caps_1 ; >122 ("z") -> skip character
527
528 movf POSTDEC2,W ; dummy decrease FSR2
529 movlw .32
530 subwf PRODL,W ; make caps by subtracting .32
531 movwf INDF2 ; store caps version of INDF2 back into buffer
532 bra all_caps_1 ; check next char
533
534 all_caps_3:
535 return ; done
536
537
538
495 ;------------------------------------------------------------------------------ 539 ;------------------------------------------------------------------------------
496 ; Print the Output Buffer to Screen 540 ; Print the Output Buffer to Screen
497 ; 541 ;
498 ; Input buffer - string to print (NULL TERMINATED) 542 ; Input buffer - string to print (NULL TERMINATED)
499 ; Output chars printed to screen 543 ; Output chars printed to screen
500 ; 544 ;
501 global aa_wordprocessor 545 global aa_wordprocessor
502 aa_wordprocessor: 546 aa_wordprocessor:
547 btfsc dn_flag
548 rcall all_caps ; make the string "all caps"
503 movf font_color,W ; get selected font color (8 bit) 549 movf font_color,W ; get selected font color (8 bit)
504 call TFT_set_color ; compute printing color (16 bit) 550 call TFT_set_color ; compute printing color (16 bit)
505 rcall aa_string_width ; set win_height and compute win_width:2 551 rcall aa_string_width ; set win_height and compute win_width:2
506 call TFT_box_write ; set up output box 552 call TFT_box_write ; set up output box
507 lfsr FSR2,buffer ; set FSR2 to the start of the output buffer 553 lfsr FSR2,buffer ; set FSR2 to the start of the output buffer
508 movlw 0x22 ; frame memory data write start 554 movlw 0x22 ; frame memory data write start
509 btfsc screen_type4 555 btfsc screen_type4
510 movlw 0x2C ; Start Writing Data to GRAM (Display 4) 556 movlw 0x2C ; Start Writing Data to GRAM (Display 4)
557 btfsc screen_type5
558 movlw 0x2C ; Start Writing Data to GRAM (Display 5)
511 call TFT_CmdWrite 559 call TFT_CmdWrite
512 aa_wordprocessor_1: 560 aa_wordprocessor_1:
513 movf POSTINC2,W ; read character from the buffer 561 movf POSTINC2,W ; read character from the buffer
514 bz aa_wordprocessor_99 ; done if null byte encountered 562 bz aa_wordprocessor_99 ; done if null byte encountered
515 563