Add Protect Memory option to Defaults panel

Fixes #1733
This commit is contained in:
oddMLan 2020-05-04 19:47:34 -07:00
parent bdd1d1eb30
commit 059ae511b8
6 changed files with 22 additions and 17 deletions

View File

@ -151,6 +151,7 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory)
AddHandler(Default_FixedAudio, new CSettingTypeApplication("Defaults", "Fixed Audio", true));
AddHandler(Default_UnalignedDMA, new CSettingTypeApplication("Defaults", "Unaligned DMA", false));
AddHandler(Default_RandomizeSIPIInterrupts, new CSettingTypeApplication("Defaults", "Randomize SI/PI Interrupts", true));
AddHandler(Default_SMM_Protect_Memory, new CSettingTypeApplication("Defaults", "SMM-Protect", false));
AddHandler(Rdb_GoodName, new CSettingTypeRomDatabase("Good Name", Game_GameName));
AddHandler(Rdb_RPCKey, new CSettingTypeRomDatabase("RPC Key", Game_RPCKey));
@ -188,7 +189,7 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory)
AddHandler(Rdb_SMM_StoreInstruc, new CSettingTypeRomDatabase("SMM-StoreInstr", false));
AddHandler(Rdb_SMM_PIDMA, new CSettingTypeRomDatabase("SMM-PI DMA", true));
AddHandler(Rdb_SMM_TLB, new CSettingTypeRomDatabase("SMM-TLB", true));
AddHandler(Rdb_SMM_Protect, new CSettingTypeRomDatabase("SMM-Protect", false));
AddHandler(Rdb_SMM_Protect, new CSettingTypeRomDatabase("SMM-Protect", Default_SMM_Protect_Memory));
AddHandler(Rdb_SMM_ValidFunc, new CSettingTypeRomDatabase("SMM-FUNC", true));
AddHandler(Rdb_GameCheatFix, new CSettingTypeRomDatabaseIndex("Cheat", "", ""));
AddHandler(Rdb_GameCheatFixPlugin, new CSettingTypeRomDatabaseIndex("CheatPlugin", "", ""));

View File

@ -79,6 +79,7 @@ enum SettingID
Default_FixedAudio,
Default_UnalignedDMA,
Default_RandomizeSIPIInterrupts,
Default_SMM_Protect_Memory,
//RDB Settings
Rdb_GoodName,

View File

@ -30,6 +30,7 @@ CDefaultsOptionsPage::CDefaultsOptionsPage(HWND hParent, const RECT & rcDispay)
SetDlgItemTextW(m_hWnd, IDC_SYNC_AUDIO, wGS(ROM_SYNC_AUDIO).c_str());
SetDlgItemTextW(m_hWnd, IDC_UNALIGNED_DMA, wGS(ROM_UNALIGNED_DMA).c_str());
SetDlgItemTextW(m_hWnd, IDC_RANDOMIZE_SIPI_INTERRUPTS, wGS(ROM_RANDOMIZE_SIPI_INTERRUPTS).c_str());
SetDlgItemTextW(m_hWnd, IDC_PROTECT_MEMORY, wGS(ADVANCE_SMM_PROTECT).c_str());
CModifiedComboBox * ComboBox;
ComboBox = AddModComboBox(GetDlgItem(IDC_RDRAM_SIZE), Default_RDRamSize);
@ -64,6 +65,7 @@ CDefaultsOptionsPage::CDefaultsOptionsPage(HWND hParent, const RECT & rcDispay)
AddModCheckBox(GetDlgItem(IDC_ROM_FIXEDAUDIO), Default_FixedAudio);
AddModCheckBox(GetDlgItem(IDC_UNALIGNED_DMA), Default_UnalignedDMA);
AddModCheckBox(GetDlgItem(IDC_RANDOMIZE_SIPI_INTERRUPTS), Default_RandomizeSIPIInterrupts);
AddModCheckBox(GetDlgItem(IDC_PROTECT_MEMORY), Default_SMM_Protect_Memory);
if (!g_Settings->LoadBool(Setting_SyncViaAudioEnabled))
{

View File

@ -22,6 +22,7 @@ class CDefaultsOptionsPage :
COMMAND_ID_HANDLER_EX(IDC_ROM_FIXEDAUDIO, CheckBoxChanged)
COMMAND_ID_HANDLER_EX(IDC_UNALIGNED_DMA, CheckBoxChanged)
COMMAND_ID_HANDLER_EX(IDC_RANDOMIZE_SIPI_INTERRUPTS, CheckBoxChanged)
COMMAND_ID_HANDLER_EX(IDC_PROTECT_MEMORY, CheckBoxChanged)
COMMAND_HANDLER_EX(IDC_RDRAM_SIZE, LBN_SELCHANGE, ComboBoxChanged)
COMMAND_HANDLER_EX(IDC_COUNTFACT, LBN_SELCHANGE, ComboBoxChanged)
COMMAND_HANDLER_EX(IDC_VIREFRESH, EN_UPDATE, EditBoxChanged)

View File

@ -1259,19 +1259,21 @@ FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
LTEXT "Memory Size:",IDC_MEMORY_SIZE_TEXT,6,8,91,10
COMBOBOX IDC_RDRAM_SIZE,102,6,109,49,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "Use High Level GFX",IDC_HLE_GFX,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,81,91,10
CONTROL "Use TLB",IDC_USE_TLB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,102,58,91,10
LTEXT "Vi Refresh Rate:",IDC_VIREFESH_TEXT,6,32,91,10
EDITTEXT IDC_VIREFRESH,102,30,109,12,ES_AUTOHSCROLL | ES_NUMBER
LTEXT "AI Count Per Byte:",IDC_COUNTPERBYTE_TEXT,6,45,91,10
EDITTEXT IDC_COUNTPERBYTE,102,44,109,12,ES_AUTOHSCROLL | ES_NUMBER
LTEXT "Counter Factor:",IDC_COUNTFACT_TEXT,6,19,91,10
COMBOBOX IDC_COUNTFACT,102,18,109,49,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "32 Bit Engine",IDC_ROM_32BIT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,58,91,10
CONTROL "Fixed Audio Timing",IDC_ROM_FIXEDAUDIO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,69,91,10
CONTROL "Sync using Audio",IDC_SYNC_AUDIO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,102,69,91,10
CONTROL "Randomize SI/PI interrupts",IDC_RANDOMIZE_SIPI_INTERRUPTS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,102,81,107,10
CONTROL "Unaligned DMA",IDC_UNALIGNED_DMA,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,93,91,10
CONTROL "Use High Level GFX",IDC_HLE_GFX,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,92,91,10
CONTROL "Use TLB",IDC_USE_TLB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,102,68,91,10
LTEXT "Vi Refresh Rate:",IDC_VIREFESH_TEXT,6,37,91,10
EDITTEXT IDC_VIREFRESH,102,35,109,12,ES_AUTOHSCROLL | ES_NUMBER
LTEXT "AI Count Per Byte:",IDC_COUNTPERBYTE_TEXT,6,51,91,10
EDITTEXT IDC_COUNTPERBYTE,102,50,109,12,ES_AUTOHSCROLL | ES_NUMBER
LTEXT "Counter Factor:",IDC_COUNTFACT_TEXT,6,21,91,10
COMBOBOX IDC_COUNTFACT,102,20,109,49,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "32 Bit Engine",IDC_ROM_32BIT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,68,91,10
CONTROL "Fixed Audio Timing",IDC_ROM_FIXEDAUDIO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,80,91,10
CONTROL "Sync using Audio",IDC_SYNC_AUDIO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,102,80,91,10
CONTROL "Randomize SI/PI interrupts",IDC_RANDOMIZE_SIPI_INTERRUPTS,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,102,92,107,10
CONTROL "Unaligned DMA",IDC_UNALIGNED_DMA,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,104,91,10
CONTROL "Protect Memory",IDC_PROTECT_MEMORY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,102,104,91,10
END
IDD_Enhancement_Config DIALOGEX 0, 0, 206, 214

View File

@ -350,6 +350,7 @@
#define IDC_RDB_AUTHOR 1159
#define IDC_RANDOMIZE_SIPI_INTERRUPTS 1159
#define IDC_RDB_VERSION 1160
#define IDC_PROTECT_MEMORY 1160
#define IDC_RDB_DATE 1161
#define IDC_CHT 1162
#define IDC_CHT_AUTHOR 1163
@ -936,9 +937,6 @@
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 211
#define _APS_NEXT_COMMAND_VALUE 40092
#define _APS_NEXT_CONTROL_VALUE 1516
#define _APS_NEXT_RESOURCE_VALUE 219
#define _APS_NEXT_COMMAND_VALUE 40121
#define _APS_NEXT_CONTROL_VALUE 1574