4 * This work is licensed under the terms of the GNU GPLv2 or later.
5 * See the COPYING file in the top-level directory.
12 #include "../../frontend/plugin_lib.h"
17 BOOL bCheckMask = FALSE;
18 unsigned short sSetMask;
19 unsigned long lSetMask;
21 static void blit(void)
23 int px = PSXDisplay.DisplayPosition.x & ~1; // XXX: align needed by bgr*_to_...
24 int py = PSXDisplay.DisplayPosition.y;
25 int w = PreviousPSXDisplay.Range.x1;
26 int h = PreviousPSXDisplay.DisplayMode.y;
27 unsigned short *srcs = psxVuw + py * 1024 + px;
32 // account for centering
33 h -= PreviousPSXDisplay.Range.y0;
35 rcbs->pl_vout_flip(srcs, 1024, PSXDisplay.RGB24, w, h);
38 void DoBufferSwap(void)
40 static int fbw, fbh, fb24bpp;
42 if (PreviousPSXDisplay.DisplayMode.x == 0 || PreviousPSXDisplay.DisplayMode.y == 0)
45 /* careful if rearranging this code, we try to set mode and flip
46 * to get the hardware apply both changes at the same time */
47 if (PreviousPSXDisplay.DisplayMode.x != fbw || PreviousPSXDisplay.DisplayMode.y != fbh
48 || PSXDisplay.RGB24 != fb24bpp) {
49 fbw = PreviousPSXDisplay.DisplayMode.x;
50 fbh = PreviousPSXDisplay.DisplayMode.y;
51 fb24bpp = PSXDisplay.RGB24;
52 rcbs->pl_vout_set_mode(fbw, fbh, fbw, fbh, fb24bpp ? 24 : 16);
55 pcnt_start(PCNT_BLIT);
60 void DoClearScreenBuffer(void)
64 unsigned long ulInitDisplay(void)
66 if (rcbs->pl_vout_open() != 0)
72 void CloseDisplay(void)
74 rcbs->pl_vout_close();