Mercurial > public > hwos_code
comparison src/text_multilang.inc @ 634:4050675965ea
3.10 stable release
author | heinrichsweikamp |
---|---|
date | Tue, 28 Apr 2020 17:34:31 +0200 |
parents | c40025d8e750 |
children | 75e90cd0c2c3 |
comparison
equal
deleted
inserted
replaced
633:690c48db7b5b | 634:4050675965ea |
---|---|
1 ;============================================================================= | 1 ;============================================================================= |
2 ; | 2 ; |
3 ; File text_multilang.inc combined next generation V3.0.1 | 3 ; File text_multilang.inc * combined next generation V3.09.4j |
4 ; | 4 ; |
5 ; Implementation of texts in various selectable languages | 5 ; Implementation of texts in various selectable languages |
6 ; | 6 ; |
7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved. | 7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved. |
8 ;============================================================================= | 8 ;============================================================================= |
12 ; Text definitions (text_french.asm example): | 12 ; Text definitions (text_french.asm example): |
13 ; TCODE tYes, "Oui" ; Yes | 13 ; TCODE tYes, "Oui" ; Yes |
14 ; TCODE tNo, "Non" ; No | 14 ; TCODE tNo, "Non" ; No |
15 ; TCODE tLogbk, "Carnet de plongées" ; Logbook | 15 ; TCODE tLogbk, "Carnet de plongées" ; Logbook |
16 ; | 16 ; |
17 ; Text direct usage: | 17 ; Text usage via is done via macros, see strings.inc |
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 | |
23 ; | |
24 ; RATIONALS: | |
25 ; - The macro should define a label so that text files can be reordered | |
26 ; to keep consistency while adding more options (and make translator life easier). | |
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 | |
31 ; lfsr instruction loads a 12 bit constant at once. | |
32 ; | |
33 ;============================================================================= | |
34 | 18 |
35 ; Pass 1: generate a jump table and define labels | 19 |
36 ; | 20 ;----------------------------------------------------------------------------- |
21 ; Pass 1: generate Index Table and define Labels | |
22 ;----------------------------------------------------------------------------- | |
23 | |
37 TCODE_1 macro label, text | 24 TCODE_1 macro label, text |
38 tcode_idx set tcode_idx+1 | 25 tcode_idx set tcode_idx+1 |
39 If LANG == 0 | 26 If LANG == 0 |
40 global label | 27 global label |
41 label: | 28 label: |
42 Endif | 29 Endif |
43 dw t#v(LANG)_#v(tcode_idx) | 30 dw t#v(LANG)_#v(tcode_idx) |
44 endm | 31 endm |
45 | 32 |
46 | 33 |
47 ; Pass 2: generates string table | 34 ;----------------------------------------------------------------------------- |
48 ; | 35 ; Pass 2: generate String Table |
36 ;----------------------------------------------------------------------------- | |
37 | |
49 TCODE_2 macro label, text | 38 TCODE_2 macro label, text |
50 tcode_idx set tcode_idx+1 | 39 tcode_idx set tcode_idx+1 |
51 t#v(LANG)_#v(tcode_idx): | 40 t#v(LANG)_#v(tcode_idx): |
52 db text, 0 | 41 db text, 0 |
53 endm | 42 endm |
54 | 43 |
55 | 44 ;----------------------------------------------------------------------------- |
56 ;============================================================================= | |
57 ; strcpy_text : copy a multiling text into string buffer | |
58 ; | |
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 | |
63 | |
64 extern strcpy_text | |
65 | |
66 | |
67 ;============================================================================= | |
68 ; strcpy_text_print : same as above, but calls word processor afterward | |
69 ; | |
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 | |
74 | |
75 extern strcpy_text_print | |
76 | |
77 | |
78 ;============================================================================= | |
79 ; strcat_text : append a multiling text to FSR2 pointer | |
80 ; | |
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 | |
85 | |
86 extern strcat_text | |
87 | |
88 | |
89 ;============================================================================= | |
90 ; strcat_text_print : aame as above, but calls word processor afterward | |
91 ; | |
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 | |
96 | |
97 extern strcat_text_print | |
98 |