Index: backends/sdl/sdl-common.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/sdl/sdl-common.cpp,v
retrieving revision 1.45
diff -u -r1.45 sdl-common.cpp
--- backends/sdl/sdl-common.cpp	1 May 2003 12:42:46 -0000	1.45
+++ backends/sdl/sdl-common.cpp	13 May 2003 19:04:05 -0000
@@ -456,7 +456,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);
 }
 	
 void OSystem_SDL_Common::set_mouse_cursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y) {
@@ -656,8 +657,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;
 
@@ -676,8 +679,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;
 
@@ -690,8 +695,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:
@@ -794,8 +801,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.20
diff -u -r1.20 sdl-common.h
--- backends/sdl/sdl-common.h	30 Apr 2003 19:11:33 -0000	1.20
+++ backends/sdl/sdl-common.h	13 May 2003 19:04:06 -0000
@@ -124,8 +124,8 @@
 	static OSystem *create(int gfx_mode, bool full_screen);
 
 protected:
-	typedef void ScalerProc(uint8 *srcPtr, uint32 srcPitch,
-								uint8 *dstPtr, uint32 dstPitch, int width, int height);
+	typedef void ScalerProc(uint8 *srcPtr, uint32 srcPitch, 
+								uint8 *dstPtr, uint32 dstPitch, int x, int y, int width, int height);
 
 	OSystem_SDL_Common();
 	virtual ~OSystem_SDL_Common();
@@ -150,7 +150,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.28
diff -u -r1.28 sdl.cpp
--- backends/sdl/sdl.cpp	30 Apr 2003 19:11:33 -0000	1.28
+++ backends/sdl/sdl.cpp	13 May 2003 19:04:07 -0000
@@ -84,32 +84,47 @@
 	
 	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_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;
 
@@ -118,18 +133,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;
 	}
 
@@ -143,7 +161,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)
@@ -172,8 +190,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;
 }
@@ -234,7 +252,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;
@@ -300,10 +319,10 @@
 		if (_scaler_proc != Normal1x) {
 			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;
@@ -312,16 +331,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);
@@ -332,7 +355,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.88
diff -u -r1.88 gameDetector.cpp
--- common/gameDetector.cpp	30 Apr 2003 12:43:54 -0000	1.88
+++ common/gameDetector.cpp	13 May 2003 19:04:12 -0000
@@ -49,7 +49,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,tv2x,dotmatrix)\n"
+	"\t-g<mode>   - graphics mode (normal,2x,3x,2xsai,super2xsai,supereagle,advmame2x,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,ja,zh,ko,hb)\n"
@@ -92,6 +92,7 @@
 	{"advmame2x", "AdvMAME2x", GFX_ADVMAME2X},
 	{"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.11
diff -u -r1.11 scaler.cpp
--- common/scaler.cpp	25 Apr 2003 20:02:57 -0000	1.11
+++ common/scaler.cpp	13 May 2003 19:04:16 -0000
@@ -155,7 +155,7 @@
 #define RED_MASK555 0x7C007C00
 #define GREEN_MASK555 0x03E003E0
 
-void Super2xSaI(uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) {
+void Super2xSaI(uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int x, int y, int width, int height) {
 	uint16 *bP;
 	uint8 *dP;
 	uint32 inc_bP;
@@ -271,7 +271,7 @@
 	}
 }
 
-void SuperEagle(uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) {
+void SuperEagle(uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int x, int y, int width, int height) {
 	uint8 *dP;
 	uint16 *bP;
 	uint32 inc_bP;
@@ -388,7 +388,7 @@
 	}
 }
 
-void _2xSaI(uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) {
+void _2xSaI(uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int x, int y, int width, int height) {
 	uint8 *dP;
 	uint16 *bP;
 	uint32 inc_bP;
@@ -583,7 +583,7 @@
 // it seems to allow for arbitrary scale factors, not just 2x... hence I leave this in
 // for now, as that seems to be a very useful feature
 void Scale_2xSaI(uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch,
-								 uint32 dstWidth, uint32 dstHeight, int width, int height) {
+								 uint32 dstWidth, uint32 dstHeight, int x, int y, int width, int height) {
 	uint8 *dP;
 	uint16 *bP;
 
@@ -714,7 +714,7 @@
 }
 
 void AdvMame2x(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);
 	uint16 *p = (uint16 *)srcPtr;
 
@@ -747,7 +747,7 @@
 }
 
 void Normal1x(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;
@@ -756,7 +756,7 @@
 }
 
 void Normal2x(uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch,
-							int width, int height) {
+							int x, int y, int width, int height) {
 	uint8 *r;
 
 	while (height--) {
@@ -775,7 +775,7 @@
 }
 
 void Normal3x(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;
@@ -801,7 +801,7 @@
 }
 
 void TV2x(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);
 	uint16 *p = (uint16 *)srcPtr;
 
@@ -831,7 +831,7 @@
 }
 
 void DotMatrix(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);
 	uint16 *p = (uint16 *)srcPtr;
@@ -849,5 +849,38 @@
 		}
 		p += nextlineSrc;
 		q += nextlineDst << 1;
+	}
+}
+
+void Ratio800(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.7
diff -u -r1.7 scaler.h
--- common/scaler.h	2 May 2003 09:08:18 -0000	1.7
+++ common/scaler.h	13 May 2003 19:04:16 -0000
@@ -25,7 +25,7 @@
 
 #define DECLARE_SCALER(x)	\
 	extern void x(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);
@@ -36,6 +36,7 @@
 DECLARE_SCALER(Normal3x);
 DECLARE_SCALER(TV2x);
 DECLARE_SCALER(DotMatrix);
+DECLARE_SCALER(Ratio800);
 
 
 enum {
@@ -48,6 +49,7 @@
 	GFX_ADVMAME2X = 6,
 	GFX_TV2X = 7,
 	GFX_DOTMATRIX = 8,
+	GFX_RATIO800 = 9,
 	
 	GFX_FLIPPING = 100,	// Palmos
 	GFX_DOUBLEBUFFER = 101	// Palmos
