-
Notifications
You must be signed in to change notification settings - Fork 0
/
titlepage.c
119 lines (104 loc) · 4.93 KB
/
titlepage.c
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/*
* titlepage.c: Rog-O-Matic XIV (CMU) Tue Jan 1 14:32:17 1985 - mlm
* Copyright (C) 1985 by A. Appel, G. Jacobson, L. Hamey, and M. Mauldin
*
* This file contains the functions which display the animated copyright
* notice on the screen. A general movie facility is used to animate
* the screen.
*/
# include <stdio.h>
# include <curses.h>
# include "types.h"
# include "globals.h"
static char *titlepage[]={
/* The static part of the display */
" @ !@ \"@ #@ K@! @!$@!K@!P@\" @\"$@\"(@\")@\"*@\"/@\"0@\"1@\"6@\"7@\"8@",
"\"=@\"?@\"C@\"D@\"E@\"I@\"J@\"K@\"L@\"M@\"U@\"V@\"W@\"X@\"]@\"a@\"c@\"e@",
"\"i@# @#!@#\"@##@#'@#+@#.@#2@#5@#9@#<@#>@#@@#F@#K@#P@#T@#^@#`@#c@#e@#i@$",
" @$$@$'@$+@$.@$2@$5@$9@$<@$@@$C@$D@$E@$F@$K@$P@$T@$_@$c@$e@$i@% @%$@%'@%",
"+@%.@%2@%5@%9@%<@%@@%C@%F@%K@%P@%T@%^@%`@%c@%f@%h@& @&%@&(@&)@&*@&/@&0@&",
"1@&2@&6@&7@&8@&<@&@@&D@&E@&G@&L@&Q@&U@&V@&W@&X@&]@&a@&c@&g@'2@(.@(/@(0@(",
"1@);C)<o)=p)>y)?r)@i)Ag)Bh)Ct)E()Fc)G))I1)J9)K8)L5)Nb)Oy*'A*(n*)d**r*+e*",
",w*.A*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6 .7 .8 .9 .: .; .",
"< .= .> .? .@ .A .B .C .D .E .F 6 ~~~~~~~~~~~~~~~~~~",
NULL};
# define NEXTCHAR (*cbf?*cbf++:(cbf=1+ *movie++)[-1])
/*
* animate: Display a movie on the screen. A movie is a list of strings
* wherein each character is either a bell command '}', a synchronize
* command '~', or a triplet <row+32, col+32, char> indicating a character
* to be placed at a specific place on the screen.
*
* Movies run the same speed regardless of baudrate (if the baud rate
* greater than 2400).
*/
animate (movie)
char *movie[];
{ register int r, c, count = 0, delaychars = (baudrate () / 200);
register char *cbf = "";
if (emacs || terse) return; /* No screen ==> no movie */
clear (); /* Clear the screen */
while (*movie || *cbf) /* While more animate commands */
{ r = NEXTCHAR; /* Get command character */
/* Ring the Bell */
if (r == '}') putchar (ctrl('G'));
/* Update the screen and delay until one timestep is gone */
else if (r == '~')
{ refresh (); /* Write out screen */
for (; count < delaychars; count++) /* Pad with nulls */
putchar (0);
count = 0; /* Reset char count */
}
/* Write out a single character and bump the character count */
else
{ r -= 32; /* Get screen row */
c = NEXTCHAR - 32; /* Get screen col */
mvaddch (r, c, NEXTCHAR); /* Write out character */
if (count++ < 4) count += 4; /* Assume one cursor move */
}
}
}
/*
* halftimeshow: If its time for a halftime show, call movie. Variable
* 'nohalf' is true if the user does not want to see a halftime show.
*/
halftimeshow (level)
int level;
{ static int nextshow = 1;
/* If terminal is too slow, dont bother */
if (baudrate () < 1200)
return;
if (!nohalf && level >= nextshow)
{ if (nextshow == 1)
{ nextshow = 9999; animate (titlepage); }
}
}