Annotation of researchv10no/cmd/pico/3610op.h, revision 1.1.1.1

1.1       root        1: /*
                      2:  * Metheus library macros
                      3:  */
                      4: #include <libc.h>
                      5: #define        NMBUF   65536
                      6: char mbuf[NMBUF], *mbufp;
                      7: int mfd;
                      8: char *omdev;
                      9: #define        msnare() \
                     10:        if((omdev=getenv("FB"))==0) write(2, "Must set FB=/dev/om?\n", 21), exit(1);\
                     11:        if((mfd=open(omdev, 2))>=0) mbufp=mbuf; else perror(omdev), exit(1)
                     12: #define        mlong(a)        (mword((a)>>16), mword(a))
                     13: #define        mword(a)        (mbyte((a)>>8), mbyte(a))
                     14: #define        mbyte(a)        (mbufp==&mbuf[NMBUF] && mflush(), *mbufp++=(a))
                     15: /* versions of the above allowing moving checks out of the loop */
                     16: #define        mcheck(n)       (mbufp>=&mbuf[NMBUF-n] && mflush())
                     17: #define        mulong(a)       (muword((a)>>16), muword(a))
                     18: #define        muword(a)       (mubyte((a)>>8), mubyte(a))
                     19: #define        mubyte(a)       (*mbufp++=a)
                     20: #define        mcmd(a)         ((mbufp-mbuf)&1 && (*mbufp++=0), mword(a))
                     21: #define        mflush()        ((mbufp-mbuf)&1 && (*mbufp++=0),write(mfd, mbuf, (mbufp-mbuf)*sizeof mbuf[0]),mbufp=mbuf)
                     22: /*
                     23:  * Metheus Omega 3610 (and other 3000 series) opcode manifests
                     24:  */
                     25:                        /* arguments w: word, b: byte, l:long*/
                     26: #define        AFILL1  0x0068  /* */
                     27: #define        AFILL2  0x0069  /* w:edge value */
                     28: #define        AFILL3  0x0074  /*  */
                     29: #define        ARC     0x0062  /* w:length */
                     30: #define        BLANK   0x004b  /* b:mode */
                     31: #define        CARC    0x2000  /* w:cx, w:cy, w:sx, w:sy, w:angle */
                     32: #define        CHARS   0x006b  /* b*:character, b:esc */
                     33: #define        CIRCLE  0x2001  /* w:cx, w:cy, w:radius */
                     34: #define        CLEAR   0x0060  /*  */
                     35: #define        CMACT   0x3000  /*  */
                     36: #define        CMAP    0x0051  /* b:index, b:red, b:grn, b:blu */
                     37: #define        CMAPOL  0x301a  /* 8b:2 nibble-sized entries */
                     38: #define        CMBLNK  0x3019  /* w:count, ... */
                     39: #define        CMCOPY  0x3016  /* b:source, b:dest, w:srcindex, w:dstindex, w:count */
                     40: #define        CMFILL  0x3017  /* w:index, w:count, b:red, b:grn, b:blu */
                     41: #define        CMLDM   0x3013  /* w:index, w:count, b:red, b:grn, b:blu, ... */
                     42: #define        CMLOAD  0x3012  /* w:index, b:red, b:grn, b:blu */
                     43: #define        CMRAMP  0x3018  /* w:index, w:count, b:r0, b:g0, b:b0, b:r1, b:g1, b:b1 */
                     44: #define        CMSEL   0x3015  /* b:buff */
                     45: #define        CMWREN  0x3011  /* b:mask */
                     46: #define        COMPDR  0x0072  /*  */
                     47: #define        CSPACE  0x0048  /* b:dx, b:dy */
                     48: #define        CURS    0x0071  /*  */
                     49: #define        DFAULT  0x003f  /* b:reset */
                     50: #define        DRAW    0x0061  /*  */
                     51: #define        DRAWAL  0x3052  /*  */
                     52: #define        DRAWTA  0x0078  /* w:x, w:y */
                     53: #define        DRAWTL  0x0077  /* w:x, w:y */
                     54: #define        DRAWTS  0x0076  /* b:x, b:y */
                     55: #define        DRAWV   0x3050  /*  */
                     56: #define        DRRCUR  0x200c  /* b:index */
                     57: #define        FFILL   0x0065  /*  */
                     58: #define        FNTINX  0x3040  /* b:type */
                     59: #define        INI     0x005e  /*  */
                     60: #define        INQ     0x0041  /* w:parameter */
                     61: #define        LDFNTX  0x3041  /* b:type, b:ESC, w:0, w:0, b:height, b:width, ... */
                     62: #define        LDPATX  0x3042  /* w:pattern, ... */
                     63: #define        LDRCUR  0x3045  /* b:index, ... */
                     64: #define        MINVEC  0x3051  /* w:length */
                     65: #define        MODEB   0x007e  /*  */
                     66: #define        MODEW   0x007f  /*  */
                     67: #define        MOVP1   0x0052  /* w:x, w:y */
                     68: #define        MOVP2   0x0053  /* w:x, w:y */
                     69: #define        NOP     0x0000  /*  */
                     70: #define        PATRNX  0x3043  /* w:pattern */
                     71: #define        PIXBLT  0x0070  /* w:width, w:height, b:pattern */
                     72: #define        POLYC   0x0044  /*  */
                     73: #define        POLYD   0x2200          /* + count */   /* w:x, w:y, ... */
                     74: #define        POLYF   0x0067  /*  */
                     75: #define        POLYLN  0x2100          /* + count */   /* w:x, w:y, ... */
                     76: #define        POLYM   0x0045  /* w:x, w:y */
                     77: #define        POLYO   0x0066  /*  */
                     78: #define        POLYS   0x0056  /*  */
                     79: #define        POLYV   0x0057  /* w:x, w:y */
                     80: #define        PPAN    0x005b  /*  */
                     81: #define        RASTOP  0x0043  /* b:function, b:alu */
                     82: #define        RDCONF  0x005d  /*  */
                     83: #define        RDMSK   0x004c  /* b:mask */
                     84: #define        RDMSKL  0x3025  /* l:mask */
                     85: #define        RDMSKS  0x3024  /* w:mask */
                     86: #define        RDR     0x006e  /*  */
                     87: #define        RDRS    0x3035  /*  */
                     88: #define        RECT1   0x0063  /*  */
                     89: #define        RECT2   0x0064  /*  */
                     90: #define        RESTOR  0x0037  /*  */
                     91: #define        RLFILL  0x006a  /* w:runlength */
                     92: #define        RMOVP1  0x0054  /* w:x, w:y */
                     93: #define        RMOVP2  0x0055  /* w:x, w:y */
                     94: #define        RMVP1S  0x0033  /* b:x, b:y */
                     95: #define        RMVP2S  0x0034  /* b:x, b:y */
                     96: #define        RPIXEL  0x006c  /*  */
                     97: #define        SAVE    0x0036  /*  */
                     98: #define        SELRES  0x301c  /* b:resolution */
                     99: #define        SETAL   0x3053  /* w:level */
                    100: #define        SETCLL  0x3061  /* l:color */
                    101: #define        SETCLS  0x3060  /* w:color */
                    102: #define        SETCOL  0x004e  /* b:color */
                    103: #define        SETCSZ  0x0058  /* b:width, b:height */
                    104: #define        SETORN  0x0059  /* b:direction */
                    105: #define        SETROC  0x0042  /* b:cmd, b:data, ..., b:end */
                    106: #define        SIGRD   0x005c  /*  */
                    107: #define        SWSCEN  0x301b  /* w:mode */
                    108: #define        SYNCH   0x005f  /* b:wait count */
                    109: #define        SZCURS  0x0047  /* w:width, w:height */
                    110: #define        WPIXEL  0x006d  /*  */
                    111: #define        WRBANK  0x003d  /* b:bank */
                    112: #define        WRMASK  0x004f  /* b:mask */
                    113: #define        WRMSKL  0x3023  /* l:mask */
                    114: #define        WRMSKS  0x3022  /* w:mask */
                    115: #define        WRR     0x006f  /* b:data, ... */
                    116: #define        WRRS    0x3032  /* w:data, ... */
                    117: #define        XDRAW   0x0073  /*  */
                    118: #define        ZOOM    0x005a  /* b:scale */

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.