From c9cae477877c643b35832a5d16f643f2d256011c Mon Sep 17 00:00:00 2001 From: stephena Date: Thu, 29 Jul 2010 17:33:07 +0000 Subject: [PATCH] When in normal resolution mode (aka, >= 640x480), ignore all screen modes smaller than 640x480. Basically, the only way to use smaller modes is on systems that report their desktop to be smaller than 640x480, or by using the maxres commandline argument to simulate the same thing. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2079 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba --- src/emucore/OSystem.cxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/emucore/OSystem.cxx b/src/emucore/OSystem.cxx index a8e9951ca..4f1f18f93 100644 --- a/src/emucore/OSystem.cxx +++ b/src/emucore/OSystem.cxx @@ -1056,10 +1056,16 @@ bool OSystem::queryVideoHardware() } else { + // All modes must fit between the lower and upper limits of the desktop + // For 'small' desktop, this means larger than 320x240 + // For 'large'/normal desktop, exclude all those less than 640x480 + bool largeDesktop = myDesktopWidth >= 640 && myDesktopHeight >= 480; + uInt32 lowerWidth = largeDesktop ? 640 : 320, + lowerHeight = largeDesktop ? 480 : 240; for(uInt32 i = 0; modes[i]; ++i) { - if(modes[i]->w >= 320 && modes[i]->w <= myDesktopWidth && - modes[i]->h >= 240 && modes[i]->h <= myDesktopHeight) + if(modes[i]->w >= lowerWidth && modes[i]->w <= myDesktopWidth && + modes[i]->h >= lowerHeight && modes[i]->h <= myDesktopHeight) { Resolution r; r.width = modes[i]->w;