Split the Exclusive Refresh Rate in to 2 settings

This commit is contained in:
mkwong98 2021-07-14 16:08:34 +08:00
parent 4e07e8481c
commit 708a13b1c7
10 changed files with 1979 additions and 1911 deletions

View file

@ -698,6 +698,7 @@ private:
bool _spritesEnabled = true;
uint32_t _screenRotation = 0;
uint32_t _exclusiveRefreshRate = 60;
uint32_t _exclusiveRefreshRate2 = 50;
ConsoleType _consoleType = ConsoleType::Nes;
ExpansionPortDevice _expansionDevice = ExpansionPortDevice::None;
@ -1281,6 +1282,30 @@ public:
return _exclusiveRefreshRate;
}
void SetExclusiveRefreshRate2(uint32_t refreshRate)
{
_exclusiveRefreshRate2 = refreshRate;
}
uint32_t GetExclusiveRefreshRate2()
{
return _exclusiveRefreshRate2;
}
uint32_t GetExclusiveRefreshRateByModel(NesModel m)
{
switch (m) {
case NesModel::NTSC:
return _exclusiveRefreshRate;
break;
case NesModel::PAL:
case NesModel::Dendy:
return _exclusiveRefreshRate2;
break;
}
return _exclusiveRefreshRate;
}
void SetExpansionDevice(ExpansionPortDevice expansionDevice)
{
_expansionDevice = expansionDevice;

View file

@ -57,6 +57,7 @@ namespace Mesen.GUI.Config
public bool UseExclusiveFullscreen = false;
public string FullscreenResolution = "";
public VideoRefreshRates ExclusiveFullscreenRefreshRate = VideoRefreshRates._60;
public VideoRefreshRates ExclusiveFullscreenRefreshRate2 = VideoRefreshRates._50;
public bool UseCustomVsPalette = false;
public bool ShowColorIndexes = true;
@ -100,6 +101,7 @@ namespace Mesen.GUI.Config
InteropEmu.SetScreenRotation((UInt32)videoInfo.ScreenRotation);
InteropEmu.SetExclusiveRefreshRate((UInt32)videoInfo.ExclusiveFullscreenRefreshRate);
InteropEmu.SetExclusiveRefreshRate2((UInt32)videoInfo.ExclusiveFullscreenRefreshRate2);
InteropEmu.SetVideoFilter(videoInfo.VideoFilter);
InteropEmu.SetVideoResizeFilter(videoInfo.UseBilinearInterpolation ? VideoResizeFilter.Bilinear : VideoResizeFilter.NearestNeighbor);

View file

@ -244,7 +244,8 @@
<Control ID="chkUseHdPacks">Fes servir els paquets d'alta resolució d'HDNes</Control>
<Control ID="chkUseExclusiveFullscreen">Fes servir el mode de pantalla completa exclusiva</Control>
<Control ID="lblFullscreenResolution">Fullscreen Resolution:</Control>
<Control ID="lblRequestedRefreshRate">Requested Refresh Rate:</Control>
<Control ID="lblRequestedRefreshRate">Requested Refresh Rate NTSC:</Control>
<Control ID="lblRequestedRefreshRate2">PAL / Dendy:</Control>
<Control ID="tpgOverscan">Sobreescaneig</Control>
<Control ID="tpgOverscanGlobal">Global</Control>
<Control ID="tpgOverscanGameSpecific">Game-Specific</Control>

View file

@ -244,7 +244,8 @@
<Control ID="chkUseHdPacks">Use HDNes HD packs</Control>
<Control ID="chkUseExclusiveFullscreen">Use exclusive fullscreen mode</Control>
<Control ID="lblFullscreenResolution">Fullscreen Resolution:</Control>
<Control ID="lblRequestedRefreshRate">Requested Refresh Rate:</Control>
<Control ID="lblRequestedRefreshRate">Requested Refresh Rate NTSC:</Control>
<Control ID="lblRequestedRefreshRate2">PAL / Dendy:</Control>
<Control ID="tpgOverscan">Overscan</Control>
<Control ID="tpgOverscanGlobal">Global</Control>
<Control ID="tpgOverscanGameSpecific">Game-Specific</Control>

File diff suppressed because it is too large Load diff

View file

@ -36,6 +36,7 @@ namespace Mesen.GUI.Forms.Config
AddBinding("FullscreenForceIntegerScale", chkFullscreenForceIntegerScale);
AddBinding("UseExclusiveFullscreen", chkUseExclusiveFullscreen);
AddBinding("ExclusiveFullscreenRefreshRate", cboRefreshRate);
AddBinding("ExclusiveFullscreenRefreshRate2", cboRefreshRate2);
AddBinding("VideoScale", nudScale);
AddBinding("AspectRatio", cboAspectRatio);

View file

@ -121,14 +121,14 @@
<value>17, 17</value>
</metadata>
<metadata name="imageList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>537, 17</value>
<value>561, 17</value>
</metadata>
<data name="imageList.ImageStream" mimetype="application/x-microsoft.net.object.binary.base64">
<value>
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACs
BQAAAk1TRnQBSQFMAwEBAAFIAQABSAEAARABAAEQAQAE/wEZAQAI/wFCAU0BNgcAATYDAAEoAwABQAMA
BQAAAk1TRnQBSQFMAwEBAAFYAQABWAEAARABAAEQAQAE/wEZAQAI/wFCAU0BNgcAATYDAAEoAwABQAMA
ARADAAEBAQABGAYAAQweAAH5AvgB1QHBAbsBqAFyAWEBkAFHATABkAFHATABpgFuAVwB0gG8AbUB+AL2
pQAB1QHAAbkBlgFNATIBqgFaASwBuwFkASsBwAFpASkBwAFpASkBuwFlASwBqwFbAS0BmAFMATAB0wG9
AbWfAAHRAbgBrwGlAVgBMgHAAW0BLgHCAW0BLQHCAW0BLQHCAW0BLQHCAW0BLQHCAW0BLQHCAW0BLQHA
@ -156,12 +156,12 @@
</value>
</data>
<metadata name="contextPicturePresets.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>221, 17</value>
<value>229, 17</value>
</metadata>
<metadata name="colorDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>107, 17</value>
<value>110, 17</value>
</metadata>
<metadata name="contextPaletteList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>389, 17</value>
<value>406, 17</value>
</metadata>
</root>

View file

@ -226,6 +226,7 @@ namespace Mesen.GUI
[DllImport(DLLPath)] public static extern void SetVideoScale(double scale, ConsoleId consoleId = ConsoleId.Master);
[DllImport(DLLPath)] public static extern void SetScreenRotation(UInt32 angle);
[DllImport(DLLPath)] public static extern void SetExclusiveRefreshRate(UInt32 refreshRate);
[DllImport(DLLPath)] public static extern void SetExclusiveRefreshRate2(UInt32 refreshRate);
[DllImport(DLLPath)] public static extern void SetVideoAspectRatio(VideoAspectRatio aspectRatio, double customRatio);
[DllImport(DLLPath)] public static extern void SetVideoFilter(VideoFilterType filter);
[DllImport(DLLPath)] public static extern void SetVideoResizeFilter(VideoResizeFilter filter);

View file

@ -654,6 +654,7 @@ namespace InteropEmu {
DllExport void __stdcall SetVideoScale(double scale, ConsoleId consoleId) { GetConsoleById(consoleId)->GetSettings()->SetVideoScale(scale); }
DllExport void __stdcall SetScreenRotation(uint32_t angle) { _settings->SetScreenRotation(angle); }
DllExport void __stdcall SetExclusiveRefreshRate(uint32_t angle) { _settings->SetExclusiveRefreshRate(angle); }
DllExport void __stdcall SetExclusiveRefreshRate2(uint32_t angle) { _settings->SetExclusiveRefreshRate2(angle); }
DllExport void __stdcall SetVideoAspectRatio(VideoAspectRatio aspectRatio, double customRatio) { _settings->SetVideoAspectRatio(aspectRatio, customRatio); }
DllExport void __stdcall SetVideoFilter(VideoFilterType filter) { _settings->SetVideoFilterType(filter); }
DllExport void __stdcall SetVideoResizeFilter(VideoResizeFilter filter) { _settings->SetVideoResizeFilter(filter); }

View file

@ -288,7 +288,7 @@ HRESULT Renderer::InitDevice()
sd.BufferDesc.Width = _realScreenWidth;
sd.BufferDesc.Height = _realScreenHeight;
sd.BufferDesc.Format = DXGI_FORMAT_B8G8R8A8_UNORM;
sd.BufferDesc.RefreshRate.Numerator = _console->GetSettings()->GetExclusiveRefreshRate();
sd.BufferDesc.RefreshRate.Numerator = _console->GetSettings()->GetExclusiveRefreshRateByModel(_console->GetModel());
sd.BufferDesc.RefreshRate.Denominator = 1;
sd.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
sd.Flags = _fullscreen ? DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH : 0;