From ea8e016631a2e4938b8294fbeac47e63b95af62d Mon Sep 17 00:00:00 2001 From: Brandon Wright Date: Tue, 16 Apr 2019 12:18:11 -0500 Subject: [PATCH] Win32: Add set defaults and warning to hacks dialog. --- win32/glslang/src | 2 +- win32/rsrc/resource.h | 3 ++- win32/rsrc/snes9x.rc | 3 ++- win32/wsnes9x.cpp | 20 +++++++++++++++++++- 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/win32/glslang/src b/win32/glslang/src index 0527c9db..c9e03360 160000 --- a/win32/glslang/src +++ b/win32/glslang/src @@ -1 +1 @@ -Subproject commit 0527c9db8148ce37442fa4a9c99a2a23ad50b0b7 +Subproject commit c9e03360e2a78a95a8571292aefa5ddbdbf66daf diff --git a/win32/rsrc/resource.h b/win32/rsrc/resource.h index 5cc89d4f..b9ddb6d1 100644 --- a/win32/rsrc/resource.h +++ b/win32/rsrc/resource.h @@ -402,6 +402,7 @@ #define IDC_SFX_CLOCK_SPEED 3035 #define IDC_SFX_CLOCK_SPEED_SPIN 3036 #define IDC_NO_SPRITE_LIMIT 3037 +#define IDC_SET_DEFAULTS 3038 #define ID_FILE_EXIT 40001 #define ID_WINDOW_HIDEMENUBAR 40004 #define ID_FILE_AVI_RECORDING 40005 @@ -549,7 +550,7 @@ #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 167 #define _APS_NEXT_COMMAND_VALUE 40179 -#define _APS_NEXT_CONTROL_VALUE 3038 +#define _APS_NEXT_CONTROL_VALUE 3039 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif diff --git a/win32/rsrc/snes9x.rc b/win32/rsrc/snes9x.rc index 19284dfd..775004ae 100644 --- a/win32/rsrc/snes9x.rc +++ b/win32/rsrc/snes9x.rc @@ -561,7 +561,7 @@ BEGIN END IDD_DIALOG_HACKS DIALOGEX 0, 0, 234, 120 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Emulator Hacks" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN @@ -578,6 +578,7 @@ BEGIN CONTROL "Separate Echo Buffer from RAM",IDC_SEPARATE_ECHO_BUFFER, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,108,72,123,10 CONTROL "Disable Sprite Limit",IDC_NO_SPRITE_LIMIT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,108,84,80,10 + PUSHBUTTON "Set Defaults",IDC_SET_DEFAULTS,6,100,48,14 END diff --git a/win32/wsnes9x.cpp b/win32/wsnes9x.cpp index 19db7c2e..b57f60b5 100644 --- a/win32/wsnes9x.cpp +++ b/win32/wsnes9x.cpp @@ -2230,8 +2230,17 @@ LRESULT CALLBACK WinProc( RestoreSNESDisplay (); break; case ID_EMULATION_HACKS: + if (MessageBoxA(hWnd, + "The settings in this dialog should only be used for compatibility\n" + "with old ROM hacks or if you otherwise know what you're doing.\n\n" + "If any problems occur, click \"Set Defaults\" to reset the options to normal.", + "Warning: Unsupported", + MB_OKCANCEL) != IDOK) + break; + RestoreGUIDisplay(); - if (DialogBox(g_hInst, MAKEINTRESOURCE(IDD_DIALOG_HACKS), hWnd, DlgEmulatorHacksProc)) + i = DialogBox(g_hInst, MAKEINTRESOURCE(IDD_DIALOG_HACKS), hWnd, DlgEmulatorHacksProc); + if (i == 1) S9xReset(); else RestoreSNESDisplay(); @@ -5157,6 +5166,15 @@ INT_PTR CALLBACK DlgEmulatorHacksProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM case IDCANCEL: EndDialog(hDlg, 0); return true; + + case IDC_SET_DEFAULTS: + SendDlgItemMessage(hDlg, IDC_SFX_CLOCK_SPEED_SPIN, UDM_SETPOS, 0, 100); + SendDlgItemMessage(hDlg, IDC_CPU_OVERCLOCK, CB_SETCURSEL, 0, 0); + SendDlgItemMessage(hDlg, IDC_SOUND_INTERPOLATION, CB_SETCURSEL, 2, 0); + CheckDlgButton(hDlg, IDC_INVALID_VRAM, false); + CheckDlgButton(hDlg, IDC_SEPARATE_ECHO_BUFFER, false); + CheckDlgButton(hDlg, IDC_NO_SPRITE_LIMIT, false); + break; default: break; }