2 * Modified by Bradley Bell, 2002, 2003
3 * This program is licensed under the terms of the GPL, version 2 or later
10 main(int argc, char *argv[])
18 printf("TEX2TXB V1.0 Copyright (c) Bryan Aamot, 1995\n"
19 "Modified by Bradley Bell, 2002, 2003\n"
20 "Text to TXB converter for Descent HOG files.\n"
21 "Converts an ascii text file to *.txb descent hog file.\n"
22 "Usage: TEX2TXB <text file name> <txb file name>\n"
23 "Example: TEX2TXB briefing.tex briefing.txb\n");
26 file = fopen(argv[1], "rb");
28 printf("Can't open file (%s)\n", argv[1]);
33 strcpy(outfilename, argv[2]);
35 strcpy(outfilename, argv[1]);
36 strcpy(strrchr(outfilename, '.'), ".txb");
39 outfile = fopen(outfilename, "wb");
41 printf("Can't open file (%s)\n", outfilename);
48 if (feof(file)) break;
51 fprintf(outfile, "\x0a");
53 code = ( ( (ch &0xfC) >> 2) + ( (ch &0x03) << 6 ) ) ^ 0xe9;
54 fprintf(outfile, "%c", code);