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 "../gpulib/cspace.h"
13 #include "../../frontend/plugin_lib.h"
18 BOOL bCheckMask = FALSE;
19 unsigned short sSetMask;
20 unsigned long lSetMask;
22 static void blit(void)
24 int px = PSXDisplay.DisplayPosition.x & ~1; // XXX: align needed by bgr*_to_...
25 int py = PSXDisplay.DisplayPosition.y;
26 int w = PreviousPSXDisplay.Range.x1;
27 int h = PreviousPSXDisplay.DisplayMode.y;
28 unsigned short *srcs = psxVuw + py * 1024 + px;
33 // account for centering
34 h -= PreviousPSXDisplay.Range.y0;
36 rcbs->pl_vout_flip(srcs, 1024, PSXDisplay.RGB24, w, h);
39 void DoBufferSwap(void)
41 static int fbw, fbh, fb24bpp;
43 if (PreviousPSXDisplay.DisplayMode.x == 0 || PreviousPSXDisplay.DisplayMode.y == 0)
46 /* careful if rearranging this code, we try to set mode and flip
47 * to get the hardware apply both changes at the same time */
48 if (PreviousPSXDisplay.DisplayMode.x != fbw || PreviousPSXDisplay.DisplayMode.y != fbh
49 || PSXDisplay.RGB24 != fb24bpp) {
50 fbw = PreviousPSXDisplay.DisplayMode.x;
51 fbh = PreviousPSXDisplay.DisplayMode.y;
52 fb24bpp = PSXDisplay.RGB24;
53 rcbs->pl_vout_set_mode(fbw, fbh, fbw, fbh, fb24bpp ? 24 : 16);
56 pcnt_start(PCNT_BLIT);
61 void DoClearScreenBuffer(void)
65 unsigned long ulInitDisplay(void)
67 if (rcbs->pl_vout_open() != 0)
73 void CloseDisplay(void)
75 rcbs->pl_vout_close();