diff --git a/Lang/English.pj.Lang b/Lang/English.pj.Lang
index 09e7531a4..245dc60cb 100644
--- a/Lang/English.pj.Lang
+++ b/Lang/English.pj.Lang
@@ -200,6 +200,7 @@
#409# "Keyboard Shortcuts"
#410# "Status"
#411# "Recompiler"
+#412# "Defaults"
//Plugin Dialog
#420# "About"
diff --git a/Source/Project64-core/Multilanguage.h b/Source/Project64-core/Multilanguage.h
index bed85934f..f0abd0b8b 100644
--- a/Source/Project64-core/Multilanguage.h
+++ b/Source/Project64-core/Multilanguage.h
@@ -229,7 +229,8 @@ enum LanguageStringID
TAB_ROMNOTES = 408,
TAB_SHORTCUTS = 409,
TAB_ROMSTATUS = 410,
- TAB_RECOMPILER = 411, //Added in 1.7.0.50
+ TAB_RECOMPILER = 411,
+ TAB_DEFAULTS = 412,
//Plugin Dialog
PLUG_ABOUT = 420,
diff --git a/Source/Project64-core/Multilanguage/LanguageClass.cpp b/Source/Project64-core/Multilanguage/LanguageClass.cpp
index 645755eaf..297576bca 100644
--- a/Source/Project64-core/Multilanguage/LanguageClass.cpp
+++ b/Source/Project64-core/Multilanguage/LanguageClass.cpp
@@ -198,6 +198,7 @@ void CLanguage::LoadDefaultStrings(void)
DEF_STR(TAB_SHORTCUTS, "Keyboard Shortcuts");
DEF_STR(TAB_ROMSTATUS, "Status");
DEF_STR(TAB_RECOMPILER, "Recompiler");
+ DEF_STR(TAB_DEFAULTS, "Defaults");
//Plugin Dialog
DEF_STR(PLUG_ABOUT, "About");
diff --git a/Source/Project64-core/Settings.cpp b/Source/Project64-core/Settings.cpp
index 3825f44d6..41bce5442 100644
--- a/Source/Project64-core/Settings.cpp
+++ b/Source/Project64-core/Settings.cpp
@@ -128,6 +128,16 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory)
AddHandler(Setting_LanguageDirDefault, new CSettingTypeRelativePath("Lang", ""));
AddHandler(Setting_LanguageDir, new CSettingTypeApplicationPath("Lang Directory", "Directory", Setting_LanguageDirDefault));
+ AddHandler(Default_RDRamSize, new CSettingTypeApplication("Defaults", "RDRAM Size", 0x400000u));
+ AddHandler(Default_UseHleGfx, new CSettingTypeApplication("Defaults", "HLE GFX", true));
+ AddHandler(Default_UseTlb, new CSettingTypeApplication("Defaults", "Use TLB", true));
+ AddHandler(Default_ViRefreshRate, new CSettingTypeApplication("Defaults", "ViRefresh", 1500u));
+ AddHandler(Default_AiCountPerBytes, new CSettingTypeApplication("Defaults", "AiCountPerBytes", 0u));
+ AddHandler(Default_CounterFactor, new CSettingTypeApplication("Defaults", "Counter Factor", 2u));
+ AddHandler(Default_32Bit, new CSettingTypeApplication("Defaults", "32bit", true));
+ AddHandler(Default_SyncViaAudio, new CSettingTypeApplication("Defaults", "Audio-Sync Audio", true));
+ AddHandler(Default_FixedAudio, new CSettingTypeApplication("Defaults", "Fixed Audio", true));
+
AddHandler(Rdb_GoodName, new CSettingTypeRomDatabase("Good Name", Game_GameName));
AddHandler(Rdb_SaveChip, new CSettingTypeRDBSaveChip("Save Type", (uint32_t)SaveChip_Auto));
#ifdef _DEBUG
@@ -135,15 +145,15 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory)
#else
AddHandler(Rdb_CpuType, new CSettingTypeRDBCpuType("CPU Type", CPU_Recompiler));
#endif
- AddHandler(Rdb_RDRamSize, new CSettingTypeRDBRDRamSize("RDRAM Size", 0x400000));
- AddHandler(Rdb_CounterFactor, new CSettingTypeRomDatabase("Counter Factor", (uint32_t)2));
- AddHandler(Rdb_UseTlb, new CSettingTypeRDBYesNo("Use TLB", true));
+ AddHandler(Rdb_RDRamSize, new CSettingTypeRDBRDRamSize("RDRAM Size", Default_RDRamSize));
+ AddHandler(Rdb_CounterFactor, new CSettingTypeRomDatabase("Counter Factor", Default_CounterFactor));
+ AddHandler(Rdb_UseTlb, new CSettingTypeRDBYesNo("Use TLB", Default_UseTlb));
AddHandler(Rdb_DelayDP, new CSettingTypeRDBYesNo("Delay DP", true));
AddHandler(Rdb_DelaySi, new CSettingTypeRDBYesNo("Delay SI", false));
- AddHandler(Rdb_32Bit, new CSettingTypeRDBYesNo("32bit", true));
+ AddHandler(Rdb_32Bit, new CSettingTypeRDBYesNo("32bit", Default_32Bit));
AddHandler(Rdb_FastSP, new CSettingTypeRDBYesNo("Fast SP", true));
- AddHandler(Rdb_FixedAudio, new CSettingTypeRomDatabase("Fixed Audio", true));
- AddHandler(Rdb_SyncViaAudio, new CSettingTypeRomDatabase("Audio-Sync Audio", true));
+ AddHandler(Rdb_FixedAudio, new CSettingTypeRomDatabase("Fixed Audio", Default_FixedAudio));
+ AddHandler(Rdb_SyncViaAudio, new CSettingTypeRomDatabase("Audio-Sync Audio", Default_SyncViaAudio));
AddHandler(Rdb_RspAudioSignal, new CSettingTypeRDBYesNo("Audio Signal", false));
AddHandler(Rdb_TLB_VAddrStart, new CSettingTypeRomDatabase("TLB: Vaddr Start", (uint32_t)0));
AddHandler(Rdb_TLB_VAddrLen, new CSettingTypeRomDatabase("TLB: Vaddr Len", (uint32_t)0));
@@ -163,8 +173,8 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory)
AddHandler(Rdb_SMM_ValidFunc, new CSettingTypeRomDatabase("SMM-FUNC", true));
AddHandler(Rdb_GameCheatFix, new CSettingTypeRomDatabaseIndex("Cheat", "", ""));
AddHandler(Rdb_GameCheatFixPlugin, new CSettingTypeRomDatabaseIndex("CheatPlugin", "", ""));
- AddHandler(Rdb_ViRefreshRate, new CSettingTypeRomDatabase("ViRefresh", (uint32_t)1500));
- AddHandler(Rdb_AiCountPerBytes, new CSettingTypeRomDatabase("AiCountPerBytes", (uint32_t)0));
+ AddHandler(Rdb_ViRefreshRate, new CSettingTypeRomDatabase("ViRefresh", Default_ViRefreshRate));
+ AddHandler(Rdb_AiCountPerBytes, new CSettingTypeRomDatabase("AiCountPerBytes", Default_AiCountPerBytes));
AddHandler(Rdb_AudioResetOnLoad, new CSettingTypeRDBYesNo("AudioResetOnLoad", false));
AddHandler(Rdb_AllowROMWrites, new CSettingTypeRDBYesNo("AllowROMWrites", false));
AddHandler(Rdb_CRC_Recalc, new CSettingTypeRDBYesNo("CRC-Recalc", false));
@@ -370,7 +380,7 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory)
AddHandler(Plugin_AUDIO_CurVer, new CSettingTypeApplication("Plugin", "Audio Dll Ver", ""));
AddHandler(Plugin_CONT_CurVer, new CSettingTypeApplication("Plugin", "Controller Dll Ver", ""));
- AddHandler(Plugin_UseHleGfx, new CSettingTypeApplication("RSP", "HLE GFX", true));
+ AddHandler(Plugin_UseHleGfx, new CSettingTypeApplication("RSP", "HLE GFX", Default_UseHleGfx));
AddHandler(Plugin_UseHleAudio, new CSettingTypeApplication("RSP", "HLE Audio", false));
AddHandler(Plugin_EnableAudio, new CSettingTypeApplication("Audio", "Enable Audio", true));
diff --git a/Source/Project64-core/Settings/SettingType/SettingsType-RDBRamSize.cpp b/Source/Project64-core/Settings/SettingType/SettingsType-RDBRamSize.cpp
index c45a57925..f97a27e16 100644
--- a/Source/Project64-core/Settings/SettingType/SettingsType-RDBRamSize.cpp
+++ b/Source/Project64-core/Settings/SettingType/SettingsType-RDBRamSize.cpp
@@ -45,7 +45,7 @@ bool CSettingTypeRDBRDRamSize::Load (uint32_t Index, uint32_t & Value ) const
LoadDefault(Index,ulValue);
}
Value = 0x400000;
- if (ulValue == 8 || !existsInRdb) //default to 8MB if ROM is not in the RDB
+ if (ulValue == 8 || ulValue == 0x800000 || !existsInRdb) //default to 8MB if ROM is not in the RDB
{
Value = 0x800000;
}
@@ -66,7 +66,7 @@ void CSettingTypeRDBRDRamSize::LoadDefault (uint32_t /*Index*/, bool & /*Value*/
void CSettingTypeRDBRDRamSize::LoadDefault (uint32_t /*Index*/, uint32_t & Value ) const
{
- Value = m_DefaultValue;
+ Value = m_DefaultSetting == Default_Constant ? m_DefaultValue : g_Settings->LoadDword(m_DefaultSetting);
}
void CSettingTypeRDBRDRamSize::LoadDefault (uint32_t /*Index*/, std::string & /*Value*/ ) const
diff --git a/Source/Project64-core/Settings/SettingType/SettingsType-RomDatabase.cpp b/Source/Project64-core/Settings/SettingType/SettingsType-RomDatabase.cpp
index 78e774f93..7a5fbe124 100644
--- a/Source/Project64-core/Settings/SettingType/SettingsType-RomDatabase.cpp
+++ b/Source/Project64-core/Settings/SettingType/SettingsType-RomDatabase.cpp
@@ -135,34 +135,44 @@ void CSettingTypeRomDatabase::GameChanged(void * /*Data */)
}
}
+bool CSettingTypeRomDatabase::Load(uint32_t & Value) const
+{
+ bool bRes = false;
+ if (m_VideoSetting)
+ {
+ bRes = m_VideoIniFile->GetNumber(Section(), m_KeyName.c_str(), Value, Value);
+ }
+ else if (m_AudioSetting)
+ {
+ bRes = m_AudioIniFile->GetNumber(Section(), m_KeyName.c_str(), Value, Value);
+ }
+ else
+ {
+ bRes = m_SettingsIniFile->GetNumber(Section(), m_KeyName.c_str(), Value, Value);
+ }
+ return bRes;
+}
+
bool CSettingTypeRomDatabase::Load(uint32_t Index, bool & Value) const
{
uint32_t temp_value = Value;
- bool bRes = Load(Index, temp_value);
- Value = temp_value != 0;
- return bRes;
+ if (Load(temp_value))
+ {
+ Value = temp_value != 0;
+ true;
+ }
+ LoadDefault(Index, Value);
+ return false;
}
bool CSettingTypeRomDatabase::Load(uint32_t Index, uint32_t & Value) const
{
- bool bRes = false;
- if (m_VideoSetting)
- {
- bRes = m_VideoIniFile->GetNumber(Section(), m_KeyName.c_str(), Value, Value);
- }
- else if (m_AudioSetting)
- {
- bRes = m_AudioIniFile->GetNumber(Section(), m_KeyName.c_str(), Value, Value);
- }
- else
- {
- bRes = m_SettingsIniFile->GetNumber(Section(), m_KeyName.c_str(), Value, Value);
- }
- if (!bRes)
+ if (!Load(Value))
{
LoadDefault(Index, Value);
- }
- return bRes;
+ return false;
+ }
+ return true;
}
bool CSettingTypeRomDatabase::Load(uint32_t Index, std::string & Value) const
@@ -211,13 +221,7 @@ void CSettingTypeRomDatabase::LoadDefault(uint32_t /*Index*/, uint32_t & Value)
{
if (m_DefaultSetting != Default_None)
{
- if (m_DefaultSetting == Default_Constant)
- {
- Value = m_DefaultValue;
- }
- else {
- g_Settings->LoadDword(m_DefaultSetting, Value);
- }
+ Value = m_DefaultSetting == Default_Constant ? m_DefaultValue : g_Settings->LoadDword(m_DefaultSetting);
}
}
diff --git a/Source/Project64-core/Settings/SettingType/SettingsType-RomDatabase.h b/Source/Project64-core/Settings/SettingType/SettingsType-RomDatabase.h
index 21ed7f663..b97845731 100644
--- a/Source/Project64-core/Settings/SettingType/SettingsType-RomDatabase.h
+++ b/Source/Project64-core/Settings/SettingType/SettingsType-RomDatabase.h
@@ -76,4 +76,6 @@ private:
CSettingTypeRomDatabase(); // Disable default constructor
CSettingTypeRomDatabase(const CSettingTypeRomDatabase&); // Disable copy constructor
CSettingTypeRomDatabase& operator=(const CSettingTypeRomDatabase&); // Disable assignment
+
+ bool Load(uint32_t & Value) const;
};
diff --git a/Source/Project64-core/Settings/SettingsID.h b/Source/Project64-core/Settings/SettingsID.h
index dfb1bcdde..af221c4d7 100644
--- a/Source/Project64-core/Settings/SettingsID.h
+++ b/Source/Project64-core/Settings/SettingsID.h
@@ -61,6 +61,17 @@ enum SettingID
Setting_CurrentLanguage,
Setting_EnableDisk,
+ //Default Settings
+ Default_RDRamSize,
+ Default_UseHleGfx,
+ Default_UseTlb,
+ Default_ViRefreshRate,
+ Default_AiCountPerBytes,
+ Default_CounterFactor,
+ Default_32Bit,
+ Default_SyncViaAudio,
+ Default_FixedAudio,
+
//RDB Settings
Rdb_GoodName,
Rdb_SaveChip,
diff --git a/Source/Project64/Project64.vcxproj b/Source/Project64/Project64.vcxproj
index 1e7962529..3127a0965 100644
--- a/Source/Project64/Project64.vcxproj
+++ b/Source/Project64/Project64.vcxproj
@@ -111,6 +111,7 @@
+
@@ -174,6 +175,7 @@
+
diff --git a/Source/Project64/Project64.vcxproj.filters b/Source/Project64/Project64.vcxproj.filters
index 3e07a311c..4b3fb4c71 100644
--- a/Source/Project64/Project64.vcxproj.filters
+++ b/Source/Project64/Project64.vcxproj.filters
@@ -216,6 +216,9 @@
Source Files
+
+ Source Files\User Interface Source\Settings Source
+
@@ -413,6 +416,9 @@
Header Files
+
+ Header Files\User Interface Headers\Settings Header
+
diff --git a/Source/Project64/UserInterface/Settings/SettingsPage-AdvancedOptions.h b/Source/Project64/UserInterface/Settings/SettingsPage-AdvancedOptions.h
index 4c8cd3084..130ad04d0 100644
--- a/Source/Project64/UserInterface/Settings/SettingsPage-AdvancedOptions.h
+++ b/Source/Project64/UserInterface/Settings/SettingsPage-AdvancedOptions.h
@@ -27,7 +27,6 @@ class CAdvancedOptionsPage :
COMMAND_ID_HANDLER_EX(IDC_SELECT_IPL_DIR, SelectIplDir)
COMMAND_HANDLER_EX(IDC_IPL_DIR, EN_UPDATE, IplDirChanged)
COMMAND_HANDLER_EX(IDC_FRAME_DISPLAY_TYPE,LBN_SELCHANGE,ComboBoxChanged)
-
END_MSG_MAP()
enum { IDD = IDD_Settings_Advanced };
@@ -35,12 +34,12 @@ class CAdvancedOptionsPage :
public:
CAdvancedOptionsPage(HWND hParent, const RECT & rcDispay );
- LanguageStringID PageTitle ( void ) { return TAB_ADVANCED; }
- void HidePage ( void );
- void ShowPage ( void );
- void ApplySettings ( bool UpdateScreen );
- bool EnableReset ( void );
- void ResetPage ( void );
+ LanguageStringID PageTitle ( void ) { return TAB_ADVANCED; }
+ void HidePage ( void );
+ void ShowPage ( void );
+ void ApplySettings ( bool UpdateScreen );
+ bool EnableReset ( void );
+ void ResetPage ( void );
private:
void SelectIplDir(UINT Code, int id, HWND ctl);
diff --git a/Source/Project64/UserInterface/Settings/SettingsPage-Defaults.cpp b/Source/Project64/UserInterface/Settings/SettingsPage-Defaults.cpp
new file mode 100644
index 000000000..bb082f785
--- /dev/null
+++ b/Source/Project64/UserInterface/Settings/SettingsPage-Defaults.cpp
@@ -0,0 +1,98 @@
+/****************************************************************************
+* *
+* Project64 - A Nintendo 64 emulator. *
+* http://www.pj64-emu.com/ *
+* Copyright (C) 2012 Project64. All rights reserved. *
+* *
+* License: *
+* GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html *
+* *
+****************************************************************************/
+#include "stdafx.h"
+#include "SettingsPage.h"
+
+CDefaultsOptionsPage::CDefaultsOptionsPage(HWND hParent, const RECT & rcDispay)
+{
+ if (!Create(hParent, rcDispay))
+ {
+ return;
+ }
+ UpdatePageSettings();
+
+ SetDlgItemTextW(m_hWnd, IDC_MEMORY_SIZE_TEXT, wGS(ROM_MEM_SIZE).c_str());
+ SetDlgItemTextW(m_hWnd, IDC_HLE_GFX, wGS(PLUG_HLE_GFX).c_str());
+ SetDlgItemTextW(m_hWnd, IDC_USE_TLB, wGS(ROM_USE_TLB).c_str());
+ SetDlgItemTextW(m_hWnd, IDC_VIREFESH_TEXT, wGS(ROM_VIREFRESH).c_str());
+ SetDlgItemTextW(m_hWnd, IDC_COUNTPERBYTE_TEXT, wGS(ROM_COUNTPERBYTE).c_str());
+ SetDlgItemTextW(m_hWnd, IDC_COUNTFACT_TEXT, wGS(ROM_COUNTER_FACTOR).c_str());
+ SetDlgItemTextW(m_hWnd, IDC_ROM_32BIT, wGS(ROM_32BIT).c_str());
+ SetDlgItemTextW(m_hWnd, IDC_ROM_FIXEDAUDIO, wGS(ROM_FIXED_AUDIO).c_str());
+ SetDlgItemTextW(m_hWnd, IDC_SYNC_AUDIO, wGS(ROM_SYNC_AUDIO).c_str());
+
+ CModifiedComboBox * ComboBox;
+ ComboBox = AddModComboBox(GetDlgItem(IDC_RDRAM_SIZE), Default_RDRamSize);
+ if (ComboBox)
+ {
+ ComboBox->SetTextField(GetDlgItem(IDC_MEMORY_SIZE_TEXT));
+ ComboBox->AddItemW(wGS(RDRAM_4MB).c_str(), 0x400000);
+ ComboBox->AddItemW(wGS(RDRAM_8MB).c_str(), 0x800000);
+ }
+
+ ComboBox = AddModComboBox(GetDlgItem(IDC_COUNTFACT), Default_CounterFactor);
+ if (ComboBox)
+ {
+ ComboBox->SetTextField(GetDlgItem(IDC_COUNTFACT_TEXT));
+ ComboBox->AddItemW(wGS(NUMBER_1).c_str(), 1);
+ ComboBox->AddItemW(wGS(NUMBER_2).c_str(), 2);
+ ComboBox->AddItemW(wGS(NUMBER_3).c_str(), 3);
+ ComboBox->AddItemW(wGS(NUMBER_4).c_str(), 4);
+ ComboBox->AddItemW(wGS(NUMBER_5).c_str(), 5);
+ ComboBox->AddItemW(wGS(NUMBER_6).c_str(), 6);
+ }
+
+ CModifiedEditBox * TxtBox = AddModTextBox(GetDlgItem(IDC_VIREFRESH), Default_ViRefreshRate, false);
+ TxtBox->SetTextField(GetDlgItem(IDC_VIREFESH_TEXT));
+ TxtBox = AddModTextBox(GetDlgItem(IDC_COUNTPERBYTE), Default_AiCountPerBytes, false);
+ TxtBox->SetTextField(GetDlgItem(IDC_COUNTPERBYTE_TEXT));
+
+ AddModCheckBox(GetDlgItem(IDC_HLE_GFX), Default_UseHleGfx);
+ AddModCheckBox(GetDlgItem(IDC_USE_TLB), Default_UseTlb);
+ AddModCheckBox(GetDlgItem(IDC_ROM_32BIT), Default_32Bit);
+ AddModCheckBox(GetDlgItem(IDC_SYNC_AUDIO), Default_SyncViaAudio);
+ AddModCheckBox(GetDlgItem(IDC_ROM_FIXEDAUDIO), Default_FixedAudio);
+
+ UpdatePageSettings();
+}
+
+void CDefaultsOptionsPage::HidePage()
+{
+ ShowWindow(SW_HIDE);
+}
+
+void CDefaultsOptionsPage::ShowPage()
+{
+ ShowWindow(SW_SHOW);
+}
+
+void CDefaultsOptionsPage::ApplySettings(bool UpdateScreen)
+{
+ CSettingsPageImpl::ApplySettings(UpdateScreen);
+}
+
+bool CDefaultsOptionsPage::EnableReset(void)
+{
+ if (CSettingsPageImpl::EnableReset()) { return true; }
+ return false;
+}
+
+void CDefaultsOptionsPage::ResetPage()
+{
+ CSettingsPageImpl::ResetPage();
+}
+
+void CDefaultsOptionsPage::UpdatePageSettings(void)
+{
+ m_InUpdateSettings = true;
+ CSettingsPageImpl::UpdatePageSettings();
+ m_InUpdateSettings = false;
+}
\ No newline at end of file
diff --git a/Source/Project64/UserInterface/Settings/SettingsPage-Defaults.h b/Source/Project64/UserInterface/Settings/SettingsPage-Defaults.h
new file mode 100644
index 000000000..0e2877ff5
--- /dev/null
+++ b/Source/Project64/UserInterface/Settings/SettingsPage-Defaults.h
@@ -0,0 +1,46 @@
+/****************************************************************************
+* *
+* Project64 - A Nintendo 64 emulator. *
+* http://www.pj64-emu.com/ *
+* Copyright (C) 2012 Project64. All rights reserved. *
+* *
+* License: *
+* GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html *
+* *
+****************************************************************************/
+#pragma once
+
+class CDefaultsOptionsPage :
+ public CSettingsPageImpl,
+ public CSettingsPage
+{
+ BEGIN_MSG_MAP_EX(CDefaultsOptionsPage)
+ COMMAND_ID_HANDLER_EX(IDC_HLE_GFX, CheckBoxChanged)
+ COMMAND_ID_HANDLER_EX(IDC_USE_TLB, CheckBoxChanged)
+ COMMAND_ID_HANDLER_EX(IDC_ROM_32BIT, CheckBoxChanged)
+ COMMAND_ID_HANDLER_EX(IDC_SYNC_AUDIO, CheckBoxChanged)
+ COMMAND_ID_HANDLER_EX(IDC_ROM_FIXEDAUDIO, 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)
+ COMMAND_HANDLER_EX(IDC_COUNTPERBYTE, EN_UPDATE, EditBoxChanged)
+ COMMAND_HANDLER_EX(IDC_RDRAM_SIZE, EN_UPDATE, EditBoxChanged)
+ END_MSG_MAP()
+
+ enum { IDD = IDD_Settings_Defaults };
+
+public:
+ CDefaultsOptionsPage(HWND hParent, const RECT & rcDispay );
+
+ LanguageStringID PageTitle ( void ) { return TAB_DEFAULTS; }
+ void HidePage ( void );
+ void ShowPage ( void );
+ void ApplySettings ( bool UpdateScreen );
+ bool EnableReset ( void );
+ void ResetPage ( void );
+
+private:
+ void UpdatePageSettings(void);
+
+ bool m_InUpdateSettings;
+};
diff --git a/Source/Project64/UserInterface/Settings/SettingsPage-Game-General.h b/Source/Project64/UserInterface/Settings/SettingsPage-Game-General.h
index eb08d247c..d4c1a16f7 100644
--- a/Source/Project64/UserInterface/Settings/SettingsPage-Game-General.h
+++ b/Source/Project64/UserInterface/Settings/SettingsPage-Game-General.h
@@ -31,7 +31,7 @@ class CGameGeneralPage :
COMMAND_HANDLER_EX(IDC_VIREFRESH, EN_UPDATE, EditBoxChanged)
COMMAND_HANDLER_EX(IDC_COUNTPERBYTE, EN_UPDATE, EditBoxChanged)
COMMAND_HANDLER_EX(IDC_OVER_CLOCK_MODIFIER, EN_UPDATE, EditBoxChanged)
- END_MSG_MAP()
+ END_MSG_MAP()
enum { IDD = IDD_Settings_GameGeneral };
diff --git a/Source/Project64/UserInterface/Settings/SettingsPage.h b/Source/Project64/UserInterface/Settings/SettingsPage.h
index 1c39307e6..95011381a 100644
--- a/Source/Project64/UserInterface/Settings/SettingsPage.h
+++ b/Source/Project64/UserInterface/Settings/SettingsPage.h
@@ -582,6 +582,7 @@ public:
};
#include "SettingsPage-AdvancedOptions.h"
+#include "SettingsPage-Defaults.h"
#include "SettingsPage-Directories.h"
#include "SettingsPage-Game-General.h"
#include "SettingsPage-Game-Plugin.h"
diff --git a/Source/Project64/UserInterface/SettingsConfig.cpp b/Source/Project64/UserInterface/SettingsConfig.cpp
index ee642b629..1b45c2375 100644
--- a/Source/Project64/UserInterface/SettingsConfig.cpp
+++ b/Source/Project64/UserInterface/SettingsConfig.cpp
@@ -8,6 +8,7 @@ CSettingConfig::CSettingConfig(bool bJustGameSetting /* = false */) :
m_CurrentPage(NULL),
m_GeneralOptionsPage(NULL),
m_AdvancedPage(NULL),
+ m_DefaultsPage(NULL),
m_GameConfig(bJustGameSetting)
{
}
@@ -55,7 +56,7 @@ bool CSettingConfig::UpdateAdvanced(bool AdvancedMode, HTREEITEM hItem)
while (hItem)
{
CSettingsPage * Page = (CSettingsPage *)m_PagesTreeList.GetItemData(hItem);
- if (!AdvancedMode && Page == m_AdvancedPage)
+ if (!AdvancedMode && (Page == m_AdvancedPage || Page == m_DefaultsPage))
{
m_PagesTreeList.DeleteItem(hItem);
return true;
@@ -63,6 +64,7 @@ bool CSettingConfig::UpdateAdvanced(bool AdvancedMode, HTREEITEM hItem)
if (AdvancedMode && Page == m_GeneralOptionsPage)
{
m_PagesTreeList.InsertItemW(TVIF_TEXT | TVIF_PARAM, wGS(m_AdvancedPage->PageTitle()).c_str(), 0, 0, 0, 0, (ULONG)m_AdvancedPage, hItem, TVI_FIRST);
+ m_PagesTreeList.InsertItemW(TVIF_TEXT | TVIF_PARAM, wGS(m_DefaultsPage->PageTitle()).c_str(), 0, 0, 0, 0, (ULONG)m_DefaultsPage, hItem, TVI_FIRST);
return true;
}
if (UpdateAdvanced(AdvancedMode, m_PagesTreeList.GetChildItem(hItem)))
@@ -127,10 +129,12 @@ LRESULT CSettingConfig::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*
m_GeneralOptionsPage = new CGeneralOptionsPage(this, this->m_hWnd, rcSettingInfo);
m_AdvancedPage = new CAdvancedOptionsPage(this->m_hWnd, rcSettingInfo);
+ m_DefaultsPage = new CDefaultsOptionsPage(this->m_hWnd, rcSettingInfo);
SettingsSection = new CConfigSettingSection(wGS(TAB_OPTIONS).c_str());
SettingsSection->AddPage(m_GeneralOptionsPage);
SettingsSection->AddPage(m_AdvancedPage);
+ SettingsSection->AddPage(m_DefaultsPage);
SettingsSection->AddPage(new COptionsDirectoriesPage(this->m_hWnd, rcSettingInfo));
m_Sections.push_back(SettingsSection);
@@ -177,7 +181,7 @@ LRESULT CSettingConfig::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*
for (size_t i = 0; i < Section->GetPageCount(); i++)
{
CSettingsPage * Page = Section->GetPage(i);
- if (HideAdvanced && Page == m_AdvancedPage)
+ if (HideAdvanced && (Page == m_AdvancedPage || Page == m_DefaultsPage))
{
continue;
}
diff --git a/Source/Project64/UserInterface/SettingsConfig.h b/Source/Project64/UserInterface/SettingsConfig.h
index 02a005787..1717c5994 100644
--- a/Source/Project64/UserInterface/SettingsConfig.h
+++ b/Source/Project64/UserInterface/SettingsConfig.h
@@ -40,6 +40,6 @@ private:
CTreeViewCtrl m_PagesTreeList;
SETTING_SECTIONS m_Sections;
- CSettingsPage * m_CurrentPage, *m_GeneralOptionsPage, *m_AdvancedPage;
+ CSettingsPage * m_CurrentPage, *m_GeneralOptionsPage, *m_AdvancedPage, *m_DefaultsPage;
bool m_GameConfig;
};
diff --git a/Source/Project64/UserInterface/UIResources.rc b/Source/Project64/UserInterface/UIResources.rc
index 2badf997c..bbf840a83 100644
--- a/Source/Project64/UserInterface/UIResources.rc
+++ b/Source/Project64/UserInterface/UIResources.rc
@@ -1256,6 +1256,26 @@ BEGIN
EDITTEXT IDC_DD48_EDIT,87,226,39,10,ES_UPPERCASE | ES_AUTOHSCROLL,WS_EX_RIGHT
END
+IDD_Settings_Defaults DIALOGEX 0, 0, 218, 169
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
+EXSTYLE WS_EX_CONTROLPARENT
+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
+END
+
/////////////////////////////////////////////////////////////////////////////
//
@@ -1669,6 +1689,14 @@ BEGIN
TOPMARGIN, 7
BOTTOMMARGIN, 219
END
+
+ IDD_Settings_Defaults, DIALOG
+ BEGIN
+ LEFTMARGIN, 4
+ RIGHTMARGIN, 216
+ TOPMARGIN, 4
+ BOTTOMMARGIN, 163
+ END
END
#endif // APSTUDIO_INVOKED
@@ -1848,6 +1876,11 @@ BEGIN
0, 0, 0, 0
END
+IDD_Settings_Defaults AFX_DIALOG_LAYOUT
+BEGIN
+ 0
+END
+
/////////////////////////////////////////////////////////////////////////////
//
diff --git a/Source/Project64/UserInterface/resource.h b/Source/Project64/UserInterface/resource.h
index e87e9232a..7135613b4 100644
--- a/Source/Project64/UserInterface/resource.h
+++ b/Source/Project64/UserInterface/resource.h
@@ -72,6 +72,7 @@
#define IDD_Debugger_RegRDRAM 198
#define IDD_Debugger_RegVI 199
#define IDD_Debugger_RegDD 200
+#define IDD_Settings_Defaults 201
#define IDC_MENU_ITEM_TEXT 1000
#define IDC_CLOSE_BUTTON 1001
#define IDC_LIST2 1003
@@ -637,7 +638,7 @@
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 194
+#define _APS_NEXT_RESOURCE_VALUE 195
#define _APS_NEXT_COMMAND_VALUE 40043
#define _APS_NEXT_CONTROL_VALUE 1445
#define _APS_NEXT_SYMED_VALUE 102
diff --git a/changes.txt b/changes.txt
index 21fc3604f..2e34fc04b 100644
--- a/changes.txt
+++ b/changes.txt
@@ -10,3 +10,4 @@ Windows 2.4
- Add Shygoo's debugger code
- New audio plugin
- large address aware
+- Ability to change defaults