blob: 3a216c1afe4ba680f86534245a5208ce79af9dd6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
#include <stdio.h>
#include <conio.h>
#include <string.h>
#include "fujichat.h"
#include "common.h"
/* TODO: rewrite in asm. This does NOT need to
be 7K of object code. */
void more(char *file) {
char c, line = 0;
char buf[200];
FILE *f = fopen(file, "r");
putchar(0x7d);
if(!f) {
printf("%s not found\n", file);
cgetc();
return;
}
while(fgets(buf, 200, f)) {
if(*buf == '#') continue;
line += (strlen(buf) / 40 + 1);
if(line > 23) {
fputs("--more--", stdout);
fflush(stdout);
c = cgetc();
if(c == 27)
break;
putchar(A_DEL);
line = 0;
}
fputs(buf, stdout);
}
fclose(f);
fputs("--any key--", stdout);
fflush(stdout);
c = cgetc();
}
int main(int, char **) {
more("D:ABOUT.TXT");
atari_exec(MENU_FILENAME);
return 0;
}
|