remove old files
This commit is contained in:
parent
b42787d07e
commit
ed17eba1ea
|
@ -1,44 +0,0 @@
|
|||
#include <stdio.h>
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
FILE *file, *outfile;
|
||||
char ch;
|
||||
int code;
|
||||
|
||||
if (argc != 3) {
|
||||
printf("TXB2TXT V1.0 Copyright (c) Bryan Aamot, 1995\n"
|
||||
"TXB to Text converter for Descent HOG files.\n"
|
||||
"Converts a *.txb descent hog file to an ascii file.\n"
|
||||
"Usage: TXB2TXT <txb file name> <text file name>\n"
|
||||
"Example: TXT2TXB briefing.txb briefing.txt\n");
|
||||
exit(1);
|
||||
}
|
||||
file = fopen(argv[1], "rb");
|
||||
if (!file) {
|
||||
printf("Can't open txb file (%s)\n", argv[1]);
|
||||
exit(2);
|
||||
}
|
||||
outfile = fopen(argv[2], "wb");
|
||||
if (!outfile) {
|
||||
printf("Can't open file (%s)\n", argv[2]);
|
||||
fclose(file);
|
||||
exit(2);
|
||||
}
|
||||
for (;;) {
|
||||
code = getc(file);
|
||||
if (feof(file)) break;
|
||||
if (code == 0x0a) {
|
||||
fprintf(outfile, "\x0d\x0a");
|
||||
} else {
|
||||
ch = ( ( (code&0x3f) << 2 ) + ( (code&0xc0) >> 6 ) ) ^ 0xa7;
|
||||
fprintf(outfile, "%c", ch);
|
||||
}
|
||||
}
|
||||
|
||||
fclose(outfile);
|
||||
fclose(file);
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -1,48 +0,0 @@
|
|||
#include <stdio.h>
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
FILE *file, *outfile;
|
||||
char ch;
|
||||
int code;
|
||||
|
||||
if (argc != 3) {
|
||||
printf("TXT2TXB V1.0 Copyright (c) Bryan Aamot, 1995\n"
|
||||
"Text to TXB converter for Descent HOG files.\n"
|
||||
"Converts a ascii text files to *.txb descent hog file format.\n"
|
||||
"Usage: TXT2TXB <text file name> <txb file name>\n"
|
||||
"Example: TXT2TXB briefing.txt briefing.txb\n");
|
||||
exit(1);
|
||||
}
|
||||
file = fopen(argv[1], "rb");
|
||||
if (!file) {
|
||||
printf("Can't open file (%s)\n", argv[1]);
|
||||
exit(2);
|
||||
}
|
||||
|
||||
outfile = fopen(argv[2], "wb");
|
||||
if (!outfile) {
|
||||
printf("Can't open file (%s)\n", argv[2]);
|
||||
fclose(file);
|
||||
exit(2);
|
||||
}
|
||||
|
||||
for (;;) {
|
||||
ch = getc(file);
|
||||
if (feof(file)) break;
|
||||
if (ch!=0x0d) {
|
||||
if (ch==0x0a) {
|
||||
fprintf(outfile, "\x0a");
|
||||
} else {
|
||||
code = ( ( (ch &0xfC) >> 2) + ( (ch &0x03) << 6 ) ) ^ 0xe9;
|
||||
fprintf(outfile, "%c", code);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fclose(outfile);
|
||||
fclose(file);
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in a new issue