aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README3
-rw-r--r--backends/sdl/sdl-common.cpp20
-rw-r--r--backends/sdl/sdl.cpp6
-rw-r--r--backends/sdl/sdl_gl.cpp2
-rw-r--r--common/gameDetector.cpp1
-rw-r--r--common/scaler.cpp38
-rw-r--r--common/scaler.h6
7 files changed, 64 insertions, 12 deletions
diff --git a/README b/README
index bb8bdc8525..a40b7cbacc 100644
--- a/README
+++ b/README
@@ -346,7 +346,7 @@ simon games.
Ctrl-z OR Alt-x - quit
Keyboard Arrow Keys - simulate mouse movement
Ctrl-f - runs in fast mode.
- Ctrl-Alt 1-9 - Switch between graphics filters
+ Ctrl-Alt 0-9 - Switch between graphics filters
Ctrl-Alt 1 - Switch beetwen bilinear and non-linear filtering [OpenGL backend]
Ctrl-Alt 2 - Don't fit the game in the whole screen (black borders) [OpenGL backend]
Ctrl-Alt 3 - Fit the game in the whole screen (no black borders) [OpenGL backend]
@@ -408,6 +408,7 @@ They are:
super2xsai - Enhanced 2xsai filtering. 640x400 screen/window size
supereagle - Less blurry than 2xsai, but slower. Also 640x400
advmame2x - 640x400 scaling. Doesn't rely on blurring like 2xSAI.
+ advmame3x - 960x600 scaling. Doesn't rely on blurring like 2xSAI.
tv2x - 640x400 scaling. Horizontal scanlines.
dotmatrix - 640x400 scaling. Dot matrix effect.
diff --git a/backends/sdl/sdl-common.cpp b/backends/sdl/sdl-common.cpp
index 2aff1e4b40..e258957cb2 100644
--- a/backends/sdl/sdl-common.cpp
+++ b/backends/sdl/sdl-common.cpp
@@ -544,13 +544,19 @@ bool OSystem_SDL_Common::poll_event(Event *event) {
break;
}
#endif
- // Ctr-Alt-1 till Ctrl-Alt-9 will change the GFX mode
- if (b == (KBD_CTRL|KBD_ALT) &&
- (ev.key.keysym.sym>='1') && (ev.key.keysym.sym<='9')) {
- Property prop;
- prop.gfx_mode = ev.key.keysym.sym - '1';
- property(PROP_SET_GFX_MODE, &prop);
- break;
+ // Ctr-Alt-<key> will change the GFX mode
+ if (b == (KBD_CTRL|KBD_ALT)) {
+ char keys[] = "1234567890";
+ char *ptr;
+
+ ptr = strchr(keys, ev.key.keysym.sym);
+ if (ptr != NULL) {
+ Property prop;
+
+ prop.gfx_mode = ptr - keys;
+ property(PROP_SET_GFX_MODE, &prop);
+ break;
+ }
}
#ifdef QTOPIA
diff --git a/backends/sdl/sdl.cpp b/backends/sdl/sdl.cpp
index 3c977e20b9..13cf5fe087 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_ADVMAME3X:
+ _scaleFactor = 3;
+ _scaler_proc = AdvMame3x;
+ break;
case GFX_TV2X:
_scaleFactor = 2;
_scaler_proc = TV2x;
@@ -360,7 +364,7 @@ uint32 OSystem_SDL::property(int param, Property *value) {
#endif
return 1;
} else if (param == PROP_SET_GFX_MODE) {
- if (value->gfx_mode >= 9)
+ if (value->gfx_mode >= 10)
return 0;
_mode = value->gfx_mode;
diff --git a/backends/sdl/sdl_gl.cpp b/backends/sdl/sdl_gl.cpp
index 9858354004..99b5dc1f12 100644
--- a/backends/sdl/sdl_gl.cpp
+++ b/backends/sdl/sdl_gl.cpp
@@ -570,7 +570,7 @@ uint32 OSystem_SDL_OpenGL::property(int param, Property *value) {
_glScreenStart = 0;
break;
default: // SDL backend
- if (value->gfx_mode >= 9)
+ if (value->gfx_mode >= 10)
return 0;
_mode = value->gfx_mode;
diff --git a/common/gameDetector.cpp b/common/gameDetector.cpp
index 27c9b7bb05..885a1e5754 100644
--- a/common/gameDetector.cpp
+++ b/common/gameDetector.cpp
@@ -90,6 +90,7 @@ static const struct GraphicsMode gfx_modes[] = {
{"super2xsai", "Super2xSAI", GFX_SUPER2XSAI},
{"supereagle", "SuperEagle", GFX_SUPEREAGLE},
{"advmame2x", "AdvMAME2x", GFX_ADVMAME2X},
+ {"advmame3x", "AdvMAME3x", GFX_ADVMAME3X},
{"tv2x", "TV2x", GFX_TV2X},
{"dotmatrix", "DotMatrix", GFX_DOTMATRIX},
#else
diff --git a/common/scaler.cpp b/common/scaler.cpp
index 320f67ef5d..96d25f3b3c 100644
--- a/common/scaler.cpp
+++ b/common/scaler.cpp
@@ -746,6 +746,44 @@ void AdvMame2x(uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch,
}
}
+void AdvMame3x(uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch,
+ int width, int height) {
+ unsigned int nextlineSrc = srcPitch / sizeof(uint16);
+ uint16 *p = (uint16 *)srcPtr;
+
+ unsigned int nextlineDst = dstPitch / sizeof(uint16);
+ uint16 *q = (uint16 *)dstPtr;
+
+ uint16 A, B, C;
+ uint16 D, E, F;
+ uint16 G, H, I;
+
+ while (height--) {
+ B = C = *(p - nextlineSrc);
+ E = F = *(p);
+ H = I = *(p + nextlineSrc);
+ for (int i = 0; i < width; ++i) {
+ p++;
+ A = B; B = C; C = *(p - nextlineSrc);
+ D = E; E = F; F = *(p);
+ G = H; H = I; I = *(p + nextlineSrc);
+
+ *(q) = D == B && B != F && D != H ? D : E;
+ *(q + 1) = E;
+ *(q + 2) = B == F && B != D && F != H ? F : E;
+ *(q + nextlineDst) = E;
+ *(q + nextlineDst + 1) = E;
+ *(q + nextlineDst + 2) = E;
+ *(q + 2 * nextlineDst) = D == H && D != B && H != F ? D : E;
+ *(q + 2 * nextlineDst + 1) = E;
+ *(q + 2 * nextlineDst + 2) = H == F && D != H && B != F ? F : E;
+ q += 3;
+ }
+ p += nextlineSrc - width;
+ q += (nextlineDst - width) * 3;
+ }
+}
+
void Normal1x(uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch,
int width, int height) {
while (height--) {
diff --git a/common/scaler.h b/common/scaler.h
index 0b4c6d4186..668b02cb95 100644
--- a/common/scaler.h
+++ b/common/scaler.h
@@ -31,6 +31,7 @@ DECLARE_SCALER(_2xSaI);
DECLARE_SCALER(Super2xSaI);
DECLARE_SCALER(SuperEagle);
DECLARE_SCALER(AdvMame2x);
+DECLARE_SCALER(AdvMame3x);
DECLARE_SCALER(Normal1x);
DECLARE_SCALER(Normal2x);
DECLARE_SCALER(Normal3x);
@@ -46,8 +47,9 @@ enum {
GFX_SUPER2XSAI = 4,
GFX_SUPEREAGLE = 5,
GFX_ADVMAME2X = 6,
- GFX_TV2X = 7,
- GFX_DOTMATRIX = 8,
+ GFX_ADVMAME3X = 7,
+ GFX_TV2X = 8,
+ GFX_DOTMATRIX = 9,
GFX_FLIPPING = 100, // Palmos
GFX_DOUBLEBUFFER = 101 // Palmos