4 main(int argc, char *argv[])
11 printf("TXT2TXB V1.0 Copyright (c) Bryan Aamot, 1995\n"
12 "Text to TXB converter for Descent HOG files.\n"
13 "Converts a ascii text files to *.txb descent hog file format.\n"
14 "Usage: TXT2TXB <text file name> <txb file name>\n"
15 "Example: TXT2TXB briefing.txt briefing.txb\n");
18 file = fopen(argv[1], "rb");
20 printf("Can't open file (%s)\n", argv[1]);
24 outfile = fopen(argv[2], "wb");
26 printf("Can't open file (%s)\n", argv[2]);
33 if (feof(file)) break;
36 fprintf(outfile, "\x0a");
38 code = ( ( (ch &0xfC) >> 2) + ( (ch &0x03) << 6 ) ) ^ 0xe9;
39 fprintf(outfile, "%c", code);