+
+void convimg_rgb24_rgb16(uint16_t *dest, unsigned char *src, int xsz, int ysz)
+{
+ int i;
+ int npixels = xsz * ysz;
+
+ for(i=0; i<npixels; i++) {
+ int r = *src++;
+ int g = *src++;
+ int b = *src++;
+ *dest++ = PACK_RGB16(r, g, b);
+ }
+}
+
+void blitfb(uint16_t *dest, uint16_t *src, int width, int height, int pitch_pix)
+{
+ int i;
+ for(i=0; i<height; i++) {
+ memcpy(dest, src, width << 1);
+ dest += 320;
+ src += pitch_pix;
+ }
+}
+
+void blit(uint16_t *dest, int destwidth, uint16_t *src, int width, int height, int pitch_pix)
+{
+ int i, spansz = width << 1;
+ for(i=0; i<height; i++) {
+ memcpy(dest, src, spansz);
+ dest += destwidth;
+ src += pitch_pix;
+ }
+}
+
+void blit_key(uint16_t *dest, int destwidth, uint16_t *src, int width, int height, int pitch_pix, uint16_t key)
+{
+ int i, j;
+ int dadv = destwidth - width;
+ int sadv = pitch_pix - width;
+
+ for(i=0; i<height; i++) {
+ for(j=0; j<width; j++) {
+ uint16_t scol = *src++;
+ if(scol != key) *dest = scol;
+ dest++;
+ }
+ dest += dadv;
+ src += sadv;
+ }
+
+}