aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backends/sdl/sdl-common.cpp4
-rw-r--r--backends/sdl/sdl.cpp6
-rw-r--r--common/gameDetector.cpp3
-rw-r--r--common/scaler.cpp25
-rw-r--r--common/scaler.h2
-rw-r--r--common/system.h3
-rw-r--r--gui/options.cpp1
7 files changed, 39 insertions, 5 deletions
diff --git a/backends/sdl/sdl-common.cpp b/backends/sdl/sdl-common.cpp
index 6a1e1da6d2..a4cb7ba341 100644
--- a/backends/sdl/sdl-common.cpp
+++ b/backends/sdl/sdl-common.cpp
@@ -481,9 +481,9 @@ bool OSystem_SDL_Common::poll_event(Event *event) {
quit();
break;
}
- // Ctr-Alt-1 till Ctrl-Alt-7 will change the GFX mode
+ // Ctr-Alt-1 till Ctrl-Alt-8 will change the GFX mode
if (b == (KBD_CTRL|KBD_ALT) &&
- (ev.key.keysym.sym>='1') && (ev.key.keysym.sym<='7')) {
+ (ev.key.keysym.sym>='1') && (ev.key.keysym.sym<='8')) {
Property prop;
prop.gfx_mode = ev.key.keysym.sym - '1';
property(PROP_SET_GFX_MODE, &prop);
diff --git a/backends/sdl/sdl.cpp b/backends/sdl/sdl.cpp
index eaa7a03642..19cde5f514 100644
--- a/backends/sdl/sdl.cpp
+++ b/backends/sdl/sdl.cpp
@@ -99,6 +99,10 @@ void OSystem_SDL::load_gfx_mode() {
_scaleFactor = 2;
_scaler_proc = AdvMame2x;
break;
+ case GFX_TV2X:
+ _scaleFactor = 2;
+ _scaler_proc = TV2x;
+ break;
case GFX_DOUBLESIZE:
_scaleFactor = 2;
@@ -341,7 +345,7 @@ uint32 OSystem_SDL::property(int param, Property *value) {
#endif
return 1;
} else if (param == PROP_SET_GFX_MODE) {
- if (value->gfx_mode >= 7)
+ if (value->gfx_mode >= 8)
return 0;
_mode = value->gfx_mode;
diff --git a/common/gameDetector.cpp b/common/gameDetector.cpp
index 99b1300963..554f181634 100644
--- a/common/gameDetector.cpp
+++ b/common/gameDetector.cpp
@@ -47,7 +47,7 @@ static const char USAGE_STRING[] =
"\t-p<path> - look for game in <path>\n"
"\t-x[<num>] - load this savegame (default: 0 - autosave)\n"
"\t-f - fullscreen mode\n"
- "\t-g<mode> - graphics mode (normal,2x,3x,2xsai,super2xsai,supereagle,advmame2x)\n"
+ "\t-g<mode> - graphics mode (normal,2x,3x,2xsai,super2xsai,supereagle,advmame2x,tv2x)\n"
"\t-e<mode> - set music engine (see README for details)\n"
"\t-a - specify game is amiga version\n"
"\n"
@@ -182,6 +182,7 @@ static const struct GraphicsModes gfx_modes[] = {
{"super2xsai", "Super2xSAI", GFX_SUPER2XSAI},
{"supereagle", "SuperEagle", GFX_SUPEREAGLE},
{"advmame2x", "AdvMAME2x", GFX_ADVMAME2X},
+ {"tv2x", "TV2x", GFX_TV2X},
{0, 0}
};
diff --git a/common/scaler.cpp b/common/scaler.cpp
index c0a2e30ef4..c0e9f85719 100644
--- a/common/scaler.cpp
+++ b/common/scaler.cpp
@@ -810,3 +810,28 @@ void Normal3x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint32
dstPtr += dstPitch3;
}
}
+
+void TV2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint32 dstPitch,
+ int width, int height)
+{
+ unsigned int nextlineSrc = srcPitch / sizeof(short);
+ short *p = (short *)srcPtr;
+
+ unsigned int nextlineDst = dstPitch / sizeof(short);
+ short *q = (short *)dstPtr;
+
+ while(height--) {
+ for (int i = 0, j = 0; i < width; ++i, j += 2) {
+ unsigned short p1 = *(p + i);
+ unsigned short p2 = *(p + i + nextlineSrc);
+ unsigned short pi = (unsigned short)((INTERPOLATE(p1, p2) & colorMask) >> 1);
+
+ *(q + j) = p1;
+ *(q + j + 1) = p1;
+ *(q + j + nextlineDst) = pi;
+ *(q + j + nextlineDst + 1) = pi;
+ }
+ p += nextlineSrc;
+ q += nextlineDst << 1;
+ }
+}
diff --git a/common/scaler.h b/common/scaler.h
index f3675ccdce..893bb12a8a 100644
--- a/common/scaler.h
+++ b/common/scaler.h
@@ -36,5 +36,7 @@ extern void Normal2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null,
uint8 *dstPtr, uint32 dstPitch, int width, int height);
extern void Normal3x(uint8 *srcPtr, uint32 srcPitch, uint8 *null,
uint8 *dstPtr, uint32 dstPitch, int width, int height);
+extern void TV2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null,
+ uint8 *dstPtr, uint32 dstPitch, int width, int height);
#endif
diff --git a/common/system.h b/common/system.h
index df8da3b59a..77d50e2e84 100644
--- a/common/system.h
+++ b/common/system.h
@@ -220,7 +220,8 @@ enum {
GFX_2XSAI = 3,
GFX_SUPER2XSAI = 4,
GFX_SUPEREAGLE = 5,
- GFX_ADVMAME2X = 6
+ GFX_ADVMAME2X = 6,
+ GFX_TV2X = 7
};
diff --git a/gui/options.cpp b/gui/options.cpp
index 68f3beb616..93478a635d 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -69,6 +69,7 @@ GlobalOptionsDialog::GlobalOptionsDialog(NewGui *gui)
gfxPopUp->appendEntry("Super2xSAI");
gfxPopUp->appendEntry("SuperEagle");
gfxPopUp->appendEntry("AdvMAME2x");
+ gfxPopUp->appendEntry("TV2x");
gfxPopUp->setSelected(0);
// The MIDI mode popup & a label