X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=ginge.git;a=blobdiff_plain;f=common%2Fhost_fb.c;h=be6d934cc68a2459fde012a284b71d984d405962;hp=46cd03379f0ac2ebb702c13ef3812ab5ff83a744;hb=499bf01c2f0e075caeb23714e3376a641c04eb7c;hpb=eb058b482d306017c5efa176351c36180c6c8b85 diff --git a/common/host_fb.c b/common/host_fb.c index 46cd033..be6d934 100644 --- a/common/host_fb.c +++ b/common/host_fb.c @@ -1,4 +1,9 @@ -// vim:shiftwidth=2:expandtab +/* + * GINGE - GINGE Is Not Gp2x Emulator + * (C) notaz, 2010-2011 + * + * This work is licensed under the MAME license, see COPYING file for details. + */ #include #ifdef LOADER #include "../loader/realfuncs.h" @@ -32,7 +37,7 @@ int host_video_init(int *stride, int no_dblbuf) 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; @@ -173,20 +178,37 @@ void host_video_blit4(const unsigned char *src, int w, int h, int stride) 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 #endif // WIZ +// vim:shiftwidth=2:expandtab