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;
69 void DoBufferSwap(void)
71 static int fps_counter;
72 if (PSXDisplay.DisplayMode.x == 0 || PSXDisplay.DisplayMode.y == 0)
75 if (PSXDisplay.DisplayMode.x != fbw || PSXDisplay.DisplayMode.y != fbh
76 || PSXDisplay.RGB24 != fb24bpp) {
77 fbw = PSXDisplay.DisplayMode.x;
78 fbh = PSXDisplay.DisplayMode.y;
79 fb24bpp = PSXDisplay.RGB24;
80 pl_fbdev_set_mode(fbw, fbh, fb24bpp ? 24 : 16);
88 if (++fps_counter == 60/6) {
89 //printf("%2.1f\n", fps_cur);
97 void DoClearScreenBuffer(void) // CLEAR DX BUFFER
101 void DoClearFrontBuffer(void) // CLEAR DX BUFFER
105 static int initialize(void)
110 bIsFirstFrame = FALSE; // done
115 ulKeybits|=KEY_SHOWFPS;
123 unsigned long ulInitDisplay(void)
128 if (pl_fbdev_init() != 0)
134 void CloseDisplay(void)
141 void CreatePic(unsigned char * pMem)
145 void DestroyPic(void)
149 void HandleKey(int keycode)