win32: fixed restoring maximized window after switching from fullscreen

win32: holding Shift when resizing FCEUX window reverts "Force integral factors" meaning
win32: remodel "Video config" dialog:
* removed the list of predefined modes (they were broken anyway)
* removed FS stretching options (obsoleted by "Best Fit")
* removed broken display of "Current Pixel Aspect Ratio" (may return it after implementing the 4:3 mode)
* "Full Screen (hotkey: Alt + Enter or double-click)" - reads current hotkey mapping

[[Split portion of a mixed commit.]]
This commit is contained in:
ansstuff 2012-12-19 19:35:00 +00:00
parent 66b0073666
commit bf8649f110
11 changed files with 125 additions and 142 deletions

View File

@ -1,3 +1,6 @@
19-Dec-2012 - AnS - win32: remodel "Video config" dialog
19-Dec-2012 - AnS - win32: fixed restoring maximized window after switching from fullscreen
18-Dec-2012 - CaH4e3 - fixed mapper 018 and 198
15-Dec-2012 - AnS - win32: added Config->Enable->Auto-resume old play session
13-Dec-2012 - AnS - win32: added Emulation Speed->Set custom speed for FrameAdvance
13-Dec-2012 - AnS - win32: added NES->Emulation Speed->Set FrameAdvance Delay

Binary file not shown.

View File

@ -112,7 +112,7 @@ extern bool turbo; //Is game in turbo mode?
void ResetVideo(void);
void ShowCursorAbs(int w);
void HideFWindow(int h);
void FixWXY(int pref);
void FixWXY(int pref, bool shift_held);
void SetMainWindowStuff(void);
int GetClientAbsRect(LPRECT lpRect);
void UpdateFCEUWindow(void);
@ -174,7 +174,7 @@ static char TempArray[2048];
static int exiting = 0;
static volatile int moocow = 0;
int windowedfailed;
int windowedfailed = 0;
int fullscreen = 0; //Windows files only, variable that keeps track of fullscreen status
static volatile int _userpause = 0; //mbg merge 7/18/06 changed tasbuild was using this only in a couple of places

View File

@ -1729,79 +1729,66 @@ BEGIN
PUSHBUTTON "Edit",IDC_BUTTON_LUAEDIT,58,31,46,16
END
VIDEOCONFIG DIALOGEX 65520, 76, 371, 297
VIDEOCONFIG DIALOGEX 65520, 76, 511, 166
STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Video Configuration"
FONT 8, "MS Sans Serif", 0, 0, 0x0
BEGIN
GROUPBOX "Full Screen Settings",65453,5,3,360,115,WS_GROUP
CONTROL "Full Screen",IDC_VIDEOCONFIG_FS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,15,60,12
GROUPBOX "Full Screen Settings",65453,5,3,171,137,WS_GROUP
CONTROL "Full Screen (Alt + Enter or double-click)",IDC_VIDEOCONFIG_FS,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,15,157,12
CONTROL "Enter full screen mode after game is loaded",IDC_VIDEOCONFIG_AUTO_FS,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,29,151,12
LTEXT "Sync Method:",65452,13,85,48,10
COMBOBOX IDC_VIDEOCONFIG_SYNC_METHOD_FS,65,82,93,50,CBS_DROPDOWNLIST | WS_TABSTOP
LTEXT "Video Mode:",65451,13,65,42,10
COMBOBOX IDC_VIDEOCONFIG_MODE,65,62,93,52,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,29,154,12
LTEXT "Sync method:",65452,12,108,51,10
COMBOBOX IDC_VIDEOCONFIG_SYNC_METHOD_FS,67,106,95,50,CBS_DROPDOWNLIST | WS_TABSTOP
CONTROL "Disable hardware acceleration",IDC_DISABLE_HW_ACCEL_FS,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,101,145,12
GROUPBOX "Custom Video Mode",65450,172,13,186,97,WS_GROUP
LTEXT "Mode:",13,181,27,25,8
EDITTEXT IDC_VIDEOCONFIG_XRES,209,25,27,12,ES_RIGHT
LTEXT "by",12,239,27,11,8
EDITTEXT IDC_VIDEOCONFIG_YRES,253,25,27,12,ES_RIGHT
LTEXT "@",11,284,27,12,8
COMBOBOX IDC_VIDEOCONFIG_BPP,297,25,35,60,CBS_DROPDOWNLIST | WS_TABSTOP
LTEXT "bpp",10,336,27,17,8
GROUPBOX "Image Size Transform",65445,180,42,170,61,WS_GROUP
LTEXT "Special scaler:",65444,187,56,60,8
COMBOBOX IDC_VIDEOCONFIG_SCALER_FS,276,53,65,46,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "Scale dimensions by:",IDC_RADIO_SCALE,"Button",BS_AUTORADIOBUTTON,187,85,80,12
CONTROL "Stretch to Fill Screen",IDC_RADIO_STRETCH,"Button",BS_AUTORADIOBUTTON,187,70,76,12
LTEXT "X:",65443,277,87,10,8
EDITTEXT IDC_VIDEOCONFIG_XSCALE,287,84,20,12
LTEXT "Y:",65442,311,86,11,8
EDITTEXT IDC_VIDEOCONFIG_YSCALE,321,84,20,12
GROUPBOX "Windowed Settings",65441,5,122,179,149,WS_GROUP
LTEXT "Size Multiplier:",65440,15,144,50,8
CTEXT "X:",65439,78,131,42,8
CTEXT "Y:",65438,129,131,42,8
EDITTEXT IDC_WINSIZE_MUL_X,78,143,42,12,ES_AUTOHSCROLL
EDITTEXT IDC_WINSIZE_MUL_Y,129,143,42,12,ES_AUTOHSCROLL
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,123,147,12
LTEXT "Mode:",13,12,67,23,9
EDITTEXT IDC_VIDEOCONFIG_XRES,37,65,27,13,ES_RIGHT
LTEXT "by",12,68,67,11,9
EDITTEXT IDC_VIDEOCONFIG_YRES,80,65,27,13,ES_RIGHT
LTEXT "@",11,111,67,11,9
COMBOBOX IDC_VIDEOCONFIG_BPP,123,65,32,12,CBS_DROPDOWNLIST | WS_TABSTOP
LTEXT "bpp",10,158,67,14,9
LTEXT "Special scaler:",65444,12,91,52,9
COMBOBOX IDC_VIDEOCONFIG_SCALER_FS,67,89,95,46,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
GROUPBOX "Windowed Settings",65441,182,3,164,137,WS_GROUP
LTEXT "Size Multiplier:",65440,189,21,50,8
CTEXT "X:",65439,253,10,26,8
CTEXT "Y:",65438,304,10,26,8
EDITTEXT IDC_WINSIZE_MUL_X,244,20,44,12,ES_AUTOHSCROLL
EDITTEXT IDC_WINSIZE_MUL_Y,295,20,44,12,ES_AUTOHSCROLL
CONTROL "Force integral scaling factors",IDC_FORCE_INT_VIDEO_SCALARS,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,159,145,12
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,189,36,145,12
CONTROL "Force aspect ratio correction",IDC_FORCE_ASPECT_CORRECTION,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,174,145,12
LTEXT "Special scaler:",65429,15,215,51,8
COMBOBOX IDC_VIDEOCONFIG_SCALER_WIN,78,213,93,47,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
LTEXT "Sync Method:",65437,15,235,51,8
COMBOBOX IDC_VIDEOCONFIG_SYNC_METHOD_WIN,78,233,93,47,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,189,50,145,12
LTEXT "Special scaler:",65429,189,91,51,9
COMBOBOX IDC_VIDEOCONFIG_SCALER_WIN,245,89,93,47,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
LTEXT "Sync method:",65437,189,108,51,9
COMBOBOX IDC_VIDEOCONFIG_SYNC_METHOD_WIN,245,106,93,47,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "Disable hardware acceleration",IDC_DISABLE_HW_ACCEL_WIN,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,252,145,12
GROUPBOX "Drawing Area",65494,191,168,174,71,WS_GROUP
LTEXT "First Line:",65436,213,189,39,8
LTEXT "Last Line:",65435,213,207,43,8
CTEXT "NTSC",65434,257,177,27,8
CTEXT "PAL",65433,312,177,27,8
EDITTEXT IDC_SCANLINE_FIRST_NTSC,258,188,27,12,ES_RIGHT
EDITTEXT IDC_SCANLINE_LAST_NTSC,258,205,27,12,ES_RIGHT
EDITTEXT IDC_SCANLINE_FIRST_PAL,312,188,27,12,ES_RIGHT
EDITTEXT IDC_SCANLINE_LAST_PAL,312,205,27,12,ES_RIGHT
CONTROL "Clip left and right sides (8 columns on each)",IDC_VIDEOCONFIG_CLIPSIDES,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,201,222,157,12
DEFPUSHBUTTON "Close",ID_CANCEL,309,276,56,14
LTEXT "Current Pixel Aspect Ratio:",65432,15,195,87,8
EDITTEXT IDC_VIDEOCONFIG_ASPECT_X,105,193,28,12,ES_AUTOHSCROLL
CTEXT ":",65431,134,194,8,8
EDITTEXT IDC_VIDEOCONFIG_ASPECT_Y,143,193,28,12,ES_AUTOHSCROLL
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,189,123,146,12
GROUPBOX "Drawing Area",65494,351,46,154,65,WS_GROUP
LTEXT "First line:",65436,371,64,40,9
LTEXT "Last line:",65435,371,80,40,9
CTEXT "NTSC",65434,417,53,27,8
CTEXT "PAL",65433,471,53,27,8
EDITTEXT IDC_SCANLINE_FIRST_NTSC,418,62,27,12,ES_RIGHT
EDITTEXT IDC_SCANLINE_LAST_NTSC,418,79,27,12,ES_RIGHT
EDITTEXT IDC_SCANLINE_FIRST_PAL,471,62,27,12,ES_RIGHT
EDITTEXT IDC_SCANLINE_LAST_PAL,471,79,27,12,ES_RIGHT
CONTROL "Clip left and right sides (8 px on each)",IDC_VIDEOCONFIG_CLIPSIDES,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,359,94,140,12
DEFPUSHBUTTON "Close",ID_CANCEL,449,146,56,14
CONTROL "Allow more than 8 sprites per scanline",IDC_VIDEOCONFIG_NO8LIM,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,201,254,157,11
GROUPBOX "Emulation",65430,191,242,174,29,WS_GROUP
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,359,124,138,11
GROUPBOX "Emulation",65430,351,113,154,27,WS_GROUP
CONTROL "Always maintain correct aspect ratio",IDC_VIDEOCONFIG_BESTFIT,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,201,133,136,12
CONTROL "Hide mouse cursor",IDC_VIDEOCONFIG_HIDEMOUSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,43,87,12
GROUPBOX "Best Fit",65495,191,122,174,43,WS_GROUP
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,359,14,136,12
CONTROL "Hide mouse cursor",IDC_VIDEOCONFIG_HIDEMOUSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,43,87,12
GROUPBOX "Best Fit",65495,351,3,154,42,WS_GROUP
CONTROL "Use console BG color for empty areas",IDC_VIDEOCONFIG_CONSOLE_BGCOLOR,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,201,147,136,12
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,359,28,136,12
END
IDD_RAMSEARCH DIALOGEX 0, 0, 287, 292

View File

@ -441,6 +441,7 @@
#define IDC_DEBUGGER_VAL_CYCLES_COUNT 503
#define CTL_VOLUME_TRACKBAR_NOISE 504
#define IDC_DEBUGGER_VAL_PPUPIXEL 504
#define IDC_SCANLINE_FIRST_NTSC2 504
#define CTL_VOLUME_TRACKBAR_NOISE2 505
#define CTL_VOLUME_TRACKBAR_PCM 505
#define IDC_DEBUGGER_VAL_CYCLES_COUNT2 505

View File

@ -23,6 +23,10 @@
#include "gui.h"
#include "../../fceu.h"
#include "../../video.h"
#include "input.h"
#include "mapinput.h"
extern bool fullscreenByDoubleclick;
static int RecalcCustom(void);
void InputScreenChanged(int fs);
@ -45,8 +49,9 @@ int winspecial = 0;
int NTSCwinspecial = 0;
int vmod = 0;
vmdef vmodes[11]={
{0,0,0,VMDF_DXBLT|VMDF_STRFS,1,1,0}, // Custom - set to current resolution at first run
vmdef vmodes[11] =
{
{0,0,0,VMDF_DXBLT|VMDF_STRFS,1,1,0}, // Custom - set to current resolution at the first launch
{320,240,8,0,1,1,0}, //1
{512,384,8,0,1,1,0}, //2
{640,480,32,0,1,1,0}, //3
@ -1208,9 +1213,12 @@ BOOL CALLBACK VideoConCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
switch(uMsg)
{
case WM_INITDIALOG:
{
/*
for(x=0;x<11;x++)
SendDlgItemMessage(hwndDlg,IDC_VIDEOCONFIG_MODE,CB_ADDSTRING,0,(LPARAM)(LPSTR)vmstr[x]);
SendDlgItemMessage(hwndDlg,IDC_VIDEOCONFIG_MODE,CB_SETCURSEL,vmod,(LPARAM)(LPSTR)0);
*/
SendDlgItemMessage(hwndDlg,IDC_VIDEOCONFIG_BPP,CB_ADDSTRING,0,(LPARAM)(LPSTR)"8");
SendDlgItemMessage(hwndDlg,IDC_VIDEOCONFIG_BPP,CB_ADDSTRING,0,(LPARAM)(LPSTR)"16");
@ -1221,20 +1229,19 @@ BOOL CALLBACK VideoConCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
SetDlgItemInt(hwndDlg,IDC_VIDEOCONFIG_XRES,vmodes[0].x,0);
SetDlgItemInt(hwndDlg,IDC_VIDEOCONFIG_YRES,vmodes[0].y,0);
SetDlgItemInt(hwndDlg,IDC_VIDEOCONFIG_XSCALE,vmodes[0].xscale,0);
SetDlgItemInt(hwndDlg,IDC_VIDEOCONFIG_YSCALE,vmodes[0].yscale,0);
CheckRadioButton(hwndDlg,IDC_RADIO_SCALE,IDC_RADIO_STRETCH,(vmodes[0].flags&VMDF_STRFS)?IDC_RADIO_STRETCH:IDC_RADIO_SCALE);
//SetDlgItemInt(hwndDlg,IDC_VIDEOCONFIG_XSCALE,vmodes[0].xscale,0);
//SetDlgItemInt(hwndDlg,IDC_VIDEOCONFIG_YSCALE,vmodes[0].yscale,0);
//CheckRadioButton(hwndDlg,IDC_RADIO_SCALE,IDC_RADIO_STRETCH,(vmodes[0].flags&VMDF_STRFS)?IDC_RADIO_STRETCH:IDC_RADIO_SCALE);
// -Video Modes Tag-
char *str[]={"<none>","hq2x","Scale2x","NTSC 2x","hq3x","Scale3x"};
int x;
for(x=0;x<6;x++)
{
// -Video Modes Tag-
char *str[]={"<none>","hq2x","Scale2x","NTSC 2x","hq3x","Scale3x"};
int x;
for(x=0;x<6;x++)
{
SendDlgItemMessage(hwndDlg,IDC_VIDEOCONFIG_SCALER_FS,CB_ADDSTRING,0,(LPARAM)(LPSTR)str[x]);
SendDlgItemMessage(hwndDlg,IDC_VIDEOCONFIG_SCALER_WIN,CB_ADDSTRING,0,(LPARAM)(LPSTR)str[x]);
}
SendDlgItemMessage(hwndDlg,IDC_VIDEOCONFIG_SCALER_FS,CB_ADDSTRING,0,(LPARAM)(LPSTR)str[x]);
SendDlgItemMessage(hwndDlg,IDC_VIDEOCONFIG_SCALER_WIN,CB_ADDSTRING,0,(LPARAM)(LPSTR)str[x]);
}
SendDlgItemMessage(hwndDlg,IDC_VIDEOCONFIG_SCALER_FS,CB_SETCURSEL,vmodes[0].special,(LPARAM)(LPSTR)0);
SendDlgItemMessage(hwndDlg,IDC_VIDEOCONFIG_SCALER_WIN,CB_SETCURSEL,winspecial,(LPARAM)(LPSTR)0);
@ -1274,8 +1281,8 @@ BOOL CALLBACK VideoConCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
SetDlgItemDouble(hwndDlg, IDC_WINSIZE_MUL_X, winsizemulx);
SetDlgItemDouble(hwndDlg, IDC_WINSIZE_MUL_Y, winsizemuly);
SetDlgItemDouble(hwndDlg, IDC_VIDEOCONFIG_ASPECT_X, saspectw);
SetDlgItemDouble(hwndDlg, IDC_VIDEOCONFIG_ASPECT_Y, saspecth);
//SetDlgItemDouble(hwndDlg, IDC_VIDEOCONFIG_ASPECT_X, saspectw);
//SetDlgItemDouble(hwndDlg, IDC_VIDEOCONFIG_ASPECT_Y, saspecth);
SendDlgItemMessage(hwndDlg,IDC_VIDEOCONFIG_SYNC_METHOD_WIN,CB_ADDSTRING,0,(LPARAM)(LPSTR)"<none>");
SendDlgItemMessage(hwndDlg,IDC_VIDEOCONFIG_SYNC_METHOD_FS,CB_ADDSTRING,0,(LPARAM)(LPSTR)"<none>");
@ -1293,7 +1300,23 @@ BOOL CALLBACK VideoConCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
if(eoptions&EO_NOSPRLIM)
CheckDlgButton(hwndDlg,IDC_VIDEOCONFIG_NO8LIM,BST_CHECKED);
char buf[1024] = "Full Screen";
int c = FCEUD_CommandMapping[EMUCMD_MISC_TOGGLEFULLSCREEN];
if (c)
{
strcat(buf, " (");
strcat(buf, GetKeyComboName(c));
if (fullscreenByDoubleclick)
strcat(buf, " or double-click)");
else
strcat(buf, ")");
} else if (fullscreenByDoubleclick)
{
strcat(buf, " (double-click anywhere)");
}
SetDlgItemText(hwndDlg, IDC_VIDEOCONFIG_FS, buf);
break;
}
case WM_CLOSE:
case WM_QUIT: goto gornk;
case WM_COMMAND:
@ -1343,18 +1366,19 @@ gornk:
UpdateRendBounds();
/*
if(IsDlgButtonChecked(hwndDlg,IDC_RADIO_STRETCH)==BST_CHECKED)
vmodes[0].flags |= VMDF_STRFS|VMDF_DXBLT;
else
vmodes[0].flags &= ~(VMDF_STRFS|VMDF_DXBLT);
vmod=SendDlgItemMessage(hwndDlg,IDC_VIDEOCONFIG_MODE,CB_GETCURSEL,0,(LPARAM)(LPSTR)0);
*/
vmodes[0].x=GetDlgItemInt(hwndDlg,IDC_VIDEOCONFIG_XRES,0,0);
vmodes[0].y=GetDlgItemInt(hwndDlg,IDC_VIDEOCONFIG_YRES,0,0);
vmodes[0].bpp=(SendDlgItemMessage(hwndDlg,IDC_VIDEOCONFIG_BPP,CB_GETCURSEL,0,(LPARAM)(LPSTR)0)+1)<<3;
vmodes[0].xscale=GetDlgItemInt(hwndDlg,IDC_VIDEOCONFIG_XSCALE,0,0);
vmodes[0].yscale=GetDlgItemInt(hwndDlg,IDC_VIDEOCONFIG_YSCALE,0,0);
//vmodes[0].xscale=GetDlgItemInt(hwndDlg,IDC_VIDEOCONFIG_XSCALE,0,0);
//vmodes[0].yscale=GetDlgItemInt(hwndDlg,IDC_VIDEOCONFIG_YSCALE,0,0);
vmodes[0].special=SendDlgItemMessage(hwndDlg,IDC_VIDEOCONFIG_SCALER_FS,CB_GETCURSEL,0,(LPARAM)(LPSTR)0);
winspecial = SendDlgItemMessage(hwndDlg,IDC_VIDEOCONFIG_SCALER_WIN,CB_GETCURSEL,0,(LPARAM)(LPSTR)0);
@ -1389,8 +1413,8 @@ gornk:
winsizemulx=GetDlgItemDouble(hwndDlg, IDC_WINSIZE_MUL_X);
winsizemuly=GetDlgItemDouble(hwndDlg, IDC_WINSIZE_MUL_Y);
saspectw=GetDlgItemDouble(hwndDlg, IDC_VIDEOCONFIG_ASPECT_X);
saspecth=GetDlgItemDouble(hwndDlg, IDC_VIDEOCONFIG_ASPECT_Y);
//saspectw=GetDlgItemDouble(hwndDlg, IDC_VIDEOCONFIG_ASPECT_X);
//saspecth=GetDlgItemDouble(hwndDlg, IDC_VIDEOCONFIG_ASPECT_Y);
FixWXY(0);
winsync=SendDlgItemMessage(hwndDlg,IDC_VIDEOCONFIG_SYNC_METHOD_WIN,CB_GETCURSEL,0,(LPARAM)(LPSTR)0);

View File

@ -965,7 +965,7 @@ void HideFWindow(int h)
{
LONG desa;
if(h) /* Full-screen. */
if (h) /* Full-screen. */
{
RECT bo;
GetWindowRect(hAppWnd, &bo);
@ -974,8 +974,7 @@ void HideFWindow(int h)
SetMenu(hAppWnd, 0);
desa=WS_POPUP | WS_CLIPSIBLINGS;
}
else
} else
{
desa = WS_OVERLAPPEDWINDOW | WS_CLIPSIBLINGS;
HideMenu(tog);
@ -984,8 +983,8 @@ void HideFWindow(int h)
SetWindowPos(hAppWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOACTIVATE | SWP_NOCOPYBITS | SWP_NOMOVE | SWP_NOREPOSITION | SWP_NOSIZE);
}
SetWindowLong(hAppWnd, GWL_STYLE ,desa | ( GetWindowLong(hAppWnd, GWL_STYLE) & WS_VISIBLE ));
SetWindowPos(hAppWnd, 0 ,0 ,0 ,0 ,0 ,SWP_FRAMECHANGED | SWP_NOACTIVATE | SWP_NOCOPYBITS | SWP_NOMOVE | SWP_NOREPOSITION | SWP_NOSIZE | SWP_NOZORDER);
SetWindowLong(hAppWnd, GWL_STYLE, desa | ( GetWindowLong(hAppWnd, GWL_STYLE) & WS_VISIBLE ));
SetWindowPos(hAppWnd, 0, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOACTIVATE | SWP_NOCOPYBITS | SWP_NOMOVE | SWP_NOREPOSITION | SWP_NOSIZE | SWP_NOZORDER);
}
//Toggles the display status of the main menu.
@ -1119,20 +1118,20 @@ void GetMouseData(uint32 (&md)[3])
if (eoptions & EO_BESTFIT && (resizable_surface_rect.top || resizable_surface_rect.left))
{
if (mousex <= resizable_surface_rect.left)
if ((int)mousex <= resizable_surface_rect.left)
{
md[0] = 0;
} else if (mousex >= resizable_surface_rect.right)
} else if ((int)mousex >= resizable_surface_rect.right)
{
md[0] = VNSWID;
} else
{
md[0] = VNSWID * (mousex - resizable_surface_rect.left) / (resizable_surface_rect.right - resizable_surface_rect.left);
}
if (mousey <= resizable_surface_rect.top)
if ((int)mousey <= resizable_surface_rect.top)
{
md[1] = 0;
} else if (mousey >= resizable_surface_rect.bottom)
} else if ((int)mousey >= resizable_surface_rect.bottom)
{
md[1] = FSettings.TotalScanlines();
} else
@ -1143,20 +1142,20 @@ void GetMouseData(uint32 (&md)[3])
{
RECT client_rect;
GetClientRect(hAppWnd, &client_rect);
if (mousex <= client_rect.left)
if ((int)mousex <= client_rect.left)
{
md[0] = 0;
} else if (mousex >= client_rect.right)
} else if ((int)mousex >= client_rect.right)
{
md[0] = VNSWID;
} else
{
md[0] = VNSWID * (mousex - client_rect.left) / (client_rect.right - client_rect.left);
}
if (mousey <= client_rect.top)
if ((int)mousey <= client_rect.top)
{
md[1] = 0;
} else if (mousey >= client_rect.bottom)
} else if ((int)mousey >= client_rect.bottom)
{
md[1] = FSettings.TotalScanlines();
} else
@ -1371,9 +1370,10 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
goto proco;
case WM_SIZE:
if(!fullscreen && !changerecursive)
switch(wParam)
if (!fullscreen && !changerecursive && !windowedfailed)
{
switch(wParam)
{
case SIZE_MAXIMIZED:
ismaximized = 1;
SetMainWindowStuff();
@ -1382,6 +1382,7 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
ismaximized = 0;
SetMainWindowStuff();
break;
}
}
break;
case WM_SIZING:
@ -1404,10 +1405,12 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
winsizemulx*= (double)w/winwidth;
if(how & 2)
winsizemuly*= (double)h/winheight;
bool shift_held = (GetAsyncKeyState(VK_SHIFT) < 0);
if(how & 1)
FixWXY(0);
FixWXY(0, shift_held);
else
FixWXY(1);
FixWXY(1, shift_held);
CalcWindowSize(&srect);
winwidth=srect.right;
@ -2405,7 +2408,7 @@ proco:
return 0;
}
void FixWXY(int pref)
void FixWXY(int pref, bool shift_held)
{
if(eoptions&EO_FORCEASPECT)
{
@ -2430,47 +2433,12 @@ void FixWXY(int pref)
}
}
// AnS: removed unnecessary restrictions of window size
/*
if(winspecial)
{
// -Video Modes Tag-
int mult;
if(winspecial >= 1 && winspecial <= 3) mult = 2;
else mult = 3;
if(winsizemulx < mult)
{
if(eoptions&EO_FORCEASPECT)
winsizemuly *= mult / winsizemulx;
if (winsizemulx < mult)
winsizemulx = mult;
}
if(winsizemuly < mult && mult < 3) //11/14/2008, adelikat: added && mult < 3 and extra code to meet mult >=3 conditions
{
if(eoptions&EO_FORCEASPECT)
winsizemulx *= mult / winsizemuly;
if (winsizemuly < mult)
winsizemuly = mult;
}
else if (winsizemuly < mult&& mult >= 3) { //11/14/2008, adelikat: This was probably a hacky solution. But when special scalar = 3 and aspect correction is on,
if(eoptions&EO_FORCEASPECT) //then x is corrected to a wider ratio (.5 of what this code seems to expect) so I added a special circumstance for these 2 situations
winsizemulx *= (mult+0.5) / winsizemuly; //And adjusted the special scaling by .5
if (winsizemuly < mult)
winsizemuly = mult;
}
}
*/
if(winsizemulx<0.1)
winsizemulx=0.1;
if(winsizemuly<0.1)
winsizemuly=0.1;
if(eoptions & EO_FORCEISCALE)
if (((eoptions & EO_FORCEISCALE) && !shift_held) || (!(eoptions & EO_FORCEISCALE) && shift_held))
{
int x,y;
@ -2593,7 +2561,7 @@ void SetMainWindowStuff()
GetWindowRect(hAppWnd, &tmp);
if(ismaximized)
if (ismaximized)
{
winwidth = tmp.right - tmp.left;
winheight = tmp.bottom - tmp.top;

View File

@ -27,7 +27,7 @@ void SetMainWindowText();
void HideFWindow(int h);
void SetMainWindowStuff();
int GetClientAbsRect(LPRECT lpRect);
void FixWXY(int pref);
void FixWXY(int pref, bool shift_held = false);
void ByebyeWindow();
void DoTimingConfigFix();
int CreateMainWindow();

View File

@ -92,7 +92,7 @@ bool frameAdvanceLagSkip = false; //If this is true, frame advance will skip ove
bool AutoSS = false; //Flagged true when the first auto-savestate is made while a game is loaded, flagged false on game close
bool movieSubtitles = true; //Toggle for displaying movie subtitles
bool DebuggerWasUpdated = false; //To prevent the debugger from updating things without being updated.
bool AutoResumePlay = false; // maybe this should be in "eoptions"...
bool AutoResumePlay = false;
char rom_name_when_closing_emulator[129] = {0};
FCEUGI::FCEUGI()

View File

@ -1171,7 +1171,7 @@ void ToggleFullscreen()
changerecursive=1;
int oldmode = fullscreen;
if(!SetVideoMode(oldmode ^1))
if(!SetVideoMode(oldmode ^ 1))
SetVideoMode(oldmode);
changerecursive=0;
#endif

Binary file not shown.