mirror of
https://github.com/datajerk/c2d.git
synced 2024-09-27 11:55:02 +00:00
text2page minor non-functional update
This commit is contained in:
parent
00609d4106
commit
90a86105a7
Binary file not shown.
14
text2page.c
14
text2page.c
@ -14,7 +14,7 @@ unsigned char holes[] = {
|
|||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
char c, highbit = 0x80;
|
char c, highbit = 0x80;
|
||||||
int i, j, k, columns = 0, lines = 0, linemap[24];
|
int i, j, k, column = 0, line = 0, linemap[24];
|
||||||
unsigned char screen[24][40];
|
unsigned char screen[24][40];
|
||||||
|
|
||||||
// build table
|
// build table
|
||||||
@ -33,18 +33,18 @@ int main()
|
|||||||
while((c = getchar()) != EOF) {
|
while((c = getchar()) != EOF) {
|
||||||
if(c == '\r') // windows trash
|
if(c == '\r') // windows trash
|
||||||
continue;
|
continue;
|
||||||
if(columns > 39) // user didn't read the docs
|
if(column > 39) // user didn't read the docs
|
||||||
continue;
|
continue;
|
||||||
if(lines > 23) // ditto
|
if(line > 23) // ditto
|
||||||
break;
|
break;
|
||||||
if(c == '\n') { // end of line
|
if(c == '\n') { // end of line
|
||||||
columns=0;
|
column=0;
|
||||||
lines++;
|
line++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
screen[linemap[lines]][columns] = c | highbit;
|
screen[linemap[line]][column] = c | highbit;
|
||||||
columns++;
|
column++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// dump to stdout
|
// dump to stdout
|
||||||
|
Loading…
Reference in New Issue
Block a user