4 main(int argc, char *argv[])
11 printf("TEX2TXB V1.0 Copyright (c) Bryan Aamot, 1995\n"
12 "Modified by Bradley Bell, 2002\n"
13 "Text to TXB converter for Descent HOG files.\n"
14 "Converts a ascii text files to *.txb descent hog file format.\n"
15 "Usage: TEX2TXB <text file name> <txb file name>\n"
16 "Example: TEX2TXB briefing.tex briefing.txb\n");
19 file = fopen(argv[1], "rb");
21 printf("Can't open file (%s)\n", argv[1]);
25 outfile = fopen(argv[2], "wb");
27 printf("Can't open file (%s)\n", argv[2]);
34 if (feof(file)) break;
37 fprintf(outfile, "\x0a");
39 code = ( ( (ch &0xfC) >> 2) + ( (ch &0x03) << 6 ) ) ^ 0xe9;
40 fprintf(outfile, "%c", code);