annotate src/text_multilang.inc @ 615:b87f23fae743

work on new battery menu
author heinrichsweikamp
date Sat, 02 Feb 2019 17:39:44 +0100
parents ca4556fb60b9
children c40025d8e750
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
heinrichsweikamp
parents:
diff changeset
1 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2 ;
heinrichsweikamp
parents:
diff changeset
3 ; File text_multilang.inc
heinrichsweikamp
parents:
diff changeset
4 ;
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
5 ; Implementation of texts in various selectable languages
0
heinrichsweikamp
parents:
diff changeset
6 ;
heinrichsweikamp
parents:
diff changeset
7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved.
heinrichsweikamp
parents:
diff changeset
8 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
9 ; HISTORY
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
10 ; 2011-06-12 : [jDG] Creation
0
heinrichsweikamp
parents:
diff changeset
11 ;
heinrichsweikamp
parents:
diff changeset
12 ; Text definitions (text_french.asm example):
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
13 ; TCODE tYes, "Oui" ; Yes
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
14 ; TCODE tNo, "Non" ; No
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
15 ; TCODE tLogbk, "Carnet de plongées" ; Logbook
0
heinrichsweikamp
parents:
diff changeset
16 ;
heinrichsweikamp
parents:
diff changeset
17 ; Text direct usage:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
18 ; lfsr FSR1,tYes ; load a 12 bit text index
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
19 ; call strcpy_text ; copy to string buffer
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
20 ; PUTC '/' ; place a single character into the text buffer
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
21 ; lfsr FSR1,tNo
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
22 ; call strcat_text_print ; append next text and call word processor to output all text to the screen
0
heinrichsweikamp
parents:
diff changeset
23 ;
heinrichsweikamp
parents:
diff changeset
24 ; RATIONALS:
heinrichsweikamp
parents:
diff changeset
25 ; - The macro should define a label so that text files can be reordered
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
26 ; to keep consistency while adding more options (and make translator life easier).
0
heinrichsweikamp
parents:
diff changeset
27 ;
heinrichsweikamp
parents:
diff changeset
28 ; - The text positions is keept in menu blocks for the menu processor.
heinrichsweikamp
parents:
diff changeset
29 ;
heinrichsweikamp
parents:
diff changeset
30 ; - library function take text number from the FSR1 register, because a
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
31 ; lfsr instruction loads a 12 bit constant at once.
0
heinrichsweikamp
parents:
diff changeset
32 ;
heinrichsweikamp
parents:
diff changeset
33 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
34
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
35 ; Pass 1: generate a jump table and define labels
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
36 TCODE_1 macro label, text
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
37 tcode_idx set tcode_idx+1
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
38 If LANG == 0
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
39 global label
0
heinrichsweikamp
parents:
diff changeset
40 label:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
41 Endif
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
42 dw t#v(LANG)_#v(tcode_idx)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
43 endm
0
heinrichsweikamp
parents:
diff changeset
44 ;
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
45 ; Pass 2: generates string table
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
46 TCODE_2 macro label, text
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
47 tcode_idx set tcode_idx+1
0
heinrichsweikamp
parents:
diff changeset
48 t#v(LANG)_#v(tcode_idx):
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
49 db text, 0
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
50 endm
0
heinrichsweikamp
parents:
diff changeset
51 ;
heinrichsweikamp
parents:
diff changeset
52 ;=============================================================================
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
53 ; strcpy_text : copy a multiling text into string buffer
0
heinrichsweikamp
parents:
diff changeset
54 ;
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
55 ; Input : FSR1 text index
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
56 ; Output : Buffer filled with the text
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
57 ; FSR2 pointer to end of copied text (the null char)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
58 ; Trashed: WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
59 extern strcpy_text
0
heinrichsweikamp
parents:
diff changeset
60
heinrichsweikamp
parents:
diff changeset
61 ;=============================================================================
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
62 ; strcpy_text_print : same as above, but calls word processor afterward
0
heinrichsweikamp
parents:
diff changeset
63 ;
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
64 ; Input : FSR1 text index
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
65 ; Output : Buffer filled with the text.
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
66 ; FSR2 pointer to end of copied text (the null char)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
67 ; Trashed: WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
68 extern strcpy_text_print
0
heinrichsweikamp
parents:
diff changeset
69
heinrichsweikamp
parents:
diff changeset
70 ;=============================================================================
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
71 ; strcat_text : append a multiling text to FSR2 pointer
0
heinrichsweikamp
parents:
diff changeset
72 ;
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
73 ; Input : FSR1 text index
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
74 ; FSR2 current position (in buffer)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
75 ; Output : FSR2 pointer to end of copied text (the null char)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
76 ; Trashed: WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
77 extern strcat_text
0
heinrichsweikamp
parents:
diff changeset
78
heinrichsweikamp
parents:
diff changeset
79 ;=============================================================================
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
80 ; strcat_text_print : aame as above, but calls word processor afterward
0
heinrichsweikamp
parents:
diff changeset
81 ;
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
82 ; Input : FSR1 text index
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
83 ; FSR2 current position (in buffer)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
84 ; Output : FSR2 pointer to end of copied text (the null char)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
85 ; Trashed: WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
86 extern strcat_text_print
0
heinrichsweikamp
parents:
diff changeset
87