summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2009-11-27 12:02:09 +0000
committerSND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2009-11-27 12:02:09 +0000
commit555d07b089f1893a3ae9534dcad7397f1fd6eedf (patch)
treedbfa59af072cb607cf373d38c2b148507fdd074b
parent9490d3a6dce545d19cadcebf3e33a55b8b27e13e (diff)
downloadpcsxr-555d07b089f1893a3ae9534dcad7397f1fd6eedf.tar.gz
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@38321 e17a0e51-4ae3-4d35-97c3-1a29b211df97
-rw-r--r--ChangeLog5
-rw-r--r--gui/LnxMain.c28
-rw-r--r--gui/Makefile.am3
-rw-r--r--gui/Makefile.in3
-rw-r--r--plugins/dfcdrom/cdrcfg-0.1df/main.c1
-rw-r--r--plugins/dfxvideo/Makefile.am2
-rw-r--r--plugins/dfxvideo/Makefile.in2
-rw-r--r--plugins/dfxvideo/draw.c18
8 files changed, 41 insertions, 21 deletions
diff --git a/ChangeLog b/ChangeLog
index f3cd98d9..1adad9f7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -21,6 +21,11 @@ November 27, 2009 Wei Mingzhi <weimingzhi@gmail.com>
* po/update-pot.sh: Include files from plugins/dfcdrom/cdrcfg-0.1df.
* po/pcsx.pot, po/zh_CN.po, po/zh_TW.po, po/pt_BR.po: Updated.
* plugins/dfcdrom/cdr.h: Moved global variables into cdr-linux.c.
+ * plugins/dfxvideo/draw.c: Removed the screensaver disabling code.
+ * plugins/dfxvideo/Makefile.am: Don't link against Xtst.
+ * gui/LnxMain.c: Disable screensaver in the main emu, so that it will be
+ effective in all of the plugins.
+ * gui/Makefile.am: Added -lXext -lXtst.
November 26, 2009 Wei Mingzhi <weimingzhi@gmail.com>
diff --git a/gui/LnxMain.c b/gui/LnxMain.c
index f1fe1846..53b2bf7f 100644
--- a/gui/LnxMain.c
+++ b/gui/LnxMain.c
@@ -31,7 +31,7 @@
#include <sys/stat.h>
#include "Linux.h"
-/* FIXME */
+
#include "../libpcsxcore/sio.h"
#include "config.h"
@@ -40,6 +40,8 @@
#include <locale.h>
#endif
+#include <X11/extensions/XTest.h>
+
enum {
DONT_USE_GUI = 0,
USE_GUI
@@ -528,9 +530,33 @@ void SysCloseLibrary(void *lib) {
dlclose(lib);
}
+static void SysDisableScreenSaver() {
+ static time_t fake_key_timer = 0;
+ static char first_time = 1, has_test_ext = 0;
+ Display *display;
+ extern unsigned long gpuDisp;
+
+ display = (Display *)gpuDisp;
+
+ if (first_time) {
+ // check if xtest is available
+ int a, b, c, d;
+ has_test_ext = XTestQueryExtension(display, &a, &b, &c, &d);
+
+ first_time = 0;
+ }
+
+ if (has_test_ext && fake_key_timer < time(NULL)) {
+ XTestFakeRelativeMotionEvent(display, 1, 0, 0);
+ fake_key_timer = time(NULL) + 55;
+ }
+}
+
void SysUpdate() {
PADhandleKey(PAD1_keypressed());
PADhandleKey(PAD2_keypressed());
+
+ SysDisableScreenSaver();
}
/* ADB TODO Replace RunGui() with StartGui ()*/
diff --git a/gui/Makefile.am b/gui/Makefile.am
index a89ed2e2..77c0c46b 100644
--- a/gui/Makefile.am
+++ b/gui/Makefile.am
@@ -16,4 +16,5 @@ pcsx_SOURCES = \
Cheat.c
pcsx_LDADD = \
- $(GTK2_LIBS) $(GLADE2_LIBS) -lpthread -lz -lm ../libpcsxcore/libpcsxcore.a
+ $(GTK2_LIBS) $(GLADE2_LIBS) -lpthread -lz -lm -lXext -lXtst \
+ ../libpcsxcore/libpcsxcore.a
diff --git a/gui/Makefile.in b/gui/Makefile.in
index 45bbe704..0c29fe75 100644
--- a/gui/Makefile.in
+++ b/gui/Makefile.in
@@ -234,7 +234,8 @@ pcsx_SOURCES = \
Cheat.c
pcsx_LDADD = \
- $(GTK2_LIBS) $(GLADE2_LIBS) -lpthread -lz -lm ../libpcsxcore/libpcsxcore.a
+ $(GTK2_LIBS) $(GLADE2_LIBS) -lpthread -lz -lm -lXext -lXtst \
+ ../libpcsxcore/libpcsxcore.a
all: all-am
diff --git a/plugins/dfcdrom/cdrcfg-0.1df/main.c b/plugins/dfcdrom/cdrcfg-0.1df/main.c
index acc5de25..9eac7ef4 100644
--- a/plugins/dfcdrom/cdrcfg-0.1df/main.c
+++ b/plugins/dfcdrom/cdrcfg-0.1df/main.c
@@ -17,6 +17,7 @@
#ifdef __linux__
#include "../cfg.c"
+#include <sys/ioctl.h>
GtkWidget *MainWindow;
diff --git a/plugins/dfxvideo/Makefile.am b/plugins/dfxvideo/Makefile.am
index 49ab9a7b..89ba770e 100644
--- a/plugins/dfxvideo/Makefile.am
+++ b/plugins/dfxvideo/Makefile.am
@@ -25,7 +25,7 @@ INCLUDES += -DUSE_NASM=1
endif
libDFXVideo_la_LDFLAGS = -module -avoid-version
libDFXVideo_la_LDFLAGS += -L/usr/X11R6/lib64 -L/usr/X11R6/lib \
- -lX11 -lXv -lXext -lXtst -lm
+ -lX11 -lXv -lXext -lm
bin_PROGRAMS = cfgDFXVideo
cfgDFXVideo_SOURCES = gpucfg-0.1df/main.c
diff --git a/plugins/dfxvideo/Makefile.in b/plugins/dfxvideo/Makefile.in
index 3353a2a5..b5491783 100644
--- a/plugins/dfxvideo/Makefile.in
+++ b/plugins/dfxvideo/Makefile.in
@@ -253,7 +253,7 @@ lib_LTLIBRARIES = libDFXVideo.la
libDFXVideo_la_SOURCES = gpu.c cfg.c draw.c fps.c key.c menu.c prim.c \
soft.c zn.c $(am__append_1)
libDFXVideo_la_LDFLAGS = -module -avoid-version -L/usr/X11R6/lib64 \
- -L/usr/X11R6/lib -lX11 -lXv -lXext -lXtst -lm
+ -L/usr/X11R6/lib -lX11 -lXv -lXext -lm
cfgDFXVideo_SOURCES = gpucfg-0.1df/main.c
cfgDFXVideo_LDADD = $(GTK2_LIBS) $(GLADE2_LIBS) -L/usr/X11R6/lib -lXext
glade_DATA = gpucfg-0.1df/dfxvideo.glade2
diff --git a/plugins/dfxvideo/draw.c b/plugins/dfxvideo/draw.c
index ef1613ce..d89d75c2 100644
--- a/plugins/dfxvideo/draw.c
+++ b/plugins/dfxvideo/draw.c
@@ -54,7 +54,6 @@ float pixelaspect;
#include <X11/extensions/Xv.h>
#include <X11/extensions/Xvlib.h>
#include <X11/extensions/XShm.h>
-#include <X11/extensions/XTest.h>
int xv_port = -1;
int xv_id = -1;
int xv_depth = 0;
@@ -62,20 +61,18 @@ int yuv_port = -1;
int yuv_id = -1;
int use_yuv = 0;
int xv_vsync = 0;
-int has_test_ext = 0;
-int fake_key_timer = 0;
XShmSegmentInfo shminfo;
int finalw,finalh;
extern XvImage *XvShmCreateImage(Display*, XvPortID, int, char*, int, int, XShmSegmentInfo*);
+#include <time.h>
+
// prototypes
void hq2x_32( unsigned char * srcPtr, DWORD srcPitch, unsigned char * dstPtr, int width, int height);
void hq3x_32( unsigned char * srcPtr, DWORD srcPitch, unsigned char * dstPtr, int width, int height);
-#include <time.h>
-
////////////////////////////////////////////////////////////////////////
// generic 2xSaI helpers
////////////////////////////////////////////////////////////////////////
@@ -1325,11 +1322,6 @@ shminfo.readOnly = 0;
printf("XShmAttach failed !\n");
exit (-1);
}
-
- {
- int a,b,c,d;
- has_test_ext = XTestQueryExtension(display, &a, &b, &c, &d);
- }
}
void (*p2XSaIFunc) (unsigned char *, DWORD, unsigned char *, int, int);
@@ -1576,12 +1568,6 @@ void DoBufferSwap(void)
if (finalw == 0 || finalh == 0)
return;
- // disable screensaver
- if (has_test_ext && fake_key_timer < time(NULL)) {
- XTestFakeRelativeMotionEvent(display, 1, 0, 0);
- fake_key_timer = time(NULL) + 55;
- }
-
XSync(display,False);
if(use_yuv) {