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