fbdev_name = "/dev/fb1";
w = h = 0;
- fbdev = vout_fbdev_init(fbdev_name, &w, &h, no_dblbuf);
+ fbdev = vout_fbdev_init(fbdev_name, &w, &h, 16, no_dblbuf);
if (fbdev == NULL)
return -1;
void host_video_blit8(const unsigned char *src, int w, int h, int stride)
{
- extern void rotated_blit8(void *dst, const void *linesx4);
+ if (probably_caanoo) {
+ unsigned char *dst = host_screen;
+ int i;
+ for (i = 0; i < 240; i++, dst += 320, src += stride)
+ memcpy(dst, src, w);
+ }
+ else {
+ extern void rotated_blit8(void *dst, const void *linesx4);
+ rotated_blit8(host_screen, src);
+ }
- rotated_blit8(host_screen, src);
host_video_flip();
}
void host_video_blit16(const unsigned short *src, int w, int h, int stride)
{
- extern void rotated_blit16(void *dst, const void *linesx4);
+ if (probably_caanoo) {
+ unsigned short *dst = host_screen;
+ int i;
+ for (i = 0; i < 240; i++, dst += 320, src += stride / 2)
+ memcpy(dst, src, w*2);
+ }
+ else {
+ extern void rotated_blit16(void *dst, const void *linesx4);
+ rotated_blit16(host_screen, src);
+ }
- rotated_blit16(host_screen, src);
host_video_flip();
}
#endif // LOADER
static volatile unsigned short *memregs;
static volatile unsigned int *memregl;
+int probably_caanoo;
int memdev = -1;
#define FB_BUF_COUNT 4
printf("framebuffer: \"%s\" @ %08lx\n", fbfix.id, fbfix.smem_start);
fb_paddr[0] = fbfix.smem_start;
+ probably_caanoo = fb_paddr[0] >= 0x4000000;
+ printf("looking like Caanoo? %s.\n", probably_caanoo ? "yes" : "no");
gp2x_screens[0] = mmap(0, 320*240*2*FB_BUF_COUNT, PROT_READ|PROT_WRITE,
MAP_SHARED, memdev, fb_paddr[0]);
unsigned int r;
int ret;
+ if (probably_caanoo)
+ rot = 0;
+
rot_cmd[0] = rot ? 6 : 5;
ret = ioctl(fbdev, _IOW('D', 90, int[2]), rot_cmd);
if (ret < 0)