Created
September 28, 2014 13:10
-
-
Save ao-kenji/a7306fab9858b6d2b1f7 to your computer and use it in GitHub Desktop.
[Merged into original tree] based on @Tsutsuii's work: http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/luna68k/dev/omrasops.c.diff?r1=1.17&r2=1.18&f=h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Index: omrasops.c | |
| =================================================================== | |
| RCS file: /cvs/src/sys/arch/luna88k/dev/omrasops.c,v | |
| retrieving revision 1.11 | |
| diff -u -r1.11 omrasops.c | |
| --- omrasops.c 2 Jan 2014 15:30:34 -0000 1.11 | |
| +++ omrasops.c 28 Sep 2014 12:50:12 -0000 | |
| @@ -159,6 +159,8 @@ | |
| u_int8_t *p; | |
| int scanspan, startx, height, width, align, y; | |
| u_int32_t lmask, rmask, glyph, glyphbg, fgpat, bgpat; | |
| + u_int32_t fgmask0, fgmask1, fgmask2, fgmask3; | |
| + u_int32_t bgmask0, bgmask1, bgmask2, bgmask3; | |
| int i, fg, bg; | |
| u_int8_t *fb; | |
| @@ -169,6 +171,14 @@ | |
| fb = (u_int8_t *)ri->ri_font->data + | |
| (uc - ri->ri_font->firstchar) * ri->ri_fontscale; | |
| ri->ri_ops.unpack_attr(cookie, attr, &fg, &bg, NULL); | |
| + fgmask0 = (fg & 0x01) ? ALL1BITS : ALL0BITS; | |
| + fgmask1 = (fg & 0x02) ? ALL1BITS : ALL0BITS; | |
| + fgmask2 = (fg & 0x04) ? ALL1BITS : ALL0BITS; | |
| + fgmask3 = (fg & 0x08) ? ALL1BITS : ALL0BITS; | |
| + bgmask0 = (bg & 0x01) ? ALL1BITS : ALL0BITS; | |
| + bgmask1 = (bg & 0x02) ? ALL1BITS : ALL0BITS; | |
| + bgmask2 = (bg & 0x04) ? ALL1BITS : ALL0BITS; | |
| + bgmask3 = (bg & 0x08) ? ALL1BITS : ALL0BITS; | |
| p = (u_int8_t *)ri->ri_bits + y * scanspan + ((startx / 32) * 4); | |
| align = startx & ALIGNMASK; | |
| @@ -185,17 +195,17 @@ | |
| glyph = (glyph >> align); | |
| glyphbg = glyph ^ ALL1BITS; | |
| - fgpat = (fg & 0x01) ? glyph : 0; | |
| - bgpat = (bg & 0x01) ? glyphbg : 0; | |
| + fgpat = glyph & fgmask0; | |
| + bgpat = glyphbg & bgmask0; | |
| *P0(p) = (*P0(p) & ~lmask) | ((fgpat | bgpat) & lmask); | |
| - fgpat = (fg & 0x02) ? glyph : 0; | |
| - bgpat = (bg & 0x02) ? glyphbg : 0; | |
| + fgpat = glyph & fgmask1; | |
| + bgpat = glyphbg & bgmask1; | |
| *P1(p) = (*P1(p) & ~lmask) | ((fgpat | bgpat) & lmask); | |
| - fgpat = (fg & 0x04) ? glyph : 0; | |
| - bgpat = (bg & 0x04) ? glyphbg : 0; | |
| + fgpat = glyph & fgmask2; | |
| + bgpat = glyphbg & bgmask2; | |
| *P2(p) = (*P2(p) & ~lmask) | ((fgpat | bgpat) & lmask); | |
| - fgpat = (fg & 0x08) ? glyph : 0; | |
| - bgpat = (bg & 0x08) ? glyphbg : 0; | |
| + fgpat = glyph & fgmask3; | |
| + bgpat = glyphbg & bgmask3; | |
| *P3(p) = (*P3(p) & ~lmask) | ((fgpat | bgpat) & lmask); | |
| p += scanspan; | |
| @@ -214,17 +224,17 @@ | |
| lhalf = (glyph >> align); | |
| lhalfbg = lhalf ^ ALL1BITS; | |
| - fgpat = (fg & 0x01) ? lhalf : 0; | |
| - bgpat = (bg & 0x01) ? lhalfbg : 0; | |
| + fgpat = lhalf & fgmask0; | |
| + bgpat = lhalfbg & bgmask0; | |
| *P0(p) = (*P0(p) & ~lmask) | ((fgpat | bgpat) & lmask); | |
| - fgpat = (fg & 0x02) ? lhalf : 0; | |
| - bgpat = (bg & 0x02) ? lhalfbg : 0; | |
| + fgpat = lhalf & fgmask1; | |
| + bgpat = lhalfbg & bgmask1; | |
| *P1(p) = (*P1(p) & ~lmask) | ((fgpat | bgpat) & lmask); | |
| - fgpat = (fg & 0x04) ? lhalf : 0; | |
| - bgpat = (bg & 0x04) ? lhalfbg : 0; | |
| + fgpat = lhalf & fgmask2; | |
| + bgpat = lhalfbg & bgmask2; | |
| *P2(p) = (*P2(p) & ~lmask) | ((fgpat | bgpat) & lmask); | |
| - fgpat = (fg & 0x08) ? lhalf : 0; | |
| - bgpat = (bg & 0x08) ? lhalfbg : 0; | |
| + fgpat = lhalf & fgmask3; | |
| + bgpat = lhalfbg & bgmask3; | |
| *P3(p) = (*P3(p) & ~lmask) | ((fgpat | bgpat) & lmask); | |
| p += BYTESDONE; | |
| @@ -232,17 +242,17 @@ | |
| rhalf = (glyph << (BLITWIDTH - align)); | |
| rhalfbg = rhalf ^ ALL1BITS; | |
| - fgpat = (fg & 0x01) ? rhalf : 0; | |
| - bgpat = (bg & 0x01) ? rhalfbg : 0; | |
| + fgpat = rhalf & fgmask0; | |
| + bgpat = rhalfbg & bgmask0; | |
| *P0(p) = ((fgpat | bgpat) & rmask) | (*P0(p) & ~rmask); | |
| - fgpat = (fg & 0x02) ? rhalf : 0; | |
| - bgpat = (bg & 0x02) ? rhalfbg : 0; | |
| + fgpat = rhalf & fgmask1; | |
| + bgpat = rhalfbg & bgmask1; | |
| *P1(p) = ((fgpat | bgpat) & rmask) | (*P1(p) & ~rmask); | |
| - fgpat = (fg & 0x04) ? rhalf : 0; | |
| - bgpat = (bg & 0x04) ? rhalfbg : 0; | |
| + fgpat = rhalf & fgmask2; | |
| + bgpat = rhalfbg & bgmask2; | |
| *P2(p) = ((fgpat | bgpat) & rmask) | (*P2(p) & ~rmask); | |
| - fgpat = (fg & 0x08) ? rhalf : 0; | |
| - bgpat = (bg & 0x08) ? rhalfbg : 0; | |
| + fgpat = rhalf & fgmask3; | |
| + bgpat = rhalfbg & bgmask3; | |
| *P3(p) = ((fgpat | bgpat) & rmask) | (*P3(p) & ~rmask); | |
| p = (q += scanspan); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment