|
|
1.1 ! root 1: #define DADDR ((unsigned short *)(0x500000)) /* display base address/4 */ ! 2: #define YMOUSE ((short *)(0x400000)) ! 3: #define XMOUSE ((short *)(0x400002)) ! 4: #define WORDSHIFT 5 ! 5: #define WORDSIZE 32 ! 6: #define WORDMASK (WORDSIZE-1) ! 7: #define ONES 0xFFFFFFFF ! 8: #define FIRSTBIT ((unsigned)0x80000000) ! 9: #define LASTBIT ((unsigned)0x1) ! 10: #define XMAX 800 ! 11: #define YMAX 1024 ! 12: ! 13: #define TGROW 1 ! 14: #define TMOVE 0 ! 15: ! 16: typedef int Word; /* 32 bits */ ! 17: ! 18: typedef unsigned int UWord; /* 32 bits */ ! 19: ! 20: typedef struct Point { ! 21: short x; ! 22: short y; ! 23: } Point; ! 24: ! 25: typedef struct Rectangle { ! 26: Point origin; ! 27: Point corner; ! 28: } Rectangle; ! 29: ! 30: #ifdef lint ! 31: extern Point Pt(); ! 32: extern Rectangle Rect(); ! 33: extern Rectangle Rpt(); ! 34: #else ! 35: #define Pt(x, y) ((((short)(y))<<16)|((unsigned short)(x))) ! 36: #define Rect(x1, y1, x2, y2) Pt(x1, y1), Pt(x2, y2) ! 37: #define Rpt(p1, p2) (p1), (p2) ! 38: #endif ! 39: ! 40: typedef struct Bitmap { ! 41: int jname; /* symbolic name agreed on by host and terminal */ ! 42: Rectangle rect; /* rectangle in data area, local coords */ ! 43: } Bitmap; ! 44: ! 45: typedef struct Menu{ ! 46: char **item; /* string array, ending with 0 */ ! 47: char *(*generator)(); /* used if item == 0 */ ! 48: } Menu; ! 49: ! 50: typedef struct Texture32 { ! 51: Word bits[32]; ! 52: } Texture32; ! 53: ! 54: typedef struct Texture { ! 55: short bits[16]; ! 56: } Texture; ! 57: ! 58: typedef struct Mouse { ! 59: Point xy; ! 60: short buttons; ! 61: } Mouse; ! 62: ! 63: ! 64: extern Mouse mouseQ[]; ! 65: extern int Qnum; ! 66: ! 67: typedef struct Fontchar ! 68: { ! 69: short x; /* left edge of bits */ ! 70: unsigned char top; /* first non-zero scan-line */ ! 71: unsigned char bottom; /* last non-zero scan-line */ ! 72: char left; /* offset of baseline */ ! 73: unsigned char width; /* width of baseline */ ! 74: short junk; /* there are two bytes of junk in the DMD files */ ! 75: } Fontchar; ! 76: ! 77: typedef struct Font ! 78: { ! 79: short n; /* number of chars in font */ ! 80: char height; /* height of bitmap */ ! 81: char ascent; /* top of bitmap to baseline */ ! 82: long unused; /* in case we think of more stuff */ ! 83: Fontchar info[1]; /* n+1 character descriptors */ ! 84: } Font; ! 85: ! 86: extern Font *getfont(); /* takes the font name char *name */ ! 87: extern Font *fntab[]; ! 88: #define defont (*fntab[0]) ! 89: ! 90: extern int mousebuttons(); ! 91: extern Point mousexy(); ! 92: #define button(i) (mousebuttons()&(8>>i)) ! 93: #define button1() (mousebuttons()&4) ! 94: #define button2() (mousebuttons()&2) ! 95: #define button3() (mousebuttons()&1) ! 96: #define button12() (mousebuttons()&6) ! 97: #define button13() (mousebuttons()&5) ! 98: #define button23() (mousebuttons()&3) ! 99: #define button123() (mousebuttons()&7) ! 100: ! 101: Rectangle getrectb(), getrect(); ! 102: #define getrect1() getrectb(4) ! 103: #define getrect2() getrectb(2) ! 104: #define getrect3() getrectb(1) ! 105: #define getrect12() getrectb(6) ! 106: #define getrect13() getrectb(5) ! 107: #define getrect23() getrectb(3) ! 108: #define getrect123() getrectb(7) ! 109: ! 110: #define muldiv(a,b,c) ((long)((a)*((long)b)/(c))) ! 111: ! 112: extern Word topbits[], botbits[]; /* now full 32 bit words */ ! 113: extern Rectangle Jrect; ! 114: extern Rectangle Drect; ! 115: extern Bitmap BMT[]; ! 116: #define display BMT[0] ! 117: ! 118: typedef int Code; ! 119: #define F_STORE ((Code) 0) /* target = source */ ! 120: #define F_OR ((Code) 1) /* target |= source */ ! 121: #define F_CLR ((Code) 2) /* target &= ~source */ ! 122: #define F_XOR ((Code) 3) /* target ^= source */ ! 123: Point add(), sub(), mul(), div(), jstring(), string(); ! 124: Rectangle rsubp(), raddp(), inset(); ! 125: Bitmap *balloc(); ! 126: Texture *cursswitch(); ! 127: Point trackarc(), trackbox(), trackcircle(); ! 128: Point trackdisc(), trackelarc(), trackeldisc(); ! 129: Point trackellipse(), trackline(), trackrect(); ! 130: Point trackstring(); ! 131: ! 132: #ifndef NULL ! 133: #define NULL ((char *)0) ! 134: #endif ! 135: ! 136: #define KBD 1 ! 137: #define SEND 2 ! 138: #define MOUSE 4 ! 139: #define RCV 8 ! 140: #define CPU 16 ! 141: #define ALARM 32 ! 142: ! 143: /* states */ ! 144: #define RUN 1 /* ready to be scheduled */ ! 145: #define BUSY 2 /* active */ ! 146: #define BLOCKED 4 /* blocked by user with ^S */ ! 147: #define USER 8 /* a user-68ld'd process */ ! 148: #define KBDLOCAL 16 /* has requested the KBD */ ! 149: #define MOUSELOCAL 32 /* has requested the MOUSE */ ! 150: #define GOTMOUSE 64 /* currently owns MOUSE */ ! 151: #define WAKEUP 128 /* tell CONTROL to issue setrun(p) */ ! 152: #define MOVED 256 /* layer got moved */ ! 153: #define UNBLOCKED 512 /* Has been unblocked */ ! 154: #define ZOMBIE 1024 /* proc died horribly; waiting for debugger */ ! 155: #define RESHAPED 2048 /* layer got reshaped */ ! 156: #define ZOMBOOT 4096 /* put in ZOMBIE state after booting */ ! 157: #define ALARMREQD 8192 /* has requested an alarm */ ! 158:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.