[Project64] Add UI for Over clock configuration

This commit is contained in:
zilmar 2017-06-15 21:09:49 +10:00
parent 7270ac5463
commit 4b93a188b7
13 changed files with 109 additions and 51 deletions

View File

@ -321,6 +321,7 @@ enum LanguageStringID
ROM_COUNTPERBYTE = 537,
ROM_32BIT = 538,
ROM_DELAY_DP = 539,
ROM_OVER_CLOCK_MODIFIER = 5400,
//Core Styles
CORE_INTERPTER = 540,
@ -535,7 +536,7 @@ enum LanguageStringID
MSG_DEL_TITLE = 2042,
MSG_CHEAT_NAME_IN_USE = 2043,
MSG_MAX_CHEATS = 2044,
MSG_PLUGIN_INIT = 2045,
MSG_PLUGIN_INIT = 2045,
MSG_NO_SHORTCUT_SEL = 2046,
MSG_NO_MENUITEM_SEL = 2047,
MSG_MENUITEM_ASSIGNED = 2048,
@ -591,7 +592,7 @@ enum LanguageStringID
ANDROID_MENU_DUMPFUNCTIONTIMES = 3113,
//Video plugin
ANDROID_VIDEO_NATIVE_RES = 3200,
ANDROID_VIDEO_NATIVE_RES = 3200,
};
#include "Multilanguage/LanguageClass.h"

View File

@ -289,6 +289,7 @@ void CLanguage::LoadDefaultStrings(void)
DEF_STR(ROM_COUNTPERBYTE, "AI count per byte:");
DEF_STR(ROM_32BIT, "32-bit engine:");
DEF_STR(ROM_DELAY_DP, "Delay DP interrupt:");
DEF_STR(ROM_OVER_CLOCK_MODIFIER, "Over Clock Modifier:");
//Core Styles
DEF_STR(CORE_INTERPTER, "Interpreter");
@ -822,4 +823,4 @@ const std::wstring wGS(LanguageStringID StringID)
{
return stdstr(g_Lang->GetString(StringID)).ToUTF16();
}
#endif
#endif

View File

@ -44,7 +44,7 @@ void CSystemTimer::Reset()
void CSystemTimer::SetTimer(TimerType Type, uint32_t Cycles, bool bRelative)
{
Cycles *= 4;
Cycles *= CGameSettings::OverClockModifier();
if (Type >= MaxTimer || Type == UnknownTimer)
{
g_Notify->BreakPoint(__FILE__, __LINE__);
@ -91,7 +91,7 @@ uint32_t CSystemTimer::GetTimer(TimerType Type)
{
return 0x7FFFFFFF;
}
return (uint32_t)(CyclesToTimer / 4);
return (uint32_t)(CyclesToTimer / CGameSettings::OverClockModifier());
}
void CSystemTimer::StopTimer(TimerType Type)
@ -168,7 +168,7 @@ void CSystemTimer::UpdateTimers()
{
int32_t random, wired;
m_LastUpdate = m_NextTimer;
m_Reg.COUNT_REGISTER += TimeTaken;
m_Reg.COUNT_REGISTER += (TimeTaken / CGameSettings::OverClockModifier());
random = m_Reg.RANDOM_REGISTER - (TimeTaken / g_System->CountPerOp());
wired = m_Reg.WIRED_REGISTER;
if (random < wired)

View File

@ -13,30 +13,31 @@
#include <Project64-core/N64System/N64Class.h>
#include <Project64-core/Settings/GameSettings.h>
bool CGameSettings::m_bSMM_StoreInstruc;
bool CGameSettings::m_bSMM_Protect;
bool CGameSettings::m_bSMM_ValidFunc;
bool CGameSettings::m_bSMM_PIDMA;
bool CGameSettings::m_bSMM_TLB;
bool CGameSettings::m_bUseTlb;
bool CGameSettings::m_bSMM_StoreInstruc;
bool CGameSettings::m_bSMM_Protect;
bool CGameSettings::m_bSMM_ValidFunc;
bool CGameSettings::m_bSMM_PIDMA;
bool CGameSettings::m_bSMM_TLB;
bool CGameSettings::m_bUseTlb;
uint32_t CGameSettings::m_CountPerOp = 2;
uint32_t CGameSettings::m_ViRefreshRate = 1500;
uint32_t CGameSettings::m_AiCountPerBytes = 500;
bool CGameSettings::m_DelayDP = false;
bool CGameSettings::m_DelaySI = false;
bool CGameSettings::m_DelayDP = false;
bool CGameSettings::m_DelaySI = false;
uint32_t CGameSettings::m_RdramSize = 0;
bool CGameSettings::m_bFixedAudio = true;
bool CGameSettings::m_bSyncingToAudio = true;
bool CGameSettings::m_bSyncToAudio = true;
bool CGameSettings::m_bFastSP = true;
bool CGameSettings::m_b32Bit = true;
bool CGameSettings::m_RspAudioSignal;
bool CGameSettings::m_bRomInMemory;
bool CGameSettings::m_RegCaching;
bool CGameSettings::m_bLinkBlocks;
bool CGameSettings::m_bFixedAudio = true;
bool CGameSettings::m_bSyncingToAudio = true;
bool CGameSettings::m_bSyncToAudio = true;
bool CGameSettings::m_bFastSP = true;
bool CGameSettings::m_b32Bit = true;
bool CGameSettings::m_RspAudioSignal;
bool CGameSettings::m_bRomInMemory;
bool CGameSettings::m_RegCaching;
bool CGameSettings::m_bLinkBlocks;
uint32_t CGameSettings::m_LookUpMode; //FUNC_LOOKUP_METHOD
SYSTEM_TYPE CGameSettings::m_SystemType = SYSTEM_NTSC;
CPU_TYPE CGameSettings::m_CpuType = CPU_Recompiler;
uint32_t CGameSettings::m_OverClockModifier = 1;
void CGameSettings::RefreshGameSettings()
{
@ -68,12 +69,14 @@ void CGameSettings::RefreshGameSettings()
m_LookUpMode = g_Settings->LoadDword(Game_FuncLookupMode);
m_SystemType = (SYSTEM_TYPE)g_Settings->LoadDword(Game_SystemType);
m_CpuType = (CPU_TYPE)g_Settings->LoadDword(Game_CpuType);
m_OverClockModifier = g_Settings->LoadDword(Game_OverClockModifier);
m_bSyncingToAudio = m_bSyncToAudio;
if (m_CountPerOp == 0)
{
m_CountPerOp = 2;
}
if (m_OverClockModifier < 1) { m_OverClockModifier = 1; }
if (m_OverClockModifier > 20) { m_OverClockModifier = 20; }
WriteTrace(TraceN64System, TraceDebug, "Done");
}

View File

@ -40,6 +40,7 @@ public:
inline static bool bSMM_TLB(void) { return m_bSMM_TLB; }
inline static SYSTEM_TYPE SystemType(void) { return m_SystemType; }
inline static CPU_TYPE CpuType(void) { return m_CpuType; }
inline static uint32_t OverClockModifier(void) { return m_OverClockModifier; }
protected:
static void SpeedChanged(int32_t SpeedLimit);
@ -50,24 +51,25 @@ private:
static bool m_RegCaching;
static bool m_bLinkBlocks;
static uint32_t m_LookUpMode; //FUNC_LOOKUP_METHOD
static bool m_bUseTlb;
static bool m_bUseTlb;
static uint32_t m_CountPerOp;
static uint32_t m_ViRefreshRate;
static uint32_t m_AiCountPerBytes;
static bool m_DelayDP;
static bool m_DelaySI;
static bool m_DelayDP;
static bool m_DelaySI;
static uint32_t m_RdramSize;
static bool m_bFixedAudio;
static bool m_bSyncingToAudio;
static bool m_bSyncToAudio;
static bool m_bFastSP;
static bool m_b32Bit;
static bool m_RspAudioSignal;
static bool m_bSMM_StoreInstruc;
static bool m_bSMM_Protect;
static bool m_bSMM_ValidFunc;
static bool m_bSMM_PIDMA;
static bool m_bSMM_TLB;
static bool m_bFixedAudio;
static bool m_bSyncingToAudio;
static bool m_bSyncToAudio;
static bool m_bFastSP;
static bool m_b32Bit;
static bool m_RspAudioSignal;
static bool m_bSMM_StoreInstruc;
static bool m_bSMM_Protect;
static bool m_bSMM_ValidFunc;
static bool m_bSMM_PIDMA;
static bool m_bSMM_TLB;
static SYSTEM_TYPE m_SystemType;
static CPU_TYPE m_CpuType;
static uint32_t m_OverClockModifier;
};

View File

@ -94,6 +94,7 @@ enum SettingID
Rdb_AudioResetOnLoad,
Rdb_AllowROMWrites,
Rdb_CRC_Recalc,
Rdb_OverClockModifier,
//Individual Game Settings
Game_IniKey,
@ -147,6 +148,7 @@ enum SettingID
Game_Transferpak_ROM,
Game_Transferpak_Sav,
Game_LoadSaveAtStart,
Game_OverClockModifier,
// General Game running info
GameRunning_LoadingInProgress,

View File

@ -164,6 +164,7 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory)
AddHandler(Rdb_AudioResetOnLoad, new CSettingTypeRDBYesNo("AudioResetOnLoad", false));
AddHandler(Rdb_AllowROMWrites, new CSettingTypeRDBYesNo("AllowROMWrites", false));
AddHandler(Rdb_CRC_Recalc, new CSettingTypeRDBYesNo("CRC-Recalc", false));
AddHandler(Rdb_OverClockModifier, new CSettingTypeRomDatabase("OverClockModifier", 1));
AddHandler(Game_IniKey, new CSettingTypeTempString(""));
AddHandler(Game_File, new CSettingTypeTempString(""));
@ -220,6 +221,7 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory)
AddHandler(Game_Transferpak_ROM, new CSettingTypeGame("Tpak-ROM-dir", Default_None));
AddHandler(Game_Transferpak_Sav, new CSettingTypeGame("Tpak-Sav-dir", Default_None));
AddHandler(Game_LoadSaveAtStart, new CSettingTypeTempBool(false));
AddHandler(Game_OverClockModifier, new CSettingTypeGame("OverClockModifier", Rdb_OverClockModifier));
//User Interface
AddHandler(UserInterface_ShowCPUPer, new CSettingTypeApplication("", "Display CPU Usage", (uint32_t)false));

View File

@ -151,11 +151,22 @@
<ItemGroup>
<None Include="res\divider.cur" />
<None Include="res\hand.cur" />
<None Include="UserInterface\Icons\divider.cur" />
<None Include="UserInterface\Icons\hand.cur" />
</ItemGroup>
<ItemGroup>
<Image Include="res\ListItems.bmp" />
<Image Include="UserInterface\Bitmaps\AboutScreenLogo.bmp" />
<Image Include="UserInterface\Bitmaps\ListItems.bmp" />
<Image Include="UserInterface\Bitmaps\tri-state.bmp" />
<Image Include="UserInterface\Icons\left.ico" />
<Image Include="UserInterface\Icons\PJ64.ICO" />
<Image Include="UserInterface\Icons\right.ico" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="UserInterface\UIResources.rc" />
</ItemGroup>
<ItemGroup>
<Manifest Include="Project64.exe.manifest" />
</ItemGroup>
</Project>

View File

@ -313,15 +313,42 @@
<None Include="res\hand.cur">
<Filter>Resource Files</Filter>
</None>
<None Include="UserInterface\Icons\divider.cur">
<Filter>Resource Files</Filter>
</None>
<None Include="UserInterface\Icons\hand.cur">
<Filter>Resource Files</Filter>
</None>
</ItemGroup>
<ItemGroup>
<Image Include="res\ListItems.bmp">
<Filter>Resource Files</Filter>
</Image>
<Image Include="UserInterface\Icons\PJ64.ICO">
<Filter>Resource Files</Filter>
</Image>
<Image Include="UserInterface\Icons\right.ico">
<Filter>Resource Files</Filter>
</Image>
<Image Include="UserInterface\Icons\left.ico">
<Filter>Resource Files</Filter>
</Image>
<Image Include="UserInterface\Bitmaps\tri-state.bmp">
<Filter>Resource Files</Filter>
</Image>
<Image Include="UserInterface\Bitmaps\ListItems.bmp">
<Filter>Resource Files</Filter>
</Image>
<Image Include="UserInterface\Bitmaps\AboutScreenLogo.bmp">
<Filter>Resource Files</Filter>
</Image>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="UserInterface\UIResources.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<Manifest Include="Project64.exe.manifest" />
</ItemGroup>
</Project>

View File

@ -28,6 +28,7 @@ CGameGeneralPage::CGameGeneralPage(HWND hParent, const RECT & rcDispay)
SetDlgItemTextW(m_hWnd, IDC_COUNTFACT_TEXT, wGS(ROM_COUNTER_FACTOR).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_OVER_CLOCK_MODIFIER_TEXT, wGS(ROM_OVER_CLOCK_MODIFIER).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());
@ -85,6 +86,9 @@ CGameGeneralPage::CGameGeneralPage(HWND hParent, const RECT & rcDispay)
TxtBox = AddModTextBox(GetDlgItem(IDC_COUNTPERBYTE), Game_AiCountPerBytes, false);
TxtBox->SetTextField(GetDlgItem(IDC_COUNTPERBYTE_TEXT));
TxtBox = AddModTextBox(GetDlgItem(IDC_OVER_CLOCK_MODIFIER), Game_OverClockModifier, false);
TxtBox->SetTextField(GetDlgItem(IDC_OVER_CLOCK_MODIFIER_TEXT));
UpdatePageSettings();
}
@ -112,4 +116,4 @@ bool CGameGeneralPage::EnableReset(void)
void CGameGeneralPage::ResetPage()
{
CSettingsPageImpl<CGameGeneralPage>::ResetPage();
}
}

View File

@ -30,7 +30,8 @@ class CGameGeneralPage :
COMMAND_ID_HANDLER_EX(IDC_AUDIO_SIGNAL, CheckBoxChanged)
COMMAND_HANDLER_EX(IDC_VIREFRESH, EN_UPDATE, EditBoxChanged)
COMMAND_HANDLER_EX(IDC_COUNTPERBYTE, EN_UPDATE, EditBoxChanged)
END_MSG_MAP()
COMMAND_HANDLER_EX(IDC_OVER_CLOCK_MODIFIER, EN_UPDATE, EditBoxChanged)
END_MSG_MAP()
enum { IDD = IDD_Settings_GameGeneral };

View File

@ -194,7 +194,7 @@ BEGIN
EDITTEXT IDC_INFO_MD5,77,59,153,13,ES_AUTOHSCROLL | ES_READONLY,WS_EX_CLIENTEDGE | WS_EX_STATICEDGE
END
IDD_Settings_GameGeneral DIALOGEX 0, 0, 218, 158
IDD_Settings_GameGeneral DIALOGEX 0, 0, 218, 169
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
@ -212,14 +212,16 @@ BEGIN
EDITTEXT IDC_VIREFRESH,102,75,109,12,ES_AUTOHSCROLL | ES_NUMBER
LTEXT "AI Count Per Byte:",IDC_COUNTPERBYTE_TEXT,6,90,91,10
EDITTEXT IDC_COUNTPERBYTE,102,88,109,12,ES_AUTOHSCROLL | ES_NUMBER
CONTROL "",IDC_STATIC,"Static",SS_BLACKFRAME | SS_SUNKEN,3,103,208,1
CONTROL "32 Bit Engine",IDC_ROM_32BIT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,107,91,10
CONTROL "Use TLB",IDC_USE_TLB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,102,107,91,10
CONTROL "Fixed Audio Timing",IDC_ROM_FIXEDAUDIO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,118,91,10
CONTROL "Sync using Audio",IDC_SYNC_AUDIO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,102,118,91,10
CONTROL "Delay DP Interrupt",IDC_DELAY_DP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,129,91,10
CONTROL "Delay SI Interrupt",IDC_DELAY_SI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,102,129,91,10
CONTROL "RSP Audio Signal",IDC_AUDIO_SIGNAL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,140,91,10
LTEXT "Over Clock Modifier",IDC_OVER_CLOCK_MODIFIER_TEXT,6,103,91,10
EDITTEXT IDC_OVER_CLOCK_MODIFIER,102,101,109,12,ES_AUTOHSCROLL | ES_NUMBER
CONTROL "",IDC_STATIC,"Static",SS_BLACKFRAME | SS_SUNKEN,3,116,208,1
CONTROL "32 Bit Engine",IDC_ROM_32BIT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,121,91,10
CONTROL "Use TLB",IDC_USE_TLB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,102,121,91,10
CONTROL "Fixed Audio Timing",IDC_ROM_FIXEDAUDIO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,132,91,10
CONTROL "Sync using Audio",IDC_SYNC_AUDIO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,102,132,91,10
CONTROL "Delay DP Interrupt",IDC_DELAY_DP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,143,91,10
CONTROL "Delay SI Interrupt",IDC_DELAY_SI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,102,143,91,10
CONTROL "RSP Audio Signal",IDC_AUDIO_SIGNAL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,154,91,10
END
IDD_Settings_Accelerator DIALOGEX 0, 0, 218, 183
@ -716,7 +718,7 @@ BEGIN
LEFTMARGIN, 4
RIGHTMARGIN, 216
TOPMARGIN, 4
BOTTOMMARGIN, 152
BOTTOMMARGIN, 163
END
IDD_Settings_Accelerator, DIALOG

View File

@ -244,11 +244,13 @@
#define IDC_DIR_FRAME1 1101
#define IDC_ROM_FASTSP 1101
#define IDC_INFO 1101
#define IDC_OVER_CLOCK_MODIFIER_TEXT 1101
#define IDC_AUDIO_SIGNAL 1102
#define IDC_DIR_TEXTURE_FRAME 1102
#define IDC_ENTER_CODE 1102
#define IDC_DESCRIPTION 1102
#define IDC_DIR_FRAME3 1103
#define IDC_OVER_CLOCK_MODIFIER 1103
#define IDC_DIR_FRAME4 1104
#define IDC_DIR_FRAME5 1105
#define IDC_MAXROMS_TXT 1111
@ -354,7 +356,7 @@
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 152
#define _APS_NEXT_RESOURCE_VALUE 153
#define _APS_NEXT_COMMAND_VALUE 40009
#define _APS_NEXT_CONTROL_VALUE 1104
#define _APS_NEXT_SYMED_VALUE 101