diff -ur ScummVM-cvs20030618/scummvm/README ScummVM-cvs20030618+hack/scummvm/README
--- ScummVM-cvs20030618/scummvm/README	2003-06-17 08:51:57.000000000 +0200
+++ ScummVM-cvs20030618+hack/scummvm/README	2003-06-18 21:36:09.000000000 +0200
@@ -339,33 +339,36 @@
 
         scummvm [OPTIONS] [GAME]
 
-        [GAME]        - Short name of game to load. For example, 'monkey' for
-                        Monkey Island.
+        [GAME]         - Short name of game to load. For example, 'monkey' for
+                         Monkey Island.
+
+        -p<path>       - Path to where the game is installed. Default is Cwd.
+        -x[<num>]      - Save game slot to load (default: autosave)
+        -f             - Full-screen mode.
+        -g<mode>       - Select graphics scaler. See below.
+        -e<mode>       - Select sound engine. See below.
+        -a             - Enable amiga pal conversion, for playing Amiga
+                         versions
+        -q<lang>       - Select language. See below.
+        -c<num>        - Drive to play cd audio from.  E.g., 0 is first drive.
+        -m<num>        - Set the music volume, 0-255.  Default is '192'
+        -o<num>        - Set the master volume, 0-255. Default is '192'
+        -s<num>        - Set the sfx volume, 0-255.    Default is '192'
+        -t<num>        - Set music tempo. 50-200. Default is '100' (percent)
+        -n             - Disable subtitles. Use with games that have voice.
+        -y             - Set talk speed ('yak option'). Default is '60'
+        -l<file>       - Load alternate configuration file
+        -w[<file>]     - Write configuration file
+        -v             - Show version information and exit
+        -z             - Display list of games
+        -b<num>        - Start in room <num>.
+        -d[<num>]      - Set debug verbosity to <num>
+        -u             - Dump scripts if a directory called 'dumps' exists in
+                         current directory
+        --multi-midi   - enable combination Adlib and native MIDI
+        --native-mt32  - true Roland MT-32 (disable GM emulation)
+        --aspect-ratio - enable aspect ratio correction
 
-        -p<path>      - Path to where the game is installed. Default is Cwd.
-        -x[<num>]     - Save game slot to load (default: autosave)
-        -f            - Full-screen mode.
-        -g<mode>      - Select graphics scaler. See below.
-        -e<mode>      - Select sound engine. See below.
-        -a            - Enable amiga pal conversion, for playing Amiga versions
-        -q<lang>      - Select language. See below.
-        -c<num>       - Drive to play cd audio from.  E.g., 0 is first drive.
-        -m<num>       - Set the music volume, 0-255.  Default is '192'
-        -o<num>       - Set the master volume, 0-255. Default is '192'
-        -s<num>       - Set the sfx volume, 0-255.    Default is '192'
-        -t<num>       - Set music tempo. 50-200. Default is '100' (percent)
-        -n            - Disable subtitles. Use with games that have voice.
-        -y            - Set talk speed ('yak option'). Default is '60'
-        -l<file>      - Load alternate configuration file
-        -w[<file>]    - Write configuration file
-        -v            - Show version information and exit
-        -z            - Display list of games
-        -b<num>       - Start in room <num>.
-        -d[<num>]     - Set debug verbosity to <num>
-        -u            - Dump scripts if a directory called 'dumps' exists in
-                        current directory
-        --multi-midi  - enable combination Adlib and native MIDI
-        --native-mt32 - true Roland MT-32 (disable GM emulation)
 
 
 Hot Keys:
@@ -380,9 +383,13 @@
         Ctrl-Alt 0-9           - Switch between graphics filters
         Ctrl-Alt b             - Switch beetwen bilinear and non-linear
                                  filtering [OpenGL backend]
-        Ctrl-Alt a             - Switch between: [OpenGL backend]
-                                 - Fit the game in the whole screen (No black borders)
-                                 - Don't fit the game in the whole screen (Black borders) 
+        Ctrl-Alt a             - Toggle aspect-ratio correction on/off.
+                                 Most of the games use a 320x200 pixel
+                                 resolution, which may look squashed on
+                                 modern monitors. Aspect-ratio correction
+                                 stretches the image to use 320x240 pixels
+                                 instead, or a multiple thereof.
+
     Scumm:
         Ctrl 0-9 and Alt 0-9   - load and save game state
         Ctrl-g                 - runs in really REALLY fast mode.
diff -ur ScummVM-cvs20030618/scummvm/backends/sdl/sdl-common.cpp ScummVM-cvs20030618+hack/scummvm/backends/sdl/sdl-common.cpp
--- ScummVM-cvs20030618/scummvm/backends/sdl/sdl-common.cpp	2003-06-17 19:24:48.000000000 +0200
+++ ScummVM-cvs20030618+hack/scummvm/backends/sdl/sdl-common.cpp	2003-06-18 21:25:45.000000000 +0200
@@ -41,22 +41,23 @@
 #define JOY_BUT_SPACE 4
 #define JOY_BUT_F5 5
 
-OSystem *OSystem_SDL_create(int gfx_mode, bool full_screen) {
-	return OSystem_SDL_Common::create(gfx_mode, full_screen);
+OSystem *OSystem_SDL_create(int gfx_mode, bool full_screen, bool aspect_ratio) {
+	return OSystem_SDL_Common::create(gfx_mode, full_screen, aspect_ratio);
 }
 
-OSystem *OSystem_SDL_Common::create(int gfx_mode, bool full_screen) {
+OSystem *OSystem_SDL_Common::create(int gfx_mode, bool full_screen, bool aspect_ratio) {
 	OSystem_SDL_Common *syst = OSystem_SDL_Common::create_intern();
 
-	syst->init_intern(gfx_mode, full_screen);
+	syst->init_intern(gfx_mode, full_screen, aspect_ratio);
 
 	return syst;
 }
 
-void OSystem_SDL_Common::init_intern(int gfx_mode, bool full_screen) {
+void OSystem_SDL_Common::init_intern(int gfx_mode, bool full_screen, bool aspect_ratio) {
 
 	_mode = gfx_mode;
 	_full_screen = full_screen;
+	_aspect_ratio = aspect_ratio;
 
 	if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER | SDL_INIT_JOYSTICK) ==-1) {
 		error("Could not initialize SDL: %s.\n", SDL_GetError());
@@ -129,6 +130,10 @@
 
 	_screenWidth = w;
 	_screenHeight = h;
+
+	if (h != 200)
+		_aspect_ratio = false;
+
 	CKSUM_NUM = (_screenWidth * _screenHeight / (8 * 8));
 	if (_dirty_checksums)
 		free(_dirty_checksums);
@@ -576,20 +581,18 @@
 				}
 			}
 
-			// Ctr-Alt-a will change aspect ratio in OpenGL backend
+			// Ctr-Alt-a will change aspect ratio
 			if (b == (KBD_CTRL|KBD_ALT) && ev.key.keysym.sym=='a') {
-					Property prop;
-					prop.gfx_mode = 11;
-					property(PROP_SET_GFX_MODE, &prop);
-					break;
+				property(PROP_TOGGLE_ASPECT_RATIO, NULL);
+				break;
 			}
 
 			// Ctr-Alt-b will change bilinear filtering in OpenGL backend
 			if (b == (KBD_CTRL|KBD_ALT) && ev.key.keysym.sym=='b') {
-					Property prop;
-					prop.gfx_mode = 12;
-					property(PROP_SET_GFX_MODE, &prop);
-					break;
+				Property prop;
+				prop.gfx_mode = 12;
+				property(PROP_SET_GFX_MODE, &prop);
+				break;
 			}
 
 #ifdef QTOPIA
@@ -698,6 +701,8 @@
 			event->mouse.x /= _scaleFactor;
 			event->mouse.y /= _scaleFactor;
 
+			if (_aspect_ratio)
+				event->mouse.y = UnAspect(event->mouse.y);
 			return true;
 
 		case SDL_MOUSEBUTTONDOWN:
@@ -718,6 +723,9 @@
 			event->mouse.x /= _scaleFactor;
 			event->mouse.y /= _scaleFactor;
 
+			if (_aspect_ratio)
+				event->mouse.y = UnAspect(event->mouse.y);
+
 			return true;
 
 		case SDL_MOUSEBUTTONUP:
@@ -731,6 +739,10 @@
 			event->mouse.y = ev.button.y;
 			event->mouse.x /= _scaleFactor;
 			event->mouse.y /= _scaleFactor;
+
+			if (_aspect_ratio)
+				event->mouse.y = UnAspect(event->mouse.y);
+
 			return true;
 
 		case SDL_JOYBUTTONDOWN:
@@ -835,6 +847,10 @@
 			event->mouse.y = km.y;
 			event->mouse.x /= _scaleFactor;
 			event->mouse.y /= _scaleFactor;
+
+			if (_aspect_ratio)
+				event->mouse.y = UnAspect(event->mouse.y);
+
 			return true;
 
 		case SDL_VIDEOEXPOSE:
diff -ur ScummVM-cvs20030618/scummvm/backends/sdl/sdl-common.h ScummVM-cvs20030618+hack/scummvm/backends/sdl/sdl-common.h
--- ScummVM-cvs20030618/scummvm/backends/sdl/sdl-common.h	2003-06-09 03:19:25.000000000 +0200
+++ ScummVM-cvs20030618+hack/scummvm/backends/sdl/sdl-common.h	2003-06-18 18:29:50.000000000 +0200
@@ -123,7 +123,7 @@
 	virtual int16 RGBToColor(uint8 r, uint8 g, uint8 b);
 	virtual void colorToRGB(int16 color, uint8 &r, uint8 &g, uint8 &b);
 
-	static OSystem *create(int gfx_mode, bool full_screen);
+	static OSystem *create(int gfx_mode, bool full_screenm, bool aspect_ratio);
 
 protected:
 	OSystem_SDL_Common();
@@ -131,7 +131,7 @@
 
 	static OSystem_SDL_Common *create_intern();
 
-	void init_intern(int gfx_mode, bool full_screen);
+	void init_intern(int gfx_mode, bool full_screen, bool aspect_ratio);
 
 	// unseen game screen
 	SDL_Surface *_screen;
@@ -142,6 +142,8 @@
 	int _tmpScreenWidth;
 	bool _overlayVisible;
 
+	bool _aspect_ratio;
+
 	// CD Audio
 	SDL_CD *_cdrom;
 	int cd_track, cd_num_loops, cd_start_frame, cd_end_frame;
diff -ur ScummVM-cvs20030618/scummvm/backends/sdl/sdl.cpp ScummVM-cvs20030618+hack/scummvm/backends/sdl/sdl.cpp
--- ScummVM-cvs20030618/scummvm/backends/sdl/sdl.cpp	2003-06-17 08:51:57.000000000 +0200
+++ ScummVM-cvs20030618+hack/scummvm/backends/sdl/sdl.cpp	2003-06-18 21:27:19.000000000 +0200
@@ -42,6 +42,7 @@
 	SDL_Surface *_hwscreen;    // hardware screen
 
 	ScalerProc *_scaler_proc;
+	uint16 *_render_buffer;
 
 	virtual void load_gfx_mode();
 	virtual void unload_gfx_mode();
@@ -53,7 +54,7 @@
 }
 
 OSystem_SDL::OSystem_SDL()
-	 : _hwscreen(0), _scaler_proc(0)
+	 : _hwscreen(0), _scaler_proc(0), _render_buffer(0)
 {
 }
 
@@ -147,11 +148,18 @@
 	//
 	// 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, (_aspect_ratio ? 240 : _screenHeight) * _scaleFactor, 16, 
 		_full_screen ? (SDL_FULLSCREEN|SDL_SWSURFACE) : SDL_SWSURFACE
 	);
 	if (_hwscreen == NULL)
 		error("_hwscreen failed");
+
+	//
+	// Intermediate rendering buffer for aspect ratio correction.
+	//
+	if (_aspect_ratio)
+		_render_buffer = (uint16 *) calloc(sizeof(uint16), _screenWidth * _scaleFactor * 240 * _scaleFactor);
 	
 	//
 	// Create the surface used for the graphics in 16 bit before scaling, and also the overlay
@@ -192,6 +200,11 @@
 		SDL_FreeSurface(_hwscreen); 
 		_hwscreen = NULL;
 	}
+
+	if (_render_buffer) {
+		free(_render_buffer);
+		_render_buffer = NULL;
+	}
 	
 	if (_tmpscreen) {
 		free(_tmpscreen->pixels);
@@ -214,6 +227,11 @@
 	// Release the HW screen surface
 	SDL_FreeSurface(_hwscreen); 
 
+	if (_render_buffer) {
+		free(_render_buffer);
+		_render_buffer = NULL;
+	}
+
 	// Setup the new GFX mode
 	load_gfx_mode();
 
@@ -281,7 +299,7 @@
 		uint32 srcPitch, dstPitch;
 		SDL_Rect *last_rect = _dirty_rect_list + _num_dirty_rects;
 
-		if (_scaler_proc == Normal1x) {
+		if (_scaler_proc == Normal1x && !_aspect_ratio) {
 			SDL_Surface *target = _overlayVisible ? _tmpscreen : _screen;
 			for(r = _dirty_rect_list; r != last_rect; ++r) {
 				dst = *r;
@@ -308,6 +326,8 @@
 			SDL_LockSurface(_tmpscreen);
 			SDL_LockSurface(_hwscreen);
 
+			byte *dstPtr = (byte *) (_aspect_ratio ? _render_buffer : _hwscreen->pixels);
+
 			srcPitch = _tmpscreen->pitch;
 			dstPitch = _hwscreen->pitch;
 
@@ -319,18 +339,22 @@
 					if (dst_h > _screenHeight - dst_y)
 						dst_h = _screenHeight - dst_y;
 
-						dst_y *= _scaleFactor;
+					dst_y *= _scaleFactor;
 
-						_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);
+					_scaler_proc((byte *)_tmpscreen->pixels + (r->x * 2 + 2) + (r->y + 1) * srcPitch, srcPitch,
+						dstPtr + r->x * 2 * _scaleFactor + dst_y * dstPitch, dstPitch, r->w, dst_h);
 				}
 			
 				r->x *= _scaleFactor;
 				r->y = dst_y;
 				r->w *= _scaleFactor;
 				r->h = dst_h * _scaleFactor;
-			}
 
+				if (_aspect_ratio) {
+					r->h = Stretch240((uint8 *) _render_buffer, dstPitch, (uint8 *) _hwscreen->pixels, dstPitch, r->w, r->h, r->x, r->y);
+					r->y = Aspect(r->y);
+				}
+			}
 			SDL_UnlockSurface(_tmpscreen);
 			SDL_UnlockSurface(_hwscreen);
 		}
@@ -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 = (_aspect_ratio ? 240 : _screenHeight) * _scaleFactor;
 		}
 
 		// Finally, blit all our changes to the screen
@@ -374,6 +398,12 @@
 		hotswap_gfx_mode();
 
 		return 1;
+	} else if (param == PROP_TOGGLE_ASPECT_RATIO) {
+		if (_screenHeight == 200) {
+			assert(_hwscreen != 0);
+			_aspect_ratio ^= true;
+			hotswap_gfx_mode();
+		}
 	}
 
 	return OSystem_SDL_Common::property(param, value);
diff -ur ScummVM-cvs20030618/scummvm/backends/sdl/sdl_gl.cpp ScummVM-cvs20030618+hack/scummvm/backends/sdl/sdl_gl.cpp
--- ScummVM-cvs20030618/scummvm/backends/sdl/sdl_gl.cpp	2003-06-18 08:27:35.000000000 +0200
+++ ScummVM-cvs20030618+hack/scummvm/backends/sdl/sdl_gl.cpp	2003-06-18 18:29:50.000000000 +0200
@@ -107,6 +107,10 @@
 
 void OSystem_SDL_OpenGL::load_gfx_mode() {
 	uint32 Rmask, Gmask, Bmask, Amask;
+
+	// HACK: The OpenGL backend has its own handling of aspect ratio
+	_aspect_ratio = false;
+
 	// I have to force 16 bit color depth with 565 ordering
 	// SDL_SetVideoMode sometimes doesn't accept your color depth definition
 	Rmask = 0xF800; // 5
@@ -520,8 +524,15 @@
 */
 
 uint32 OSystem_SDL_OpenGL::property(int param, Property *value) {
+	Property prop;
 	int i;
 
+	if (param == PROP_TOGGLE_ASPECT_RATIO) {
+		param = PROP_SET_GFX_MODE;
+		prop.gfx_mode = 12;
+		value = &prop;
+	}
+
 	if (param == PROP_TOGGLE_FULLSCREEN) {
 		if (!_usingOpenGL)
 			assert(_hwscreen != 0);
diff -ur ScummVM-cvs20030618/scummvm/common/gameDetector.cpp ScummVM-cvs20030618+hack/scummvm/common/gameDetector.cpp
--- ScummVM-cvs20030618/scummvm/common/gameDetector.cpp	2003-06-17 10:55:53.000000000 +0200
+++ ScummVM-cvs20030618+hack/scummvm/common/gameDetector.cpp	2003-06-18 18:29:51.000000000 +0200
@@ -50,38 +50,39 @@
 	"Syntax:\n"
 	"\tscummvm [-v] [-d[<num>]] [-n] [-b<num>] [-t<num>] [-s<num>] [-p<path>] [-m<num>] [-f] game\n"
 	"Flags:\n"
-	"\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-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"
+	"\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-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"
 	"\n"
-	"\t-c<num>       - use cdrom <num> for cd audio\n"
-	"\t-m<num>       - set music volume to <num> (0-255)\n"
-	"\t-o<num>       - set master volume to <num> (0-255)\n"
-	"\t-s<num>       - set sfx volume to <num> (0-255)\n"
-	"\t-t<num>       - set music tempo (50-200, default 100%%)\n"
+	"\t-c<num>        - use cdrom <num> for cd audio\n"
+	"\t-m<num>        - set music volume to <num> (0-255)\n"
+	"\t-o<num>        - set master volume to <num> (0-255)\n"
+	"\t-s<num>        - set sfx volume to <num> (0-255)\n"
+	"\t-t<num>        - set music tempo (50-200, default 100%%)\n"
 	"\n"
-	"\t-n            - no subtitles for speech\n"
-	"\t-y            - set text speed (default: 60)\n"
+	"\t-n             - no subtitles for speech\n"
+	"\t-y             - set text speed (default: 60)\n"
 	"\n"
-	"\t-l<file>      - load config file instead of default\n"
+	"\t-l<file>       - load config file instead of default\n"
 #if defined(UNIX)
-	"\t-w[<file>]    - write to config file [~/.scummvmrc]\n"
+	"\t-w[<file>]     - write to config file [~/.scummvmrc]\n"
 #else
-	"\t-w[<file>]    - write to config file [scummvm.ini]\n"
+	"\t-w[<file>]     - write to config file [scummvm.ini]\n"
 #endif
-	"\t-v            - show version info and exit\n"
-	"\t-z            - display list of games\n"
+	"\t-v             - show version info and exit\n"
+	"\t-z             - display list of games\n"
 	"\n"
-	"\t-b<num>       - start in room <num>\n"
-	"\t-d[<num>]     - enable debug output (debug level [1])\n"
-	"\t-u            - dump scripts\n"
+	"\t-b<num>        - start in room <num>\n"
+	"\t-d[<num>]      - enable debug output (debug level [1])\n"
+	"\t-u             - dump scripts\n"
 	"\n"
-	"\t--multi-midi  - enable combination Adlib and native MIDI\n"
-	"\t--native-mt32 - true Roland MT-32 (disable GM emulation)\n"
+	"\t--multi-midi   - enable combination Adlib and native MIDI\n"
+	"\t--native-mt32  - true Roland MT-32 (disable GM emulation)\n"
+	"\t--aspect-ratio - enable aspect ratio correction\n"
 ;
 #endif
 // This contains a pointer to a list of all supported games.
@@ -148,6 +149,7 @@
 
 GameDetector::GameDetector() {
 	_fullScreen = false;
+	_aspectRatio = false;
 
 	_use_adlib = false;
 
@@ -245,6 +247,7 @@
 		}
 
 	_fullScreen = g_config->getBool("fullscreen", _fullScreen);
+	_aspectRatio = g_config->getBool("aspect_ratio", _aspectRatio);
 
 	if ((val = g_config->get("gfx_mode")))
 		if ((_gfx_mode = parseGraphicsMode(val)) == -1) {
@@ -453,6 +456,9 @@
 				} else if (!strcmp (s, "native-mt32")) {
 					_native_mt32 = true;
 					g_config->setBool ("native_mt32", true);
+				} else if (!strcmp (s, "aspect-ratio")) {
+					_aspectRatio = true;
+					g_config->setBool ("aspect_ratio", true);
 				} else {
 					goto ShowHelpAndExit;
 				}
@@ -673,7 +679,7 @@
 	return OSystem_PALMOS_create(_gfx_mode);
 #else
 	/* SDL is the default driver for now */
-	return OSystem_SDL_create(_gfx_mode, _fullScreen);
+	return OSystem_SDL_create(_gfx_mode, _fullScreen, _aspectRatio);
 #endif
 }
 
diff -ur ScummVM-cvs20030618/scummvm/common/gameDetector.h ScummVM-cvs20030618+hack/scummvm/common/gameDetector.h
--- ScummVM-cvs20030618/scummvm/common/gameDetector.h	2003-06-15 16:53:37.000000000 +0200
+++ ScummVM-cvs20030618+hack/scummvm/common/gameDetector.h	2003-06-18 18:29:51.000000000 +0200
@@ -110,6 +110,7 @@
 	const String& getGameName(void);
 	
 	bool _fullScreen;
+	bool _aspectRatio;
 
 	bool _use_adlib;
 
diff -ur ScummVM-cvs20030618/scummvm/common/scaler.cpp ScummVM-cvs20030618+hack/scummvm/common/scaler.cpp
--- ScummVM-cvs20030618/scummvm/common/scaler.cpp	2003-06-12 17:20:58.000000000 +0200
+++ ScummVM-cvs20030618+hack/scummvm/common/scaler.cpp	2003-06-18 22:42:21.000000000 +0200
@@ -632,3 +632,64 @@
 		q += nextlineDst << 1;
 	}
 }
+
+// FIXME: Implement bilinear filtering instead of stupid pixel doubling.
+//
+// The theory of bilinear filtering:
+//
+// For each destination pixel, calculate its exact scaled position in the
+// source image. It is unlikely that it will correspond to any one picture
+// so its colour is interpolated from the four surrounding pixels, like so:
+//
+//    c0| fx      |c1
+//    --+-----+---+--
+//      |     |   |
+//    fy|     |   |
+//      +-----X   |
+//      |         |
+//    --+---------+--
+//    c2|         |c3
+//
+// The colour c at X is
+//
+//    c = c0 * (1-fx) * (1-fy)
+//      + c1 * fx * (1-fy)
+//      + c2 * (1-fx) * fy
+//      + c3 * fx * fy
+//
+// We only stretch the height so fx is always 0, which leads to the following,
+// simplified formula:
+//
+//    c = c0 * (1-fy)
+//      + c2 * fy
+//
+// And we always stretch by the same proportions, so we should be able to
+// pre-calculate fy.
+
+int Stretch240(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr,
+		uint32 dstPitch, int width, int height, int srcX, int srcY) {
+	int new_height = 0;
+	int y;
+
+	srcPtr = srcPtr + srcX * 2 + srcY * dstPitch;
+	dstPtr = dstPtr + srcX * 2 + Aspect(srcY) * dstPitch;
+
+	for (y = srcY; y < srcY + height; y++) {
+		memcpy(dstPtr, srcPtr, width * 2);
+		new_height++;
+
+		// This is chosen specifically so that the destination Y
+		// coordinate will always equal Aspect(y) above.
+
+		if ((y % 5) == 3) {
+			dstPtr += dstPitch;
+			new_height++;
+			memcpy(dstPtr, srcPtr, width * 2);
+		}
+
+		srcPtr += srcPitch;
+		dstPtr += dstPitch;
+	}
+
+	return new_height;
+}
diff -ur ScummVM-cvs20030618/scummvm/common/scaler.h ScummVM-cvs20030618+hack/scummvm/common/scaler.h
--- ScummVM-cvs20030618/scummvm/common/scaler.h	2003-06-17 08:51:57.000000000 +0200
+++ ScummVM-cvs20030618+hack/scummvm/common/scaler.h	2003-06-18 20:45:24.000000000 +0200
@@ -41,6 +41,17 @@
 DECLARE_SCALER(TV2x);
 DECLARE_SCALER(DotMatrix);
 
+FORCEINLINE int Aspect(int y) {
+	return y + (y + 1) / 5;
+}
+
+FORCEINLINE int UnAspect(int y) {
+	return (y * 5 + 3) / 6;
+}
+
+extern int Stretch240(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr,
+			uint32 dstPitch, int width, int height, int srcX,
+			int srcY);
 
 enum {
 	GFX_NORMAL = 0,
diff -ur ScummVM-cvs20030618/scummvm/common/system.h ScummVM-cvs20030618+hack/scummvm/common/system.h
--- ScummVM-cvs20030618/scummvm/common/system.h	2003-06-09 03:19:24.000000000 +0200
+++ ScummVM-cvs20030618+hack/scummvm/common/system.h	2003-06-18 18:29:51.000000000 +0200
@@ -94,7 +94,8 @@
 		PROP_GET_SAMPLE_RATE = 6,
 		PROP_GET_FULLSCREEN = 7,
 		PROP_GET_FMOPL_ENV_BITS = 8,
-		PROP_GET_FMOPL_EG_ENT = 9
+		PROP_GET_FMOPL_EG_ENT = 9,
+		PROP_TOGGLE_ASPECT_RATIO = 10
 	};
 	union Property {
 		const char *caption;
@@ -363,7 +364,7 @@
 /* Factory functions. This means we don't have to include the headers for
  * all backends.
  */
-extern OSystem *OSystem_SDL_create(int gfx_driver, bool full_screen);
+extern OSystem *OSystem_SDL_create(int gfx_driver, bool full_screen, bool aspect_ratio);
 extern OSystem *OSystem_NULL_create();
 extern OSystem *OSystem_MorphOS_create(int game_id, int gfx_driver, bool full_screen);
 extern OSystem *OSystem_Dreamcast_create();
