diff --git a/Core/EmulationSettings.cpp b/Core/EmulationSettings.cpp index 73eb9000..224c54c5 100644 --- a/Core/EmulationSettings.cpp +++ b/Core/EmulationSettings.cpp @@ -78,6 +78,7 @@ NtscFilterSettings EmulationSettings::_ntscFilterSettings; bool EmulationSettings::_backgroundEnabled = true; bool EmulationSettings::_spritesEnabled = true; uint32_t EmulationSettings::_screenRotation = 0; +uint32_t EmulationSettings::_exclusiveRefreshRate = 60; ConsoleType EmulationSettings::_consoleType = ConsoleType::Nes; ExpansionPortDevice EmulationSettings::_expansionDevice = ExpansionPortDevice::None; diff --git a/Core/EmulationSettings.h b/Core/EmulationSettings.h index 4b4ed68d..90b00115 100644 --- a/Core/EmulationSettings.h +++ b/Core/EmulationSettings.h @@ -605,6 +605,7 @@ private: static bool _backgroundEnabled; static bool _spritesEnabled; static uint32_t _screenRotation; + static uint32_t _exclusiveRefreshRate; static ConsoleType _consoleType; static ExpansionPortDevice _expansionDevice; @@ -1159,6 +1160,16 @@ public: return _screenRotation; } + static void SetExclusiveRefreshRate(uint32_t refreshRate) + { + _exclusiveRefreshRate = refreshRate; + } + + static uint32_t GetExclusiveRefreshRate() + { + return _exclusiveRefreshRate; + } + static uint32_t* GetRgbPalette() { return _currentPalette; diff --git a/GUI.NET/Config/VideoInfo.cs b/GUI.NET/Config/VideoInfo.cs index 02682206..107acc0e 100644 --- a/GUI.NET/Config/VideoInfo.cs +++ b/GUI.NET/Config/VideoInfo.cs @@ -52,6 +52,7 @@ namespace Mesen.GUI.Config public bool FullscreenForceIntegerScale = false; public bool UseExclusiveFullscreen = false; + public VideoRefreshRates ExclusiveFullscreenRefreshRate = VideoRefreshRates._60; public bool UseCustomVsPalette = false; public bool ShowColorIndexes = true; @@ -82,6 +83,8 @@ namespace Mesen.GUI.Config InteropEmu.SetScreenRotation((UInt32)videoInfo.ScreenRotation); + InteropEmu.SetExclusiveRefreshRate((UInt32)videoInfo.ExclusiveFullscreenRefreshRate); + InteropEmu.SetVideoFilter(videoInfo.VideoFilter); InteropEmu.SetVideoResizeFilter(videoInfo.UseBilinearInterpolation ? VideoResizeFilter.Bilinear : VideoResizeFilter.NearestNeighbor); InteropEmu.SetVideoScale(videoInfo.VideoScale <= 10 ? videoInfo.VideoScale : 2); diff --git a/GUI.NET/Dependencies/resources.ca.xml b/GUI.NET/Dependencies/resources.ca.xml index 190e7881..c2819b4d 100644 --- a/GUI.NET/Dependencies/resources.ca.xml +++ b/GUI.NET/Dependencies/resources.ca.xml @@ -222,6 +222,7 @@ Mostra els FPS Fes servir els paquets d'alta resolució d'HDNes Fes servir el mode de pantalla completa exclusiva + Requested Refresh Rate: Sobreescaneig Retall de vídeo Esquerra @@ -867,6 +868,14 @@ Pantalla panoràmica (16:9) Personalitzat + + 50 Hz + 60 Hz + 100 Hz + 120 Hz + 200 Hz + 240 Hz + Cap 90° diff --git a/GUI.NET/Dependencies/resources.en.xml b/GUI.NET/Dependencies/resources.en.xml index 661bab08..60cc06c4 100644 --- a/GUI.NET/Dependencies/resources.en.xml +++ b/GUI.NET/Dependencies/resources.en.xml @@ -203,6 +203,14 @@ Widescreen (16:9) Custom + + 50 Hz + 60 Hz + 100 Hz + 120 Hz + 200 Hz + 240 Hz + None 90° diff --git a/GUI.NET/Dependencies/resources.es.xml b/GUI.NET/Dependencies/resources.es.xml index c344ebf4..750c1cac 100644 --- a/GUI.NET/Dependencies/resources.es.xml +++ b/GUI.NET/Dependencies/resources.es.xml @@ -221,6 +221,7 @@ Mostrar FPS Utilizar los paquetes de alta resolución de HDNes Use exclusive fullscreen mode + Requested Refresh Rate: Overscan Recorte Izquierda @@ -885,6 +886,14 @@ Pantalla panorámica (16:9) Personalizado + + 50 Hz + 60 Hz + 100 Hz + 120 Hz + 200 Hz + 240 Hz + None 90° diff --git a/GUI.NET/Dependencies/resources.fr.xml b/GUI.NET/Dependencies/resources.fr.xml index 21ac7a6e..9e1bd8ff 100644 --- a/GUI.NET/Dependencies/resources.fr.xml +++ b/GUI.NET/Dependencies/resources.fr.xml @@ -222,6 +222,7 @@ Afficher le FPS Utiliser les packs haute-définition de HDNes Utiliser le mode plein écran exclusif + Taux de rafraîchissement : Overscan Overscan Gauche @@ -898,6 +899,14 @@ Écran large (16:9) Personalisé + + 50 Hz + 60 Hz + 100 Hz + 120 Hz + 200 Hz + 240 Hz + Aucune 90° diff --git a/GUI.NET/Dependencies/resources.ja.xml b/GUI.NET/Dependencies/resources.ja.xml index 5b7b6a5d..e7f56df5 100644 --- a/GUI.NET/Dependencies/resources.ja.xml +++ b/GUI.NET/Dependencies/resources.ja.xml @@ -223,6 +223,7 @@ フレームレート表示 HDNesのHDパックを使う 排他的なフルスクリーンモードを使う + リフレッシュレート: オーバースキャン オーバースキャン @@ -882,6 +883,14 @@ ワイド (16:9) カスタム + + 50 Hz + 60 Hz + 100 Hz + 120 Hz + 200 Hz + 240 Hz + なし 90度 diff --git a/GUI.NET/Dependencies/resources.pt.xml b/GUI.NET/Dependencies/resources.pt.xml index 049dd731..4f8b05bb 100644 --- a/GUI.NET/Dependencies/resources.pt.xml +++ b/GUI.NET/Dependencies/resources.pt.xml @@ -221,6 +221,7 @@ Mostrar FPS Usar os pacotes de alta definição do HDNes Use exclusive fullscreen mode + Requested Refresh Rate: Overscan Recorte Esquerda @@ -883,6 +884,14 @@ Widescreen (16:9) Personalizado + + 50 Hz + 60 Hz + 100 Hz + 120 Hz + 200 Hz + 240 Hz + Nenhuma 90° diff --git a/GUI.NET/Dependencies/resources.ru.xml b/GUI.NET/Dependencies/resources.ru.xml index 19ec4256..c84fdb9c 100644 --- a/GUI.NET/Dependencies/resources.ru.xml +++ b/GUI.NET/Dependencies/resources.ru.xml @@ -221,6 +221,7 @@ Показывать FPS Использовать HDNes HD packs Use exclusive fullscreen mode + Requested Refresh Rate: Overscan Overscan Слева @@ -887,6 +888,14 @@ Широкий экран (16:9) Custom + + 50 Hz + 60 Hz + 100 Hz + 120 Hz + 200 Hz + 240 Hz + None 90° diff --git a/GUI.NET/Dependencies/resources.uk.xml b/GUI.NET/Dependencies/resources.uk.xml index de13f9bc..b8173f9d 100644 --- a/GUI.NET/Dependencies/resources.uk.xml +++ b/GUI.NET/Dependencies/resources.uk.xml @@ -221,6 +221,7 @@ Показувати FPS Використовувати HDNes HD packs Use exclusive fullscreen mode + Requested Refresh Rate: Overscan Overscan Злiва @@ -887,6 +888,14 @@ Широкий екран (16:9) Custom + + 50 Hz + 60 Hz + 100 Hz + 120 Hz + 200 Hz + 240 Hz + Нiякий 90° diff --git a/GUI.NET/Forms/Config/frmVideoConfig.Designer.cs b/GUI.NET/Forms/Config/frmVideoConfig.Designer.cs index 3867292c..f4874848 100644 --- a/GUI.NET/Forms/Config/frmVideoConfig.Designer.cs +++ b/GUI.NET/Forms/Config/frmVideoConfig.Designer.cs @@ -31,6 +31,7 @@ namespace Mesen.GUI.Forms.Config { this.components = new System.ComponentModel.Container(); this.tlpMain = new System.Windows.Forms.TableLayoutPanel(); + this.chkUseExclusiveFullscreen = new System.Windows.Forms.CheckBox(); this.lblVideoScale = new System.Windows.Forms.Label(); this.chkVerticalSync = new System.Windows.Forms.CheckBox(); this.lblDisplayRatio = new System.Windows.Forms.Label(); @@ -44,8 +45,9 @@ namespace Mesen.GUI.Forms.Config this.nudCustomRatio = new Mesen.GUI.Controls.MesenNumericUpDown(); this.chkFullscreenForceIntegerScale = new System.Windows.Forms.CheckBox(); this.chkShowFps = new System.Windows.Forms.CheckBox(); - this.chkUseExclusiveFullscreen = new System.Windows.Forms.CheckBox(); this.chkIntegerFpsMode = new System.Windows.Forms.CheckBox(); + this.cboRefreshRate = new System.Windows.Forms.ComboBox(); + this.lblRequestedRefreshRate = new System.Windows.Forms.Label(); this.tabMain = new System.Windows.Forms.TabControl(); this.tpgGeneral = new System.Windows.Forms.TabPage(); this.tpgPicture = new System.Windows.Forms.TabPage(); @@ -128,6 +130,7 @@ namespace Mesen.GUI.Forms.Config this.mnuPaletteSonyCxa2025As = new System.Windows.Forms.ToolStripMenuItem(); this.mnuPaletteUnsaturated = new System.Windows.Forms.ToolStripMenuItem(); this.mnuPaletteYuv = new System.Windows.Forms.ToolStripMenuItem(); + this.flpRefreshRate = new System.Windows.Forms.FlowLayoutPanel(); this.tlpMain.SuspendLayout(); this.flowLayoutPanel7.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.picHdNesTooltip)).BeginInit(); @@ -159,6 +162,7 @@ namespace Mesen.GUI.Forms.Config this.tableLayoutPanel9.SuspendLayout(); this.contextPicturePresets.SuspendLayout(); this.contextPaletteList.SuspendLayout(); + this.flpRefreshRate.SuspendLayout(); this.SuspendLayout(); // // baseConfigPanel @@ -171,21 +175,23 @@ namespace Mesen.GUI.Forms.Config this.tlpMain.ColumnCount = 2; this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tlpMain.Controls.Add(this.chkUseExclusiveFullscreen, 0, 4); this.tlpMain.Controls.Add(this.lblVideoScale, 0, 0); this.tlpMain.Controls.Add(this.chkVerticalSync, 0, 3); this.tlpMain.Controls.Add(this.lblDisplayRatio, 0, 1); - this.tlpMain.Controls.Add(this.flowLayoutPanel7, 0, 6); + this.tlpMain.Controls.Add(this.flowLayoutPanel7, 0, 7); this.tlpMain.Controls.Add(this.nudScale, 1, 0); this.tlpMain.Controls.Add(this.flowLayoutPanel6, 1, 1); - this.tlpMain.Controls.Add(this.chkFullscreenForceIntegerScale, 0, 5); - this.tlpMain.Controls.Add(this.chkShowFps, 0, 7); - this.tlpMain.Controls.Add(this.chkUseExclusiveFullscreen, 0, 4); + this.tlpMain.Controls.Add(this.chkFullscreenForceIntegerScale, 0, 6); + this.tlpMain.Controls.Add(this.chkShowFps, 0, 8); this.tlpMain.Controls.Add(this.chkIntegerFpsMode, 0, 2); + this.tlpMain.Controls.Add(this.flpRefreshRate, 0, 5); this.tlpMain.Dock = System.Windows.Forms.DockStyle.Fill; this.tlpMain.Location = new System.Drawing.Point(3, 3); this.tlpMain.Margin = new System.Windows.Forms.Padding(0); this.tlpMain.Name = "tlpMain"; - this.tlpMain.RowCount = 9; + this.tlpMain.RowCount = 10; + this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle()); @@ -198,6 +204,19 @@ namespace Mesen.GUI.Forms.Config this.tlpMain.Size = new System.Drawing.Size(521, 370); this.tlpMain.TabIndex = 1; // + // chkUseExclusiveFullscreen + // + this.chkUseExclusiveFullscreen.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.chkUseExclusiveFullscreen.AutoSize = true; + this.tlpMain.SetColumnSpan(this.chkUseExclusiveFullscreen, 2); + this.chkUseExclusiveFullscreen.Location = new System.Drawing.Point(3, 95); + this.chkUseExclusiveFullscreen.Name = "chkUseExclusiveFullscreen"; + this.chkUseExclusiveFullscreen.Size = new System.Drawing.Size(169, 17); + this.chkUseExclusiveFullscreen.TabIndex = 24; + this.chkUseExclusiveFullscreen.Text = "Use exclusive fullscreen mode"; + this.chkUseExclusiveFullscreen.UseVisualStyleBackColor = true; + this.chkUseExclusiveFullscreen.CheckedChanged += new System.EventHandler(this.chkUseExclusiveFullscreen_CheckedChanged); + // // lblVideoScale // this.lblVideoScale.Anchor = System.Windows.Forms.AnchorStyles.Left; @@ -236,7 +255,7 @@ namespace Mesen.GUI.Forms.Config this.flowLayoutPanel7.Controls.Add(this.chkUseHdPacks); this.flowLayoutPanel7.Controls.Add(this.picHdNesTooltip); this.flowLayoutPanel7.Dock = System.Windows.Forms.DockStyle.Fill; - this.flowLayoutPanel7.Location = new System.Drawing.Point(0, 138); + this.flowLayoutPanel7.Location = new System.Drawing.Point(0, 165); this.flowLayoutPanel7.Margin = new System.Windows.Forms.Padding(0); this.flowLayoutPanel7.Name = "flowLayoutPanel7"; this.flowLayoutPanel7.Size = new System.Drawing.Size(521, 23); @@ -372,7 +391,7 @@ namespace Mesen.GUI.Forms.Config this.chkFullscreenForceIntegerScale.Anchor = System.Windows.Forms.AnchorStyles.Left; this.chkFullscreenForceIntegerScale.AutoSize = true; this.tlpMain.SetColumnSpan(this.chkFullscreenForceIntegerScale, 2); - this.chkFullscreenForceIntegerScale.Location = new System.Drawing.Point(3, 118); + this.chkFullscreenForceIntegerScale.Location = new System.Drawing.Point(3, 145); this.chkFullscreenForceIntegerScale.Name = "chkFullscreenForceIntegerScale"; this.chkFullscreenForceIntegerScale.Size = new System.Drawing.Size(289, 17); this.chkFullscreenForceIntegerScale.TabIndex = 23; @@ -384,25 +403,13 @@ namespace Mesen.GUI.Forms.Config this.chkShowFps.Anchor = System.Windows.Forms.AnchorStyles.Left; this.chkShowFps.AutoSize = true; this.tlpMain.SetColumnSpan(this.chkShowFps, 2); - this.chkShowFps.Location = new System.Drawing.Point(3, 164); + this.chkShowFps.Location = new System.Drawing.Point(3, 191); this.chkShowFps.Name = "chkShowFps"; this.chkShowFps.Size = new System.Drawing.Size(76, 17); this.chkShowFps.TabIndex = 9; this.chkShowFps.Text = "Show FPS"; this.chkShowFps.UseVisualStyleBackColor = true; // - // chkUseExclusiveFullscreen - // - this.chkUseExclusiveFullscreen.Anchor = System.Windows.Forms.AnchorStyles.Left; - this.chkUseExclusiveFullscreen.AutoSize = true; - this.tlpMain.SetColumnSpan(this.chkUseExclusiveFullscreen, 2); - this.chkUseExclusiveFullscreen.Location = new System.Drawing.Point(3, 95); - this.chkUseExclusiveFullscreen.Name = "chkUseExclusiveFullscreen"; - this.chkUseExclusiveFullscreen.Size = new System.Drawing.Size(169, 17); - this.chkUseExclusiveFullscreen.TabIndex = 24; - this.chkUseExclusiveFullscreen.Text = "Use exclusive fullscreen mode"; - this.chkUseExclusiveFullscreen.UseVisualStyleBackColor = true; - // // chkIntegerFpsMode // this.chkIntegerFpsMode.Anchor = System.Windows.Forms.AnchorStyles.Left; @@ -415,6 +422,31 @@ namespace Mesen.GUI.Forms.Config this.chkIntegerFpsMode.Text = "Enable integer FPS mode (e.g: run at 60 fps instead of 60.1)"; this.chkIntegerFpsMode.UseVisualStyleBackColor = true; // + // cboRefreshRate + // + this.cboRefreshRate.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cboRefreshRate.FormattingEnabled = true; + this.cboRefreshRate.Items.AddRange(new object[] { + "Auto", + "NTSC (8:7)", + "PAL (18:13)", + "Standard (4:3)", + "Widescreen (16:9)"}); + this.cboRefreshRate.Location = new System.Drawing.Point(137, 3); + this.cboRefreshRate.Name = "cboRefreshRate"; + this.cboRefreshRate.Size = new System.Drawing.Size(68, 21); + this.cboRefreshRate.TabIndex = 25; + // + // lblRequestedRefreshRate + // + this.lblRequestedRefreshRate.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.lblRequestedRefreshRate.AutoSize = true; + this.lblRequestedRefreshRate.Location = new System.Drawing.Point(3, 7); + this.lblRequestedRefreshRate.Name = "lblRequestedRefreshRate"; + this.lblRequestedRefreshRate.Size = new System.Drawing.Size(128, 13); + this.lblRequestedRefreshRate.TabIndex = 17; + this.lblRequestedRefreshRate.Text = "Requested Refresh Rate:"; + // // tabMain // this.tabMain.Controls.Add(this.tpgGeneral); @@ -1515,6 +1547,19 @@ namespace Mesen.GUI.Forms.Config this.mnuPaletteYuv.Text = "YUV v3 (by FirebrandX)"; this.mnuPaletteYuv.Click += new System.EventHandler(this.mnuPaletteYuv_Click); // + // flpRefreshRate + // + this.tlpMain.SetColumnSpan(this.flpRefreshRate, 2); + this.flpRefreshRate.Controls.Add(this.lblRequestedRefreshRate); + this.flpRefreshRate.Controls.Add(this.cboRefreshRate); + this.flpRefreshRate.Dock = System.Windows.Forms.DockStyle.Fill; + this.flpRefreshRate.Location = new System.Drawing.Point(30, 115); + this.flpRefreshRate.Margin = new System.Windows.Forms.Padding(30, 0, 0, 0); + this.flpRefreshRate.Name = "flpRefreshRate"; + this.flpRefreshRate.Size = new System.Drawing.Size(491, 27); + this.flpRefreshRate.TabIndex = 26; + this.flpRefreshRate.Visible = false; + // // frmVideoConfig // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -1575,6 +1620,8 @@ namespace Mesen.GUI.Forms.Config this.tableLayoutPanel9.PerformLayout(); this.contextPicturePresets.ResumeLayout(false); this.contextPaletteList.ResumeLayout(false); + this.flpRefreshRate.ResumeLayout(false); + this.flpRefreshRate.PerformLayout(); this.ResumeLayout(false); } @@ -1679,5 +1726,8 @@ namespace Mesen.GUI.Forms.Config private System.Windows.Forms.Label lblScreenRotation; private System.Windows.Forms.ComboBox cboScreenRotation; private System.Windows.Forms.CheckBox chkUseExclusiveFullscreen; + private System.Windows.Forms.Label lblRequestedRefreshRate; + private System.Windows.Forms.ComboBox cboRefreshRate; + private System.Windows.Forms.FlowLayoutPanel flpRefreshRate; } } \ No newline at end of file diff --git a/GUI.NET/Forms/Config/frmVideoConfig.cs b/GUI.NET/Forms/Config/frmVideoConfig.cs index 9a614284..2c4a9431 100644 --- a/GUI.NET/Forms/Config/frmVideoConfig.cs +++ b/GUI.NET/Forms/Config/frmVideoConfig.cs @@ -30,6 +30,9 @@ namespace Mesen.GUI.Forms.Config AddBinding("VerticalSync", chkVerticalSync); AddBinding("UseHdPacks", chkUseHdPacks); AddBinding("IntegerFpsMode", chkIntegerFpsMode); + AddBinding("FullscreenForceIntegerScale", chkFullscreenForceIntegerScale); + AddBinding("UseExclusiveFullscreen", chkUseExclusiveFullscreen); + AddBinding("ExclusiveFullscreenRefreshRate", cboRefreshRate); AddBinding("VideoScale", nudScale); AddBinding("AspectRatio", cboAspectRatio); @@ -65,8 +68,6 @@ namespace Mesen.GUI.Forms.Config AddBinding("DisableSprites", chkDisableSprites); AddBinding("ForceBackgroundFirstColumn", chkForceBackgroundFirstColumn); AddBinding("ForceSpritesFirstColumn", chkForceSpritesFirstColumn); - AddBinding("FullscreenForceIntegerScale", chkFullscreenForceIntegerScale); - AddBinding("UseExclusiveFullscreen", chkUseExclusiveFullscreen); AddBinding("UseCustomVsPalette", chkUseCustomVsPalette); @@ -428,5 +429,10 @@ namespace Mesen.GUI.Forms.Config { this.RefreshPalette(); } + + private void chkUseExclusiveFullscreen_CheckedChanged(object sender, EventArgs e) + { + flpRefreshRate.Visible = chkUseExclusiveFullscreen.Checked; + } } } diff --git a/GUI.NET/InteropEmu.cs b/GUI.NET/InteropEmu.cs index 3c0557da..17228e42 100644 --- a/GUI.NET/InteropEmu.cs +++ b/GUI.NET/InteropEmu.cs @@ -180,6 +180,7 @@ namespace Mesen.GUI [DllImport(DLLPath)] public static extern void SetOverscanDimensions(UInt32 left, UInt32 right, UInt32 top, UInt32 bottom); [DllImport(DLLPath)] public static extern void SetVideoScale(double scale); [DllImport(DLLPath)] public static extern void SetScreenRotation(UInt32 angle); + [DllImport(DLLPath)] public static extern void SetExclusiveRefreshRate(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); @@ -1910,6 +1911,16 @@ namespace Mesen.GUI Custom = 6 } + public enum VideoRefreshRates + { + _50 = 50, + _60 = 60, + _100 = 100, + _120 = 120, + _200 = 200, + _240 = 240 + } + [Flags] public enum ConsoleFeatures { diff --git a/InteropDLL/ConsoleWrapper.cpp b/InteropDLL/ConsoleWrapper.cpp index ffc09893..a64be553 100644 --- a/InteropDLL/ConsoleWrapper.cpp +++ b/InteropDLL/ConsoleWrapper.cpp @@ -446,6 +446,7 @@ namespace InteropEmu { DllExport void __stdcall SetPpuNmiConfig(uint32_t extraScanlinesBeforeNmi, uint32_t extraScanlinesAfterNmi) { EmulationSettings::SetPpuNmiConfig(extraScanlinesBeforeNmi, extraScanlinesAfterNmi); } DllExport void __stdcall SetVideoScale(double scale) { EmulationSettings::SetVideoScale(scale); } DllExport void __stdcall SetScreenRotation(uint32_t angle) { EmulationSettings::SetScreenRotation(angle); } + DllExport void __stdcall SetExclusiveRefreshRate(uint32_t angle) { EmulationSettings::SetExclusiveRefreshRate(angle); } DllExport void __stdcall SetVideoAspectRatio(VideoAspectRatio aspectRatio, double customRatio) { EmulationSettings::SetVideoAspectRatio(aspectRatio, customRatio); } DllExport void __stdcall SetVideoFilter(VideoFilterType filter) { EmulationSettings::SetVideoFilterType(filter); } DllExport void __stdcall SetVideoResizeFilter(VideoResizeFilter filter) { EmulationSettings::SetVideoResizeFilter(filter); } diff --git a/Windows/Renderer.cpp b/Windows/Renderer.cpp index 6f09287d..23c3f11b 100644 --- a/Windows/Renderer.cpp +++ b/Windows/Renderer.cpp @@ -267,9 +267,10 @@ namespace NES sd.BufferDesc.Width = _realScreenWidth; sd.BufferDesc.Height = _realScreenHeight; sd.BufferDesc.Format = DXGI_FORMAT_B8G8R8A8_UNORM; - sd.BufferDesc.RefreshRate.Numerator = 60; + sd.BufferDesc.RefreshRate.Numerator = EmulationSettings::GetExclusiveRefreshRate(); sd.BufferDesc.RefreshRate.Denominator = 1; sd.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT; + sd.Flags = _fullscreen ? DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH : 0; sd.OutputWindow = _hWnd; sd.SampleDesc.Count = 1; sd.SampleDesc.Quality = 0; @@ -296,7 +297,7 @@ namespace NES break; } } - + if(FAILED(hr)) { MessageManager::Log("D3D11CreateDeviceAndSwapChain() failed - Error:" + std::to_string(hr)); return hr; diff --git a/Windows/Renderer.h b/Windows/Renderer.h index 0d3f64f1..ac2a41f9 100644 --- a/Windows/Renderer.h +++ b/Windows/Renderer.h @@ -78,7 +78,7 @@ namespace NES { void DrawNESScreen(); void DrawPauseScreen(); - std::wstring WrapText(string text, SpriteFont* font, float maxLineWidth, uint32_t &lineCount); + void DrawString(string message, float x, float y, DirectX::FXMVECTOR color, float scale, SpriteFont* font = nullptr); void DrawString(std::wstring message, float x, float y, DirectX::FXMVECTOR color, float scale, SpriteFont* font = nullptr);