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 & ~1; // alignment needed by blitter
35 int stride = gpu.screen.hres;
40 srcs = &gpu.vram[y * 1024 + x];
42 if ((gpu.status.reg ^ old_status) & ((7<<16)|(1<<21)) || h != old_h) // width|rgb24 change?
44 old_status = gpu.status.reg;
46 screen_buf = cbs->pl_vout_set_mode(stride, h, gpu.status.rgb24 ? 24 : 16);
51 // only do centering, at least for now
52 doffs = (stride - w) / 2 & ~1;
57 dest += (doffs / 8) * 24;
58 for (; h-- > 0; dest += stride * 3, srcs += 1024)
60 bgr888_to_rgb888(dest, srcs, w * 3);
64 for (; h-- > 0; dest += stride * 2, srcs += 1024)
66 bgr888_to_rgb565(dest, srcs, w * 3);
73 for (; h-- > 0; dest += stride * 2, srcs += 1024)
75 bgr555_to_rgb565(dest, srcs, w * 2);
79 screen_buf = cbs->pl_vout_flip();
82 void GPUupdateLace(void)
84 if (gpu.frameskip.enabled && !gpu.frameskip.frame_ready)
87 if (!gpu.status.blanking && gpu.state.fb_dirty) {
88 renderer_flush_queues();
90 gpu.state.fb_dirty = 0;
96 gpu.frameskip.enabled = cbs->frameskip;
97 gpu.frameskip.advice = &cbs->fskip_advice;
100 screen_buf = cbs->pl_vout_flip();
106 cbs->pl_vout_close();
110 void GPUrearmedCallbacks(const struct rearmed_cbs *cbs_)
113 gpu.frameskip.enabled = cbs->frameskip;
114 gpu.frameskip.advice = &cbs->fskip_advice;
115 gpu.frameskip.active = gpu.frameskip.frame_ready = 0;
118 // vim:shiftwidth=2:expandtab