Mercurial > public > hwos_code
diff src/strings.asm @ 623:c40025d8e750
3.03 beta released
author | heinrichsweikamp |
---|---|
date | Mon, 03 Jun 2019 14:01:48 +0200 |
parents | ca4556fb60b9 |
children | cd58f7fc86db |
line wrap: on
line diff
--- a/src/strings.asm Wed Apr 10 10:51:07 2019 +0200 +++ b/src/strings.asm Mon Jun 03 14:01:48 2019 +0200 @@ -1,6 +1,6 @@ ;============================================================================= ; -; File strings.asm V2.99c +; File strings.asm combined next generation V3.03.1 ; ; Implementation code various string functions. ; @@ -16,41 +16,39 @@ extern aa_wordprocessor -strings CODE +strings CODE ;============================================================================= + ; Variants that call word_processor at the end - global strcpy_block_print + global strcat_block_print strcpy_block_print: lfsr FSR2,buffer - global strcat_block_print strcat_block_print: - clrf PRODL,A + bsf aa_aux_flag ; print afterwards bra strings_common - ; Variants that do not call word_processor at end - global strcpy_block + global strcat_block strcpy_block: lfsr FSR2,buffer - global strcat_block strcat_block: - setf PRODL,A - + bcf aa_aux_flag ; do not print afterwards + ;bra strings_common ; Common part: append the string from PROM return address - strings_common: VARARGS_BEGIN rcall strcat_prom VARARGS_ALIGN VARARGS_END - btfsc PRODL,0,A ; ahall we print afterwards? + btfss aa_aux_flag ; shall we print? return ; NO - then return straight away - goto aa_wordprocessor ; YES - print it... + goto aa_wordprocessor ; YES - print it... + ;============================================================================= ; Copy multi-lingual text from FSR1 12 bit pointer to buffer @@ -77,9 +75,9 @@ ; Append multi-lingual text from FSR1 12 bit pointers to buffer at FRS2 ; -; Input: FSR1 = 12 bit pointer to multi-lingual text -; FSR2 = current position in buffer -; Output: FSR2 pointing to closing null byte in buffer +; Input: FSR1 = 12 bit pointer to multi-lingual text +; FSR2 = current position in buffer +; Output: FSR2 pointing to closing null byte in buffer ; Trashed: TBLPTR, TABLAT global strcat_text @@ -97,14 +95,14 @@ global strcat_text_print strcat_text_print: rcall text_get_tblptr - bra strcat_prom_print + bra strcat_prom_print ;============================================================================= ; Get pointer to multilingual text in TBLPTR ; -; Input: FSR1 = 12 bit text handle -; opt_language = current language -; Output: TBLPTR = 24 bit PROM address +; Input: FSR1 = 12 bit text handle +; opt_language = current language +; Output: TBLPTR = 24 bit PROM address global text_get_tblptr text_get_tblptr: @@ -154,8 +152,8 @@ ;============================================================================= ; Copy a null-terminated string from TBLPTR to buffer ; -; Input: TBLPTR : string pointer into PROM -; Output: string in buffer, FSR2 pointing to the closing null byte +; Input: TBLPTR : string pointer into PROM +; Output: string in buffer, FSR2 pointing to the closing null byte ; global strcpy_prom strcpy_prom: @@ -164,18 +162,18 @@ ; Append a null-terminated string from TBLPTR to buffer ; -; Input: TBLPTR : string pointer into PROM -; FRS2 : current character position -; Output: string in buffer, FSR2 pointing to the closing null byte +; Input: TBLPTR : string pointer into PROM +; FRS2 : current character position +; Output: string in buffer, FSR2 pointing to the closing null byte ; global strcat_prom strcat_prom: - tblrd*+ - movf TABLAT,W - movwf POSTINC2 - bnz strcat_prom - movf POSTDEC2,W ; step back one char - return + tblrd*+ ; read a character from PROM + movf TABLAT,W ; transfer character to WREG + movwf POSTINC2 ; transfer character from WREG to output buffer and increment buffer pointer + bnz strcat_prom ; last character = NULL ? NO - loop + movf POSTDEC2,W ; YES - step back one char + return ; - done ;============================================================================= ; Variant that calls word processor right-away... @@ -193,34 +191,38 @@ global start_tiny_block start_tiny_block: clrf WREG - movff WREG, win_font ; needs a bank-safe move here ! bra start_common global start_small_block start_small_block: movlw 1 - movff WREG, win_font ; needs a bank-safe move here ! bra start_common global start_std_block start_std_block: movlw 2 - movff WREG, win_font ; needs a bank-safe move here ! bra start_common global start_medium_block start_medium_block: movlw 3 - movff WREG, win_font ; needs a bank-safe move here ! bra start_common global start_large_block start_large_block: movlw 4 - movff WREG, win_font ; needs a bank-safe move here ! - ;bra start_common + bra start_common + + IFDEF _huge_font + global start_huge_block +start_huge_block: + movlw 5 + ;bra start_block_common + ENDIF start_common: + movff WREG,win_font ; needs a bank-safe move here ! + VARARGS_BEGIN VARARGS_GET8 win_leftx2 VARARGS_GET8 win_top