diff --git a/win32/wconfig.cpp b/win32/wconfig.cpp index 750fcd8a..047c06f5 100644 --- a/win32/wconfig.cpp +++ b/win32/wconfig.cpp @@ -245,6 +245,7 @@ void WinSetDefaultValues () GUI.BilinearFilter = false; GUI.LockDirectories = false; GUI.window_maximized = false; + GUI.EmulatedFullscreen = false; WinDeleteRecentGamesList (); @@ -901,6 +902,7 @@ void WinRegisterConfigItems() AddStringC("OpenGL:GLSLvertexFileName", GUI.GLSLvertexShaderFileName, MAX_PATH, "", "vertex shader filename for OpenGL mode"); AddStringC("OpenGL:GLSLfragmentFileName", GUI.GLSLfragmentShaderFileName, MAX_PATH, "", "fragment shader filename for OpenGL mode"); AddBoolC("ExtendHeight", GUI.HeightExtend, false, "true to display an extra 15 pixels at the bottom, which few games use. Also increases AVI output size from 256x224 to 256x240."); + AddBoolC("AlwaysCenterImage", GUI.AlwaysCenterImage,false, "true to center the image even if larger than window"); AddIntC("Window:Width", GUI.window_size.right, 512, "256=1x, 512=2x, 768=3x, 1024=4x, etc. (usually)"); AddIntC("Window:Height", GUI.window_size.bottom, 448, "224=1x, 448=2x, 672=3x, 896=4x, etc. (usually)"); AddIntC("Window:Left", GUI.window_size.left, 0, "in pixels from left edge of screen"); diff --git a/win32/win32_display.cpp b/win32/win32_display.cpp index b4e1d934..eab573cb 100644 --- a/win32/win32_display.cpp +++ b/win32/win32_display.cpp @@ -303,8 +303,10 @@ RECT CalculateDisplayRect(unsigned int sourceWidth,unsigned int sourceHeight, } else { drawRect.left = ((int)(displayWidth) - (int)sourceWidth) / 2; drawRect.top = ((int)(displayHeight) - (int)sourceHeight) / 2; - if(drawRect.left < 0) drawRect.left = 0; - if(drawRect.top < 0) drawRect.top = 0; + if(!GUI.AlwaysCenterImage) { + if(drawRect.left < 0) drawRect.left = 0; + if(drawRect.top < 0) drawRect.top = 0; + } drawRect.right = drawRect.left + sourceWidth; drawRect.bottom = drawRect.top + sourceHeight; } diff --git a/win32/wsnes9x.h b/win32/wsnes9x.h index 434dc5a4..3844a983 100644 --- a/win32/wsnes9x.h +++ b/win32/wsnes9x.h @@ -307,6 +307,7 @@ struct sGUI { bool AspectRatio; OutputMethod outputMethod; int AspectWidth; + bool AlwaysCenterImage; bool EmulateFullscreen; bool EmulatedFullscreen; bool BilinearFilter;