|
|
1.1 ! root 1: /* ! 2: * Model 5620 DMD ! 3: */ ! 4: ! 5: #include <sys/2681.h> ! 6: ! 7: #define DUART ((struct duart *)0x200000) ! 8: #define TVIDEO (DUART->scc_sopbc = 0x02) ! 9: #define RVIDEO (DUART->scc_ropbc = 0x02) ! 10: #define BonW() RVIDEO ! 11: #define WonB() TVIDEO ! 12: #define DADDR ((unsigned short *)(0x500000)) /* display base address/4 */ ! 13: #define YMOUSE ((short *)(0x400000)) ! 14: #define XMOUSE ((short *)(0x400002)) ! 15: #define WORDSHIFT 5 ! 16: #define WORDSIZE 32 ! 17: #define WORDMASK (WORDSIZE-1) ! 18: #define ONES 0xFFFFFFFF ! 19: #define FIRSTBIT ((unsigned)0x80000000) ! 20: #define LASTBIT ((unsigned)0x1) ! 21: #define XMAX 800 ! 22: #define YMAX 1024 ! 23: ! 24: /* ! 25: * Graphics definitions ! 26: */ ! 27: ! 28: typedef int Word; /* 32 bits */ ! 29: ! 30: typedef unsigned int UWord; /* 32 bits */ ! 31: ! 32: typedef struct Point { ! 33: short x; ! 34: short y; ! 35: } Point; ! 36: ! 37: typedef struct Rectangle { ! 38: Point origin; ! 39: Point corner; ! 40: } Rectangle; ! 41: ! 42: typedef struct Bitmap { ! 43: Word *base; /* pointer to start of data */ ! 44: unsigned width; /* width in 32 bit words of total data area */ ! 45: Rectangle rect; /* rectangle in data area, local coords */ ! 46: char *_null; /* unused, always zero */ ! 47: } Bitmap; ! 48: ! 49: typedef struct Menu { ! 50: char **item; /* string array, ending with 0 */ ! 51: short n; /* number of items, deduced by menuhit */ ! 52: short lasty; ! 53: Bitmap *b; /* storage for menu and overlay */ ! 54: } Menu; ! 55: ! 56: typedef struct Texture32 { ! 57: Word bits[32]; ! 58: } Texture32; ! 59: ! 60: typedef struct Texture { ! 61: short bits[16]; ! 62: } Texture; ! 63: ! 64: extern struct Mouse { ! 65: Point xy, jxy; ! 66: short buttons; ! 67: } mouse; ! 68: ! 69: #define Pt(x, y) ((((short)(x))<<16)|((unsigned short)(y))) ! 70: #define Rect(x1, y1, x2, y2) Pt(x1, y1), Pt(x2, y2) ! 71: #define Rpt(p1, p2) (p1), (p2) ! 72: ! 73: #define button(i) (mouse.buttons&(8>>i)) ! 74: #define button1() (mouse.buttons&4) ! 75: #define button2() (mouse.buttons&2) ! 76: #define button3() (mouse.buttons&1) ! 77: #define button12() (mouse.buttons&6) ! 78: #define button13() (mouse.buttons&5) ! 79: #define button23() (mouse.buttons&3) ! 80: #define button123() (mouse.buttons&7) ! 81: ! 82: #define muldiv(a,b,c) ((long)((a)*((long)b)/(c))) ! 83: ! 84: extern Word topbits[], botbits[]; /* now full 32 bit words */ ! 85: extern Rectangle Jrect; ! 86: extern Bitmap display; ! 87: ! 88: /* ! 89: * Function Codes ! 90: */ ! 91: typedef int Code; ! 92: #define F_STORE ((Code) 0) /* target = source */ ! 93: #define F_OR ((Code) 1) /* target |= source */ ! 94: #define F_CLR ((Code) 2) /* target &= ~source */ ! 95: #define F_XOR ((Code) 3) /* target ^= source */ ! 96: ! 97: Point add(), sub(), mul(), div(), jstring(), string(); ! 98: Rectangle rsubp(), raddp(), inset(); ! 99: Word *addr(); ! 100: char *alloc(), *gcalloc(); ! 101: Bitmap *balloc(); ! 102: Texture *cursswitch(); ! 103: #define NULL ((char *)0) ! 104: #define KBD 1 ! 105: #define SEND 2 ! 106: #define MOUSE 4 ! 107: #define RCV 8 ! 108: #define CPU 16 ! 109: #define ALARM 32 ! 110: ! 111: #define ringbell() DUART->b_data=0x08,nap(3),DUART->b_data=0 ! 112: ! 113: #ifdef MPX ! 114: #include <mpx.h> ! 115: #include <setup.h> ! 116: extern Rectangle Drect; ! 117: #else ! 118: #ifndef MPXTERM ! 119: #define sw(n) ! 120: #define request(n) ! 121: #define sleep(n) nap(n) ! 122: #define exit() reboot() ! 123: #define transform(p) (p) ! 124: #define rtransform(r) (r) ! 125: #endif ! 126: #define Drect Jrect ! 127: #endif ! 128: #ifdef lint ! 129: #undef sleep ! 130: #undef request ! 131: #undef sw ! 132: #undef unblock ! 133: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.