-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path437la1.tcs
553 lines (525 loc) · 11 KB
/
437la1.tcs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
# Character Mapping Table
# DOS code page 437 <-> ISO Latin-1
# To use this file, you must first compile it with MKCHRTAB (also known
# as MKCHRTAB32 for Windows 95/NT users).
#
# To compile a game using this character set mapping, prepare the game's
# source code using DOS code page 437, then compile the game using this
# command:
#
# tc -ctab 437la1.tcp mygame.t
#
# To play a game using ISO Latin 1 on DOS, make sure your DOS command
# prompt is set to code page 437, then play the game normally. The TADS
# run-time should automatically load the compiled version of this mapping
# file.
#
# Internal Character Set Identifier - this is a string of no more than
# four characters that uniquely and universally identifies the character
# set. For a given character set, this ID must be the same on every
# platform. The reason the ID must be the same everywhere is that the
# run-time uses the ID, which the compiler stores in the .GAM file, to
# choose the character set mapping file when a player loads the game.
# In order to allow you to compile your game on one system, and have
# players run the game on different systems, every system must use the
# same character set identifier for the internal character set, so that
# every platform can choose the correct character set mapping to the
# native character set.
#
# IMPORTANT - to ensure that character set identifiers are universal
# and unique, character set identifiers MUST be registered. Currently,
# Mike Roberts (mjr_@hotmail.com) maintains the list of registered
# character set identifiers; please contact him by email if you would
# like the current list or add a new character set to the list.
#
# You do NOT need to register *native* character sets. The native
# character set used to compile a game is not stored with the game,
# because it is irrelevant once the game is compiled -- the game is
# entirely translated to the internal character set during compilation.
# Note, however, that the TADS run-time varies by operating system in
# how it determines the native character set, and how it chooses a
# character set mapping file based on the native character set.
#
# On DOS, the run-time chooses a native character set based on the active
# "code page"; DOS labels code pages with 3- or 4-digit numbers. (For
# example, this file is for code page 437, the DOS US code page.) The
# run-time generates the name of the character mapping table by appending
# the internal character set ID to the code page number, then adding the
# extension ".tcp" -- for example, the mapping file for native code page
# 437 to internal character set ISO Latin 1 is called "437LA1.TCP".
# This convention is system-specific; consult the documentation for your
# version of TADS for local conventions.
#
# Members of the ISO Latin-X series of character sets are all registered,
# and are assigned identifiers such of the form "LaX", where X is the
# numeric suffix to the ISO Latin name. For example, ISO Latin-1 (ISO
# 8859-1) has identifier "La1", ISO Latin-2 has identifier "La2", and
# so on.
#
id = La1
# Full name of the internal character set - this name is stored in a
# game compiled with this internal character set, so that the run-time
# can display a sensible error message if a suitable mapping file is
# not available when a player loads the game. The full name isn't used
# for choosing the mapping file, but is meant for the player to see.
#
# Each registered character set has an official full name, which should
# be used here to ensure that players encountering character mapping
# problems can more easily determine what file they need. The ISO
# Latin series names should be of the form "ISO Latin-X (ISO 8859-Y)".
#
ldesc = ISO Latin-1 (ISO 8859-1)
# Extra System-specific information - this can be any string of
# characters; the meaning is system-dependent. For DOS, this extra
# information is ignored, so we'll just leave it out entirely here.
# Other systems use it for varying purposes. On Windows, for example,
# this string contains a code page number, which the TADS run-time
# will use as the system code page when this character set is selected
# by a game.
# EXTRA_SYSTEM_INFO = none
# ---------------------------------------------------------------------------
# The ASCII subset 1-127 is the same in both character sets and therefore
# doesn't need to be mapped
#
# The following characters have equivalent characters in both character
# sets, so we'll provide a reversible 1-to-1 mapping.
# DOS 437 <-> ISO Latin 1
128 <-> 199
129 <-> 252
130 <-> 233
131 <-> 226
132 <-> 228
133 <-> 224
134 <-> 229
135 <-> 231
136 <-> 234
137 <-> 235
138 <-> 232
139 <-> 239
140 <-> 238
141 <-> 236
142 <-> 196
143 <-> 197
144 <-> 201
145 <-> 230
146 <-> 198
147 <-> 244
148 <-> 246
149 <-> 242
150 <-> 251
151 <-> 249
152 <-> 255
153 <-> 214
154 <-> 220
155 <-> 162
156 <-> 163
157 <-> 165
160 <-> 225
161 <-> 237
162 <-> 243
163 <-> 250
164 <-> 241
165 <-> 209
166 <-> 170
167 <-> 186
168 <-> 191
170 <-> 172
171 <-> 189
172 <-> 188
173 <-> 161
174 <-> 171
175 <-> 187
179 <-> 166
196 <-> 151
230 <-> 181
241 <-> 177
246 <-> 247
248 <-> 176
249 <-> 183
253 <-> 178
#
# there are a few characters in the DOS character set that map to the same
# ISO Latin 1 character as some other DOS character; we'll cover those
# here.
250 -> 183
#
# these characters are mappings from ISO Latin 1 that are redundant --
# multiple characters in ISO Latin 1 map to the same character in DOS
# code page 437. So, we only need to provide the mapping from ISO Latin 1.
# DOS code page 437 <- ISO Latin 1
196 <- 150
#
# The following characters from DOS code page 437 have no equivalents
# in ISO Latin-1. We'll map them to character 129; this character
# isn't used in Latin-1, so we'll use it as our invalid character code.
# We'll map it back to character 250 in code page 437, which is a
# mid-dot character; this will serve as our "missing character" display
# indicator.
# DOS 437 -> ISO Latin 1 invalid (129) -> DOS 437 invalid (177)
127 -> 129 -> 250
158 -> 129
159 -> 129
169 -> 129
176 -> 129
177 -> 129
178 -> 129
180 -> 129
181 -> 129
182 -> 129
183 -> 129
184 -> 129
185 -> 129
186 -> 129
187 -> 129
188 -> 129
189 -> 129
190 -> 129
191 -> 129
192 -> 129
193 -> 129
194 -> 129
195 -> 129
197 -> 129
198 -> 129
199 -> 129
200 -> 129
201 -> 129
202 -> 129
203 -> 129
204 -> 129
205 -> 129
206 -> 129
207 -> 129
208 -> 129
209 -> 129
210 -> 129
211 -> 129
212 -> 129
213 -> 129
214 -> 129
215 -> 129
216 -> 129
217 -> 129
218 -> 129
219 -> 129
220 -> 129
221 -> 129
222 -> 129
223 -> 129
224 -> 129
225 -> 129
226 -> 129
227 -> 129
228 -> 129
229 -> 129
231 -> 129
232 -> 129
233 -> 129
234 -> 129
235 -> 129
236 -> 129
237 -> 129
238 -> 129
239 -> 129
240 -> 129
242 -> 129
243 -> 129
244 -> 129
245 -> 129
247 -> 129
251 -> 129
252 -> 129
254 -> 129
255 -> 129
#
# The following characters from ISO Latin 1 do not have exact equivalents
# in DOS code page 437, but have reasonable approximations. For example,
# we'll map accented characters to the unaccented version when no
# accented version is available.
#
'\'' <- 130
'"' <- 132
'<' <- 139
'\'' <- 145
'\'' <- 146
'"' <- 147
'"' <- 148
'>' <- 155
'Y' <- 159
'\'' <- 180
',' <- 184
'A' <- 192
'A' <- 193
'A' <- 194
'A' <- 195
'E' <- 200
'E' <- 202
'E' <- 203
'I' <- 205
'I' <- 206
'I' <- 207
'O' <- 210
'O' <- 211
'O' <- 212
'O' <- 213
'x' <- 215
'O' <- 216
'U' <- 217
'U' <- 218
'U' <- 219
'Y' <- 221
225 <- 223
'a' <- 227
'o' <- 245
'o' <- 248
'y' <- 253
#
# The following characters from ISO Latin 1 do not appear in DOS code
# page 437. Map these ISO Latin 1 characters to our "missing character"
# indicator (DOS code page character 250).
250 <- 128
250 <- 131
250 <- 133
250 <- 134
250 <- 135
250 <- 136
250 <- 137
250 <- 138
250 <- 140
250 <- 141
250 <- 142
250 <- 143
250 <- 144
250 <- 149
250 <- 152
250 <- 153
250 <- 154
250 <- 156
250 <- 157
250 <- 158
250 <- 160
250 <- 164
250 <- 167
250 <- 168
250 <- 169
250 <- 173
250 <- 174
250 <- 175
250 <- 179
250 <- 182
250 <- 185
250 <- 190
250 <- 204
250 <- 208
250 <- 222
250 <- 240
250 <- 254
#
# We can also specify entity mappings for this character set.
# The entity mappings provide the local character set expansions for
# the HTML named entities.
#
&scaron = 's'
&Scaron = 'S'
&sbquo = '\''
&bdquo = '"'
&dagger = 250
&Dagger = 250
&permil = 250
&lsaquo = '<'
&OElig = 250
&lsquo = '\''
&rsquo = '\''
&ldquo = '"'
&rdquo = '"'
&ndash = 0304
&mdash = '-' '-'
&trade = '(' 't' 'm' ')'
&rsaquo = '>'
&oelig = 250
&Yuml = 'Y'
¡ = 0255
¢ = 0233
£ = 0234
¤ = 250
¥ = 0235
¦ = 0263
§ = 250
¨ = 250
© = '(' 'c' ')'
ª = 0246
« = 0256
¬ = 0252
­ = ' '
® = '(' 'R' ')'
¯ = 250
° = 0370
± = 0361
² = 0375
³ = 250
´ = '\''
µ = 0346
¶ = 250
· = 0371
¸ = ','
¹ = 250
º = 0247
» = 0257
¼ = 0254
½ = 0253
¾ = '3' '/' '4'
¿ = 0250
À = 'A'
Á = 'A'
 = 'A'
à = 'A'
Ä = 0216
Å = 0217
Æ = 0222
Ç = 0200
È = 'E'
É = 0220
Ê = 'E'
Ë = 'E'
Ì = 'I'
Í = 'I'
Î = 'I'
Ï = 'I'
Ð = 250
Ñ = 0245
Ò = 'O'
Ó = 'O'
Ô = 'O'
Õ = 'O'
Ö = 0231
× = 'x'
Ø = 'O'
Ù = 'U'
Ú = 'U'
Û = 'U'
Ü = 0232
Ý = 'Y'
Þ = 250
ß = 0341
à = 0205
á = 0240
â = 0203
ã = 'a'
ä = 0204
å = 0206
æ = 0221
ç = 0207
è = 0212
é = 0202
ê = 0210
ë = 0211
ì = 0215
í = 0241
î = 0214
ï = 0213
ð = 250
ñ = 0244
ò = 0225
ó = 0242
ô = 0223
õ = 'o'
ö = 0224
÷ = 0366
ø = 'o'
ù = 0227
ú = 0243
û = 0226
ü = 0201
ý = 'y'
þ = 250
ÿ = 0230
&circ = '^'
&tilde = '~'
# code page 437 has a bunch of the math symbols and Greek letters as well
&fnof = 159
&alpha = 224
&Gamma = 226
&pi = 227
&Sigma = 228
&sigma = 229
&tau = 231
&Phi = 232
&Theta = 233
&Omega = 234
&delta = 235
&infin = 236
&phi = 237
&epsilon = 238
&cap = 239
&equiv = 240
&ge = 242
&le = 243
&asymp = 247
&radic = 251
# several of the capital Greek letters look a lot like Roman letters
&Alpha = 'A'
&Beta = 'B'
&Zeta = 'Z'
&Eta = 'H'
&Iota = 'I'
&Kappa = 'K'
&Mu = 'M'
&Nu = 'N'
&Omicron = 'O'
&Rho = 'P'
&Tau = 'T'
&Upsilon = 'Y'
&Chi = 'X'
# provide approximations for the Latin-2 entities
&Aogon = 'A'
&Lstrok = 'L'
&Lcaron = 'L'
&Sacute = 'S'
&Scedil = 'S'
&Tcaron = 'T'
&Zacute = 'Z'
&Zcaron = 'Z'
&Zdot = 'Z'
&aogon = 'a'
&ogon = 'o'
&lstrok = 'l'
&lcaron = 'l'
&sacute = 's'
&scedil = 's'
&tcaron = 't'
&zacute = 'z'
&dblac = '"'
&zcaron = 'z'
&zdot = 'z'
&Racute = 'R'
&Abreve = 'A'
&Lacute = 'L'
&Cacute = 'C'
&Ccaron = 'C'
&Eogon = 'E'
&Ecaron = 'E'
&Dcaron = 'D'
&Dstrok = 'D'
&Nacute = 'N'
&Ncaron = 'N'
&Odblac = 'O'
&Rcaron = 'R'
&Uring = 'U'
&Udblac = 'U'
&Tcedil = 'T'
&racute = 'r'
&abreve = 'a'
&lacute = 'l'
&cacute = 'c'
&ccaron = 'c'
&eogon = 'e'
&ecaron = 'e'
&dcaron = 'd'
&dstrok = 'd'
&nacute = 'n'
&ncaron = 'n'
&odblac = 'o'
&rcaron = 'r'
&uring = 'u'
&udblac = 'u'
&tcedil = 't'