/* * linux/drivers/video/iplan2p4.c -- Low level frame buffer operations for * interleaved bitplanes à la Atari (4 * planes, 2 bytes interleave) * * Created 5 Apr 1997 by Geert Uytterhoeven * * This file is subject to the terms and conditions of the GNU General Public * License. See the file COPYING in the main directory of this archive for * more details.
*/
#include <linux/string.h> #include <linux/fb.h>
#include <asm/setup.h>
#include"atafb.h"
#define BPL 4 #include"atafb_utils.h"
void atafb_iplan2p4_copyarea(struct fb_info *info, u_long next_line, int sy, int sx, int dy, int dx, int height, int width)
{ /* bmove() has to distinguish two major cases: If both, source and * destination, start at even addresses or both are at odd * addresses, just the first odd and last even column (if present) * require special treatment (memmove_col()). The rest between * then can be copied by normal operations, because all adjacent * bytes are affected and are to be stored in the same order. * The pathological case is when the move should go from an odd * address to an even or vice versa. Since the bytes in the plane * words must be assembled in new order, it seems wisest to make * all movements by memmove_col().
*/
u8 *src, *dst;
u32 *s, *d; int w, l , i, j;
u_int colsize;
u_int upwards = (dy < sy) || (dy == sy && dx < sx);
colsize = height; if (!((sx ^ dx) & 15)) { /* odd->odd or even->even */
mask = 0xff00ff00;
f = 0;
w = width; if (sx & 15) {
f = 1;
w += 8;
} if ((sx + width) & 15)
f |= 2;
w >>= 4; for (i = height; i; i--) {
src32 = (u32 *)src;
dst32 = (u32 *)dst;
mask = 0xff00ff;
f = 0;
w = width; if ((dx + width) & 15)
f = 1; if (sx & 15) {
f |= 2;
w += 8;
}
w >>= 4; for (i = height; i; i--) {
src32 = (u32 *)src;
dst32 = (u32 *)dst;
void atafb_iplan2p4_fillrect(struct fb_info *info, u_long next_line, u32 color, int sy, int sx, int height, int width)
{
u32 *dest; int rows, i;
u32 cval[4];
dest = (u32 *)(info->screen_base + sy * next_line + (sx & ~15) / (8 / BPL)); if (sx & 15) {
u8 *dest8 = (u8 *)dest + 1;
expand8_col2mask(color, cval);
for (i = height; i; i--) {
fill8_col(dest8, cval);
dest8 += next_line;
}
dest += BPL / 2;
width -= 8;
}
expand16_col2mask(color, cval);
rows = width >> 4; if (rows) {
u32 *d = dest;
u32 off = next_line - rows * BPL * 2; for (i = height; i; i--) {
d = fill16_col(d, rows, cval);
d = (u32 *)((long)d + off);
}
dest += rows * BPL / 2;
width &= 15;
}
if (width) {
u8 *dest8 = (u8 *)dest;
expand8_col2mask(color, cval);
for (i = height; i; i--) {
fill8_col(dest8, cval);
dest8 += next_line;
}
}
}
void atafb_iplan2p4_linefill(struct fb_info *info, u_long next_line, int dy, int dx, u32 width, const u8 *data, u32 bgcolor, u32 fgcolor)
{
u32 *dest; const u16 *data16; int rows;
u32 fgm[4], bgm[4], m;
dest = (u32 *)(info->screen_base + dy * next_line + (dx & ~15) / (8 / BPL)); if (dx & 15) {
fill8_2col((u8 *)dest + 1, fgcolor, bgcolor, *data++);
dest += BPL / 2;
width -= 8;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.