0
|
1 ;=============================================================================
|
|
2 ;
|
|
3 ; File text_multilang.inc
|
|
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
|
|
36 TCODE_1 macro label, text
|
|
37 tcode_idx set tcode_idx+1
|
|
38 If LANG == 0
|
|
39 global label
|
0
|
40 label:
|
604
|
41 Endif
|
|
42 dw t#v(LANG)_#v(tcode_idx)
|
|
43 endm
|
0
|
44 ;
|
604
|
45 ; Pass 2: generates string table
|
|
46 TCODE_2 macro label, text
|
|
47 tcode_idx set tcode_idx+1
|
0
|
48 t#v(LANG)_#v(tcode_idx):
|
604
|
49 db text, 0
|
|
50 endm
|
0
|
51 ;
|
|
52 ;=============================================================================
|
604
|
53 ; strcpy_text : copy a multiling text into string buffer
|
0
|
54 ;
|
604
|
55 ; Input : FSR1 text index
|
|
56 ; Output : Buffer filled with the text
|
|
57 ; FSR2 pointer to end of copied text (the null char)
|
|
58 ; Trashed: WREG
|
|
59 extern strcpy_text
|
0
|
60
|
|
61 ;=============================================================================
|
604
|
62 ; strcpy_text_print : same as above, but calls word processor afterward
|
0
|
63 ;
|
604
|
64 ; Input : FSR1 text index
|
|
65 ; Output : Buffer filled with the text.
|
|
66 ; FSR2 pointer to end of copied text (the null char)
|
|
67 ; Trashed: WREG
|
|
68 extern strcpy_text_print
|
0
|
69
|
|
70 ;=============================================================================
|
604
|
71 ; strcat_text : append a multiling text to FSR2 pointer
|
0
|
72 ;
|
604
|
73 ; Input : FSR1 text index
|
|
74 ; FSR2 current position (in buffer)
|
|
75 ; Output : FSR2 pointer to end of copied text (the null char)
|
|
76 ; Trashed: WREG
|
|
77 extern strcat_text
|
0
|
78
|
|
79 ;=============================================================================
|
604
|
80 ; strcat_text_print : aame as above, but calls word processor afterward
|
0
|
81 ;
|
604
|
82 ; Input : FSR1 text index
|
|
83 ; FSR2 current position (in buffer)
|
|
84 ; Output : FSR2 pointer to end of copied text (the null char)
|
|
85 ; Trashed: WREG
|
|
86 extern strcat_text_print
|
0
|
87
|