Index: backends/sdl/sdl-common.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/sdl/sdl-common.cpp,v
retrieving revision 1.59
diff -u -r1.59 sdl-common.cpp
--- backends/sdl/sdl-common.cpp	9 Jun 2003 01:19:25 -0000	1.59
+++ backends/sdl/sdl-common.cpp	17 Jun 2003 21:17:22 -0000
@@ -458,7 +458,8 @@
 
 void OSystem_SDL_Common::warp_mouse(int x, int y) {
 	if (_mouseCurState.x != x || _mouseCurState.y != y) {
-		SDL_WarpMouse(x * _scaleFactor, y * _scaleFactor);
+		SDL_WarpMouse(x * _scaleFactor_hmul / _scaleFactor_hdiv,
+			y * _scaleFactor_vmul / _scaleFactor_vdiv);
 
 		// SDL_WarpMouse() generates a mouse movement event, so
 		// set_mouse_pos() would be called eventually. However, the
@@ -674,8 +675,10 @@
 			km.x = event->mouse.x = ev.motion.x;
 			km.y = event->mouse.y = ev.motion.y;
 
-			event->mouse.x /= _scaleFactor;
-			event->mouse.y /= _scaleFactor;
+			event->mouse.x *= _scaleFactor_hdiv;
+			event->mouse.x /= _scaleFactor_hmul;
+			event->mouse.y *= _scaleFactor_vdiv;
+			event->mouse.y /= _scaleFactor_vmul;
 
 			return true;
 
@@ -694,8 +697,10 @@
 				break;
 			km.x = event->mouse.x = ev.button.x;
 			km.y = event->mouse.y = ev.button.y;
-			event->mouse.x /= _scaleFactor;
-			event->mouse.y /= _scaleFactor;
+			event->mouse.x *= _scaleFactor_hdiv;
+			event->mouse.x /= _scaleFactor_hmul;
+			event->mouse.y *= _scaleFactor_vdiv;
+			event->mouse.y /= _scaleFactor_vmul;
 
 			return true;
 
@@ -708,8 +713,10 @@
 				break;
 			event->mouse.x = ev.button.x;
 			event->mouse.y = ev.button.y;
-			event->mouse.x /= _scaleFactor;
-			event->mouse.y /= _scaleFactor;
+			event->mouse.x *= _scaleFactor_hdiv;
+			event->mouse.x /= _scaleFactor_hmul;
+			event->mouse.y *= _scaleFactor_vdiv;
+			event->mouse.y /= _scaleFactor_vmul;
 			return true;
 
 		case SDL_JOYBUTTONDOWN:
@@ -812,8 +819,10 @@
 			}
 			event->mouse.x = km.x;
 			event->mouse.y = km.y;
-			event->mouse.x /= _scaleFactor;
-			event->mouse.y /= _scaleFactor;
+			event->mouse.x *= _scaleFactor_hdiv;
+			event->mouse.x /= _scaleFactor_hmul;
+			event->mouse.y *= _scaleFactor_vdiv;
+			event->mouse.y /= _scaleFactor_vmul;
 			return true;
 
 		case SDL_VIDEOEXPOSE:
Index: backends/sdl/sdl-common.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/sdl/sdl-common.h,v
retrieving revision 1.27
diff -u -r1.27 sdl-common.h
--- backends/sdl/sdl-common.h	9 Jun 2003 01:19:25 -0000	1.27
+++ backends/sdl/sdl-common.h	17 Jun 2003 21:17:23 -0000
@@ -153,7 +153,10 @@
 	};
 
 	bool _forceFull; // Force full redraw on next update_screen
-	int _scaleFactor;
+	int _scaleFactor_hmul;
+	int _scaleFactor_hdiv;
+	int _scaleFactor_vmul;
+	int _scaleFactor_vdiv;
 	int _mode;
 	bool _full_screen;
 	uint32 _mode_flags;
Index: backends/sdl/sdl.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/sdl/sdl.cpp,v
retrieving revision 1.33
diff -u -r1.33 sdl.cpp
--- backends/sdl/sdl.cpp	28 May 2003 22:19:11 -0000	1.33
+++ backends/sdl/sdl.cpp	17 Jun 2003 21:17:25 -0000
@@ -84,36 +84,52 @@
 	
 	switch(_mode) {
 	case GFX_2XSAI:
-		_scaleFactor = 2;
+		_scaleFactor_hmul = _scaleFactor_vmul = 2;
+		_scaleFactor_hdiv = _scaleFactor_vdiv = 1;
 		_scaler_proc = _2xSaI;
 		break;
 	case GFX_SUPER2XSAI:
-		_scaleFactor = 2;
+		_scaleFactor_hmul = _scaleFactor_vmul = 2;
+		_scaleFactor_hdiv = _scaleFactor_vdiv = 1;
 		_scaler_proc = Super2xSaI;
 		break;
 	case GFX_SUPEREAGLE:
-		_scaleFactor = 2;
+		_scaleFactor_hmul = _scaleFactor_vmul = 2;
+		_scaleFactor_hdiv = _scaleFactor_vdiv = 1;
 		_scaler_proc = SuperEagle;
 		break;
 	case GFX_ADVMAME2X:
-		_scaleFactor = 2;
+		_scaleFactor_hmul = _scaleFactor_vmul = 2;
+		_scaleFactor_hdiv = _scaleFactor_vdiv = 1;
 		_scaler_proc = AdvMame2x;
 		break;
 	case GFX_ADVMAME3X:
-		_scaleFactor = 3;
+		_scaleFactor_hmul = _scaleFactor_vmul = 3;
+		_scaleFactor_hdiv = _scaleFactor_vdiv = 1;
 		_scaler_proc = AdvMame3x;
 		break;
 	case GFX_TV2X:
-		_scaleFactor = 2;
+		_scaleFactor_hmul = _scaleFactor_vmul = 2;
+		_scaleFactor_hdiv = _scaleFactor_vdiv = 1;
 		_scaler_proc = TV2x;
 		break;
 	case GFX_DOTMATRIX:
-		_scaleFactor = 2;
+		_scaleFactor_hmul = _scaleFactor_vmul = 2;
+		_scaleFactor_hdiv = _scaleFactor_vdiv = 1;
 		_scaler_proc = DotMatrix;
 		break;
 
+	case GFX_RATIO800:
+		_scaleFactor_hmul = 5;
+		_scaleFactor_hdiv = 2;
+		_scaleFactor_vmul = 3;
+		_scaleFactor_vdiv = 1;
+		_scaler_proc = Ratio800;
+		break;
+
 	case GFX_DOUBLESIZE:
-		_scaleFactor = 2;
+		_scaleFactor_hmul = _scaleFactor_vmul = 2;
+		_scaleFactor_hdiv = _scaleFactor_vdiv = 1;
 		_scaler_proc = Normal2x;
 		break;
 
@@ -122,18 +138,21 @@
 			warning("full screen in useless in triplesize mode, reverting to normal mode");
 			goto normal_mode;
 		}
-		_scaleFactor = 3;
+		_scaleFactor_hmul = _scaleFactor_vmul = 3;
+		_scaleFactor_hdiv = _scaleFactor_vdiv = 1;
 		_scaler_proc = Normal3x;
 		break;
 
 	case GFX_NORMAL:
 normal_mode:;
-		_scaleFactor = 1;
+		_scaleFactor_hmul = _scaleFactor_vmul = 1;
+		_scaleFactor_hdiv = _scaleFactor_vdiv = 1;
 		_scaler_proc = Normal1x;
 		break;
 	default:
 		error("unknown gfx mode");
-		_scaleFactor = 1;
+		_scaleFactor_hmul = _scaleFactor_vmul = 1;
+		_scaleFactor_hdiv = _scaleFactor_vdiv = 1;
 		_scaler_proc = NULL;
 	}
 
@@ -147,7 +166,7 @@
 	//
 	// Create the surface that contains the scaled graphics in 16 bit mode
 	//
-	_hwscreen = SDL_SetVideoMode(_screenWidth * _scaleFactor, _screenHeight * _scaleFactor, 16, 
+	_hwscreen = SDL_SetVideoMode(_screenWidth * _scaleFactor_hmul / _scaleFactor_hdiv, _screenHeight * _scaleFactor_vmul / _scaleFactor_vdiv, 16, 
 		_full_screen ? (SDL_FULLSCREEN|SDL_SWSURFACE) : SDL_SWSURFACE
 	);
 	if (_hwscreen == NULL)
@@ -176,8 +195,8 @@
 		error("_tmpscreen failed");
 
 	// keyboard cursor control, some other better place for it?
-	km.x_max = _screenWidth * _scaleFactor - 1;
-	km.y_max = _screenHeight * _scaleFactor - 1;
+	km.x_max = _screenWidth * _scaleFactor_hmul / _scaleFactor_hdiv - 1;
+	km.y_max = _screenHeight * _scaleFactor_vmul / _scaleFactor_vdiv - 1;
 	km.delay_time = 25;
 	km.last_time = 0;
 }
@@ -240,7 +259,8 @@
 
 	// If the shake position changed, fill the dirty area with blackness
 	if (_currentShakePos != _newShakePos) {
-		SDL_Rect blackrect = {0, 0, _screenWidth * _scaleFactor, _newShakePos * _scaleFactor};
+		/* ratio: FIXME */
+		SDL_Rect blackrect = {0, 0, _screenWidth * _scaleFactor_hmul / _scaleFactor_hdiv, _newShakePos * _scaleFactor_vmul / _scaleFactor_vdiv};
 		SDL_FillRect(_hwscreen, &blackrect, 0);
 
 		_currentShakePos = _newShakePos;
@@ -307,10 +327,10 @@
 
 			SDL_LockSurface(_tmpscreen);
 			SDL_LockSurface(_hwscreen);
-
+		
 			srcPitch = _tmpscreen->pitch;
 			dstPitch = _hwscreen->pitch;
-
+		
 			for(r = _dirty_rect_list; r != last_rect; ++r) {
 				register int dst_y = r->y + _currentShakePos;
 				register int dst_h = 0;
@@ -319,16 +339,20 @@
 					if (dst_h > _screenHeight - dst_y)
 						dst_h = _screenHeight - dst_y;
 
-						dst_y *= _scaleFactor;
+						dst_y *= _scaleFactor_vmul;
+						dst_y /= _scaleFactor_vdiv;
 
 						_scaler_proc((byte *)_tmpscreen->pixels + (r->x * 2 + 2) + (r->y + 1) * srcPitch, srcPitch,
-						(byte *)_hwscreen->pixels + r->x * 2 * _scaleFactor + dst_y * dstPitch, dstPitch, r->w, dst_h);
+						(byte *)_hwscreen->pixels + (r->x * _scaleFactor_hmul / _scaleFactor_hdiv) * 2 + dst_y*dstPitch, dstPitch, r->x, r->y, r->w, dst_h);
 				}
 			
-				r->x *= _scaleFactor;
+				r->w = (r->x + r->w) * _scaleFactor_hmul / _scaleFactor_hdiv;
+				r->x *= _scaleFactor_hmul;
+				r->x /= _scaleFactor_hdiv;
+				r->w -= r->x;
+				r->h = (r->y + r->h) * _scaleFactor_vmul / _scaleFactor_vdiv;
 				r->y = dst_y;
-				r->w *= _scaleFactor;
-				r->h = dst_h * _scaleFactor;
+				r->h -= r->y;
 			}
 
 			SDL_UnlockSurface(_tmpscreen);
@@ -339,7 +363,7 @@
 		// This is necessary if shaking is active.
 		if (_forceFull) {
 			_dirty_rect_list[0].y = 0;
-			_dirty_rect_list[0].h = _screenHeight * _scaleFactor;
+			_dirty_rect_list[0].h = _screenHeight * _scaleFactor_vmul / _scaleFactor_vdiv;
 		}
 
 		// Finally, blit all our changes to the screen
Index: common/gameDetector.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/gameDetector.cpp,v
retrieving revision 1.110
diff -u -r1.110 gameDetector.cpp
--- common/gameDetector.cpp	15 Jun 2003 01:42:13 -0000	1.110
+++ common/gameDetector.cpp	17 Jun 2003 21:17:27 -0000
@@ -53,7 +53,7 @@
 	"\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,advmame3x,tv2x,dotmatrix)\n"
+	"\t-g<mode>      - graphics mode (normal,2x,3x,2xsai,super2xsai,supereagle,advmame2x,advmame3x,tv2x,dotmatrix,ratio800)\n"
 	"\t-e<mode>      - set music engine (see README for details)\n"
 	"\t-a            - specify game is amiga version\n"
 	"\t-q<lang>      - specify language (en,de,fr,it,pt,es,jp,zh,kr,hb)\n"
@@ -100,6 +100,7 @@
 	{"advmame3x", "AdvMAME3x", GFX_ADVMAME3X},
 	{"tv2x", "TV2x", GFX_TV2X},
 	{"dotmatrix", "DotMatrix", GFX_DOTMATRIX},
+	{"ratio800", "Ratio800", GFX_RATIO800},
 #else
 	{"flipping", "Page Flipping", GFX_FLIPPING},
 	{"dbuffer", "Double Buffer", GFX_DOUBLEBUFFER},
Index: common/scaler.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/scaler.cpp,v
retrieving revision 1.21
diff -u -r1.21 scaler.cpp
--- common/scaler.cpp	12 Jun 2003 15:20:58 -0000	1.21
+++ common/scaler.cpp	17 Jun 2003 21:17:29 -0000
@@ -106,7 +106,7 @@
 	return x + y;
 }
 
-void Super2xSaI(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) {
+void Super2xSaI(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int x, int y, int width, int height) {
 	const uint16 *bP;
 	uint16 *dP;
 	const uint32 nextlineSrc = srcPitch >> 1;
@@ -212,7 +212,7 @@
 	}
 }
 
-void SuperEagle(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) {
+void SuperEagle(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int x, int y, int width, int height) {
 	const uint16 *bP;
 	uint16 *dP;
 	const uint32 nextlineSrc = srcPitch >> 1;
@@ -317,7 +317,7 @@
 	}
 }
 
-void _2xSaI(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) {
+void _2xSaI(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int x, int y, int width, int height) {
 	const uint16 *bP;
 	uint16 *dP;
 	const uint32 nextlineSrc = srcPitch >> 1;
@@ -451,7 +451,7 @@
 }
 
 void AdvMame2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch,
-							 int width, int height) {
+							 int x, int y, int width, int height) {
 	unsigned int nextlineSrc = srcPitch / sizeof(uint16);
 	const uint16 *p = (const uint16 *)srcPtr;
 
@@ -487,7 +487,7 @@
 }
 
 void AdvMame3x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch,
-							 int width, int height) {
+							 int x, int y, int width, int height) {
 	unsigned int nextlineSrc = srcPitch / sizeof(uint16);
 	const uint16 *p = (const uint16 *)srcPtr;
 
@@ -528,7 +528,7 @@
 }
 
 void Normal1x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch,
-							int width, int height) {
+							int x, int y, int width, int height) {
 	while (height--) {
 		memcpy(dstPtr, srcPtr, 2 * width);
 		srcPtr += srcPitch;
@@ -537,7 +537,7 @@
 }
 
 void Normal2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch,
-							int width, int height) {
+							int x, int y, int width, int height) {
 	uint8 *r;
 
 	while (height--) {
@@ -556,7 +556,7 @@
 }
 
 void Normal3x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch,
-							int width, int height) {
+							int x, int y, int width, int height) {
 	uint8 *r;
 	uint32 dstPitch2 = dstPitch * 2;
 	uint32 dstPitch3 = dstPitch * 3;
@@ -582,7 +582,7 @@
 }
 
 void TV2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, 
-					int width, int height) {
+					int x, int y, int width, int height) {
 	unsigned int nextlineSrc = srcPitch / sizeof(uint16);
 	const uint16 *p = (const uint16 *)srcPtr;
 
@@ -612,7 +612,7 @@
 }
 
 void DotMatrix(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch,
-					int width, int height)
+					int x, int y, int width, int height)
 {
 	unsigned int nextlineSrc = srcPitch / sizeof(uint16);
 	const uint16 *p = (const uint16 *)srcPtr;
@@ -630,5 +630,38 @@
 		}
 		p += nextlineSrc;
 		q += nextlineDst << 1;
+	}
+}
+
+void Ratio800(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, 
+					int x, int y, int width, int height)
+{
+	unsigned int nextlineSrc = srcPitch / sizeof(uint16);
+	uint16 *p = (uint16 *)srcPtr;
+
+	unsigned int nextlineDst = dstPitch / sizeof(uint16);
+	uint16 *q0 = (uint16 *)dstPtr;
+	uint16 *q;
+
+	int i, j;
+	uint16 c;
+
+	for(i = 0; i < height; i++) {
+	    q = q0;
+	    for(j = 0; j < width; j++) {
+		c = *p;
+		if((j ^ x) & 1) {
+		    q[0] = q[nextlineDst] = q[nextlineDst * 2] =
+			INTERPOLATE(c, p[-1]);
+		    q++;
+		}
+		p++;
+		q[0] = q[nextlineDst] = q[nextlineDst * 2] =
+		q[1] = q[nextlineDst + 1] = q[nextlineDst * 2 + 1] =
+		    c;
+		q += 2;
+	    }
+	    p += nextlineSrc - width;
+	    q0 += nextlineDst * 3;
 	}
 }
Index: common/scaler.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/scaler.h,v
retrieving revision 1.10
diff -u -r1.10 scaler.h
--- common/scaler.h	26 May 2003 12:59:16 -0000	1.10
+++ common/scaler.h	17 Jun 2003 21:17:29 -0000
@@ -24,11 +24,11 @@
 extern int Init_2xSaI (uint32 BitFormat);
 
 typedef void ScalerProc(const uint8 *srcPtr, uint32 srcPitch,
-							uint8 *dstPtr, uint32 dstPitch, int width, int height);
+							uint8 *dstPtr, uint32 dstPitch, int x, int y, int width, int height);
 
 #define DECLARE_SCALER(x)	\
 	extern void x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, \
-					uint32 dstPitch, int width, int height)
+					uint32 dstPitch, int x, int y, int width, int height)
 
 DECLARE_SCALER(_2xSaI);
 DECLARE_SCALER(Super2xSaI);
@@ -40,6 +40,7 @@
 DECLARE_SCALER(Normal3x);
 DECLARE_SCALER(TV2x);
 DECLARE_SCALER(DotMatrix);
+DECLARE_SCALER(Ratio800);
 
 
 enum {
@@ -53,6 +54,7 @@
 	GFX_ADVMAME3X = 7,
 	GFX_TV2X = 8,
 	GFX_DOTMATRIX = 9,
+	GFX_RATIO800 = 10,
 	
 	GFX_FLIPPING = 100,	// Palmos
 	GFX_DOUBLEBUFFER = 101,	// Palmos
