11 #define ror(x,n) ((x >> n) | (x << (8-n))) 63 if ((style < 0) || (style >= NSTYLES))
75 if ((num < 0) || (num >= NSTYLES))
77 if (num == 0)
return (
MFBOK);
88 int xl, yl, dx, dy, dy2, errterm = 0, next, lcnt;
90 unsigned char cbuf, left, right;
91 union {
unsigned short color2;
unsigned char c[2]; }
c;
102 outpw(0x3ce,
c.color2 & 0xff00);
109 left = (0xff >> (xl & 7));
110 right = ~(0xff >> (x & 7));
111 dx = (x >> 3) - (xl >>= 3) - 1;
112 if (dx < 0) { left &= right; dx = 0; right = 0; }
141 cbuf = 0x80 >> (xl & 7);
155 rgen =
pc.
base + (x >> 3) + (
long) lcnt*next;
156 left = 0x80 >> ((lcnt+xl) & 7);
187 cbuf = 0x80 >> (xl & 7);
199 while (errterm > 0 && xl <= x) {
203 if (cbuf & 0x80) rgen++;
212 rgen =
pc.
base + (xl >> 3) + (
long) lcnt*next;
213 left = 0x80 >> ((lcnt+xl) & 7);
221 cbuf = 0x80 >> (xl & 7);
236 while (errterm > 0 && xl <= x) {
243 if (cbuf & 0x80) rgen++;
264 int xl, yl, dy, dy2, errterm = 0, next, lcnt;
266 unsigned char cbuf, left, right;
267 union {
unsigned short o[2];
long l; } p1, p2;
268 union {
unsigned short color2;
unsigned char c[2]; }
c;
288 if (p1.o[1] != p2.o[1])
298 if ((
unsigned)rgen & 1) {
304 *(rgen + dx - 1) =
c.c[0];
307 *(
short far *)rgen =
c.color2;
319 if (p1.o[1] != p2.o[1]) {
320 outp(0x3cd,cbuf + 0x11);
325 *(rgen + dx - 1) =
c.c[0];
328 *(
short far *)rgen =
c.color2;
344 p1.l = xl + (long) lcnt*
pc.
xsize;
345 left = 0x80 >> ((lcnt+xl) & 7);
358 if (p1.o[1] != p2.o[1]) {
359 outp(0x3cd,cbuf + 0x11);
383 p1.l = xl + (long) lcnt*next;
395 if ((cbuf & 0xf) != p1.o[1]) {
402 left = 0x80 >> ((lcnt+xl) & 7);
414 if ((cbuf & 0xf) != p1.o[1]) {
436 p1.l = xl + (long) (
pc.
ysize-1-yl)*next;
448 if ((cbuf & 0xf) != p1.o[1]) {
459 while (errterm > 0 && xl <= x) {
460 if ((cbuf & 0xf) != p1.o[1]) {
478 p1.l = xl + (long) lcnt*next;
479 left = 0x80 >> ((lcnt+xl) & 7);
494 if ((cbuf & 0xf) != p1.o[1]) {
501 *(
pc.
base + p1.o[0]) =
c.color2;
507 while (errterm > 0 && xl <= x) {
509 if ((cbuf & 0xf) != p1.o[1]) {
516 *(
pc.
base + p1.o[0]) =
c.color2;
538 int xl, yl, dx, dy, dy2, errterm = 0, next, lcnt;
539 unsigned left, right;
540 union {
unsigned short color2;
unsigned char c[2]; }
c;
564 if ((
unsigned)rgen & 1) {
570 *(rgen + dx - 1) =
c.c[0];
573 *(
short*)rgen =
c.color2;
587 left = 0x80 >> ((lcnt+xl) & 7);
610 rgen =
pc.
base + xl + (long) lcnt*next;
621 left = 0x80 >> ((lcnt+xl) & 7);
646 rgen =
pc.
base + xl + (long) lcnt*next;
666 while (errterm > 0 && xl <= x) {
679 left = 0x80 >> ((lcnt+xl) & 7);
702 while (errterm > 0 && xl <= x) {
void MFBLine(int x0, int y0, int x1, int y1)
int MFBDefineLineStyle(int num, int mask)
unsigned char linestyles[NSTYLES]
static void mode_1_line()
int MFBSetLineStyle(int style)
while(TDesc->tSucc!=NULL)
#define MFBSwapInt(f1, f2)
static void mode_2_line()
void MFBDrawLineTo(int x, int y)
void MFBMoveTo(int x, int y)