Annotation of 43BSDReno/sys/hpstand/ite_rb.c, revision 1.1

1.1     ! root        1: /*
        !             2:  * Copyright (c) 1988 University of Utah.
        !             3:  * Copyright (c) 1990 The Regents of the University of California.
        !             4:  * All rights reserved.
        !             5:  *
        !             6:  * This code is derived from software contributed to Berkeley by
        !             7:  * the Systems Programming Group of the University of Utah Computer
        !             8:  * Science Department.
        !             9:  *
        !            10:  * Redistribution is only permitted until one year after the first shipment
        !            11:  * of 4.4BSD by the Regents.  Otherwise, redistribution and use in source and
        !            12:  * binary forms are permitted provided that: (1) source distributions retain
        !            13:  * this entire copyright notice and comment, and (2) distributions including
        !            14:  * binaries display the following acknowledgement:  This product includes
        !            15:  * software developed by the University of California, Berkeley and its
        !            16:  * contributors'' in the documentation or other materials provided with the
        !            17:  * distribution and in all advertising materials mentioning features or use
        !            18:  * of this software.  Neither the name of the University nor the names of
        !            19:  * its contributors may be used to endorse or promote products derived from
        !            20:  * this software without specific prior written permission.
        !            21:  * THIS SOFTWARE IS PROVIDED AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
        !            22:  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
        !            23:  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
        !            24:  *
        !            25:  * from: Utah $Hdr: ite_rb.c 1.5 89/02/20$
        !            26:  *
        !            27:  *     @(#)ite_rb.c    7.1 (Berkeley) 5/8/90
        !            28:  */
        !            29: 
        !            30: #include "samachdep.h"
        !            31: 
        !            32: #ifdef ITECONSOLE
        !            33: 
        !            34: #include "param.h"
        !            35: #include "../hpdev/itevar.h"
        !            36: #include "../hpdev/itereg.h"
        !            37: #include "../hpdev/grfvar.h"
        !            38: #include "../hpdev/grf_rbreg.h"
        !            39: 
        !            40: #define REGBASE                ((struct rboxfb *)(ip->regbase))
        !            41: #define WINDOWMOVER    rbox_windowmove
        !            42: 
        !            43: rbox_init(ip)
        !            44:        struct ite_softc *ip;
        !            45: {
        !            46:        int i;
        !            47:        
        !            48:        rb_waitbusy(REGADDR);
        !            49:        DELAY(3000);
        !            50: 
        !            51:        REGBASE->interrupt = 0x04;
        !            52:        REGBASE->display_enable = 0x01;
        !            53:        REGBASE->video_enable = 0x01;
        !            54:        REGBASE->drive = 0x01;
        !            55:        REGBASE->vdrive = 0x0;
        !            56: 
        !            57:        ite_devinfo(ip);
        !            58:        
        !            59:        REGBASE->opwen = 0xFF;
        !            60: 
        !            61:        /*
        !            62:         * Clear the framebuffer.
        !            63:         */
        !            64:        rbox_windowmove(ip, 0, 0, 0, 0, ip->fbheight, ip->fbwidth, RR_CLEAR);
        !            65:        rb_waitbusy(REGADDR);
        !            66:        
        !            67:        for(i = 0; i < 16; i++) {
        !            68:                *(REGADDR + 0x63c3 + i*4) = 0x0;
        !            69:                *(REGADDR + 0x6403 + i*4) = 0x0;
        !            70:                *(REGADDR + 0x6803 + i*4) = 0x0;
        !            71:                *(REGADDR + 0x6c03 + i*4) = 0x0;
        !            72:                *(REGADDR + 0x73c3 + i*4) = 0x0;
        !            73:                *(REGADDR + 0x7403 + i*4) = 0x0;
        !            74:                *(REGADDR + 0x7803 + i*4) = 0x0;
        !            75:                *(REGADDR + 0x7c03 + i*4) = 0x0;
        !            76:        }
        !            77: 
        !            78:        REGBASE->rep_rule = 0x33;
        !            79:        
        !            80:        /*
        !            81:         * I cannot figure out how to make the blink planes stop. So, we
        !            82:         * must set both colormaps so that when the planes blink, and
        !            83:         * the secondary colormap is active, we still get text.
        !            84:         */
        !            85:        CM1RED[0x00].value = 0x00;
        !            86:        CM1GRN[0x00].value = 0x00;
        !            87:        CM1BLU[0x00].value = 0x00;
        !            88:        CM1RED[0x01].value = 0xFF;
        !            89:        CM1GRN[0x01].value = 0xFF;
        !            90:        CM1BLU[0x01].value = 0xFF;
        !            91: 
        !            92:        CM2RED[0x00].value = 0x00;
        !            93:        CM2GRN[0x00].value = 0x00;
        !            94:        CM2BLU[0x00].value = 0x00;
        !            95:        CM2RED[0x01].value = 0xFF;
        !            96:        CM2GRN[0x01].value = 0xFF;
        !            97:        CM2BLU[0x01].value = 0xFF;
        !            98: 
        !            99:        REGBASE->blink = 0x00;
        !           100:        REGBASE->write_enable = 0x01;
        !           101:        REGBASE->opwen = 0x00;
        !           102:        
        !           103:        ite_fontinit(ip);
        !           104: 
        !           105:        /*
        !           106:         * Stash the inverted cursor.
        !           107:         */
        !           108:        rbox_windowmove(ip, charY(ip, ' '), charX(ip, ' '),
        !           109:                            ip->cblanky, ip->cblankx, ip->ftheight,
        !           110:                            ip->ftwidth, RR_COPYINVERTED);
        !           111: }
        !           112: 
        !           113: rbox_putc(ip, c, dy, dx, mode)
        !           114:        register struct ite_softc *ip;
        !           115:         register int dy, dx;
        !           116:        int c, mode;
        !           117: {
        !           118:        rbox_windowmove(ip, charY(ip, c), charX(ip, c),
        !           119:                        dy * ip->ftheight, dx * ip->ftwidth,
        !           120:                        ip->ftheight, ip->ftwidth, RR_COPY);
        !           121: }
        !           122: 
        !           123: rbox_cursor(ip, flag)
        !           124:        register struct ite_softc *ip;
        !           125:         register int flag;
        !           126: {
        !           127:        if (flag == DRAW_CURSOR)
        !           128:                draw_cursor(ip)
        !           129:        else if (flag == MOVE_CURSOR) {
        !           130:                erase_cursor(ip)
        !           131:                draw_cursor(ip)
        !           132:        }
        !           133:        else
        !           134:                erase_cursor(ip)
        !           135: }
        !           136: 
        !           137: rbox_clear(ip, sy, sx, h, w)
        !           138:        struct ite_softc *ip;
        !           139:        register int sy, sx, h, w;
        !           140: {
        !           141:        rbox_windowmove(ip, sy * ip->ftheight, sx * ip->ftwidth,
        !           142:                        sy * ip->ftheight, sx * ip->ftwidth, 
        !           143:                        h  * ip->ftheight, w  * ip->ftwidth,
        !           144:                        RR_CLEAR);
        !           145: }
        !           146: 
        !           147: rbox_scroll(ip, sy, sx, count, dir)
        !           148:         register struct ite_softc *ip;
        !           149:         register int sy, count;
        !           150:         int dir, sx;
        !           151: {
        !           152:        register int dy = sy - count;
        !           153:        register int height = ip->rows - sy;
        !           154: 
        !           155:        rbox_cursor(ip, ERASE_CURSOR);
        !           156: 
        !           157:        rbox_windowmove(ip, sy * ip->ftheight, sx * ip->ftwidth,
        !           158:                        dy * ip->ftheight, sx * ip->ftwidth,
        !           159:                        height * ip->ftheight,
        !           160:                        ip->cols * ip->ftwidth, RR_COPY);
        !           161: }
        !           162: 
        !           163: rbox_windowmove(ip, sy, sx, dy, dx, h, w, func)
        !           164:        struct ite_softc *ip;
        !           165:        int sy, sx, dy, dx, h, w, func;
        !           166: {
        !           167:        register struct rboxfb *rp = REGBASE;
        !           168:        if (h == 0 || w == 0)
        !           169:                return;
        !           170:        
        !           171:        rb_waitbusy(REGADDR);
        !           172:        rp->rep_rule = func << 4 | func;
        !           173:        rp->source_y = sy;
        !           174:        rp->source_x = sx;
        !           175:        rp->dest_y = dy;
        !           176:        rp->dest_x = dx;
        !           177:        rp->wheight = h;
        !           178:        rp->wwidth  = w;
        !           179:        rp->wmove = 1;
        !           180: }
        !           181: #endif

unix.superglobalmegacorp.com

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