mirror of https://github.com/snes9xgit/snes9x.git
Fix menu commands, add predefined window sizes
This commit is contained in:
parent
8774ddb4e3
commit
8218618c6c
|
@ -397,6 +397,7 @@
|
|||
#define ID_OPTIONS_EMULATION 40069
|
||||
#define ID_OPTIONS_SETTINGS 40070
|
||||
#define ID_DEBUG_TRACE 40071
|
||||
#define ID_FRAME_ADVANCE 40074
|
||||
#define ID_DEBUG_FRAME_ADVANCE 40075
|
||||
#define ID_DEBUG_SNES_STATUS 40076
|
||||
#define ID_NETPLAY_SERVER 40077
|
||||
|
@ -437,7 +438,7 @@
|
|||
#define ID_FILE_STOP_AVI 40117
|
||||
#define ID_OPTIONS_KEYCUSTOM 40118
|
||||
#define ID_WINDOW_ 40119
|
||||
#define ID_WINDOW_VIDMEM 40122
|
||||
#define ID_WINDOW_BILINEAR 40122
|
||||
#define ID_WINDOW_ASPECTRATIO 40123
|
||||
#define ID_TURBO_LEFT 40124
|
||||
#define ID_TURBO_UP 40125
|
||||
|
@ -476,13 +477,17 @@
|
|||
#define ID_SOUND_210MS 40166
|
||||
#define ID_EMULATION_PAUSEWHENINACTIVE 40167
|
||||
#define ID_VIDEO_SHOWFRAMERATE 40168
|
||||
#define ID_WINDOW_SIZE_1X 40169
|
||||
#define ID_WINDOW_SIZE_2X 40170
|
||||
#define ID_WINDOW_SIZE_3X 40171
|
||||
#define ID_WINDOW_SIZE_4X 40172
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 151
|
||||
#define _APS_NEXT_COMMAND_VALUE 40169
|
||||
#define _APS_NEXT_COMMAND_VALUE 40173
|
||||
#define _APS_NEXT_CONTROL_VALUE 3018
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
|
|
|
@ -701,18 +701,6 @@ IDB_HIDDENFOLDER BITMAP "hiddir.bmp"
|
|||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
IDI_ICON1 ICON "icon1.ico"
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Dutch (Netherlands) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NLD)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_DUTCH, SUBLANG_DUTCH
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
|
@ -777,19 +765,6 @@ END
|
|||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
#endif // Dutch (Netherlands) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.K.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
|
@ -871,7 +846,8 @@ BEGIN
|
|||
BEGIN
|
||||
MENUITEM "&Pause", ID_FILE_PAUSE
|
||||
MENUITEM "Pause &When Inactive", ID_EMULATION_PAUSEWHENINACTIVE
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "&Frame Advance", ID_FRAME_ADVANCE
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "&Settings...\tAlt+F8", ID_OPTIONS_SETTINGS
|
||||
END
|
||||
POPUP "&Input"
|
||||
|
@ -943,10 +919,17 @@ BEGIN
|
|||
BEGIN
|
||||
MENUITEM "&Hide menubar\tEsc", ID_WINDOW_HIDEMENUBAR
|
||||
MENUITEM "&Full Screen\tAlt+Enter", ID_WINDOW_FULLSCREEN
|
||||
POPUP "&Window Size"
|
||||
BEGIN
|
||||
MENUITEM "&1x" ID_WINDOW_SIZE_1X
|
||||
MENUITEM "&2x" ID_WINDOW_SIZE_2X
|
||||
MENUITEM "&3x" ID_WINDOW_SIZE_3X
|
||||
MENUITEM "&4x" ID_WINDOW_SIZE_4X
|
||||
END
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "&Stretch Image\tAlt+Backspace", 40032
|
||||
MENUITEM "&Maintain Aspect Ratio", 40123
|
||||
MENUITEM "&Bilinear Filtering", ID_WINDOW_VIDMEM
|
||||
MENUITEM "&Stretch Image\tAlt+Backspace", ID_WINDOW_STRETCH
|
||||
MENUITEM "&Maintain Aspect Ratio", ID_WINDOW_ASPECTRATIO
|
||||
MENUITEM "&Bilinear Filtering", ID_WINDOW_BILINEAR
|
||||
MENUITEM "Show Frame &Rate", ID_VIDEO_SHOWFRAMERATE
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "&Display Configuration...\tAlt+F5", ID_OPTIONS_DISPLAY
|
||||
|
@ -977,7 +960,7 @@ BEGIN
|
|||
END
|
||||
END
|
||||
|
||||
#endif // English (U.K.) resources
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@
|
|||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="2057"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
|
@ -180,7 +180,7 @@
|
|||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="2057"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
|
@ -277,7 +277,7 @@
|
|||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1043"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
|
@ -376,7 +376,7 @@
|
|||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1043"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
|
@ -473,7 +473,7 @@
|
|||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1043"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
|
@ -569,7 +569,7 @@
|
|||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1043"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
|
@ -669,7 +669,7 @@
|
|||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="2057"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
|
@ -768,7 +768,7 @@
|
|||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="2057"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
|
@ -865,7 +865,7 @@
|
|||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1043"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
|
@ -965,7 +965,7 @@
|
|||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1043"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
|
@ -1071,7 +1071,7 @@
|
|||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="2057"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
|
@ -1175,7 +1175,7 @@
|
|||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="2057"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
|
|
|
@ -2054,29 +2054,35 @@ LRESULT CALLBACK WinProc(
|
|||
case ID_WINDOW_FULLSCREEN:
|
||||
ToggleFullScreen ();
|
||||
break;
|
||||
case ID_WINDOW_STRETCH: {
|
||||
case ID_WINDOW_SIZE_1X:
|
||||
case ID_WINDOW_SIZE_2X:
|
||||
case ID_WINDOW_SIZE_3X:
|
||||
case ID_WINDOW_SIZE_4X:
|
||||
UINT factor,newWidth,newHeight;
|
||||
factor = (wParam & 0xffff) - ID_WINDOW_SIZE_1X + 1;
|
||||
newWidth = GUI.AspectWidth * factor;
|
||||
newHeight = (GUI.HeightExtend ? SNES_HEIGHT_EXTENDED : SNES_HEIGHT) * factor;
|
||||
newWidth += 2*(GetSystemMetrics(SM_CXBORDER) + GetSystemMetrics(SM_CXDLGFRAME));
|
||||
newHeight += 2*(GetSystemMetrics(SM_CYBORDER) + GetSystemMetrics(SM_CYDLGFRAME)) +
|
||||
GetSystemMetrics(SM_CYCAPTION) + (GUI.HideMenu ? 0 : (GetSystemMetrics(SM_CYMENU) +
|
||||
(factor<2 ? GetSystemMetrics(SM_CYMENU) : 0)));
|
||||
SetWindowPos(GUI.hWnd,0,0,0,newWidth,newHeight,SWP_NOMOVE);
|
||||
break;
|
||||
case ID_WINDOW_STRETCH:
|
||||
GUI.Stretch = !GUI.Stretch;
|
||||
if(!GUI.Stretch != !GUI.BilinearFilter) {
|
||||
GUI.BilinearFilter = !GUI.BilinearFilter;
|
||||
RestoreSNESDisplay ();
|
||||
}
|
||||
RECT rect;
|
||||
GetClientRect (GUI.hWnd, &rect);
|
||||
InvalidateRect (GUI.hWnd, &rect, true);
|
||||
} break;
|
||||
case ID_WINDOW_ASPECTRATIO: {
|
||||
WinDisplayApplyChanges();
|
||||
WinRefreshDisplay();
|
||||
break;
|
||||
case ID_WINDOW_ASPECTRATIO:
|
||||
GUI.AspectRatio = !GUI.AspectRatio;
|
||||
RECT rect;
|
||||
GetClientRect (GUI.hWnd, &rect);
|
||||
InvalidateRect (GUI.hWnd, &rect, true);
|
||||
} break;
|
||||
case ID_WINDOW_VIDMEM: {
|
||||
WinDisplayApplyChanges();
|
||||
WinRefreshDisplay();
|
||||
break;
|
||||
case ID_WINDOW_BILINEAR:
|
||||
GUI.BilinearFilter = !GUI.BilinearFilter;
|
||||
RestoreSNESDisplay ();
|
||||
RECT rect;
|
||||
GetClientRect (GUI.hWnd, &rect);
|
||||
InvalidateRect (GUI.hWnd, &rect, true);
|
||||
} break;
|
||||
WinDisplayApplyChanges();
|
||||
WinRefreshDisplay();
|
||||
break;
|
||||
case ID_VIDEO_SHOWFRAMERATE:
|
||||
Settings.DisplayFrameRate = !Settings.DisplayFrameRate;
|
||||
break;
|
||||
|
@ -2226,6 +2232,10 @@ LRESULT CALLBACK WinProc(
|
|||
DialogBox(g_hInst, MAKEINTRESOURCE(IDD_ABOUT), hWnd, DlgAboutProc);
|
||||
RestoreSNESDisplay ();
|
||||
break;
|
||||
case ID_FRAME_ADVANCE:
|
||||
Settings.Paused = true;
|
||||
Settings.FrameAdvance = true;
|
||||
break;
|
||||
#ifdef DEBUGGER
|
||||
case ID_DEBUG_TRACE:
|
||||
CPU.Flags ^= TRACE_FLAG;
|
||||
|
@ -2236,10 +2246,6 @@ LRESULT CALLBACK WinProc(
|
|||
ICPU.FrameAdvanceCount = 1;
|
||||
Settings.Paused = FALSE;
|
||||
break;
|
||||
|
||||
case ID_DEBUG_SNES_STATUS:
|
||||
MessageBox(GUI.hWnd, TEXT("Sorry, but this function is not implemented yet."), NULL, MB_OK | MB_ICONINFORMATION);
|
||||
break;
|
||||
#endif
|
||||
case IDM_ROM_INFO:
|
||||
RestoreGUIDisplay ();
|
||||
|
@ -2583,6 +2589,13 @@ BOOL WinInit( HINSTANCE hInstance)
|
|||
MessageBox (NULL, TEXT("Failed to initialize the menu.\nThis could indicate a failure of your operating system;\ntry closing some other windows or programs, or restart your computer, before opening Snes9x again.\nOr, if you compiled this program yourself, ensure that Snes9x was built with the proper resource files."), TEXT("Snes9X - Menu Initialization Failure"), MB_OK | MB_ICONSTOP);
|
||||
// return FALSE; // disabled: try to function without the menu
|
||||
}
|
||||
#ifdef DEBUGGER
|
||||
if(GUI.hMenu) {
|
||||
InsertMenu(GUI.hMenu,ID_OPTIONS_SETTINGS,MF_BYCOMMAND | MF_STRING | MF_ENABLED,ID_DEBUG_FRAME_ADVANCE,TEXT("&Debug Frame Advance"));
|
||||
InsertMenu(GUI.hMenu,ID_OPTIONS_SETTINGS,MF_BYCOMMAND | MF_STRING | MF_ENABLED,ID_DEBUG_TRACE,TEXT("&Trace"));
|
||||
InsertMenu(GUI.hMenu,ID_OPTIONS_SETTINGS,MF_BYCOMMAND | MF_SEPARATOR | MF_ENABLED,NULL,NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
TCHAR buf [100];
|
||||
_stprintf (buf, WINDOW_TITLE, TEXT(VERSION));
|
||||
|
@ -3597,7 +3610,7 @@ static void CheckMenuStates ()
|
|||
mii.fState = GUI.BilinearFilter ? MFS_CHECKED : MFS_UNCHECKED;
|
||||
if(!GUI.Stretch)
|
||||
mii.fState |= MFS_DISABLED;
|
||||
SetMenuItemInfo (GUI.hMenu, ID_WINDOW_VIDMEM, FALSE, &mii);
|
||||
SetMenuItemInfo (GUI.hMenu, ID_WINDOW_BILINEAR, FALSE, &mii);
|
||||
|
||||
mii.fState = Settings.DisplayFrameRate ? MFS_CHECKED : MFS_UNCHECKED;
|
||||
SetMenuItemInfo (GUI.hMenu, ID_VIDEO_SHOWFRAMERATE, FALSE, &mii);
|
||||
|
@ -3759,10 +3772,6 @@ static void CheckMenuStates ()
|
|||
#ifdef DEBUGGER
|
||||
mii.fState = (CPU.Flags & TRACE_FLAG) ? MFS_CHECKED : MFS_UNCHECKED;
|
||||
SetMenuItemInfo (GUI.hMenu, ID_DEBUG_TRACE, FALSE, &mii);
|
||||
mii.fState = MFS_UNCHECKED;
|
||||
SetMenuItemInfo (GUI.hMenu, ID_DEBUG_FRAME_ADVANCE, FALSE, &mii);
|
||||
mii.fState = MFS_DISABLED;
|
||||
SetMenuItemInfo (GUI.hMenu, ID_DEBUG_SNES_STATUS, FALSE, &mii);
|
||||
#endif
|
||||
|
||||
mii.fState = (!Settings.StopEmulation) ? MFS_ENABLED : MFS_DISABLED;
|
||||
|
|
Loading…
Reference in New Issue