2
fmt_page(struct export *e, struct fmt_page *pg, struct vt_page *vtp)
6
u8 c, *p = vtp->data[0];
8
sprintf(buf, "\2%3x.%02x\7", vtp->pgno, vtp->subno & 0xff);
10
for (y = 0; y < H; y++)
12
/* two variables for each attribute
13
* new_attr -- information got from the latest char
14
* here_attr -- value of the attribute for this xy position
15
* So, if the attribute char is "Set-At"
18
* here_attr=new_attr=attribute(latest_char);
19
* ... processing ... (use here_attr !!!)
20
* here_attr=new_attr; // <-- unneeded,
21
* // but doesn't break the code
25
* new_attr=attribute(latest_char);
26
* ... processing ... (use here_attr !!!)
29
* Attributes persist until changed by another attribute
32
u8 held_mosaic_char=' ';
33
u8 dbl=0; /* set to 1 for double height page
34
* (is used at the end of row processing) */
36
u8 new_gfx=0, here_gfx=0; // Start-of-row default condition
37
u8 new_bg=0, here_bg=0; // Start-of-row default condition
38
u8 new_fg=7, here_fg=7; // Start-of-row default condition
39
u8 new_bln=0, here_bln=0; // Start-of-row default condition
40
u8 new_dbl=0, here_dbl=0; // Start-of-row default condition
41
u8 new_con=0, here_con=0; // Start-of-row default condition
42
u8 here_sep=0; /* Start-of-row default condition
43
* set/reset by 0x19,0x1a chars
44
* Both (0x19,0x1a) are Set-At
45
* so anyway (here_sep==new_sep) all the time
47
u8 new_hld=0, here_hld=0;
52
for (x = 0; x < W; ++x)
54
pg->data[y][x].ch=' '; // case 0x00 ... 0x1f
58
//Alpha Colour Codes (foreground)
61
new_fg=c; // in this case (c == (c & 0x07))
80
//Start Box (used with End Box to mark visible
81
// part of page on transparent ones
82
// eg. newsflash or subtitle )
98
//Double Width (for Presentation Level 2.5 and 3.5)
103
//Double Size (for Presentation Level 2.5 and 3.5)
108
//Mosaic Colour Codes
117
here_con=new_con=EA_CONCEALED;
120
//Contiguous Mosaic Graphics
125
//Separated Mosaic Graphics
127
here_sep=EA_SEPARATED;
142
here_bg=new_bg=here_fg;
155
// start of "... processing ..."
157
default: //noncontrol characters
159
/* **************************** */
160
/* special treating of sep
161
* when in Hold-Mosaics mode
162
* see the specs for details...
164
if (c & (1<<5)) //why "6" bit set is (1<<5) ????????
169
if (here_hld) //when in "hold" set 'here_sep' here:
170
pg->data[y][x].attr|=here_sep;
171
/* **************************** */
174
if (here_hld) c=held_mosaic_char;
176
if ((here_gfx) && ((c & 0xa0) == 0x20))
177
pg->data[y][x].ch= c + ((c & 0x40) ? 32 : -32);
179
if ((here_con) && (not e->reveal))
180
pg->data[y][x].ch=' ';
182
pg->data[y][x].fg=here_fg;
183
pg->data[y][x].bg=here_bg;
185
if (here_hld) // special treating again...
186
pg->data[y][x].attr=(here_dbl|here_gfx|
188
else // when not in "hold" set 'here_sep' here
189
pg->data[y][x].attr=(here_dbl|here_gfx|
190
here_bln|here_con|here_sep);
192
// end of "... processing ..."
204
for (x = 0; x < W; ++x)
206
if (~pg->data[y][x].attr & EA_DOUBLE)
207
pg->data[y][x].attr |= EA_HDOUBLE;
208
pg->data[y+1][x] = pg->data[y][x];
209
pg->data[y+1][x].ch = ' ';