Mercurial > public > hwos_code
comparison src/text_multilang.inc @ 0:11d4fc797f74
init
| author | heinrichsweikamp |
|---|---|
| date | Wed, 24 Apr 2013 19:22:45 +0200 |
| parents | |
| children | ca4556fb60b9 |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:11d4fc797f74 |
|---|---|
| 1 ;============================================================================= | |
| 2 ; | |
| 3 ; File text_multilang.inc | |
| 4 ; | |
| 5 ; Implementation text in various selectable languages. | |
| 6 ; | |
| 7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved. | |
| 8 ;============================================================================= | |
| 9 ; HISTORY | |
| 10 ; 2011-06-12 : [jDG] Creation... | |
| 11 ; | |
| 12 ; Text definitions (text_french.asm example): | |
| 13 ; TCODE tYes, "Oui" ; Yes | |
| 14 ; TCODE tNo, "Non" ; No | |
| 15 ; TCODE tLogbk, "Carnet de plongées" ; Logbook | |
| 16 ; | |
| 17 ; Text direct usage: | |
| 18 ; lfsr FSR1,tYes ; Load a 12bit text index | |
| 19 ; call strcpy_text ; Copy to string buffer. | |
| 20 ; PUTC '/' | |
| 21 ; lfsr FSR1,tNo | |
| 22 ; call strcat_text_print ; Append, and call word processor. | |
| 23 ; | |
| 24 ; RATIONALS: | |
| 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). | |
| 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 12bits constant at once. | |
| 32 ; | |
| 33 ;============================================================================= | |
| 34 ; | |
| 35 | |
| 36 ; Pass 1: generate jump table, and define labels. | |
| 37 TCODE_1 macro label, text | |
| 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): | |
| 50 db text, 0 | |
| 51 endm | |
| 52 ; | |
| 53 ;============================================================================= | |
| 54 ; strcpy_text : copy a multiling text into string buffer. | |
| 55 ; | |
| 56 ; Input: FSR1 : text index | |
| 57 ; Output: Buffer: filled with the text. | |
| 58 ; FSR2: pointer to end of copied text (the null char). | |
| 59 ; Trashed: WREG. | |
| 60 extern strcpy_text | |
| 61 | |
| 62 ;============================================================================= | |
| 63 ; strcpy_text_print : Same as above, but calls word processor afterward. | |
| 64 ; | |
| 65 ; Input: FSR1 : text index | |
| 66 ; Output: Buffer: filled with the text. | |
| 67 ; FSR2: pointer to end of copied text (the null char). | |
| 68 ; Trashed: WREG. | |
| 69 extern strcpy_text_print | |
| 70 | |
| 71 ;============================================================================= | |
| 72 ; strcat_text : Append a multiling text to FSR2 pointer. | |
| 73 ; | |
| 74 ; Input: FSR1 : text index | |
| 75 ; FSR2 : Current position (in Buffer) | |
| 76 ; Output: FSR2: pointer to end of copied text (the null char). | |
| 77 ; Trashed: WREG. | |
| 78 extern strcat_text | |
| 79 | |
| 80 ;============================================================================= | |
| 81 ; strcat_text_print : Same as above, but calls word processor afterward. | |
| 82 ; | |
| 83 ; Input: FSR1 : text index | |
| 84 ; FSR2 : Current position (in Buffer) | |
| 85 ; Output: FSR2: pointer to end of copied text (the null char). | |
| 86 ; Trashed: WREG. | |
| 87 extern strcat_text_print | |
| 88 |
