4 * This work is licensed under the terms of the GNU GPLv2 or later.
5 * See the COPYING file in the top-level directory.
10 #include "externals.h"
18 #include "plugin_lib.h"
24 BOOL bIsFirstFrame = TRUE;
25 BOOL bCheckMask = FALSE;
26 unsigned short sSetMask = 0;
27 unsigned long lSetMask = 0;
31 int iMaintainAspect = 0;
32 int iUseNoStretchBlt = 0;
35 PSXPoint_t ptCursorPoint[8];
36 unsigned short usCursorActive = 0;
40 static void blit(void)
42 int x = PSXDisplay.DisplayPosition.x;
43 int y = PSXDisplay.DisplayPosition.y;
44 int w = PreviousPSXDisplay.Range.x1;
45 int h = PreviousPSXDisplay.DisplayMode.y;
46 int pitch = PreviousPSXDisplay.DisplayMode.x * 2;
47 unsigned char *dest = pl_fbdev_buf;
49 // TODO: clear border if centering
51 // account for centering
52 h -= PreviousPSXDisplay.Range.y0;
53 dest += PreviousPSXDisplay.Range.y0 / 2 * pitch;
54 dest += PreviousPSXDisplay.Range.x0 * 2; // XXX
57 unsigned short *srcs = psxVuw + y * 1024 + x;
58 for (; h-- > 0; dest += pitch, srcs += 1024)
60 memcpy(dest, srcs, w * 2);
65 static int fbw, fbh, fb24bpp;
67 void DoBufferSwap(void)
70 if (PSXDisplay.DisplayMode.x == 0 || PSXDisplay.DisplayMode.y == 0)
73 if (PSXDisplay.DisplayMode.x != fbw || PSXDisplay.DisplayMode.y != fbh
74 || PSXDisplay.RGB24 != fb24bpp) {
75 fbw = PSXDisplay.DisplayMode.x;
76 fbh = PSXDisplay.DisplayMode.y;
77 fb24bpp = PSXDisplay.RGB24;
78 pl_fbdev_set_mode(fbw, fbh, fb24bpp ? 24 : 16);
81 if (fps_cur != fps_old) {
82 printf("%2.1f\n", fps_cur);
90 void DoClearScreenBuffer(void) // CLEAR DX BUFFER
94 void DoClearFrontBuffer(void) // CLEAR DX BUFFER
98 static int initialize(void)
103 bIsFirstFrame = FALSE; // done
108 ulKeybits|=KEY_SHOWFPS;
116 unsigned long ulInitDisplay(void)
121 if (pl_fbdev_init() != 0)
127 void CloseDisplay(void)
133 void CreatePic(unsigned char * pMem)
137 void DestroyPic(void)
141 void HandleKey(int keycode)