Annotation of Net2/arch/hp300/stand/ite_dv.c, revision 1.1.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 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_dv.c 1.1 89/02/28$
                     39:  *
                     40:  *     @(#)ite_dv.c    7.2 (Berkeley) 12/16/90
                     41:  */
                     42: 
                     43: #include "samachdep.h"
                     44: 
                     45: #ifdef ITECONSOLE
                     46: 
                     47: #include "sys/param.h"
                     48: #include "../dev/itevar.h"
                     49: #include "../dev/itereg.h"
                     50: #include "../dev/grfvar.h"
                     51: #include "../dev/grf_dvreg.h"
                     52: 
                     53: #define REGBASE                ((struct dvboxfb *)(ip->regbase))
                     54: #define WINDOWMOVER    dvbox_windowmove
                     55: 
                     56: dvbox_init(ip)
                     57:        struct ite_softc *ip;
                     58: {
                     59:        int i;
                     60:        
                     61:        dv_reset(REGADDR);
                     62:        DELAY(4000);
                     63: 
                     64:        /*
                     65:         * Turn on frame buffer, turn on overlay planes, set replacement
                     66:         * rule, enable top overlay plane writes for ite, disable all frame
                     67:         * buffer planes, set byte per pixel, and display frame buffer 0.
                     68:         * Lastly, turn on the box.
                     69:         */
                     70:        REGBASE->interrupt = 0x04;
                     71:        REGBASE->drive     = 0x10;              
                     72:        REGBASE->rep_rule  = RR_COPY << 4 | RR_COPY;
                     73:        REGBASE->opwen     = 0x01;
                     74:        REGBASE->fbwen     = 0x0;
                     75:        REGBASE->fold      = 0x01;
                     76:        REGBASE->vdrive    = 0x0;
                     77:        REGBASE->dispen    = 0x01;
                     78: 
                     79:        /*
                     80:         * Video enable top overlay plane.
                     81:         */
                     82:        REGBASE->opvenp = 0x01;
                     83:        REGBASE->opvens = 0x01;
                     84: 
                     85:        /*
                     86:         * Make sure that overlay planes override frame buffer planes.
                     87:         */
                     88:        REGBASE->ovly0p  = 0x0;
                     89:        REGBASE->ovly0s  = 0x0;
                     90:        REGBASE->ovly1p  = 0x0;
                     91:        REGBASE->ovly1s  = 0x0;
                     92:        REGBASE->fv_trig = 0x1;
                     93:        DELAY(400);
                     94: 
                     95:        /*
                     96:         * Setup the overlay colormaps. Need to set the 0,1 (black/white)
                     97:         * color for both banks.
                     98:         */
                     99: 
                    100:        for (i = 0; i <= 1; i++) {
                    101:                REGBASE->cmapbank = i;
                    102:                REGBASE->rgb[0].red   = 0x00;
                    103:                REGBASE->rgb[0].green = 0x00;
                    104:                REGBASE->rgb[0].blue  = 0x00;
                    105:                REGBASE->rgb[1].red   = 0xFF;
                    106:                REGBASE->rgb[1].green = 0xFF;
                    107:                REGBASE->rgb[1].blue  = 0xFF;
                    108:        }
                    109:        REGBASE->cmapbank = 0;
                    110:        
                    111:        db_waitbusy(REGADDR);
                    112: 
                    113:        ite_devinfo(ip);
                    114:        ite_fontinit(ip);
                    115: 
                    116:        /*
                    117:         * Clear the (visible) framebuffer.
                    118:         */
                    119:        dvbox_windowmove(ip, 0, 0, 0, 0, ip->dheight, ip->dwidth, RR_CLEAR);
                    120:        db_waitbusy(REGADDR);
                    121: 
                    122:        /*
                    123:         * Stash the inverted cursor.
                    124:         */
                    125:        dvbox_windowmove(ip, charY(ip, ' '), charX(ip, ' '),
                    126:                         ip->cblanky, ip->cblankx, ip->ftheight,
                    127:                         ip->ftwidth, RR_COPYINVERTED);
                    128:        db_waitbusy(REGADDR);
                    129: }
                    130: 
                    131: dvbox_putc(ip, c, dy, dx, mode)
                    132:        register struct ite_softc *ip;
                    133:         register int dy, dx;
                    134:        int c, mode;
                    135: {
                    136:        dvbox_windowmove(ip, charY(ip, c), charX(ip, c),
                    137:                         dy * ip->ftheight, dx * ip->ftwidth,
                    138:                         ip->ftheight, ip->ftwidth, RR_COPY);
                    139: }
                    140: 
                    141: dvbox_cursor(ip, flag)
                    142:        register struct ite_softc *ip;
                    143:         register int flag;
                    144: {
                    145:        if (flag == DRAW_CURSOR)
                    146:                draw_cursor(ip)
                    147:        else if (flag == MOVE_CURSOR) {
                    148:                erase_cursor(ip)
                    149:                draw_cursor(ip)
                    150:        }
                    151:        else
                    152:                erase_cursor(ip)
                    153: }
                    154: 
                    155: dvbox_clear(ip, sy, sx, h, w)
                    156:        struct ite_softc *ip;
                    157:        register int sy, sx, h, w;
                    158: {
                    159:        dvbox_windowmove(ip, sy * ip->ftheight, sx * ip->ftwidth,
                    160:                         sy * ip->ftheight, sx * ip->ftwidth, 
                    161:                         h  * ip->ftheight, w  * ip->ftwidth,
                    162:                         RR_CLEAR);
                    163: }
                    164: 
                    165: dvbox_scroll(ip, sy, sx, count, dir)
                    166:         register struct ite_softc *ip;
                    167:         register int sy, count;
                    168:         int dir, sx;
                    169: {
                    170:        register int dy = sy - count;
                    171:        register int height = ip->rows - sy;
                    172: 
                    173:        dvbox_cursor(ip, ERASE_CURSOR);
                    174: 
                    175:        dvbox_windowmove(ip, sy * ip->ftheight, sx * ip->ftwidth,
                    176:                         dy * ip->ftheight, sx * ip->ftwidth,
                    177:                         height * ip->ftheight,
                    178:                         ip->cols * ip->ftwidth, RR_COPY);
                    179: }
                    180: 
                    181: dvbox_windowmove(ip, sy, sx, dy, dx, h, w, func)
                    182:        struct ite_softc *ip;
                    183:        int sy, sx, dy, dx, h, w, func;
                    184: {
                    185:        register struct dvboxfb *dp = REGBASE;
                    186:        if (h == 0 || w == 0)
                    187:                return;
                    188:        
                    189:        db_waitbusy(REGADDR);
                    190:        dp->rep_rule = func << 4 | func;
                    191:        dp->source_y = sy;
                    192:        dp->source_x = sx;
                    193:        dp->dest_y   = dy;
                    194:        dp->dest_x   = dx;
                    195:        dp->wheight  = h;
                    196:        dp->wwidth   = w;
                    197:        dp->wmove    = 1;
                    198: }
                    199: 
                    200: dv_reset(dbp)
                    201:        register struct dvboxfb *dbp;
                    202: {
                    203:        dbp->reset = 0x80;
                    204:        DELAY(400);
                    205: 
                    206:        dbp->interrupt = 0x04;
                    207:        dbp->en_scan   = 0x01;
                    208:        dbp->fbwen     = ~0;
                    209:        dbp->opwen     = ~0;
                    210:        dbp->fold      = 0x01;
                    211:        dbp->drive     = 0x01;
                    212:        dbp->rep_rule  = 0x33;
                    213:        dbp->alt_rr    = 0x33;
                    214:        dbp->zrr       = 0x33;
                    215: 
                    216:        dbp->fbvenp    = 0xFF;
                    217:        dbp->dispen    = 0x01;
                    218:        dbp->fbvens    = 0x0;
                    219:        dbp->fv_trig   = 0x01;
                    220:        DELAY(400);
                    221:        dbp->vdrive    = 0x0;
                    222:        dbp->zconfig   = 0x0;
                    223: 
                    224:        while (dbp->wbusy & 0x01)
                    225:          DELAY(400);
                    226: 
                    227:        /*
                    228:         * Start of missing ROM code.
                    229:         */
                    230:        dbp->cmapbank = 0;
                    231: 
                    232:        dbp->red0   = 0;
                    233:        dbp->red1   = 0;
                    234:        dbp->green0 = 0;
                    235:        dbp->green1 = 0;
                    236:        dbp->blue0  = 0;
                    237:        dbp->blue1  = 0;
                    238: 
                    239:        dbp->panxh   = 0;
                    240:        dbp->panxl   = 0;
                    241:        dbp->panyh   = 0;
                    242:        dbp->panyl   = 0;
                    243:        dbp->zoom    = 0;
                    244:        dbp->cdwidth = 0x50;
                    245:        dbp->chstart = 0x52;
                    246:        dbp->cvwidth = 0x22;
                    247:        dbp->pz_trig = 1;
                    248:        /*
                    249:         * End of missing ROM code.
                    250:         */
                    251: }
                    252: 
                    253: #endif

unix.superglobalmegacorp.com

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