forked from zuberfowler/zedit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DS8LHMN.C
111 lines (106 loc) · 4.56 KB
/
DS8LHMN.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
#include "zedit.h"
void ds8lhmn(
union both_scr *posptr,
char ln[],
int line_no)
/**********************************************************************/
/* */
/* Copy into screen position a line of text using 8x8 chars in rom. */
/* */
/* Hercules mono-graphic screen: */
/* The screen size is 720h X 348v, text is 80 X 25. */
/* The screen has four fields (0:3) of rows with each having a range */
/* of 0:86. Adjacent rows from the same field are displayed four */
/* lines apart on the screen. */
/* The character patterns are 7 X 9 (columns X rows) and are framed */
/* by a 9 X (12 + 2) box (the 2 does not occur on row 25). */
/* Each char code is translated to an index into the array in rom. */
/* */
/**********************************************************************/
/* */
/* This is ZEDIT source material. */
/* */
/* ZEDIT Source Materials are intellectual property */
/* (c) Copyright 1987,2001 by Clyde Thomas Zuber. */
/* */
/**********************************************************************/
{
extern struct rombios *romptr;
register int tab;
register int c; /* col */
register int f; /* field */
register int r; /* range */
register int d; /* down */
int start_field;
start_field = (line_no * 14) % 4;
for (r = (line_no * 14) / 4; ; ++r)
{
for (f = start_field; f < 4; ++f)
{
d = ((r * 4 + f) % 14) - 3;
c = 0;
for (tab = 0; tab < 90; ++tab)
{
if (d < 0 || d > 7)
posptr -> sa.pos[f].scr[r] [tab] = 0x00u;
else
switch(tab % 9)
{
case 0:
posptr -> sa.pos[f].scr[r] [tab] =
(char) (romptr -> rchr[ln[c]] [d] >> 1u);
++c;
break;
case 1:
posptr -> sa.pos[f].scr[r] [tab] =
(char) (romptr -> rchr[ln[c-1]] [d] << 7u) |
(char) (romptr -> rchr[ln[c]] [d] >> 2u);
++c;
break;
case 2:
posptr -> sa.pos[f].scr[r] [tab] =
(char) (romptr -> rchr[ln[c-1]] [d] << 6u) |
(char) (romptr -> rchr[ln[c]] [d] >> 3u);
++c;
break;
case 3:
posptr -> sa.pos[f].scr[r] [tab] =
(char) (romptr -> rchr[ln[c-1]] [d] << 5u) |
(char) (romptr -> rchr[ln[c]] [d] >> 4u);
++c;
break;
case 4:
posptr -> sa.pos[f].scr[r] [tab] =
(char) (romptr -> rchr[ln[c-1]] [d] << 4u) |
(char) (romptr -> rchr[ln[c]] [d] >> 5u);
++c;
break;
case 5:
posptr -> sa.pos[f].scr[r] [tab] =
(char) (romptr -> rchr[ln[c-1]] [d] << 3u) |
(char) (romptr -> rchr[ln[c]] [d] >> 6u);
++c;
break;
case 6:
posptr -> sa.pos[f].scr[r] [tab] =
(char) (romptr -> rchr[ln[c-1]] [d] << 2u) |
(char) (romptr -> rchr[ln[c]] [d] >> 7u);
break;
case 7:
posptr -> sa.pos[f].scr[r] [tab] =
(char) (romptr -> rchr[ln[c]] [d] << 1u);
++c;
break;
case 8:
posptr -> sa.pos[f].scr[r] [tab] =
romptr -> rchr[ln[c]] [d];
++c;
break;
} /* end switch */
} /* end for */
if (d == 10)
return;
} /* end for */
start_field = 0;
} /* end for */
} /* end ds8lhmn */