Annotation of sys/arch/hp300/stand/common/ite_gb.c, Revision 1.1
1.1 ! nbrk 1: /* $OpenBSD: ite_gb.c,v 1.5 2006/08/17 06:31:10 miod Exp $ */
! 2: /* $NetBSD: ite_gb.c,v 1.8 1996/03/03 04:23:36 thorpej Exp $ */
! 3:
! 4: /*
! 5: * Copyright (c) 1988 University of Utah.
! 6: * Copyright (c) 1990, 1993
! 7: * The Regents of the University of California. All rights reserved.
! 8: *
! 9: * This code is derived from software contributed to Berkeley by
! 10: * the Systems Programming Group of the University of Utah Computer
! 11: * Science Department.
! 12: *
! 13: * Redistribution and use in source and binary forms, with or without
! 14: * modification, are permitted provided that the following conditions
! 15: * are met:
! 16: * 1. Redistributions of source code must retain the above copyright
! 17: * notice, this list of conditions and the following disclaimer.
! 18: * 2. Redistributions in binary form must reproduce the above copyright
! 19: * notice, this list of conditions and the following disclaimer in the
! 20: * documentation and/or other materials provided with the distribution.
! 21: * 3. Neither the name of the University nor the names of its contributors
! 22: * may be used to endorse or promote products derived from this software
! 23: * without specific prior written permission.
! 24: *
! 25: * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
! 26: * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
! 27: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
! 28: * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
! 29: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
! 30: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
! 31: * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
! 32: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
! 33: * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
! 34: * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
! 35: * SUCH DAMAGE.
! 36: *
! 37: * from: Utah $Hdr: ite_gb.c 1.9 92/01/20$
! 38: *
! 39: * @(#)ite_gb.c 8.1 (Berkeley) 6/10/93
! 40: */
! 41:
! 42: #ifdef ITECONSOLE
! 43:
! 44: #include <sys/param.h>
! 45:
! 46: #include "samachdep.h"
! 47: #include "itevar.h"
! 48: #include "itereg.h"
! 49: #include "grf_gbreg.h"
! 50:
! 51: #define REGBASE ((struct gboxfb *)(ip->regbase))
! 52:
! 53: void gbox_windowmove(struct ite_data *, int, int, int, int,
! 54: int, int, int);
! 55:
! 56: void
! 57: gbox_init(struct ite_data *ip)
! 58: {
! 59: ip->bmv = gbox_windowmove;
! 60:
! 61: REGBASE->write_protect = 0x0;
! 62: REGBASE->interrupt = 0x4;
! 63: REGBASE->rep_rule = RR_COPY;
! 64: REGBASE->blink1 = 0xff;
! 65: REGBASE->blink2 = 0xff;
! 66: REGBASE->sec_interrupt = 0x01;
! 67:
! 68: /*
! 69: * Set up the color map entries. We use three entries in the
! 70: * color map. The first, is for black, the second is for
! 71: * white, and the very last entry is for the inverted cursor.
! 72: */
! 73: REGBASE->creg_select = 0x00;
! 74: REGBASE->cmap_red = 0x00;
! 75: REGBASE->cmap_grn = 0x00;
! 76: REGBASE->cmap_blu = 0x00;
! 77: REGBASE->cmap_write = 0x00;
! 78: gbcm_waitbusy(ip->regbase);
! 79:
! 80: REGBASE->creg_select = 0x01;
! 81: REGBASE->cmap_red = 0xFF;
! 82: REGBASE->cmap_grn = 0xFF;
! 83: REGBASE->cmap_blu = 0xFF;
! 84: REGBASE->cmap_write = 0x01;
! 85: gbcm_waitbusy(ip->regbase);
! 86:
! 87: REGBASE->creg_select = 0xFF;
! 88: REGBASE->cmap_red = 0xFF;
! 89: REGBASE->cmap_grn = 0xFF;
! 90: REGBASE->cmap_blu = 0xFF;
! 91: REGBASE->cmap_write = 0x01;
! 92: gbcm_waitbusy(ip->regbase);
! 93:
! 94: ite_fontinfo(ip);
! 95: ite_fontinit8bpp(ip);
! 96:
! 97: /*
! 98: * Clear the display. This used to be before the font unpacking
! 99: * but it crashes. Figure it out later.
! 100: */
! 101: gbox_windowmove(ip, 0, 0, 0, 0, ip->dheight, ip->dwidth, RR_CLEAR);
! 102: tile_mover_waitbusy(ip->regbase);
! 103:
! 104: /*
! 105: * Stash the inverted cursor.
! 106: */
! 107: gbox_windowmove(ip, charY(ip, ' '), charX(ip, ' '),
! 108: ip->cblanky, ip->cblankx, ip->ftheight,
! 109: ip->ftwidth, RR_COPYINVERTED);
! 110: }
! 111:
! 112: void
! 113: gbox_scroll(struct ite_data *ip)
! 114: {
! 115: tile_mover_waitbusy(ip->regbase);
! 116: REGBASE->write_protect = 0x0;
! 117:
! 118: ite_dio_scroll(ip);
! 119: }
! 120:
! 121: void
! 122: gbox_windowmove(struct ite_data *ip, int sy, int sx, int dy, int dx, int h,
! 123: int w, int mask)
! 124: {
! 125: int src, dest;
! 126:
! 127: src = (sy * 1024) + sx; /* upper left corner in pixels */
! 128: dest = (dy * 1024) + dx;
! 129:
! 130: tile_mover_waitbusy(ip->regbase);
! 131: REGBASE->width = -(w / 4);
! 132: REGBASE->height = -(h / 4);
! 133: if (src < dest)
! 134: REGBASE->rep_rule = MOVE_DOWN_RIGHT|mask;
! 135: else {
! 136: REGBASE->rep_rule = MOVE_UP_LEFT|mask;
! 137: /*
! 138: * Adjust to top of lower right tile of the block.
! 139: */
! 140: src = src + ((h - 4) * 1024) + (w - 4);
! 141: dest= dest + ((h - 4) * 1024) + (w - 4);
! 142: }
! 143: FBBASE[dest] = FBBASE[src];
! 144: }
! 145: #endif
CVSweb