]> 4ch.mooo.com Git - 16.git/blob - 16/v2/source/MAPED/SMALFONT.C
new file: 16/v2/source/ENGINE/MAKE.BAT
[16.git] / 16 / v2 / source / MAPED / SMALFONT.C
1 /*\r
2 Copyright (C) 1998 BJ Eirich (aka vecna)\r
3 This program is free software; you can redistribute it and/or\r
4 modify it under the terms of the GNU General Public License\r
5 as published by the Free Software Foundation; either version 2\r
6 of the License, or (at your option) any later version.\r
7 This program is distributed in the hope that it will be useful,\r
8 but WITHOUT ANY WARRANTY; without even the implied warranty of\r
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\r
10 See the GNU General Public Lic\r
11 See the GNU General Public License for more details.\r
12 You should have received a copy of the GNU General Public License\r
13 along with this program; if not, write to the Free Software\r
14 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.\r
15 */\r
16 \r
17 #include <stdio.h>\r
18 \r
19 #include "vdriver.h"\r
20 \r
21 #define xx 31\r
22 \r
23 int fontx=0;\r
24 int fonty=0;\r
25 \r
26 char sbA[]={3,\r
27             00,xx,00,\r
28             xx,00,xx,\r
29             xx,xx,xx,\r
30             xx,00,xx,\r
31             xx,00,xx};\r
32 \r
33 char ssA[]={3,\r
34             00,00,00,\r
35             00,xx,00,\r
36             xx,00,xx,\r
37             xx,xx,xx,\r
38             xx,00,xx};\r
39 \r
40 char sbB[]={3,\r
41             xx,xx,00,\r
42             xx,00,xx,\r
43             xx,xx,00,\r
44             xx,00,xx,\r
45             xx,xx,00};\r
46 \r
47 char ssB[]={3,\r
48             00,00,00,\r
49             xx,xx,00,\r
50             xx,xx,00,\r
51             xx,00,xx,\r
52             xx,xx,xx};\r
53 \r
54 char sbC[]={3,\r
55             00,xx,xx,\r
56             xx,00,00,\r
57             xx,00,00,\r
58             xx,00,00,\r
59             00,xx,xx};\r
60 \r
61 char ssC[]={3,\r
62             00,00,00,\r
63             00,xx,xx,\r
64             xx,00,00,\r
65             xx,00,00,\r
66             00,xx,xx};\r
67 \r
68 char sbD[]={3,\r
69             xx,xx,00,\r
70             xx,00,xx,\r
71             xx,00,xx,\r
72             xx,00,xx,\r
73             xx,xx,00};\r
74 \r
75 char ssD[]={3,\r
76             00,00,00,\r
77             xx,xx,00,\r
78             xx,00,xx,\r
79             xx,00,xx,\r
80             xx,xx,00};\r
81 \r
82 char sbE[]={3,\r
83             xx,xx,xx,\r
84             xx,00,00,\r
85             xx,xx,00,\r
86             xx,00,00,\r
87             xx,xx,xx};\r
88 \r
89 char ssE[]={3,\r
90             00,00,00,\r
91             xx,xx,xx,\r
92             xx,xx,00,\r
93             xx,00,00,\r
94             xx,xx,xx};\r
95 \r
96 char sbF[]={3,\r
97             xx,xx,xx,\r
98             xx,00,00,\r
99             xx,xx,00,\r
100             xx,00,00,\r
101             xx,00,00};\r
102 \r
103 char ssF[]={3,\r
104             00,00,00,\r
105             xx,xx,xx,\r
106             xx,00,00,\r
107             xx,xx,00,\r
108             xx,00,00};\r
109 \r
110 char sbG[]={3,\r
111             00,xx,xx,\r
112             xx,00,00,\r
113             xx,00,xx,\r
114             xx,00,xx,\r
115             00,xx,xx};\r
116 \r
117 char ssG[]={3,\r
118             00,00,00,\r
119             00,xx,xx,\r
120             xx,00,00,\r
121             xx,00,xx,\r
122             00,xx,xx};\r
123 \r
124 char sbH[]={3,\r
125             xx,00,xx,\r
126             xx,00,xx,\r
127             xx,xx,xx,\r
128             xx,00,xx,\r
129             xx,00,xx};\r
130 \r
131 char ssH[]={3,\r
132             00,00,00,\r
133             xx,00,xx,\r
134             xx,00,xx,\r
135             xx,xx,xx,\r
136             xx,00,xx};\r
137 \r
138 char sbI[]={1,\r
139             xx,\r
140             xx,\r
141             xx,\r
142             xx,\r
143             xx};\r
144 \r
145 char ssI[]={1,\r
146             00,\r
147             xx,\r
148             xx,\r
149             xx,\r
150             xx};\r
151 \r
152 char sbJ[]={3,\r
153             00,00,xx,\r
154             00,00,xx,\r
155             00,00,xx,\r
156             xx,00,xx,\r
157             00,xx,00};\r
158 \r
159 char ssJ[]={3,\r
160             00,00,00,\r
161             00,00,xx,\r
162             00,00,xx,\r
163             xx,00,xx,\r
164             00,xx,00};\r
165 \r
166 char sbK[]={3,\r
167             xx,00,xx,\r
168             xx,00,xx,\r
169             xx,xx,00,\r
170             xx,00,xx,\r
171             xx,00,xx};\r
172 \r
173 char ssK[]={3,\r
174             00,00,00,\r
175             xx,00,xx,\r
176             xx,xx,00,\r
177             xx,00,xx,\r
178             xx,00,xx};\r
179 \r
180 char sbL[]={3,\r
181             xx,00,00,\r
182             xx,00,00,\r
183             xx,00,00,\r
184             xx,00,00,\r
185             xx,xx,xx};\r
186 \r
187 char ssL[]={3,\r
188             00,00,00,\r
189             xx,00,00,\r
190             xx,00,00,\r
191             xx,00,00,\r
192             xx,xx,xx};\r
193 \r
194 char sbM[]={5,\r
195             xx,00,00,00,xx,\r
196             xx,xx,00,xx,xx,\r
197             xx,00,xx,00,xx,\r
198             xx,00,00,00,xx,\r
199             xx,00,00,00,xx};\r
200 \r
201 char ssM[]={5,\r
202             00,00,00,00,00,\r
203             xx,00,00,00,xx,\r
204             xx,xx,00,xx,xx,\r
205             xx,00,xx,00,xx,\r
206             xx,00,00,00,xx};\r
207 \r
208 char sbN[]={4,\r
209             xx,00,00,xx,\r
210             xx,xx,00,xx,\r
211             xx,00,xx,xx,\r
212             xx,00,00,xx,\r
213             xx,00,00,xx};\r
214 \r
215 char ssN[]={4,\r
216             00,00,00,00,\r
217             xx,00,00,xx,\r
218             xx,xx,00,xx,\r
219             xx,00,xx,xx,\r
220             xx,00,00,xx};\r
221 \r
222 char sbO[]={3,\r
223             00,xx,00,\r
224             xx,00,xx,\r
225             xx,00,xx,\r
226             xx,00,xx,\r
227             00,xx,00};\r
228 \r
229 char ssO[]={3,\r
230             00,00,00,\r
231             00,xx,00,\r
232             xx,00,xx,\r
233             xx,00,xx,\r
234             00,xx,00};\r
235 \r
236 char sbP[]={3,\r
237             xx,xx,00,\r
238             xx,00,xx,\r
239             xx,xx,00,\r
240             xx,00,00,\r
241             xx,00,00};\r
242 \r
243 char ssP[]={3,\r
244             00,00,00,\r
245             xx,xx,00,\r
246             xx,00,xx,\r
247             xx,xx,00,\r
248             xx,00,00};\r
249 \r
250 char sbQ[]={4,\r
251             00,xx,xx,00,\r
252             xx,00,00,xx,\r
253             xx,00,00,xx,\r
254             xx,00,xx,00,\r
255             00,xx,00,xx};\r
256 \r
257 char ssQ[]={3,\r
258             00,00,00,\r
259             xx,xx,00,\r
260             xx,00,xx,\r
261             xx,xx,00,\r
262             00,xx,xx};\r
263 \r
264 char sbR[]={3,\r
265             xx,xx,00,\r
266             xx,00,xx,\r
267             xx,xx,00,\r
268             xx,00,xx,\r
269             xx,00,xx};\r
270 \r
271 char ssR[]={3,\r
272             00,00,00,\r
273             xx,xx,00,\r
274             xx,00,xx,\r
275             xx,xx,00,\r
276             xx,00,xx};\r
277 \r
278 char sbS[]={3,\r
279             00,xx,xx,\r
280             xx,00,00,\r
281             00,xx,00,\r
282             00,00,xx,\r
283             xx,xx,00};\r
284 \r
285 char ssS[]={3,\r
286             00,00,00,\r
287             00,xx,xx,\r
288             xx,00,00,\r
289             00,xx,xx,\r
290             xx,xx,00};\r
291 \r
292 char sbT[]={3,\r
293             xx,xx,xx,\r
294             00,xx,00,\r
295             00,xx,00,\r
296             00,xx,00,\r
297             00,xx,00};\r
298 \r
299 char ssT[]={3,\r
300             00,00,00,\r
301             xx,xx,xx,\r
302             00,xx,00,\r
303             00,xx,00,\r
304             00,xx,00};\r
305 \r
306 char sbU[]={3,\r
307             xx,00,xx,\r
308             xx,00,xx,\r
309             xx,00,xx,\r
310             xx,00,xx,\r
311             xx,xx,xx};\r
312 \r
313 char ssU[]={3,\r
314             00,00,00,\r
315             xx,00,xx,\r
316             xx,00,xx,\r
317             xx,00,xx,\r
318             xx,xx,xx};\r
319 \r
320 char sbV[]={3,\r
321             xx,00,xx,\r
322             xx,00,xx,\r
323             xx,00,xx,\r
324             xx,00,xx,\r
325             00,xx,00};\r
326 \r
327 char ssV[]={3,\r
328             00,00,00,\r
329             xx,00,xx,\r
330             xx,00,xx,\r
331             xx,00,xx,\r
332             00,xx,00};\r
333 \r
334 char sbW[]={5,\r
335             xx,00,00,00,xx,\r
336             xx,00,00,00,xx,\r
337             xx,00,xx,00,xx,\r
338             xx,xx,00,xx,xx,\r
339             xx,00,00,00,xx};\r
340 \r
341 char ssW[]={5,\r
342             00,00,00,00,00,\r
343             xx,00,00,00,xx,\r
344             xx,00,xx,00,xx,\r
345             xx,xx,00,xx,xx,\r
346             xx,00,00,00,xx};\r
347 \r
348 char sbX[]={3,\r
349             xx,00,xx,\r
350             xx,00,xx,\r
351             00,xx,00,\r
352             xx,00,xx,\r
353             xx,00,xx};\r
354 \r
355 char ssX[]={3,\r
356             00,00,00,\r
357             xx,00,xx,\r
358             00,xx,00,\r
359             xx,00,xx,\r
360             xx,00,xx};\r
361 \r
362 char sbY[]={3,\r
363             xx,00,xx,\r
364             xx,00,xx,\r
365             00,xx,00,\r
366             00,xx,00,\r
367             00,xx,00};\r
368 \r
369 char ssY[]={3,\r
370             00,00,00,\r
371             xx,00,xx,\r
372             xx,00,xx,\r
373             00,xx,00,\r
374             00,xx,00};\r
375 \r
376 char sbZ[]={3,\r
377             xx,xx,xx,\r
378             00,00,xx,\r
379             00,xx,00,\r
380             xx,00,00,\r
381             xx,xx,xx};\r
382 \r
383 char ssZ[]={2,\r
384             00,00,\r
385             xx,xx,\r
386             00,xx,\r
387             xx,00,\r
388             xx,xx};\r
389 \r
390 char s1[]={1,\r
391            xx,\r
392            xx,\r
393            xx,\r
394            xx,\r
395            xx};\r
396 \r
397 char s2[]={3,\r
398            xx,xx,xx,\r
399            00,00,xx,\r
400            xx,xx,xx,\r
401            xx,00,00,\r
402            xx,xx,xx};\r
403 \r
404 char s3[]={3,\r
405            xx,xx,xx,\r
406            00,00,xx,\r
407            00,xx,xx,\r
408            00,00,xx,\r
409            xx,xx,xx};\r
410 \r
411 char s4[]={3,\r
412            xx,00,xx,\r
413            xx,00,xx,\r
414            xx,xx,xx,\r
415            00,00,xx,\r
416            00,00,xx};\r
417 \r
418 char s5[]={3,\r
419            xx,xx,xx,\r
420            xx,00,00,\r
421            xx,xx,xx,\r
422            00,00,xx,\r
423            xx,xx,xx};\r
424 \r
425 char s6[]={3,\r
426            xx,xx,xx,\r
427            xx,00,00,\r
428            xx,xx,xx,\r
429            xx,00,xx,\r
430            xx,xx,xx};\r
431 \r
432 char s7[]={3,\r
433            xx,xx,xx,\r
434            00,00,xx,\r
435            00,00,xx,\r
436            00,00,xx,\r
437            00,00,xx};\r
438 \r
439 char s8[]={3,\r
440            xx,xx,xx,\r
441            xx,00,xx,\r
442            xx,xx,xx,\r
443            xx,00,xx,\r
444            xx,xx,xx};\r
445 \r
446 char s9[]={3,\r
447            xx,xx,xx,\r
448            xx,00,xx,\r
449            xx,xx,xx,\r
450            00,00,xx,\r
451            xx,xx,xx};\r
452 \r
453 char s0[]={3,\r
454            xx,xx,xx,\r
455            xx,00,xx,\r
456            xx,00,xx,\r
457            xx,00,xx,\r
458            xx,xx,xx};\r
459 \r
460 char sQuote[]={3,\r
461                xx,00,xx,\r
462                xx,00,xx,\r
463                00,00,00,\r
464                00,00,00,\r
465                00,00,00};\r
466 \r
467 char sYow[]={1,\r
468              xx,\r
469              xx,\r
470              xx,\r
471              00,\r
472              xx};\r
473 \r
474 char sQuotes[]={1,\r
475                 xx,\r
476                 xx,\r
477                 00,\r
478                 00,\r
479                 00};\r
480 \r
481 \r
482 char sComma[]={2,\r
483                00,00,\r
484                00,00,\r
485                00,00,\r
486                00,xx,\r
487                xx,00};\r
488 char sPeriod[]={1,\r
489                 00,\r
490                 00,\r
491                 00,\r
492                 00,\r
493                 xx};\r
494 \r
495 char sMinus[]={2,\r
496                00,00,\r
497                00,00,\r
498                xx,xx,\r
499                00,00,\r
500                00,00};\r
501 \r
502 char sQuest[]={3,\r
503                xx,xx,xx,\r
504                00,00,xx,\r
505                00,xx,xx,\r
506                00,00,00,\r
507                00,xx,00};\r
508 \r
509 char sColon[]={1,\r
510                00,\r
511                xx,\r
512                00,\r
513                xx,\r
514                00};\r
515 \r
516 char sch[]={3,\r
517             00,xx,00,\r
518             xx,xx,xx,\r
519             xx,xx,xx,\r
520             xx,xx,xx,\r
521             00,xx,00};\r
522 \r
523 char usc[]={2,\r
524             00,00,\r
525             00,00,\r
526             00,00,\r
527             00,00,\r
528             xx,xx};\r
529 \r
530 char star[]={4,\r
531              00,00,00,xx,\r
532              xx,00,xx,00,\r
533              00,xx,00,00,\r
534              00,00,00,00,\r
535              00,00,00,00};\r
536 \r
537 char ss[]={2,\r
538            xx,xx,\r
539            xx,xx,\r
540            xx,xx,\r
541            xx,xx,\r
542            xx,xx};\r
543 \r
544 char sra[]={3,\r
545             xx,00,00,\r
546             xx,xx,00,\r
547             xx,xx,xx,\r
548             xx,xx,00,\r
549             xx,00,00};\r
550 \r
551 char slParen[]={2,\r
552                 00,xx,\r
553                 xx,00,\r
554                 xx,00,\r
555                 xx,00,\r
556                 00,xx};\r
557 \r
558 char srParen[]={2,\r
559                 xx,00,\r
560                 00,xx,\r
561                 00,xx,\r
562                 00,xx,\r
563                 xx,00};\r
564 \r
565 char ssemic[]={2,\r
566                xx,xx,\r
567                00,00,\r
568                xx,xx,\r
569                00,xx,\r
570                xx,00};\r
571 \r
572 char sSlash[]={3,\r
573                00,00,xx,\r
574                00,00,xx,\r
575                00,xx,00,\r
576                xx,00,00,\r
577                xx,00,00};\r
578 \r
579 char sBlank[]={2,\r
580                00,00,\r
581                00,00,\r
582                00,00,\r
583                00,00,\r
584                00,00};\r
585 \r
586 // ...\r
587 char mousepic[] = { xx,00,00,00,\r
588                     xx,xx,00,00,\r
589                     xx,xx,xx,00,\r
590                     xx,xx,xx,xx,\r
591                     00,00,xx,00,\r
592                     00,00,xx,00};\r
593 \r
594 char *smal_tbl[]=\r
595 {  sBlank,\r
596    sYow,  sQuote,      ss,      ss,     ss,     ss, sQuotes, slParen,  // 40\r
597  srParen,    star,      ss,  sComma, sMinus,sPeriod,  sSlash,      s0,  // 48\r
598       s1,      s2,      s3,      s4,     s5,     s6,      s7,      s8,  // 56\r
599       s9,  sColon,  ssemic,      ss,     ss,    sra,  sQuest,      ss,  // 64\r
600      sbA,     sbB,     sbC,     sbD,    sbE,    sbF,     sbG,     sbH,  // 72\r
601      sbI,     sbJ,     sbK,     sbL,    sbM,    sbN,     sbO,     sbP,  // 80\r
602      sbQ,     sbR,     sbS,     sbT,    sbU,    sbV,     sbW,     sbX,  // 88\r
603      sbY,     sbZ,      ss,      ss,     ss,     ss,     usc,     sch,  // 96\r
604      ssA,     ssB,     ssC,     ssD,    ssE,    ssF,     ssG,     ssH,  // 102\r
605      ssI,     ssJ,     ssK,     ssL,    ssM,    ssN,     ssO,     ssP,  // 110\r
606      ssQ,     ssR,     ssS,     ssT,    ssU,    ssV,     ssW,     ssX,  // 118\r
607      ssY,     ssZ };                                                    // 120\r
608 \r
609 unsigned char lastcol=31;\r
610 \r
611 void GotoXY(int x1, int y1)\r
612 {\r
613   fontx=x1;\r
614   fonty=y1;\r
615 }\r
616 \r
617 void print_char(char c)\r
618 { char* img;\r
619 \r
620   c-=32;\r
621   if (c>90) c=2;\r
622   img=smal_tbl[c];\r
623   TCopySprite(fontx,fonty,img[0],5,img+1);\r
624   fontx+=img[0]+1;\r
625 }\r
626 \r
627 void printstring(char *str)\r
628 {\r
629   for (; *str; ++str)\r
630     print_char(*str);\r
631 }\r
632 \r
633 int pixels(char *str)\r
634 { int pix;\r
635 \r
636   for (pix=0; *str; ++str)\r
637     pix += *smal_tbl[*str-32]+1;\r
638   return pix;\r
639 }\r
640 \r
641 void dec_to_asciiz(int num, char *buf)\r
642 {\r
643   sprintf(buf,"%d",num);\r
644 }\r
645 \r
646 void TextColor(unsigned char newc)\r
647 { char *src;\r
648 \r
649   src=sbA;\r
650   while ((int)src < (int) smal_tbl)\r
651   {\r
652     if (*src==lastcol) *src=newc;\r
653     src++;\r
654   }\r
655 }\r