Annotation of 43BSDReno/sys/hpstand/ite_subr.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 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_subr.c 1.1 89/02/17$
                     26:  *
                     27:  *     @(#)ite_subr.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: 
                     38: ite_devinfo(ip)
                     39:        struct ite_softc *ip;
                     40: {
                     41:        struct fontinfo *fi;
                     42:        struct font *fd;
                     43: 
                     44:        fi = (struct fontinfo *) ((*FONTROM << 8 | *(FONTROM + 2)) + REGADDR);
                     45:        fd = (struct font *) ((fi->haddr << 8 | fi->laddr) + REGADDR);
                     46: 
                     47:        ip->ftheight = fd->fh;
                     48:        ip->ftwidth  = fd->fw;
                     49:        ip->fbwidth  = ITEREGS->fbwidth_h << 8 | ITEREGS->fbwidth_l;
                     50:        ip->fbheight = ITEREGS->fbheight_h << 8 | ITEREGS->fbheight_l;
                     51:        ip->dwidth   = ITEREGS->dispwidth_h << 8 | ITEREGS->dispwidth_l;
                     52:        ip->dheight  = ITEREGS->dispheight_h << 8 | ITEREGS->dispheight_l;
                     53:        ip->rows     = ip->dheight / ip->ftheight;
                     54:        ip->cols     = ip->dwidth / ip->ftwidth;
                     55: 
                     56:        if (ip->fbwidth > ip->dwidth) {
                     57:                /*
                     58:                 * Stuff goes to right of display.
                     59:                 */
                     60:                ip->fontx    = ip->dwidth;
                     61:                ip->fonty    = 0;
                     62:                ip->cpl      = (ip->fbwidth - ip->dwidth) / ip->ftwidth;
                     63:                ip->cblankx  = ip->dwidth;
                     64:                ip->cblanky  = ip->fonty + ((128 / ip->cpl) +1) * ip->ftheight;
                     65:        }
                     66:        else {
                     67:                /*
                     68:                 * Stuff goes below the display.
                     69:                 */
                     70:                ip->fontx   = 0;
                     71:                ip->fonty   = ip->dheight;
                     72:                ip->cpl     = ip->fbwidth / ip->ftwidth;
                     73:                ip->cblankx = 0;
                     74:                ip->cblanky = ip->fonty + ((128 / ip->cpl) + 1) * ip->ftheight;
                     75:        }
                     76: }
                     77: 
                     78: ite_fontinit(ip)
                     79:        register struct ite_softc *ip;
                     80: {
                     81:        struct fontinfo *fi;
                     82:        struct font *fd;
                     83:        register u_char *fbmem, *dp;
                     84:        register int bn;
                     85:        int c, l, b;
                     86: 
                     87:        fi = (struct fontinfo *) ((*FONTROM << 8 | *(FONTROM + 2)) + REGADDR);
                     88:        fd = (struct font *) ((fi->haddr << 8 | fi->laddr) + REGADDR);
                     89: 
                     90:        dp = fd->data;
                     91: 
                     92:        for (c = 0; c < 128; c++) {
                     93:                fbmem = (u_char *) FBBASE +
                     94:                        (ip->fonty + (c / ip->cpl) * ip->ftheight) *
                     95:                        ip->fbwidth;
                     96:                fbmem += ip->fontx + (c % ip->cpl) * ip->ftwidth;
                     97:                for (l = 0; l < ip->ftheight; l++) {
                     98:                        bn = 7;
                     99:                        for (b = 0; b < ip->ftwidth; b++) {
                    100:                                if ((1 << bn) & *dp)
                    101:                                        *fbmem++ = 1;
                    102:                                else
                    103:                                        *fbmem++ = 0;
                    104:                                if (--bn < 0) {
                    105:                                        bn = 7;
                    106:                                        dp += 2;
                    107:                                }
                    108:                        }
                    109:                        if (bn < 7)
                    110:                                dp += 2;
                    111:                        fbmem -= ip->ftwidth;
                    112:                        fbmem += ip->fbwidth;
                    113:                }
                    114:        }
                    115: 
                    116: }
                    117: #endif

unix.superglobalmegacorp.com

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