Home | History | Annotate | Line # | Download | only in common
ite_subr.c revision 1.5.106.1
      1  1.5.106.1   jruoho /*	$NetBSD: ite_subr.c,v 1.5.106.1 2011/06/06 09:05:38 jruoho Exp $	*/
      2        1.1  thorpej 
      3        1.1  thorpej /*
      4  1.5.106.1   jruoho  * Copyright (c) 1988 University of Utah.
      5        1.1  thorpej  * Copyright (c) 1990, 1993
      6        1.1  thorpej  *	The Regents of the University of California.  All rights reserved.
      7        1.2      agc  *
      8        1.2      agc  * This code is derived from software contributed to Berkeley by
      9        1.2      agc  * the Systems Programming Group of the University of Utah Computer
     10        1.2      agc  * Science Department.
     11        1.2      agc  *
     12        1.2      agc  * Redistribution and use in source and binary forms, with or without
     13        1.2      agc  * modification, are permitted provided that the following conditions
     14        1.2      agc  * are met:
     15        1.2      agc  * 1. Redistributions of source code must retain the above copyright
     16        1.2      agc  *    notice, this list of conditions and the following disclaimer.
     17        1.2      agc  * 2. Redistributions in binary form must reproduce the above copyright
     18        1.2      agc  *    notice, this list of conditions and the following disclaimer in the
     19        1.2      agc  *    documentation and/or other materials provided with the distribution.
     20        1.2      agc  * 3. Neither the name of the University nor the names of its contributors
     21        1.2      agc  *    may be used to endorse or promote products derived from this software
     22        1.2      agc  *    without specific prior written permission.
     23        1.2      agc  *
     24        1.2      agc  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     25        1.2      agc  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     26        1.2      agc  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     27        1.2      agc  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     28        1.2      agc  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     29        1.2      agc  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     30        1.2      agc  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     31        1.2      agc  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     32        1.2      agc  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     33        1.2      agc  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     34        1.2      agc  * SUCH DAMAGE.
     35        1.2      agc  *
     36        1.2      agc  * from: Utah $Hdr: ite_subr.c 1.2 92/01/20$
     37        1.2      agc  *
     38        1.2      agc  *	@(#)ite_subr.c	8.1 (Berkeley) 6/10/93
     39        1.2      agc  */
     40        1.1  thorpej 
     41        1.1  thorpej #ifdef ITECONSOLE
     42        1.1  thorpej 
     43        1.1  thorpej #include <sys/param.h>
     44        1.1  thorpej 
     45  1.5.106.1   jruoho #include <hp300/stand/common/itereg.h>
     46        1.1  thorpej 
     47        1.1  thorpej #include <hp300/stand/common/samachdep.h>
     48        1.1  thorpej #include <hp300/stand/common/itevar.h>
     49        1.1  thorpej 
     50  1.5.106.1   jruoho static void ite_writeglyph(struct ite_data *, u_char *, u_char *);
     51  1.5.106.1   jruoho 
     52        1.3  tsutsui void
     53        1.4  tsutsui ite_fontinfo(struct ite_data *ip)
     54        1.1  thorpej {
     55        1.1  thorpej 	u_long fontaddr = getword(ip, getword(ip, FONTROM) + FONTADDR);
     56        1.1  thorpej 
     57        1.1  thorpej 	ip->ftheight = getbyte(ip, fontaddr + FONTHEIGHT);
     58        1.1  thorpej 	ip->ftwidth  = getbyte(ip, fontaddr + FONTWIDTH);
     59        1.1  thorpej 	ip->rows     = ip->dheight / ip->ftheight;
     60        1.1  thorpej 	ip->cols     = ip->dwidth / ip->ftwidth;
     61        1.1  thorpej 
     62        1.1  thorpej 	if (ip->fbwidth > ip->dwidth) {
     63        1.1  thorpej 		/*
     64        1.1  thorpej 		 * Stuff goes to right of display.
     65        1.1  thorpej 		 */
     66        1.1  thorpej 		ip->fontx    = ip->dwidth;
     67        1.1  thorpej 		ip->fonty    = 0;
     68        1.1  thorpej 		ip->cpl      = (ip->fbwidth - ip->dwidth) / ip->ftwidth;
     69        1.1  thorpej 		ip->cblankx  = ip->dwidth;
     70        1.1  thorpej 		ip->cblanky  = ip->fonty + ((128 / ip->cpl) +1) * ip->ftheight;
     71  1.5.106.1   jruoho 	} else {
     72        1.1  thorpej 		/*
     73        1.1  thorpej 		 * Stuff goes below the display.
     74        1.1  thorpej 		 */
     75        1.1  thorpej 		ip->fontx   = 0;
     76        1.1  thorpej 		ip->fonty   = ip->dheight;
     77        1.1  thorpej 		ip->cpl     = ip->fbwidth / ip->ftwidth;
     78        1.1  thorpej 		ip->cblankx = 0;
     79        1.1  thorpej 		ip->cblanky = ip->fonty + ((128 / ip->cpl) + 1) * ip->ftheight;
     80        1.1  thorpej 	}
     81        1.1  thorpej }
     82        1.1  thorpej 
     83        1.3  tsutsui void
     84  1.5.106.1   jruoho ite_fontinit1bpp(struct ite_data *ip)
     85  1.5.106.1   jruoho {
     86  1.5.106.1   jruoho 	u_char *fbmem, *dp;
     87  1.5.106.1   jruoho 	int c, l, b;
     88  1.5.106.1   jruoho 	int stride, width;
     89  1.5.106.1   jruoho 
     90  1.5.106.1   jruoho 	dp = (u_char *)(getword(ip, getword(ip, FONTROM) + FONTADDR) +
     91  1.5.106.1   jruoho 	    (char *)ip->regbase) + FONTDATA;
     92  1.5.106.1   jruoho 	stride = ip->fbwidth >> 3;
     93  1.5.106.1   jruoho 	width = (ip->ftwidth + 7) / 8;
     94  1.5.106.1   jruoho 
     95  1.5.106.1   jruoho 	for (c = 0; c < 128; c++) {
     96  1.5.106.1   jruoho 		fbmem = (u_char *)FBBASE +
     97  1.5.106.1   jruoho 		    (ip->fonty + (c / ip->cpl) * ip->ftheight) * stride;
     98  1.5.106.1   jruoho 		fbmem += (ip->fontx >> 3) + (c % ip->cpl) * width;
     99  1.5.106.1   jruoho 		for (l = 0; l < ip->ftheight; l++) {
    100  1.5.106.1   jruoho 			for (b = 0; b < width; b++) {
    101  1.5.106.1   jruoho 				*fbmem++ = *dp;
    102  1.5.106.1   jruoho 				dp += 2;
    103  1.5.106.1   jruoho 			}
    104  1.5.106.1   jruoho 			fbmem -= width;
    105  1.5.106.1   jruoho 			fbmem += stride;
    106  1.5.106.1   jruoho 		}
    107  1.5.106.1   jruoho 	}
    108  1.5.106.1   jruoho }
    109  1.5.106.1   jruoho 
    110  1.5.106.1   jruoho void
    111  1.5.106.1   jruoho ite_fontinit8bpp(struct ite_data *ip)
    112        1.1  thorpej {
    113        1.1  thorpej 	int bytewidth = (((ip->ftwidth - 1) / 8) + 1);
    114        1.1  thorpej 	int glyphsize = bytewidth * ip->ftheight;
    115        1.1  thorpej 	u_char fontbuf[500];
    116        1.1  thorpej 	u_char *dp, *fbmem;
    117        1.1  thorpej 	int c, i, romp;
    118        1.1  thorpej 
    119        1.1  thorpej 	romp = getword(ip, getword(ip, FONTROM) + FONTADDR) + FONTDATA;
    120        1.1  thorpej 	for (c = 0; c < 128; c++) {
    121  1.5.106.1   jruoho 		fbmem = (u_char *)(FBBASE +
    122        1.1  thorpej 		     (ip->fonty + (c / ip->cpl) * ip->ftheight) * ip->fbwidth +
    123        1.1  thorpej 		     (ip->fontx + (c % ip->cpl) * ip->ftwidth));
    124        1.1  thorpej 		dp = fontbuf;
    125        1.1  thorpej 		for (i = 0; i < glyphsize; i++) {
    126        1.1  thorpej 			*dp++ = getbyte(ip, romp);
    127        1.1  thorpej 			romp += 2;
    128        1.1  thorpej 		}
    129  1.5.106.1   jruoho 		ite_writeglyph(ip, fbmem, fontbuf);
    130        1.1  thorpej 	}
    131        1.1  thorpej }
    132        1.1  thorpej 
    133  1.5.106.1   jruoho static void
    134        1.4  tsutsui ite_writeglyph(struct ite_data *ip, u_char *fbmem, u_char *glyphp)
    135        1.1  thorpej {
    136        1.3  tsutsui 	int bn;
    137        1.3  tsutsui 	int l, b;
    138        1.1  thorpej 
    139        1.1  thorpej 	for (l = 0; l < ip->ftheight; l++) {
    140        1.1  thorpej 		bn = 7;
    141        1.1  thorpej 		for (b = 0; b < ip->ftwidth; b++) {
    142        1.1  thorpej 			if ((1 << bn) & *glyphp)
    143        1.1  thorpej 				*fbmem++ = 1;
    144        1.1  thorpej 			else
    145        1.1  thorpej 				*fbmem++ = 0;
    146        1.1  thorpej 			if (--bn < 0) {
    147        1.1  thorpej 				bn = 7;
    148        1.1  thorpej 				glyphp++;
    149        1.1  thorpej 			}
    150        1.1  thorpej 		}
    151        1.1  thorpej 		if (bn < 7)
    152        1.1  thorpej 			glyphp++;
    153        1.1  thorpej 		fbmem -= ip->ftwidth;
    154        1.1  thorpej 		fbmem += ip->fbwidth;
    155        1.1  thorpej 	}
    156        1.1  thorpej }
    157  1.5.106.1   jruoho 
    158  1.5.106.1   jruoho /*
    159  1.5.106.1   jruoho  * The cursor is just an inverted space.
    160  1.5.106.1   jruoho  */
    161  1.5.106.1   jruoho #define flip_cursor(ip) \
    162  1.5.106.1   jruoho 	(*ip->bmv)(ip, ip->cblanky, ip->cblankx, ip->cursory * ip->ftheight, \
    163  1.5.106.1   jruoho 	    ip->cursorx * ip->ftwidth, ip->ftheight, ip->ftwidth, RR_XOR)
    164  1.5.106.1   jruoho 
    165  1.5.106.1   jruoho void
    166  1.5.106.1   jruoho ite_dio_cursor(struct ite_data *ip, int flag)
    167  1.5.106.1   jruoho {
    168  1.5.106.1   jruoho 
    169  1.5.106.1   jruoho 	switch (flag) {
    170  1.5.106.1   jruoho 	case MOVE_CURSOR:
    171  1.5.106.1   jruoho 		flip_cursor(ip);
    172  1.5.106.1   jruoho 		/* FALLTHROUGH */
    173  1.5.106.1   jruoho 	case DRAW_CURSOR:
    174  1.5.106.1   jruoho 		ip->cursorx = ip->curx;
    175  1.5.106.1   jruoho 		ip->cursory = ip->cury;
    176  1.5.106.1   jruoho 		/* FALLTHROUGH */
    177  1.5.106.1   jruoho 	default:
    178  1.5.106.1   jruoho 		flip_cursor(ip);
    179  1.5.106.1   jruoho 		break;
    180  1.5.106.1   jruoho 	}
    181  1.5.106.1   jruoho }
    182  1.5.106.1   jruoho 
    183  1.5.106.1   jruoho void
    184  1.5.106.1   jruoho ite_dio_putc1bpp(struct ite_data *ip, int c, int dy, int dx)
    185  1.5.106.1   jruoho {
    186  1.5.106.1   jruoho 
    187  1.5.106.1   jruoho 	ite_dio_windowmove1bpp(ip, charY(ip, c), charX1bpp(ip, c),
    188  1.5.106.1   jruoho 	    dy * ip->ftheight, dx * ip->ftwidth,
    189  1.5.106.1   jruoho 	    ip->ftheight, ip->ftwidth, RR_COPY);
    190  1.5.106.1   jruoho }
    191  1.5.106.1   jruoho 
    192  1.5.106.1   jruoho void
    193  1.5.106.1   jruoho ite_dio_putc8bpp(struct ite_data *ip, int c, int dy, int dx)
    194  1.5.106.1   jruoho {
    195  1.5.106.1   jruoho 
    196  1.5.106.1   jruoho 	(*ip->bmv)(ip, charY(ip, c), charX(ip, c),
    197  1.5.106.1   jruoho 	    dy * ip->ftheight, dx * ip->ftwidth,
    198  1.5.106.1   jruoho 	    ip->ftheight, ip->ftwidth, RR_COPY);
    199  1.5.106.1   jruoho }
    200  1.5.106.1   jruoho 
    201  1.5.106.1   jruoho void
    202  1.5.106.1   jruoho ite_dio_clear(struct ite_data *ip, int sy, int sx, int h, int w)
    203  1.5.106.1   jruoho {
    204  1.5.106.1   jruoho 
    205  1.5.106.1   jruoho 	(*ip->bmv)(ip, sy * ip->ftheight, sx * ip->ftwidth,
    206  1.5.106.1   jruoho 	    sy * ip->ftheight, sx * ip->ftwidth,
    207  1.5.106.1   jruoho 	    h  * ip->ftheight, w  * ip->ftwidth, RR_CLEAR);
    208  1.5.106.1   jruoho }
    209  1.5.106.1   jruoho 
    210  1.5.106.1   jruoho void
    211  1.5.106.1   jruoho ite_dio_scroll(struct ite_data *ip)
    212  1.5.106.1   jruoho {
    213  1.5.106.1   jruoho 
    214  1.5.106.1   jruoho 	flip_cursor(ip);
    215  1.5.106.1   jruoho 
    216  1.5.106.1   jruoho 	(*ip->bmv)(ip, ip->ftheight, 0, 0, 0, (ip->rows - 1) * ip->ftheight,
    217  1.5.106.1   jruoho 	    ip->cols * ip->ftwidth, RR_COPY);
    218  1.5.106.1   jruoho }
    219  1.5.106.1   jruoho 
    220  1.5.106.1   jruoho #include <hp300/stand/common/maskbits.h>
    221  1.5.106.1   jruoho 
    222  1.5.106.1   jruoho /* NOTE:
    223  1.5.106.1   jruoho  * the first element in starttab could be 0xffffffff.  making it 0
    224  1.5.106.1   jruoho  * lets us deal with a full first word in the middle loop, rather
    225  1.5.106.1   jruoho  * than having to do the multiple reads and masks that we'd
    226  1.5.106.1   jruoho  * have to do if we thought it was partial.
    227  1.5.106.1   jruoho  */
    228  1.5.106.1   jruoho int starttab[32] = {
    229  1.5.106.1   jruoho 	0x00000000,
    230  1.5.106.1   jruoho 	0x7FFFFFFF,
    231  1.5.106.1   jruoho 	0x3FFFFFFF,
    232  1.5.106.1   jruoho 	0x1FFFFFFF,
    233  1.5.106.1   jruoho 	0x0FFFFFFF,
    234  1.5.106.1   jruoho 	0x07FFFFFF,
    235  1.5.106.1   jruoho 	0x03FFFFFF,
    236  1.5.106.1   jruoho 	0x01FFFFFF,
    237  1.5.106.1   jruoho 	0x00FFFFFF,
    238  1.5.106.1   jruoho 	0x007FFFFF,
    239  1.5.106.1   jruoho 	0x003FFFFF,
    240  1.5.106.1   jruoho 	0x001FFFFF,
    241  1.5.106.1   jruoho 	0x000FFFFF,
    242  1.5.106.1   jruoho 	0x0007FFFF,
    243  1.5.106.1   jruoho 	0x0003FFFF,
    244  1.5.106.1   jruoho 	0x0001FFFF,
    245  1.5.106.1   jruoho 	0x0000FFFF,
    246  1.5.106.1   jruoho 	0x00007FFF,
    247  1.5.106.1   jruoho 	0x00003FFF,
    248  1.5.106.1   jruoho 	0x00001FFF,
    249  1.5.106.1   jruoho 	0x00000FFF,
    250  1.5.106.1   jruoho 	0x000007FF,
    251  1.5.106.1   jruoho 	0x000003FF,
    252  1.5.106.1   jruoho 	0x000001FF,
    253  1.5.106.1   jruoho 	0x000000FF,
    254  1.5.106.1   jruoho 	0x0000007F,
    255  1.5.106.1   jruoho 	0x0000003F,
    256  1.5.106.1   jruoho 	0x0000001F,
    257  1.5.106.1   jruoho 	0x0000000F,
    258  1.5.106.1   jruoho 	0x00000007,
    259  1.5.106.1   jruoho 	0x00000003,
    260  1.5.106.1   jruoho 	0x00000001
    261  1.5.106.1   jruoho };
    262  1.5.106.1   jruoho 
    263  1.5.106.1   jruoho int endtab[32] = {
    264  1.5.106.1   jruoho 	0x00000000,
    265  1.5.106.1   jruoho 	0x80000000,
    266  1.5.106.1   jruoho 	0xC0000000,
    267  1.5.106.1   jruoho 	0xE0000000,
    268  1.5.106.1   jruoho 	0xF0000000,
    269  1.5.106.1   jruoho 	0xF8000000,
    270  1.5.106.1   jruoho 	0xFC000000,
    271  1.5.106.1   jruoho 	0xFE000000,
    272  1.5.106.1   jruoho 	0xFF000000,
    273  1.5.106.1   jruoho 	0xFF800000,
    274  1.5.106.1   jruoho 	0xFFC00000,
    275  1.5.106.1   jruoho 	0xFFE00000,
    276  1.5.106.1   jruoho 	0xFFF00000,
    277  1.5.106.1   jruoho 	0xFFF80000,
    278  1.5.106.1   jruoho 	0xFFFC0000,
    279  1.5.106.1   jruoho 	0xFFFE0000,
    280  1.5.106.1   jruoho 	0xFFFF0000,
    281  1.5.106.1   jruoho 	0xFFFF8000,
    282  1.5.106.1   jruoho 	0xFFFFC000,
    283  1.5.106.1   jruoho 	0xFFFFE000,
    284  1.5.106.1   jruoho 	0xFFFFF000,
    285  1.5.106.1   jruoho 	0xFFFFF800,
    286  1.5.106.1   jruoho 	0xFFFFFC00,
    287  1.5.106.1   jruoho 	0xFFFFFE00,
    288  1.5.106.1   jruoho 	0xFFFFFF00,
    289  1.5.106.1   jruoho 	0xFFFFFF80,
    290  1.5.106.1   jruoho 	0xFFFFFFC0,
    291  1.5.106.1   jruoho 	0xFFFFFFE0,
    292  1.5.106.1   jruoho 	0xFFFFFFF0,
    293  1.5.106.1   jruoho 	0xFFFFFFF8,
    294  1.5.106.1   jruoho 	0xFFFFFFFC,
    295  1.5.106.1   jruoho 	0xFFFFFFFE
    296  1.5.106.1   jruoho };
    297  1.5.106.1   jruoho 
    298  1.5.106.1   jruoho void
    299  1.5.106.1   jruoho ite_dio_windowmove1bpp(struct ite_data *ip, int sy, int sx, int dy, int dx,
    300  1.5.106.1   jruoho     int h, int w, int func)
    301  1.5.106.1   jruoho {
    302  1.5.106.1   jruoho 	int width;		/* add to get to same position in next line */
    303  1.5.106.1   jruoho 
    304  1.5.106.1   jruoho 	unsigned int *psrcLine, *pdstLine;
    305  1.5.106.1   jruoho 				/* pointers to line with current src and dst */
    306  1.5.106.1   jruoho 	unsigned int *psrc;	/* pointer to current src longword */
    307  1.5.106.1   jruoho 	unsigned int *pdst;	/* pointer to current dst longword */
    308  1.5.106.1   jruoho 
    309  1.5.106.1   jruoho 				/* following used for looping through a line */
    310  1.5.106.1   jruoho 	unsigned int startmask, endmask;  /* masks for writing ends of dst */
    311  1.5.106.1   jruoho 	int nlMiddle;		/* whole longwords in dst */
    312  1.5.106.1   jruoho 	int nl;			/* temp copy of nlMiddle */
    313  1.5.106.1   jruoho 	unsigned int tmpSrc;	/* place to store full source word */
    314  1.5.106.1   jruoho 	int xoffSrc;		/* offset (>= 0, < 32) from which to
    315  1.5.106.1   jruoho 				   fetch whole longwords fetched
    316  1.5.106.1   jruoho 				   in src */
    317  1.5.106.1   jruoho 	int nstart;		/* number of ragged bits at start of dst */
    318  1.5.106.1   jruoho 	int nend;		/* number of ragged bits at end of dst */
    319  1.5.106.1   jruoho 	int srcStartOver;	/* pulling nstart bits from src
    320  1.5.106.1   jruoho 				   overflows into the next word? */
    321  1.5.106.1   jruoho 
    322  1.5.106.1   jruoho 	if (h == 0 || w == 0)
    323  1.5.106.1   jruoho 		return;
    324  1.5.106.1   jruoho 
    325  1.5.106.1   jruoho 	width = ip->fbwidth >> 5;
    326  1.5.106.1   jruoho 	psrcLine = ((unsigned int *) ip->fbbase) + (sy * width);
    327  1.5.106.1   jruoho 	pdstLine = ((unsigned int *) ip->fbbase) + (dy * width);
    328  1.5.106.1   jruoho 
    329  1.5.106.1   jruoho 	/* x direction doesn't matter for < 1 longword */
    330  1.5.106.1   jruoho 	if (w <= 32) {
    331  1.5.106.1   jruoho 		int srcBit, dstBit;     /* bit offset of src and dst */
    332  1.5.106.1   jruoho 
    333  1.5.106.1   jruoho 		pdstLine += (dx >> 5);
    334  1.5.106.1   jruoho 		psrcLine += (sx >> 5);
    335  1.5.106.1   jruoho 		psrc = psrcLine;
    336  1.5.106.1   jruoho 		pdst = pdstLine;
    337  1.5.106.1   jruoho 
    338  1.5.106.1   jruoho 		srcBit = sx & 0x1f;
    339  1.5.106.1   jruoho 		dstBit = dx & 0x1f;
    340  1.5.106.1   jruoho 
    341  1.5.106.1   jruoho 		while (h--) {
    342  1.5.106.1   jruoho 			getandputrop(psrc, srcBit, dstBit, w, pdst, func);
    343  1.5.106.1   jruoho 			pdst += width;
    344  1.5.106.1   jruoho 			psrc += width;
    345  1.5.106.1   jruoho 		}
    346  1.5.106.1   jruoho 	} else {
    347  1.5.106.1   jruoho 		maskbits(dx, w, startmask, endmask, nlMiddle);
    348  1.5.106.1   jruoho 		if (startmask)
    349  1.5.106.1   jruoho 			nstart = 32 - (dx & 0x1f);
    350  1.5.106.1   jruoho 		else
    351  1.5.106.1   jruoho 			nstart = 0;
    352  1.5.106.1   jruoho 		if (endmask)
    353  1.5.106.1   jruoho 			nend = (dx + w) & 0x1f;
    354  1.5.106.1   jruoho 		else
    355  1.5.106.1   jruoho 			nend = 0;
    356  1.5.106.1   jruoho 
    357  1.5.106.1   jruoho 		xoffSrc = ((sx & 0x1f) + nstart) & 0x1f;
    358  1.5.106.1   jruoho 		srcStartOver = ((sx & 0x1f) + nstart) > 31;
    359  1.5.106.1   jruoho 
    360  1.5.106.1   jruoho 		pdstLine += (dx >> 5);
    361  1.5.106.1   jruoho 		psrcLine += (sx >> 5);
    362  1.5.106.1   jruoho 
    363  1.5.106.1   jruoho 		while (h--) {
    364  1.5.106.1   jruoho 			psrc = psrcLine;
    365  1.5.106.1   jruoho 			pdst = pdstLine;
    366  1.5.106.1   jruoho 
    367  1.5.106.1   jruoho 			if (startmask) {
    368  1.5.106.1   jruoho 				getandputrop(psrc, (sx & 0x1f), (dx & 0x1f),
    369  1.5.106.1   jruoho 				    nstart, pdst, func);
    370  1.5.106.1   jruoho 				pdst++;
    371  1.5.106.1   jruoho 				if (srcStartOver)
    372  1.5.106.1   jruoho 					psrc++;
    373  1.5.106.1   jruoho 			}
    374  1.5.106.1   jruoho 
    375  1.5.106.1   jruoho 			/* special case for aligned operations */
    376  1.5.106.1   jruoho 			if (xoffSrc == 0) {
    377  1.5.106.1   jruoho 				nl = nlMiddle;
    378  1.5.106.1   jruoho 				while (nl--) {
    379  1.5.106.1   jruoho 					DoRop(*pdst, func, *psrc++, *pdst);
    380  1.5.106.1   jruoho 					pdst++;
    381  1.5.106.1   jruoho 				}
    382  1.5.106.1   jruoho 			} else {
    383  1.5.106.1   jruoho 				nl = nlMiddle + 1;
    384  1.5.106.1   jruoho 				while (--nl) {
    385  1.5.106.1   jruoho 					getunalignedword(psrc, xoffSrc, tmpSrc);
    386  1.5.106.1   jruoho 					DoRop(*pdst, func, tmpSrc, *pdst);
    387  1.5.106.1   jruoho 					pdst++;
    388  1.5.106.1   jruoho 					psrc++;
    389  1.5.106.1   jruoho 				}
    390  1.5.106.1   jruoho 			}
    391  1.5.106.1   jruoho 
    392  1.5.106.1   jruoho 			if (endmask) {
    393  1.5.106.1   jruoho 				getandputrop0(psrc, xoffSrc, nend, pdst, func);
    394  1.5.106.1   jruoho 			}
    395  1.5.106.1   jruoho 
    396  1.5.106.1   jruoho 			pdstLine += width;
    397  1.5.106.1   jruoho 			psrcLine += width;
    398  1.5.106.1   jruoho 		}
    399  1.5.106.1   jruoho 	}
    400  1.5.106.1   jruoho }
    401        1.1  thorpej #endif
    402