annotate src/text_multilang.inc @ 193:901c10831e4e

reset voting logic on sensor switch
author heinrichsweikamp
date Mon, 03 Nov 2014 17:31:03 +0100
parents 11d4fc797f74
children ca4556fb60b9
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 ;
heinrichsweikamp
parents:
diff changeset
5 ; Implementation text in various selectable languages.
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
heinrichsweikamp
parents:
diff changeset
10 ; 2011-06-12 : [jDG] Creation...
heinrichsweikamp
parents:
diff changeset
11 ;
heinrichsweikamp
parents:
diff changeset
12 ; Text definitions (text_french.asm example):
heinrichsweikamp
parents:
diff changeset
13 ; TCODE tYes, "Oui" ; Yes
heinrichsweikamp
parents:
diff changeset
14 ; TCODE tNo, "Non" ; No
heinrichsweikamp
parents:
diff changeset
15 ; TCODE tLogbk, "Carnet de plongées" ; Logbook
heinrichsweikamp
parents:
diff changeset
16 ;
heinrichsweikamp
parents:
diff changeset
17 ; Text direct usage:
heinrichsweikamp
parents:
diff changeset
18 ; lfsr FSR1,tYes ; Load a 12bit text index
heinrichsweikamp
parents:
diff changeset
19 ; call strcpy_text ; Copy to string buffer.
heinrichsweikamp
parents:
diff changeset
20 ; PUTC '/'
heinrichsweikamp
parents:
diff changeset
21 ; lfsr FSR1,tNo
heinrichsweikamp
parents:
diff changeset
22 ; call strcat_text_print ; Append, and call word processor.
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
heinrichsweikamp
parents:
diff changeset
26 ; to keep consistency while adding more option (and make translator life easier).
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
heinrichsweikamp
parents:
diff changeset
31 ; lfsr instruction loads a 12bits constant at once.
heinrichsweikamp
parents:
diff changeset
32 ;
heinrichsweikamp
parents:
diff changeset
33 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
34 ;
heinrichsweikamp
parents:
diff changeset
35
heinrichsweikamp
parents:
diff changeset
36 ; Pass 1: generate jump table, and define labels.
heinrichsweikamp
parents:
diff changeset
37 TCODE_1 macro label, text
heinrichsweikamp
parents:
diff changeset
38 tcode_idx set tcode_idx+1
heinrichsweikamp
parents:
diff changeset
39 If LANG == 0
heinrichsweikamp
parents:
diff changeset
40 global label
heinrichsweikamp
parents:
diff changeset
41 label:
heinrichsweikamp
parents:
diff changeset
42 Endif
heinrichsweikamp
parents:
diff changeset
43 dw t#v(LANG)_#v(tcode_idx)
heinrichsweikamp
parents:
diff changeset
44 endm
heinrichsweikamp
parents:
diff changeset
45 ;
heinrichsweikamp
parents:
diff changeset
46 ; Pass 2: generates string table.
heinrichsweikamp
parents:
diff changeset
47 TCODE_2 macro label, text
heinrichsweikamp
parents:
diff changeset
48 tcode_idx set tcode_idx+1
heinrichsweikamp
parents:
diff changeset
49 t#v(LANG)_#v(tcode_idx):
heinrichsweikamp
parents:
diff changeset
50 db text, 0
heinrichsweikamp
parents:
diff changeset
51 endm
heinrichsweikamp
parents:
diff changeset
52 ;
heinrichsweikamp
parents:
diff changeset
53 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
54 ; strcpy_text : copy a multiling text into string buffer.
heinrichsweikamp
parents:
diff changeset
55 ;
heinrichsweikamp
parents:
diff changeset
56 ; Input: FSR1 : text index
heinrichsweikamp
parents:
diff changeset
57 ; Output: Buffer: filled with the text.
heinrichsweikamp
parents:
diff changeset
58 ; FSR2: pointer to end of copied text (the null char).
heinrichsweikamp
parents:
diff changeset
59 ; Trashed: WREG.
heinrichsweikamp
parents:
diff changeset
60 extern strcpy_text
heinrichsweikamp
parents:
diff changeset
61
heinrichsweikamp
parents:
diff changeset
62 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
63 ; strcpy_text_print : Same as above, but calls word processor afterward.
heinrichsweikamp
parents:
diff changeset
64 ;
heinrichsweikamp
parents:
diff changeset
65 ; Input: FSR1 : text index
heinrichsweikamp
parents:
diff changeset
66 ; Output: Buffer: filled with the text.
heinrichsweikamp
parents:
diff changeset
67 ; FSR2: pointer to end of copied text (the null char).
heinrichsweikamp
parents:
diff changeset
68 ; Trashed: WREG.
heinrichsweikamp
parents:
diff changeset
69 extern strcpy_text_print
heinrichsweikamp
parents:
diff changeset
70
heinrichsweikamp
parents:
diff changeset
71 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
72 ; strcat_text : Append a multiling text to FSR2 pointer.
heinrichsweikamp
parents:
diff changeset
73 ;
heinrichsweikamp
parents:
diff changeset
74 ; Input: FSR1 : text index
heinrichsweikamp
parents:
diff changeset
75 ; FSR2 : Current position (in Buffer)
heinrichsweikamp
parents:
diff changeset
76 ; Output: FSR2: pointer to end of copied text (the null char).
heinrichsweikamp
parents:
diff changeset
77 ; Trashed: WREG.
heinrichsweikamp
parents:
diff changeset
78 extern strcat_text
heinrichsweikamp
parents:
diff changeset
79
heinrichsweikamp
parents:
diff changeset
80 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
81 ; strcat_text_print : Same as above, but calls word processor afterward.
heinrichsweikamp
parents:
diff changeset
82 ;
heinrichsweikamp
parents:
diff changeset
83 ; Input: FSR1 : text index
heinrichsweikamp
parents:
diff changeset
84 ; FSR2 : Current position (in Buffer)
heinrichsweikamp
parents:
diff changeset
85 ; Output: FSR2: pointer to end of copied text (the null char).
heinrichsweikamp
parents:
diff changeset
86 ; Trashed: WREG.
heinrichsweikamp
parents:
diff changeset
87 extern strcat_text_print
heinrichsweikamp
parents:
diff changeset
88