c2d/page2text.c

33 lines
538 B
C
Raw Normal View History

#include <stdio.h>
2017-04-16 14:40:25 -06:00
#define MASK 0x7F
int main()
{
2017-04-16 14:40:25 -06:00
int i, j, k, line;
2017-04-15 21:58:58 -06:00
char screen[24][40];
2017-04-16 14:02:54 -06:00
// clear screen (just in case partial dump)
2017-04-16 10:38:06 -06:00
for (i = 0; i < 24; i++)
for (j = 0; j < 40; j++)
2017-04-16 13:16:36 -06:00
screen[i][j] = ' ';
2017-04-16 10:38:06 -06:00
for (i = 0; i < 24; i++) {
2017-04-16 13:57:04 -06:00
line = 8 * (i % 3) + i / 3;
2017-04-16 10:38:06 -06:00
for (j = 0; j < 40; j++)
2017-04-16 14:40:25 -06:00
screen[line][j] = getchar() & MASK;
2017-04-16 13:57:04 -06:00
if (i % 3 == 2)
2017-04-16 10:38:06 -06:00
for (k = 0; k < 8; k++)
getchar();
}
// dump to stdout
2017-04-16 10:38:06 -06:00
for (i = 0; i < 24; i++) {
for (j = 0; j < 40; j++)
putchar(screen[i][j]);
printf("\n");
}
return 0;
}