comparison src/text_multilang.inc @ 604:ca4556fb60b9

bump to 2.99beta, work on 3.00 stable
author heinrichsweikamp
date Thu, 22 Nov 2018 19:47:26 +0100
parents 11d4fc797f74
children c40025d8e750
comparison
equal deleted inserted replaced
603:00b24fb4324d 604:ca4556fb60b9
1 ;============================================================================= 1 ;=============================================================================
2 ; 2 ;
3 ; File text_multilang.inc 3 ; File text_multilang.inc
4 ; 4 ;
5 ; Implementation text 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 ;=============================================================================
9 ; HISTORY 9 ; HISTORY
10 ; 2011-06-12 : [jDG] Creation... 10 ; 2011-06-12 : [jDG] Creation
11 ; 11 ;
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 direct usage:
18 ; lfsr FSR1,tYes ; Load a 12bit text index 18 ; lfsr FSR1,tYes ; load a 12 bit text index
19 ; call strcpy_text ; Copy to string buffer. 19 ; call strcpy_text ; copy to string buffer
20 ; PUTC '/' 20 ; PUTC '/' ; place a single character into the text buffer
21 ; lfsr FSR1,tNo 21 ; lfsr FSR1,tNo
22 ; call strcat_text_print ; Append, and call word processor. 22 ; call strcat_text_print ; append next text and call word processor to output all text to the screen
23 ; 23 ;
24 ; RATIONALS: 24 ; RATIONALS:
25 ; - The macro should define a label so that text files can be reordered 25 ; - The macro should define a label so that text files can be reordered
26 ; to keep consistency while adding more option (and make translator life easier). 26 ; to keep consistency while adding more options (and make translator life easier).
27 ; 27 ;
28 ; - The text positions is keept in menu blocks for the menu processor. 28 ; - The text positions is keept in menu blocks for the menu processor.
29 ; 29 ;
30 ; - library function take text number from the FSR1 register, because a 30 ; - library function take text number from the FSR1 register, because a
31 ; lfsr instruction loads a 12bits constant at once. 31 ; lfsr instruction loads a 12 bit constant at once.
32 ; 32 ;
33 ;============================================================================= 33 ;=============================================================================
34
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
40 label:
41 Endif
42 dw t#v(LANG)_#v(tcode_idx)
43 endm
34 ; 44 ;
35 45 ; Pass 2: generates string table
36 ; Pass 1: generate jump table, and define labels. 46 TCODE_2 macro label, text
37 TCODE_1 macro label, text 47 tcode_idx set tcode_idx+1
38 tcode_idx set tcode_idx+1
39 If LANG == 0
40 global label
41 label:
42 Endif
43 dw t#v(LANG)_#v(tcode_idx)
44 endm
45 ;
46 ; Pass 2: generates string table.
47 TCODE_2 macro label, text
48 tcode_idx set tcode_idx+1
49 t#v(LANG)_#v(tcode_idx): 48 t#v(LANG)_#v(tcode_idx):
50 db text, 0 49 db text, 0
51 endm 50 endm
52 ; 51 ;
53 ;============================================================================= 52 ;=============================================================================
54 ; strcpy_text : copy a multiling text into string buffer. 53 ; strcpy_text : copy a multiling text into string buffer
55 ; 54 ;
56 ; Input: FSR1 : text index 55 ; Input : FSR1 text index
57 ; Output: Buffer: filled with the text. 56 ; Output : Buffer filled with the text
58 ; FSR2: pointer to end of copied text (the null char). 57 ; FSR2 pointer to end of copied text (the null char)
59 ; Trashed: WREG. 58 ; Trashed: WREG
60 extern strcpy_text 59 extern strcpy_text
61 60
62 ;============================================================================= 61 ;=============================================================================
63 ; strcpy_text_print : Same as above, but calls word processor afterward. 62 ; strcpy_text_print : same as above, but calls word processor afterward
64 ; 63 ;
65 ; Input: FSR1 : text index 64 ; Input : FSR1 text index
66 ; Output: Buffer: filled with the text. 65 ; Output : Buffer filled with the text.
67 ; FSR2: pointer to end of copied text (the null char). 66 ; FSR2 pointer to end of copied text (the null char)
68 ; Trashed: WREG. 67 ; Trashed: WREG
69 extern strcpy_text_print 68 extern strcpy_text_print
70 69
71 ;============================================================================= 70 ;=============================================================================
72 ; strcat_text : Append a multiling text to FSR2 pointer. 71 ; strcat_text : append a multiling text to FSR2 pointer
73 ; 72 ;
74 ; Input: FSR1 : text index 73 ; Input : FSR1 text index
75 ; FSR2 : Current position (in Buffer) 74 ; FSR2 current position (in buffer)
76 ; Output: FSR2: pointer to end of copied text (the null char). 75 ; Output : FSR2 pointer to end of copied text (the null char)
77 ; Trashed: WREG. 76 ; Trashed: WREG
78 extern strcat_text 77 extern strcat_text
79 78
80 ;============================================================================= 79 ;=============================================================================
81 ; strcat_text_print : Same as above, but calls word processor afterward. 80 ; strcat_text_print : aame as above, but calls word processor afterward
82 ; 81 ;
83 ; Input: FSR1 : text index 82 ; Input : FSR1 text index
84 ; FSR2 : Current position (in Buffer) 83 ; FSR2 current position (in buffer)
85 ; Output: FSR2: pointer to end of copied text (the null char). 84 ; Output : FSR2 pointer to end of copied text (the null char)
86 ; Trashed: WREG. 85 ; Trashed: WREG
87 extern strcat_text_print 86 extern strcat_text_print
88 87