2 * (C) GraÅžvydas "notaz" Ignotas, 2011
4 * This work is licensed under the terms of any of these licenses
6 * - GNU GPL, version 2 or later.
7 * - GNU LGPL, version 2.1 or later.
8 * See the COPYING file in the top-level directory.
12 #include "../../frontend/plugin_lib.h"
13 #include "../../frontend/arm_utils.h"
15 static const struct rearmed_cbs *cbs;
16 static void *screen_buf;
28 static void blit(void)
30 static uint32_t old_status, old_h;
31 int x = gpu.screen.x & ~3; // alignment needed by blitter
38 srcs = &gpu.vram[y * 1024 + x];
40 h = gpu.screen.y2 - gpu.screen.y1;
41 if (gpu.status.dheight)
47 if ((gpu.status.reg ^ old_status) & ((7<<16)|(1<<21)) || h != old_h) // width|rgb24 change?
49 old_status = gpu.status.reg;
51 screen_buf = cbs->pl_fbdev_set_mode(w, h, gpu.status.rgb24 ? 24 : 16);
58 for (; h-- > 0; dest += w * 3, srcs += 1024)
60 bgr888_to_rgb888(dest, srcs, w * 3);
63 for (; h-- > 0; dest += w * 2, srcs += 1024)
65 bgr888_to_rgb565(dest, srcs, w * 3);
71 for (; h-- > 0; dest += w * 2, srcs += 1024)
73 bgr555_to_rgb565(dest, srcs, w * 2);
77 screen_buf = cbs->pl_fbdev_flip();
80 void GPUupdateLace(void)
82 if (!gpu.status.blanking)
89 screen_buf = cbs->pl_fbdev_flip();
95 cbs->pl_fbdev_close();
99 void GPUrearmedCallbacks(const struct rearmed_cbs *cbs_)
104 // vim:shiftwidth=2:expandtab