Add command-line switches for xvideo scaling

This commit is contained in:
greg-kennedy 2015-12-19 21:20:57 -06:00
parent 250947af95
commit 3d7f5e78ec
2 changed files with 25 additions and 2 deletions

View File

@ -12,7 +12,6 @@ OBJECTS = ../apu/apu.o ../apu/bapu/dsp/sdsp.o ../apu/bapu/dsp/SPC_DSP.o ../ap
DEFS = -DMITSHM
ifdef S9XXVIDEO
OBJECTS += x11-driver-display-xv.o
DEFS += -DUSE_XVIDEO
LIBS += -lXv
endif

View File

@ -200,6 +200,10 @@
#include <X11/extensions/XShm.h>
#endif
#ifdef USE_XVIDEO
#include <X11/extensions/Xv.h>
#endif
#include "snes9x.h"
#include "memmap.h"
#include "ppu.h"
@ -247,6 +251,9 @@ struct GUIData
XShmSegmentInfo sm_info;
bool8 use_shared_memory;
#endif
#ifdef USE_XVIDEO
bool8 use_xvideo;
#endif
};
static struct GUIData GUI;
@ -298,6 +305,9 @@ void S9xExtraDisplayUsage (void)
S9xMessage(S9X_INFO, S9X_USAGE, "-setrepeat Allow altering keyboard auto-repeat");
S9xMessage(S9X_INFO, S9X_USAGE, "");
S9xMessage(S9X_INFO, S9X_USAGE, "-fullscreen Switch to full-screen on start");
#ifdef USE_XVIDEO
S9xMessage(S9X_INFO, S9X_USAGE, "-xvideo Xv hardware-accelerated scaling");
#endif
S9xMessage(S9X_INFO, S9X_USAGE, "");
S9xMessage(S9X_INFO, S9X_USAGE, "-v1 Video mode: Blocky (default)");
S9xMessage(S9X_INFO, S9X_USAGE, "-v2 Video mode: TV");
@ -318,6 +328,11 @@ void S9xParseDisplayArg (char **argv, int &i, int argc)
if (!strcasecmp(argv[i], "-fullscreen"))
GUI.fullscreen = TRUE;
else
#ifdef USE_XVIDEO
if (!strcasecmp(argv[i], "-xvideo"))
GUI.use_xvideo = TRUE;
else
#endif
if (!strncasecmp(argv[i], "-v", 2))
{
switch (argv[i][2])
@ -476,7 +491,10 @@ const char * S9xParseDisplayConfig (ConfigFile &conf, int pass)
}
GUI.no_repeat = !conf.GetBool("Unix/X11::SetKeyRepeat", TRUE);
GUI.fullscreen = conf.GetBool("Unix/X11::Fullscreen", TRUE);
GUI.fullscreen = conf.GetBool("Unix/X11::Fullscreen", FALSE);
#ifdef USE_XVIDEO
GUI.use_xvideo = conf.GetBool("Unix/X11::Xvideo", FALSE);
#endif
if (conf.Exists("Unix/X11::VideoMode"))
{
@ -730,6 +748,12 @@ static void SetupImage (void)
{
TakedownImage();
#ifdef USE_XVIDEO
if (GUI.use_xvideo)
{
}
#endif
#ifdef MITSHM
GUI.use_shared_memory = TRUE;