Mercurial > public > mk2
comparison code_part1/OSTC_code_asm_part1/multilang_text.asm @ 174:53b16a746166
Multi-lang
+ Move texts to single compact table.
+ Place at address 0x15000, reserved up to 0x17AFF (10kB)
+ Generate the english_test.asm reference (4kB)
+ Move altimeter texts into the table.
author | JeanDo |
---|---|
date | Thu, 03 Feb 2011 04:09:21 +0100 |
parents | |
children | adadccc367a6 |
comparison
equal
deleted
inserted
replaced
173:4a7a778d9e49 | 174:53b16a746166 |
---|---|
1 | |
2 ; OSTC - diving computer code | |
3 ; Copyright (C) 2008 HeinrichsWeikamp GbR | |
4 | |
5 ; This program is free software: you can redistribute it and/or modify | |
6 ; it under the terms of the GNU General Public License as published by | |
7 ; the Free Software Foundation, either version 3 of the License, or | |
8 ; (at your option) any later version. | |
9 | |
10 ; This program is distributed in the hope that it will be useful, | |
11 ; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 ; GNU General Public License for more details. | |
14 | |
15 ; You should have received a copy of the GNU General Public License | |
16 ; along with this program. If not, see <http://www.gnu.org/licenses/>. | |
17 | |
18 | |
19 ; hold texts and parameters for the texts | |
20 ; written by: Matthias Heinrichs, info@heinrichsweikamp.com | |
21 ; History: | |
22 ; 2007/10/13: written | |
23 ; 2008/05/24: Last update Matthias | |
24 ; 2011/02/02: moving texts to english_text.asm to prepare multilingual. | |
25 ; known bugs: | |
26 ; ToDo: | |
27 | |
28 texts code_pack 0x15000 | |
29 | |
30 TCODE_1 macro x, y, text | |
31 ; Compile-time checking on provided parameters: | |
32 If x<0 || x>.159 | |
33 Error "Bad X coordinate ", #v(tcode_idx), x | |
34 Endif | |
35 If y<0 || y>.239 | |
36 Error "Bad Y coordinate ", y | |
37 Endif | |
38 dw tcode_ptr_#v(tcode_idx) | |
39 db 0+x, 0+y | |
40 tcode_idx set tcode_idx+1 | |
41 endm | |
42 | |
43 TCODE_2 macro x, y, text | |
44 tcode_ptr_#v(tcode_idx): | |
45 db text, 0 | |
46 tcode_idx set tcode_idx+1 | |
47 endm | |
48 | |
49 ;---- Manage language ------------------------------------------------------- | |
50 ; Compile with ASM macro definition GERMAN=1 to use another | |
51 ; file... | |
52 #ifdef GERMAN | |
53 #define LANGUAGE_FILE "german_text.asm" | |
54 #endif | |
55 #ifdef FRENCH | |
56 #define LANGUAGE_FILE "french_text.asm" | |
57 #endif | |
58 #ifndef LANGUAGE_FILE | |
59 #define LANGUAGE_FILE "english_text.asm" | |
60 #endif | |
61 | |
62 ;---- PASS 1 : generate description block ------------------------------------ | |
63 text_pointer: | |
64 | |
65 tcode_idx set 1 | |
66 #define TCODE TCODE_1 | |
67 #include LANGUAGE_FILE | |
68 #undefine TCODE | |
69 | |
70 ;---- PASS 2 : generate text contens ----------------------------------------- | |
71 tcode_idx set 1 | |
72 #define TCODE TCODE_2 | |
73 #include LANGUAGE_FILE | |
74 #undefine TCODE | |
75 | |
76 code | |
77 |