#define _IN_DRAW
-#include "externals.h"
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <X11/cursorfont.h>
+
#include "gpu.h"
-#include "draw.h"
-#include "prim.h"
-#include "menu.h"
-#include "interp.h"
-#include "swap.h"
// misc globals
-int iResX;
-int iResY;
+int iResX=640;
+int iResY=480;
long lLowerpart;
BOOL bIsFirstFrame = TRUE;
BOOL bCheckMask = FALSE;
int iMaintainAspect = 0;
int iUseNoStretchBlt = 0;
int iFastFwd = 0;
-int iDebugMode = 0;
+//int iDebugMode = 0;
int iFVDisplay = 0;
PSXPoint_t ptCursorPoint[8];
unsigned short usCursorActive = 0;
+unsigned long ulKeybits;
+
+int iWindowMode=1;
+int iColDepth=32;
+char szDispBuf[64];
+char szMenuBuf[36];
+char szDebugText[512];
+void InitMenu(void) {}
+void CloseMenu(void) {}
//unsigned int LUT16to32[65536];
//unsigned int RGBtoYUV[65536];
XShmSegmentInfo shminfo;
int finalw,finalh;
+typedef struct {
+#define MWM_HINTS_DECORATIONS 2
+ long flags;
+ long functions;
+ long decorations;
+ long input_mode;
+} MotifWmHints;
+
extern XvImage *XvShmCreateImage(Display*, XvPortID, int, char*, int, int, XShmSegmentInfo*);
#include <time.h>
//backup YUV mode
//hmm, should I bother check guid == 55595659-0000-0010-8000-00aa00389b71?
//and check byte order? fo[j].byte_order == LSBFirst
-#ifdef __BIG_ENDIAN__
+#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
if ( fo[j].type == XvYUV && fo[j].bits_per_pixel == 16 && fo[j].format == XvPacked && strncmp("YUYV", fo[j].component_order, 5) == 0 )
#else
if ( fo[j].type == XvYUV && fo[j].bits_per_pixel == 16 && fo[j].format == XvPacked && strncmp("UYVY", fo[j].component_order, 5) == 0 )
U = min(abs(R * -1214 + G * -2384 + B * 3598 + 4096 + 1048576) >> 13, 240);
V = min(abs(R * 3598 + G * -3013 + B * -585 + 4096 + 1048576) >> 13, 240);
-#ifdef __BIG_ENDIAN__
+#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
destpix[row] = Y << 24 | U << 16 | Y << 8 | V;
#else
destpix[row] = Y << 24 | V << 16 | Y << 8 | U;
U = min(abs(R * -1214 + G * -2384 + B * 3598 + 4096 + 1048576) >> 13, 240);
V = min(abs(R * 3598 + G * -3013 + B * -585 + 4096 + 1048576) >> 13, 240);
-#ifdef __BIG_ENDIAN__
+#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
destpix[row] = Y << 24 | U << 16 | Y << 8 | V;
#else
destpix[row] = Y << 24 | V << 16 | Y << 8 | U;
Y2 = min(abs(R * 2104 + G * 4130 + B * 802 + 4096 + 131072) >> 13, 235);
-#ifdef __BIG_ENDIAN__
+#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
*d = V | Y2 << 8 | U << 16 | Y1 << 24;
#else
*d = U | Y1 << 8 | V << 16 | Y2 << 24;
}
}
-extern time_t tStart;
+time_t tStart;
//Note: dest x,y,w,h are both input and output variables
inline void MaintainAspect(unsigned int *dx,unsigned int *dy,unsigned int *dw,unsigned int *dh)
p2XSaIFunc=NULL;
+#if 0
if(iUseNoStretchBlt==1)
{
p2XSaIFunc=Std2xSaI_ex8;
{
p2XSaIFunc=hq3x_32;
}
+#endif
bUsingTWin=FALSE;
iShowFPS=0;
ulKeybits|=KEY_SHOWFPS;
szDispBuf[0]=0;
- BuildDispMenu(0);
+ //BuildDispMenu(0);
}
return 0;
{
}
+#if 0
static void hq2x_32_def(uint32_t * dst0, uint32_t * dst1, const uint32_t * src0, const uint32_t * src1, const uint32_t * src2, unsigned count)
{
static unsigned char cache_vert_mask[640];
hq3x_32_def(dst0, dst1, dst2, src0, src1, src1, width);
}
+#endif