Annotation of 43BSDReno/sys/hpstand/ite_tc.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_tc.c 1.9 89/02/20$
        !            26:  *
        !            27:  *     @(#)ite_tc.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_tcreg.h"
        !            39: 
        !            40: #define REGBASE                ((struct tcboxfb *)(ip->regbase))
        !            41: #define WINDOWMOVER    topcat_windowmove
        !            42: 
        !            43: topcat_init(ip)
        !            44:        register struct ite_softc *ip;
        !            45: {
        !            46: 
        !            47:        /*
        !            48:         * Determine the number of planes by writing to the first frame
        !            49:         * buffer display location, then reading it back. 
        !            50:         */
        !            51:        REGBASE->wen = ~0;
        !            52:        REGBASE->fben = ~0;
        !            53:        REGBASE->prr = RR_COPY;
        !            54:        *FBBASE = 0xFF;
        !            55:        ip->planemask = *FBBASE;
        !            56: 
        !            57:        /*
        !            58:         * Enable reading/writing of all the planes.
        !            59:         */
        !            60:        REGBASE->fben = ip->planemask;
        !            61:        REGBASE->wen  = ip->planemask;
        !            62:        REGBASE->ren  = ip->planemask;
        !            63:        REGBASE->prr  = RR_COPY;
        !            64: 
        !            65:        ite_devinfo(ip);
        !            66: 
        !            67:        /*
        !            68:         * Clear the framebuffer on all planes.
        !            69:         */
        !            70:        topcat_windowmove(ip, 0, 0, 0, 0, ip->fbheight, ip->fbwidth, RR_CLEAR);
        !            71:        tc_waitbusy(REGADDR, ip->planemask);
        !            72: 
        !            73:        ite_fontinit(ip);
        !            74: 
        !            75:        /*
        !            76:         * Stash the inverted cursor.
        !            77:         */
        !            78:        topcat_windowmove(ip, charY(ip, ' '), charX(ip, ' '),
        !            79:                          ip->cblanky, ip->cblankx, ip->ftheight,
        !            80:                          ip->ftwidth, RR_COPYINVERTED);
        !            81: }
        !            82: 
        !            83: topcat_putc(ip, c, dy, dx, mode)
        !            84:        register struct ite_softc *ip;
        !            85:         register int dy, dx;
        !            86:        int c, mode;
        !            87: {
        !            88:        topcat_windowmove(ip, charY(ip, c), charX(ip, c),
        !            89:                          dy * ip->ftheight, dx * ip->ftwidth,
        !            90:                          ip->ftheight, ip->ftwidth, RR_COPY);
        !            91: }
        !            92: 
        !            93: topcat_cursor(ip, flag)
        !            94:        register struct ite_softc *ip;
        !            95:         register int flag;
        !            96: {
        !            97:        if (flag == DRAW_CURSOR)
        !            98:                draw_cursor(ip)
        !            99:        else if (flag == MOVE_CURSOR) {
        !           100:                erase_cursor(ip)
        !           101:                draw_cursor(ip)
        !           102:        }
        !           103:        else
        !           104:                erase_cursor(ip)
        !           105: }
        !           106: 
        !           107: topcat_clear(ip, sy, sx, h, w)
        !           108:        struct ite_softc *ip;
        !           109:        register int sy, sx, h, w;
        !           110: {
        !           111:        topcat_windowmove(ip, sy * ip->ftheight, sx * ip->ftwidth,
        !           112:                          sy * ip->ftheight, sx * ip->ftwidth, 
        !           113:                          h  * ip->ftheight, w  * ip->ftwidth,
        !           114:                          RR_CLEAR);
        !           115: }
        !           116: 
        !           117: topcat_scroll(ip, sy, sx, count, dir)
        !           118:         register struct ite_softc *ip;
        !           119:         register int sy, count;
        !           120:         int dir, sx;
        !           121: {
        !           122:        register int dy = sy - count;
        !           123:        register int height = ip->rows - sy;
        !           124: 
        !           125:        topcat_cursor(ip, ERASE_CURSOR);
        !           126: 
        !           127:        topcat_windowmove(ip, sy * ip->ftheight, sx * ip->ftwidth,
        !           128:                          dy * ip->ftheight, sx * ip->ftwidth,
        !           129:                          height * ip->ftheight,
        !           130:                          ip->cols  * ip->ftwidth, RR_COPY);
        !           131: }
        !           132: 
        !           133: topcat_windowmove(ip, sy, sx, dy, dx, h, w, func)
        !           134:        struct ite_softc *ip;
        !           135:        int sy, sx, dy, dx, h, w, func;
        !           136: {
        !           137:        register struct tcboxfb *rp = REGBASE;
        !           138:        
        !           139:        if (h == 0 || w == 0)
        !           140:                return;
        !           141:        tc_waitbusy(REGADDR, ip->planemask);
        !           142:        rp->wmrr     = func;
        !           143:        rp->source_y = sy;
        !           144:        rp->source_x = sx;
        !           145:        rp->dest_y   = dy;
        !           146:        rp->dest_x   = dx;
        !           147:        rp->wheight  = h;
        !           148:        rp->wwidth   = w;
        !           149:        rp->wmove    = ip->planemask;
        !           150: }
        !           151: #endif

unix.superglobalmegacorp.com

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