http://www.ousob.com --- Legacy Redefined /* * (top left,bottom,right,FG,BG,blink,intensity,fill,shadow) */ #include <extend50.h> int far *vidbuf = (int far *)0xB8000000; typedef struct{ unsigned int ch_attr : 8; unsigned int foreGround : 3; unsigned int intensity : 1; unsigned int backGround : 3; unsigned int blink : 1; } ATTR; typedef union{ struct { unsigned char character; unsigned char attribute; } c; ATTR a; } CHR; CHR ch; unsigned char gc(int row, int col); CLIPPER b_box() { int i,j; int t = _parni(1); int l = _parni(2); int b = _parni(3); int r = _parni(4); int row = _parni(1); int col = _parni(2); int ht = ( _parni(3) - _parni(1) ); int wd = ( _parni(4) - _parni(2) ); int fill = _parni(9); int shadow = _parni(10); ch.a.foreGround = _parni(5); ch.a.backGround = _parni(6); ch.a.blink = _parni(7); ch.a.intensity = _parni(8); if( !ISNUM(1) && !ISNUM(2) && !ISNUM(3) && !ISNUM(4) && !ISNUM(5) && !ISNUM(6) && !ISNUM(7) && !ISNUM(8) && !ISNUM(9) && !ISNUM(10) ){ _ret(); return; } if( fill ){ for(i=t; i<=b; i++){ for(j=l; j<=r; j++){ *(vidbuf + i*80 + j) = (unsigned char)' ' | ch.c.attribute<<8; } } } *(vidbuf + (row*80) + col) = (unsigned char)'' | ch.c.attribute<<8; for(col=(l+1); col<(l+wd); col++){ *(vidbuf + (t*80) + col) = (unsigned char)'' | ch.c.attribute<<8; } *(vidbuf + (t*80) + (l+wd) ) = (unsigned char)'' | ch.c.attribute<<8; col = (l + wd ); for(row=(t+1); row<(t+1+ht); row++){ *(vidbuf + (row*80) + col) = (unsigned char)'' | ch.c.attribute<<8; } col = l; for(row=(t+1); row<(t+ht); row++){ *(vidbuf + (row*80) + col) = (unsigned char)'' | ch.c.attribute<<8; } *(vidbuf + (b*80) + l) = (unsigned char)'' | ch.c.attribute<<8; for(col=(l+1); col<(l+wd); col++){ *(vidbuf + (b*80) + col) = (unsigned char)'' | ch.c.attribute<<8; } *(vidbuf + (b*80) + r ) = (unsigned char)'' | ch.c.attribute<<8; if( shadow ){ ch.a.foreGround = 8; ch.a.intensity = 1; ch.a.backGround = 0; col = (l + wd + 1); for(row=(t+1); row <=(t+1+ht); row++){ *(vidbuf + (row*80) + col) = gc(row,col) | ch.c.attribute<<8; } row = (b+1); for(col=(l+2); col<(l+2+wd); col++){ *(vidbuf + (row*80) + col) = gc(row,col) | ch.c.attribute<<8; } } _ret(); } unsigned char gc(int row, int col) { return *(vidbuf + (row * 80) + col); }