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