diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/code_part1/OSTC_code_asm_part1/multilang_text.asm	Thu Feb 03 04:09:21 2011 +0100
@@ -0,0 +1,77 @@
+
+; OSTC - diving computer code
+; Copyright (C) 2008 HeinrichsWeikamp GbR
+
+;    This program is free software: you can redistribute it and/or modify
+;    it under the terms of the GNU General Public License as published by
+;    the Free Software Foundation, either version 3 of the License, or
+;    (at your option) any later version.
+
+;    This program is distributed in the hope that it will be useful,
+;    but WITHOUT ANY WARRANTY; without even the implied warranty of
+;    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;    GNU General Public License for more details.
+
+;    You should have received a copy of the GNU General Public License
+;    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+
+; hold texts and parameters for the texts
+; written by: Matthias Heinrichs, info@heinrichsweikamp.com
+; History:
+; 2007/10/13: written
+; 2008/05/24: Last update Matthias
+; 2011/02/02: moving texts to english_text.asm to prepare multilingual.
+; known bugs:
+; ToDo: 
+
+texts	    code_pack    0x15000
+
+TCODE_1 macro   x, y, text
+    ; Compile-time checking on provided parameters:
+    If x<0 || x>.159
+        Error "Bad X coordinate ", #v(tcode_idx), x
+    Endif
+    If y<0 || y>.239
+        Error "Bad Y coordinate ", y
+    Endif
+        dw      tcode_ptr_#v(tcode_idx)
+        db      0+x, 0+y
+tcode_idx set tcode_idx+1
+        endm
+
+TCODE_2 macro   x, y, text
+tcode_ptr_#v(tcode_idx):
+        db      text, 0
+tcode_idx set tcode_idx+1
+        endm
+
+;---- Manage language -------------------------------------------------------
+; Compile with ASM macro definition GERMAN=1 to use another
+; file...
+#ifdef GERMAN
+#define LANGUAGE_FILE "german_text.asm"
+#endif
+#ifdef FRENCH
+#define LANGUAGE_FILE "french_text.asm"
+#endif
+#ifndef LANGUAGE_FILE
+#define LANGUAGE_FILE "english_text.asm"
+#endif
+
+;---- PASS 1 : generate description block ------------------------------------
+text_pointer:
+
+tcode_idx   set     1
+#define     TCODE TCODE_1
+#include    LANGUAGE_FILE
+#undefine   TCODE
+
+;---- PASS 2 : generate text contens -----------------------------------------
+tcode_idx   set     1
+#define     TCODE TCODE_2
+#include    LANGUAGE_FILE
+#undefine   TCODE
+
+            code
+