Commit | Line | Data |
---|---|---|
a5316884 AF |
1 | /* |
2 | * Copyright (c) 1992 OMRON Corporation. | |
3 | * Copyright (c) 1992 The Regents of the University of California. | |
4 | * All rights reserved. | |
5 | * | |
6 | * This code is derived from software contributed to Berkeley by | |
7 | * OMRON Corporation. | |
8 | * | |
9 | * %sccs.include.redist.c% | |
10 | * | |
11 | * @(#)screen.c 7.1 (Berkeley) %G% | |
12 | */ | |
13 | ||
14 | /* | |
15 | * screen.c -- screen handler | |
16 | * by A.Fujita, Jun-17-1992 | |
17 | */ | |
18 | ||
19 | #include <sys/param.h> | |
20 | #include <luna68k/stand/status.h> | |
21 | ||
22 | int | |
23 | screen(argc, argv) | |
24 | int argc; | |
25 | char *argv[]; | |
26 | { | |
27 | int i, j, flag; | |
28 | register char *p; | |
29 | short hcnt, vcnt; | |
30 | ||
31 | if (!strcmp(argv[1], "clear")) { | |
32 | bmdclear(); | |
33 | } else if (!strcmp(argv[1], "adjust")) { | |
34 | hcnt = vcnt = 0; | |
35 | ||
36 | flag = 0; | |
37 | for (p = argv[2] ; *p != '\0'; p++) { | |
38 | if (*p == '-') | |
39 | flag++; | |
40 | else | |
41 | hcnt = (hcnt * 10) + (*p - 0x30); | |
42 | } | |
43 | if (flag) | |
44 | hcnt = -1 * hcnt; | |
45 | ||
46 | flag = 0; | |
47 | for (p = argv[3] ; *p != '\0'; p++) { | |
48 | if (*p == '-') | |
49 | flag++; | |
50 | else | |
51 | vcnt = (vcnt * 10) + (*p - 0x30); | |
52 | } | |
53 | if (flag) | |
54 | vcnt = -1 * vcnt; | |
55 | ||
56 | bmdadjust(hcnt, vcnt); | |
57 | } else if (!strcmp(argv[1], "number")) { | |
58 | for (j = 0; j < 50; j++) | |
59 | for (i = 0; i < 10; i++) | |
60 | bmdputc( 0x30 + i ); | |
61 | ||
62 | } else if (!strcmp(argv[1], "alpha")) { | |
63 | for (j = 0; j < 26; j++) { | |
64 | for (i = 0; i < 90; i++) { | |
65 | bmdputc(0x41 + j); | |
66 | } | |
67 | bmdputc(0x0D); | |
68 | bmdputc(0x0A); | |
69 | } | |
70 | } | |
71 | ||
72 | return(ST_NORMAL); | |
73 | } |