Annotation of Net2/arch/hp300/stand/ite_rb.c, revision 1.1.1.2

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 and use in source and binary forms, with or without
                     11:  * modification, are permitted provided that the following conditions
                     12:  * are met:
                     13:  * 1. Redistributions of source code must retain the above copyright
                     14:  *    notice, this list of conditions and the following disclaimer.
                     15:  * 2. Redistributions in binary form must reproduce the above copyright
                     16:  *    notice, this list of conditions and the following disclaimer in the
                     17:  *    documentation and/or other materials provided with the distribution.
                     18:  * 3. All advertising materials mentioning features or use of this software
                     19:  *    must display the following acknowledgement:
                     20:  *     This product includes software developed by the University of
                     21:  *     California, Berkeley and its contributors.
                     22:  * 4. Neither the name of the University nor the names of its contributors
                     23:  *    may be used to endorse or promote products derived from this software
                     24:  *    without specific prior written permission.
                     25:  *
                     26:  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
                     27:  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
                     28:  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
                     29:  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
                     30:  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
                     31:  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
                     32:  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
                     33:  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
                     34:  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
                     35:  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
                     36:  * SUCH DAMAGE.
                     37:  *
                     38:  * from: Utah $Hdr: ite_rb.c 1.5 89/02/20$
                     39:  *
1.1.1.2 ! root       40:  *     from: @(#)ite_rb.c      7.2 (Berkeley) 12/16/90
        !            41:  *     ite_rb.c,v 1.2 1993/05/22 07:59:06 cgd Exp
1.1       root       42:  */
                     43: 
                     44: #include "samachdep.h"
                     45: 
                     46: #ifdef ITECONSOLE
                     47: 
                     48: #include "sys/param.h"
                     49: #include "../dev/itevar.h"
                     50: #include "../dev/itereg.h"
                     51: #include "../dev/grfvar.h"
                     52: #include "../dev/grf_rbreg.h"
                     53: 
                     54: #define REGBASE                ((struct rboxfb *)(ip->regbase))
                     55: #define WINDOWMOVER    rbox_windowmove
                     56: 
                     57: rbox_init(ip)
                     58:        struct ite_softc *ip;
                     59: {
                     60:        int i;
                     61:        
                     62:        rb_waitbusy(REGADDR);
                     63:        DELAY(3000);
                     64: 
                     65:        REGBASE->interrupt = 0x04;
                     66:        REGBASE->display_enable = 0x01;
                     67:        REGBASE->video_enable = 0x01;
                     68:        REGBASE->drive = 0x01;
                     69:        REGBASE->vdrive = 0x0;
                     70: 
                     71:        ite_devinfo(ip);
                     72:        
                     73:        REGBASE->opwen = 0xFF;
                     74: 
                     75:        /*
                     76:         * Clear the framebuffer.
                     77:         */
                     78:        rbox_windowmove(ip, 0, 0, 0, 0, ip->fbheight, ip->fbwidth, RR_CLEAR);
                     79:        rb_waitbusy(REGADDR);
                     80:        
                     81:        for(i = 0; i < 16; i++) {
                     82:                *(REGADDR + 0x63c3 + i*4) = 0x0;
                     83:                *(REGADDR + 0x6403 + i*4) = 0x0;
                     84:                *(REGADDR + 0x6803 + i*4) = 0x0;
                     85:                *(REGADDR + 0x6c03 + i*4) = 0x0;
                     86:                *(REGADDR + 0x73c3 + i*4) = 0x0;
                     87:                *(REGADDR + 0x7403 + i*4) = 0x0;
                     88:                *(REGADDR + 0x7803 + i*4) = 0x0;
                     89:                *(REGADDR + 0x7c03 + i*4) = 0x0;
                     90:        }
                     91: 
                     92:        REGBASE->rep_rule = 0x33;
                     93:        
                     94:        /*
                     95:         * I cannot figure out how to make the blink planes stop. So, we
                     96:         * must set both colormaps so that when the planes blink, and
                     97:         * the secondary colormap is active, we still get text.
                     98:         */
                     99:        CM1RED[0x00].value = 0x00;
                    100:        CM1GRN[0x00].value = 0x00;
                    101:        CM1BLU[0x00].value = 0x00;
                    102:        CM1RED[0x01].value = 0xFF;
                    103:        CM1GRN[0x01].value = 0xFF;
                    104:        CM1BLU[0x01].value = 0xFF;
                    105: 
                    106:        CM2RED[0x00].value = 0x00;
                    107:        CM2GRN[0x00].value = 0x00;
                    108:        CM2BLU[0x00].value = 0x00;
                    109:        CM2RED[0x01].value = 0xFF;
                    110:        CM2GRN[0x01].value = 0xFF;
                    111:        CM2BLU[0x01].value = 0xFF;
                    112: 
                    113:        REGBASE->blink = 0x00;
                    114:        REGBASE->write_enable = 0x01;
                    115:        REGBASE->opwen = 0x00;
                    116:        
                    117:        ite_fontinit(ip);
                    118: 
                    119:        /*
                    120:         * Stash the inverted cursor.
                    121:         */
                    122:        rbox_windowmove(ip, charY(ip, ' '), charX(ip, ' '),
                    123:                            ip->cblanky, ip->cblankx, ip->ftheight,
                    124:                            ip->ftwidth, RR_COPYINVERTED);
                    125: }
                    126: 
                    127: rbox_putc(ip, c, dy, dx, mode)
                    128:        register struct ite_softc *ip;
                    129:         register int dy, dx;
                    130:        int c, mode;
                    131: {
                    132:        rbox_windowmove(ip, charY(ip, c), charX(ip, c),
                    133:                        dy * ip->ftheight, dx * ip->ftwidth,
                    134:                        ip->ftheight, ip->ftwidth, RR_COPY);
                    135: }
                    136: 
                    137: rbox_cursor(ip, flag)
                    138:        register struct ite_softc *ip;
                    139:         register int flag;
                    140: {
                    141:        if (flag == DRAW_CURSOR)
                    142:                draw_cursor(ip)
                    143:        else if (flag == MOVE_CURSOR) {
                    144:                erase_cursor(ip)
                    145:                draw_cursor(ip)
                    146:        }
                    147:        else
                    148:                erase_cursor(ip)
                    149: }
                    150: 
                    151: rbox_clear(ip, sy, sx, h, w)
                    152:        struct ite_softc *ip;
                    153:        register int sy, sx, h, w;
                    154: {
                    155:        rbox_windowmove(ip, sy * ip->ftheight, sx * ip->ftwidth,
                    156:                        sy * ip->ftheight, sx * ip->ftwidth, 
                    157:                        h  * ip->ftheight, w  * ip->ftwidth,
                    158:                        RR_CLEAR);
                    159: }
                    160: 
                    161: rbox_scroll(ip, sy, sx, count, dir)
                    162:         register struct ite_softc *ip;
                    163:         register int sy, count;
                    164:         int dir, sx;
                    165: {
                    166:        register int dy = sy - count;
                    167:        register int height = ip->rows - sy;
                    168: 
                    169:        rbox_cursor(ip, ERASE_CURSOR);
                    170: 
                    171:        rbox_windowmove(ip, sy * ip->ftheight, sx * ip->ftwidth,
                    172:                        dy * ip->ftheight, sx * ip->ftwidth,
                    173:                        height * ip->ftheight,
                    174:                        ip->cols * ip->ftwidth, RR_COPY);
                    175: }
                    176: 
                    177: rbox_windowmove(ip, sy, sx, dy, dx, h, w, func)
                    178:        struct ite_softc *ip;
                    179:        int sy, sx, dy, dx, h, w, func;
                    180: {
                    181:        register struct rboxfb *rp = REGBASE;
                    182:        if (h == 0 || w == 0)
                    183:                return;
                    184:        
                    185:        rb_waitbusy(REGADDR);
                    186:        rp->rep_rule = func << 4 | func;
                    187:        rp->source_y = sy;
                    188:        rp->source_x = sx;
                    189:        rp->dest_y = dy;
                    190:        rp->dest_x = dx;
                    191:        rp->wheight = h;
                    192:        rp->wwidth  = w;
                    193:        rp->wmove = 1;
                    194: }
                    195: #endif

unix.superglobalmegacorp.com

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