void fbcon_ilbm_bmove(struct display *p, int sy, int sx, int dy, int dx, int height, int width) { if (sx == 0 && dx == 0 && width == p->next_plane) mymemmove(p->screen_base+dy*fontheight(p)*p->next_line, p->screen_base+sy*fontheight(p)*p->next_line, height*fontheight(p)*p->next_line); else { u8 *src, *dest; u_int i; if (dy <= sy) { src = p->screen_base+sy*fontheight(p)*p->next_line+sx; dest = p->screen_base+dy*fontheight(p)*p->next_line+dx; for (i = p->var.bits_per_pixel*height*fontheight(p); i--;) { mymemmove(dest, src, width); src += p->next_plane; dest += p->next_plane; } } else { src = p->screen_base+(sy+height)*fontheight(p)*p->next_line+sx; dest = p->screen_base+(dy+height)*fontheight(p)*p->next_line+dx; for (i = p->var.bits_per_pixel*height*fontheight(p); i--;) { src -= p->next_plane; dest -= p->next_plane; mymemmove(dest, src, width); } } } }
void fbcon_mfb_bmove(struct display *p, int sy, int sx, int dy, int dx, int height, int width) { u8 *src, *dest; u_int rows; if (sx == 0 && dx == 0 && width == p->next_line) { src = p->screen_base+sy*fontheight(p)*width; dest = p->screen_base+dy*fontheight(p)*width; mymemmove(dest, src, height*fontheight(p)*width); } else if (dy <= sy) { src = p->screen_base+sy*fontheight(p)*p->next_line+sx; dest = p->screen_base+dy*fontheight(p)*p->next_line+dx; for (rows = height*fontheight(p); rows--;) { mymemmove(dest, src, width); src += p->next_line; dest += p->next_line; } } else { src = p->screen_base+((sy+height)*fontheight(p)-1)*p->next_line+sx; dest = p->screen_base+((dy+height)*fontheight(p)-1)*p->next_line+dx; for (rows = height*fontheight(p); rows--;) { mymemmove(dest, src, width); src -= p->next_line; dest -= p->next_line; } } }
/* recv stream to a edp packet (S->C) */ EdpPacket* GetEdpPacket(RecvBuffer* buf) { //assert(buf->_read_pos == 0); EdpPacket* pkg = 0; int32 flag = IsPkgComplete(buf); if (flag <= 0) { return pkg; } pkg = NewBuffer(); WriteBytes(pkg, buf->_data, flag); /* shrink buffer */ mymemmove(buf->_data, buf->_data + flag, buf->_write_pos - flag); buf->_write_pos -= flag; return pkg; }