Annotation of sys/arch/hp300/stand/common/ite_rb.c, Revision 1.1
1.1 ! nbrk 1: /* $OpenBSD: ite_rb.c,v 1.5 2006/08/17 06:31:10 miod Exp $ */
! 2: /* $NetBSD: ite_rb.c,v 1.8 1996/03/03 04:23:38 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_rb.c 1.6 92/01/20$
! 38: *
! 39: * @(#)ite_rb.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 "grf_rbreg.h"
! 49:
! 50: #define REGBASE ((struct rboxfb *)(ip->regbase))
! 51:
! 52: void rbox_windowmove(struct ite_data *, int, int, int, int,
! 53: int, int, int);
! 54:
! 55: void
! 56: rbox_init(struct ite_data *ip)
! 57: {
! 58: int i;
! 59:
! 60: ip->bmv = rbox_windowmove;
! 61:
! 62: rb_waitbusy(ip->regbase);
! 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_fontinfo(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(ip->regbase);
! 80:
! 81: for(i = 0; i < 16; i++) {
! 82: *(ip->regbase + 0x63c3 + i*4) = 0x0;
! 83: *(ip->regbase + 0x6403 + i*4) = 0x0;
! 84: *(ip->regbase + 0x6803 + i*4) = 0x0;
! 85: *(ip->regbase + 0x6c03 + i*4) = 0x0;
! 86: *(ip->regbase + 0x73c3 + i*4) = 0x0;
! 87: *(ip->regbase + 0x7403 + i*4) = 0x0;
! 88: *(ip->regbase + 0x7803 + i*4) = 0x0;
! 89: *(ip->regbase + 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_fontinit8bpp(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: void
! 128: rbox_windowmove(struct ite_data *ip, int sy, int sx, int dy, int dx, int h,
! 129: int w, int func)
! 130: {
! 131: struct rboxfb *rp = REGBASE;
! 132: if (h == 0 || w == 0)
! 133: return;
! 134:
! 135: rb_waitbusy(ip->regbase);
! 136: rp->rep_rule = func << 4 | func;
! 137: rp->source_y = sy;
! 138: rp->source_x = sx;
! 139: rp->dest_y = dy;
! 140: rp->dest_x = dx;
! 141: rp->wheight = h;
! 142: rp->wwidth = w;
! 143: rp->wmove = 1;
! 144: }
! 145: #endif
CVSweb